@@ -21,84 +21,84 @@ discard block |
||
| 21 | 21 | */ |
| 22 | 22 | function geodir_cf_checkbox($html,$location,$cf,$p=''){ |
| 23 | 23 | |
| 24 | - // check we have the post value |
|
| 25 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 26 | - else{ global $post;} |
|
| 27 | - |
|
| 28 | - if(!is_array($cf) && $cf!=''){ |
|
| 29 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 30 | - if(!$cf){return NULL;} |
|
| 31 | - } |
|
| 32 | - |
|
| 33 | - $html_var = $cf['htmlvar_name']; |
|
| 34 | - |
|
| 35 | - // Check if there is a location specific filter. |
|
| 36 | - if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){ |
|
| 37 | - /** |
|
| 38 | - * Filter the checkbox html by location. |
|
| 39 | - * |
|
| 40 | - * @param string $html The html to filter. |
|
| 41 | - * @param array $cf The custom field array. |
|
| 42 | - * @since 1.6.6 |
|
| 43 | - */ |
|
| 44 | - $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf); |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - // Check if there is a custom field specific filter. |
|
| 48 | - if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){ |
|
| 49 | - /** |
|
| 50 | - * Filter the checkbox html by individual custom field. |
|
| 51 | - * |
|
| 52 | - * @param string $html The html to filter. |
|
| 53 | - * @param string $location The location to output the html. |
|
| 54 | - * @param array $cf The custom field array. |
|
| 55 | - * @since 1.6.6 |
|
| 56 | - */ |
|
| 57 | - $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf); |
|
| 58 | - } |
|
| 59 | - |
|
| 60 | - // Check if there is a custom field key specific filter. |
|
| 61 | - if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){ |
|
| 62 | - /** |
|
| 63 | - * Filter the checkbox html by field type key. |
|
| 64 | - * |
|
| 65 | - * @param string $html The html to filter. |
|
| 66 | - * @param string $location The location to output the html. |
|
| 67 | - * @param array $cf The custom field array. |
|
| 68 | - * @since 1.6.6 |
|
| 69 | - */ |
|
| 70 | - $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - // If not html then we run the standard output. |
|
| 74 | - if(empty($html)){ |
|
| 75 | - |
|
| 76 | - if ( (int) $post->{$html_var} == 1 ): |
|
| 77 | - |
|
| 78 | - if ( $post->{$html_var} == '1' ): |
|
| 79 | - $html_val = __( 'Yes', 'geodirectory' ); |
|
| 80 | - else: |
|
| 81 | - $html_val = __( 'No', 'geodirectory' ); |
|
| 82 | - endif; |
|
| 83 | - |
|
| 84 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 85 | - if (strpos($field_icon, 'http') !== false) { |
|
| 86 | - $field_icon_af = ''; |
|
| 87 | - } elseif ($field_icon == '') { |
|
| 88 | - $field_icon_af = ''; |
|
| 89 | - } else { |
|
| 90 | - $field_icon_af = $field_icon; |
|
| 91 | - $field_icon = ''; |
|
| 92 | - } |
|
| 93 | - |
|
| 94 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
| 95 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ''; |
|
| 96 | - $html .= '</span>' . $html_val . '</div>'; |
|
| 97 | - endif; |
|
| 98 | - |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - return $html; |
|
| 24 | + // check we have the post value |
|
| 25 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 26 | + else{ global $post;} |
|
| 27 | + |
|
| 28 | + if(!is_array($cf) && $cf!=''){ |
|
| 29 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 30 | + if(!$cf){return NULL;} |
|
| 31 | + } |
|
| 32 | + |
|
| 33 | + $html_var = $cf['htmlvar_name']; |
|
| 34 | + |
|
| 35 | + // Check if there is a location specific filter. |
|
| 36 | + if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){ |
|
| 37 | + /** |
|
| 38 | + * Filter the checkbox html by location. |
|
| 39 | + * |
|
| 40 | + * @param string $html The html to filter. |
|
| 41 | + * @param array $cf The custom field array. |
|
| 42 | + * @since 1.6.6 |
|
| 43 | + */ |
|
| 44 | + $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf); |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + // Check if there is a custom field specific filter. |
|
| 48 | + if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){ |
|
| 49 | + /** |
|
| 50 | + * Filter the checkbox html by individual custom field. |
|
| 51 | + * |
|
| 52 | + * @param string $html The html to filter. |
|
| 53 | + * @param string $location The location to output the html. |
|
| 54 | + * @param array $cf The custom field array. |
|
| 55 | + * @since 1.6.6 |
|
| 56 | + */ |
|
| 57 | + $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf); |
|
| 58 | + } |
|
| 59 | + |
|
| 60 | + // Check if there is a custom field key specific filter. |
|
| 61 | + if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){ |
|
| 62 | + /** |
|
| 63 | + * Filter the checkbox html by field type key. |
|
| 64 | + * |
|
| 65 | + * @param string $html The html to filter. |
|
| 66 | + * @param string $location The location to output the html. |
|
| 67 | + * @param array $cf The custom field array. |
|
| 68 | + * @since 1.6.6 |
|
| 69 | + */ |
|
| 70 | + $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + // If not html then we run the standard output. |
|
| 74 | + if(empty($html)){ |
|
| 75 | + |
|
| 76 | + if ( (int) $post->{$html_var} == 1 ): |
|
| 77 | + |
|
| 78 | + if ( $post->{$html_var} == '1' ): |
|
| 79 | + $html_val = __( 'Yes', 'geodirectory' ); |
|
| 80 | + else: |
|
| 81 | + $html_val = __( 'No', 'geodirectory' ); |
|
| 82 | + endif; |
|
| 83 | + |
|
| 84 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 85 | + if (strpos($field_icon, 'http') !== false) { |
|
| 86 | + $field_icon_af = ''; |
|
| 87 | + } elseif ($field_icon == '') { |
|
| 88 | + $field_icon_af = ''; |
|
| 89 | + } else { |
|
| 90 | + $field_icon_af = $field_icon; |
|
| 91 | + $field_icon = ''; |
|
| 92 | + } |
|
| 93 | + |
|
| 94 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
| 95 | + $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ''; |
|
| 96 | + $html .= '</span>' . $html_val . '</div>'; |
|
| 97 | + endif; |
|
| 98 | + |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + return $html; |
|
| 102 | 102 | } |
| 103 | 103 | add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3); |
| 104 | 104 | |
@@ -115,71 +115,71 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | function geodir_cf_fieldset($html,$location,$cf,$p=''){ |
| 117 | 117 | |
| 118 | - // check we have the post value |
|
| 119 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 120 | - else{ global $post;} |
|
| 121 | - |
|
| 122 | - if(!is_array($cf) && $cf!=''){ |
|
| 123 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 124 | - if(!$cf){return NULL;} |
|
| 125 | - } |
|
| 126 | - |
|
| 127 | - $html_var = $cf['htmlvar_name']; |
|
| 128 | - |
|
| 129 | - // Check if there is a location specific filter. |
|
| 130 | - if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){ |
|
| 131 | - /** |
|
| 132 | - * Filter the fieldset html by location. |
|
| 133 | - * |
|
| 134 | - * @param string $html The html to filter. |
|
| 135 | - * @param array $cf The custom field array. |
|
| 136 | - * @since 1.6.6 |
|
| 137 | - */ |
|
| 138 | - $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf); |
|
| 139 | - } |
|
| 140 | - |
|
| 141 | - // Check if there is a custom field specific filter. |
|
| 142 | - if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){ |
|
| 143 | - /** |
|
| 144 | - * Filter the fieldset html by individual custom field. |
|
| 145 | - * |
|
| 146 | - * @param string $html The html to filter. |
|
| 147 | - * @param string $location The location to output the html. |
|
| 148 | - * @param array $cf The custom field array. |
|
| 149 | - * @since 1.6.6 |
|
| 150 | - */ |
|
| 151 | - $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf); |
|
| 152 | - } |
|
| 153 | - |
|
| 154 | - // Check if there is a custom field key specific filter. |
|
| 155 | - if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){ |
|
| 156 | - /** |
|
| 157 | - * Filter the fieldset html by field type key. |
|
| 158 | - * |
|
| 159 | - * @param string $html The html to filter. |
|
| 160 | - * @param string $location The location to output the html. |
|
| 161 | - * @param array $cf The custom field array. |
|
| 162 | - * @since 1.6.6 |
|
| 163 | - */ |
|
| 164 | - $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - // If not html then we run the standard output. |
|
| 168 | - if(empty($html)){ |
|
| 169 | - |
|
| 170 | - global $field_set_start; |
|
| 171 | - $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']); |
|
| 172 | - |
|
| 173 | - if ($field_set_start == 1) { |
|
| 174 | - $html = ''; |
|
| 175 | - } else { |
|
| 176 | - $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>'; |
|
| 177 | - //$field_set_start = 1; |
|
| 178 | - } |
|
| 179 | - |
|
| 180 | - } |
|
| 181 | - |
|
| 182 | - return $html; |
|
| 118 | + // check we have the post value |
|
| 119 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 120 | + else{ global $post;} |
|
| 121 | + |
|
| 122 | + if(!is_array($cf) && $cf!=''){ |
|
| 123 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 124 | + if(!$cf){return NULL;} |
|
| 125 | + } |
|
| 126 | + |
|
| 127 | + $html_var = $cf['htmlvar_name']; |
|
| 128 | + |
|
| 129 | + // Check if there is a location specific filter. |
|
| 130 | + if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){ |
|
| 131 | + /** |
|
| 132 | + * Filter the fieldset html by location. |
|
| 133 | + * |
|
| 134 | + * @param string $html The html to filter. |
|
| 135 | + * @param array $cf The custom field array. |
|
| 136 | + * @since 1.6.6 |
|
| 137 | + */ |
|
| 138 | + $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf); |
|
| 139 | + } |
|
| 140 | + |
|
| 141 | + // Check if there is a custom field specific filter. |
|
| 142 | + if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){ |
|
| 143 | + /** |
|
| 144 | + * Filter the fieldset html by individual custom field. |
|
| 145 | + * |
|
| 146 | + * @param string $html The html to filter. |
|
| 147 | + * @param string $location The location to output the html. |
|
| 148 | + * @param array $cf The custom field array. |
|
| 149 | + * @since 1.6.6 |
|
| 150 | + */ |
|
| 151 | + $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf); |
|
| 152 | + } |
|
| 153 | + |
|
| 154 | + // Check if there is a custom field key specific filter. |
|
| 155 | + if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){ |
|
| 156 | + /** |
|
| 157 | + * Filter the fieldset html by field type key. |
|
| 158 | + * |
|
| 159 | + * @param string $html The html to filter. |
|
| 160 | + * @param string $location The location to output the html. |
|
| 161 | + * @param array $cf The custom field array. |
|
| 162 | + * @since 1.6.6 |
|
| 163 | + */ |
|
| 164 | + $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + // If not html then we run the standard output. |
|
| 168 | + if(empty($html)){ |
|
| 169 | + |
|
| 170 | + global $field_set_start; |
|
| 171 | + $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']); |
|
| 172 | + |
|
| 173 | + if ($field_set_start == 1) { |
|
| 174 | + $html = ''; |
|
| 175 | + } else { |
|
| 176 | + $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>'; |
|
| 177 | + //$field_set_start = 1; |
|
| 178 | + } |
|
| 179 | + |
|
| 180 | + } |
|
| 181 | + |
|
| 182 | + return $html; |
|
| 183 | 183 | } |
| 184 | 184 | add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3); |
| 185 | 185 | |
@@ -196,106 +196,106 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | function geodir_cf_url($html,$location,$cf,$p=''){ |
| 198 | 198 | |
| 199 | - // check we have the post value |
|
| 200 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 201 | - else{ global $post;} |
|
| 202 | - |
|
| 203 | - if(!is_array($cf) && $cf!=''){ |
|
| 204 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 205 | - if(!$cf){return NULL;} |
|
| 206 | - } |
|
| 207 | - |
|
| 208 | - $html_var = $cf['htmlvar_name']; |
|
| 209 | - |
|
| 210 | - // Check if there is a location specific filter. |
|
| 211 | - if(has_filter("geodir_custom_field_output_url_loc_{$location}")){ |
|
| 212 | - /** |
|
| 213 | - * Filter the url html by location. |
|
| 214 | - * |
|
| 215 | - * @param string $html The html to filter. |
|
| 216 | - * @param array $cf The custom field array. |
|
| 217 | - * @since 1.6.6 |
|
| 218 | - */ |
|
| 219 | - $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf); |
|
| 220 | - } |
|
| 221 | - |
|
| 222 | - // Check if there is a custom field specific filter. |
|
| 223 | - if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){ |
|
| 224 | - /** |
|
| 225 | - * Filter the url html by individual custom field. |
|
| 226 | - * |
|
| 227 | - * @param string $html The html to filter. |
|
| 228 | - * @param string $location The location to output the html. |
|
| 229 | - * @param array $cf The custom field array. |
|
| 230 | - * @since 1.6.6 |
|
| 231 | - */ |
|
| 232 | - $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf); |
|
| 233 | - } |
|
| 234 | - |
|
| 235 | - // Check if there is a custom field key specific filter. |
|
| 236 | - if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){ |
|
| 237 | - /** |
|
| 238 | - * Filter the url html by field type key. |
|
| 239 | - * |
|
| 240 | - * @param string $html The html to filter. |
|
| 241 | - * @param string $location The location to output the html. |
|
| 242 | - * @param array $cf The custom field array. |
|
| 243 | - * @since 1.6.6 |
|
| 244 | - */ |
|
| 245 | - $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 246 | - } |
|
| 247 | - |
|
| 248 | - // If not html then we run the standard output. |
|
| 249 | - if(empty($html)){ |
|
| 250 | - |
|
| 251 | - if ($post->{$cf['htmlvar_name']}): |
|
| 252 | - |
|
| 253 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 254 | - if (strpos($field_icon, 'http') !== false) { |
|
| 255 | - $field_icon_af = ''; |
|
| 256 | - } elseif ($field_icon == '') { |
|
| 257 | - |
|
| 258 | - if ($cf['name'] == 'geodir_facebook') { |
|
| 259 | - $field_icon_af = '<i class="fa fa-facebook-square"></i>'; |
|
| 260 | - } elseif ($cf['name'] == 'geodir_twitter') { |
|
| 261 | - $field_icon_af = '<i class="fa fa-twitter-square"></i>'; |
|
| 262 | - } else { |
|
| 263 | - $field_icon_af = '<i class="fa fa-link"></i>'; |
|
| 264 | - } |
|
| 265 | - |
|
| 266 | - } else { |
|
| 267 | - $field_icon_af = $field_icon; |
|
| 268 | - $field_icon = ''; |
|
| 269 | - } |
|
| 270 | - |
|
| 271 | - $a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']}); |
|
| 272 | - |
|
| 273 | - |
|
| 274 | - $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
|
| 275 | - $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title']; |
|
| 276 | - if(!empty($cf['default_value'])){$title = $cf['default_value'];} |
|
| 277 | - $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
|
| 278 | - |
|
| 279 | - |
|
| 280 | - |
|
| 281 | - // all search engines that use the nofollow value exclude links that use it from their ranking calculation |
|
| 282 | - $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"'; |
|
| 283 | - /** |
|
| 284 | - * Filter custom field website name. |
|
| 285 | - * |
|
| 286 | - * @since 1.0.0 |
|
| 287 | - * |
|
| 288 | - * @param string $title Website Title. |
|
| 289 | - * @param string $website Website URL. |
|
| 290 | - * @param int $post->ID Post ID. |
|
| 291 | - */ |
|
| 292 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
| 293 | - |
|
| 294 | - endif; |
|
| 295 | - |
|
| 296 | - } |
|
| 297 | - |
|
| 298 | - return $html; |
|
| 199 | + // check we have the post value |
|
| 200 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 201 | + else{ global $post;} |
|
| 202 | + |
|
| 203 | + if(!is_array($cf) && $cf!=''){ |
|
| 204 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 205 | + if(!$cf){return NULL;} |
|
| 206 | + } |
|
| 207 | + |
|
| 208 | + $html_var = $cf['htmlvar_name']; |
|
| 209 | + |
|
| 210 | + // Check if there is a location specific filter. |
|
| 211 | + if(has_filter("geodir_custom_field_output_url_loc_{$location}")){ |
|
| 212 | + /** |
|
| 213 | + * Filter the url html by location. |
|
| 214 | + * |
|
| 215 | + * @param string $html The html to filter. |
|
| 216 | + * @param array $cf The custom field array. |
|
| 217 | + * @since 1.6.6 |
|
| 218 | + */ |
|
| 219 | + $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf); |
|
| 220 | + } |
|
| 221 | + |
|
| 222 | + // Check if there is a custom field specific filter. |
|
| 223 | + if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){ |
|
| 224 | + /** |
|
| 225 | + * Filter the url html by individual custom field. |
|
| 226 | + * |
|
| 227 | + * @param string $html The html to filter. |
|
| 228 | + * @param string $location The location to output the html. |
|
| 229 | + * @param array $cf The custom field array. |
|
| 230 | + * @since 1.6.6 |
|
| 231 | + */ |
|
| 232 | + $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf); |
|
| 233 | + } |
|
| 234 | + |
|
| 235 | + // Check if there is a custom field key specific filter. |
|
| 236 | + if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){ |
|
| 237 | + /** |
|
| 238 | + * Filter the url html by field type key. |
|
| 239 | + * |
|
| 240 | + * @param string $html The html to filter. |
|
| 241 | + * @param string $location The location to output the html. |
|
| 242 | + * @param array $cf The custom field array. |
|
| 243 | + * @since 1.6.6 |
|
| 244 | + */ |
|
| 245 | + $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 246 | + } |
|
| 247 | + |
|
| 248 | + // If not html then we run the standard output. |
|
| 249 | + if(empty($html)){ |
|
| 250 | + |
|
| 251 | + if ($post->{$cf['htmlvar_name']}): |
|
| 252 | + |
|
| 253 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 254 | + if (strpos($field_icon, 'http') !== false) { |
|
| 255 | + $field_icon_af = ''; |
|
| 256 | + } elseif ($field_icon == '') { |
|
| 257 | + |
|
| 258 | + if ($cf['name'] == 'geodir_facebook') { |
|
| 259 | + $field_icon_af = '<i class="fa fa-facebook-square"></i>'; |
|
| 260 | + } elseif ($cf['name'] == 'geodir_twitter') { |
|
| 261 | + $field_icon_af = '<i class="fa fa-twitter-square"></i>'; |
|
| 262 | + } else { |
|
| 263 | + $field_icon_af = '<i class="fa fa-link"></i>'; |
|
| 264 | + } |
|
| 265 | + |
|
| 266 | + } else { |
|
| 267 | + $field_icon_af = $field_icon; |
|
| 268 | + $field_icon = ''; |
|
| 269 | + } |
|
| 270 | + |
|
| 271 | + $a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']}); |
|
| 272 | + |
|
| 273 | + |
|
| 274 | + $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
|
| 275 | + $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title']; |
|
| 276 | + if(!empty($cf['default_value'])){$title = $cf['default_value'];} |
|
| 277 | + $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
|
| 278 | + |
|
| 279 | + |
|
| 280 | + |
|
| 281 | + // all search engines that use the nofollow value exclude links that use it from their ranking calculation |
|
| 282 | + $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"'; |
|
| 283 | + /** |
|
| 284 | + * Filter custom field website name. |
|
| 285 | + * |
|
| 286 | + * @since 1.0.0 |
|
| 287 | + * |
|
| 288 | + * @param string $title Website Title. |
|
| 289 | + * @param string $website Website URL. |
|
| 290 | + * @param int $post->ID Post ID. |
|
| 291 | + */ |
|
| 292 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
| 293 | + |
|
| 294 | + endif; |
|
| 295 | + |
|
| 296 | + } |
|
| 297 | + |
|
| 298 | + return $html; |
|
| 299 | 299 | } |
| 300 | 300 | add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3); |
| 301 | 301 | |
@@ -312,80 +312,80 @@ discard block |
||
| 312 | 312 | */ |
| 313 | 313 | function geodir_cf_phone($html,$location,$cf,$p=''){ |
| 314 | 314 | |
| 315 | - // check we have the post value |
|
| 316 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 317 | - else{ global $post;} |
|
| 318 | - |
|
| 319 | - if(!is_array($cf) && $cf!=''){ |
|
| 320 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 321 | - if(!$cf){return NULL;} |
|
| 322 | - } |
|
| 323 | - |
|
| 324 | - $html_var = $cf['htmlvar_name']; |
|
| 325 | - |
|
| 326 | - // Check if there is a location specific filter. |
|
| 327 | - if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){ |
|
| 328 | - /** |
|
| 329 | - * Filter the phone html by location. |
|
| 330 | - * |
|
| 331 | - * @param string $html The html to filter. |
|
| 332 | - * @param array $cf The custom field array. |
|
| 333 | - * @since 1.6.6 |
|
| 334 | - */ |
|
| 335 | - $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf); |
|
| 336 | - } |
|
| 337 | - |
|
| 338 | - // Check if there is a custom field specific filter. |
|
| 339 | - if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){ |
|
| 340 | - /** |
|
| 341 | - * Filter the phone html by individual custom field. |
|
| 342 | - * |
|
| 343 | - * @param string $html The html to filter. |
|
| 344 | - * @param string $location The location to output the html. |
|
| 345 | - * @param array $cf The custom field array. |
|
| 346 | - * @since 1.6.6 |
|
| 347 | - */ |
|
| 348 | - $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf); |
|
| 349 | - } |
|
| 350 | - |
|
| 351 | - // Check if there is a custom field key specific filter. |
|
| 352 | - if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){ |
|
| 353 | - /** |
|
| 354 | - * Filter the phone html by field type key. |
|
| 355 | - * |
|
| 356 | - * @param string $html The html to filter. |
|
| 357 | - * @param string $location The location to output the html. |
|
| 358 | - * @param array $cf The custom field array. |
|
| 359 | - * @since 1.6.6 |
|
| 360 | - */ |
|
| 361 | - $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 362 | - } |
|
| 363 | - |
|
| 364 | - // If not html then we run the standard output. |
|
| 365 | - if(empty($html)){ |
|
| 366 | - |
|
| 367 | - if ($post->{$cf['htmlvar_name']}): |
|
| 368 | - |
|
| 369 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 370 | - if (strpos($field_icon, 'http') !== false) { |
|
| 371 | - $field_icon_af = ''; |
|
| 372 | - } elseif ($field_icon == '') { |
|
| 373 | - $field_icon_af = '<i class="fa fa-phone"></i>'; |
|
| 374 | - } else { |
|
| 375 | - $field_icon_af = $field_icon; |
|
| 376 | - $field_icon = ''; |
|
| 377 | - } |
|
| 378 | - |
|
| 379 | - |
|
| 380 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af . |
|
| 381 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
| 382 | - $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>'; |
|
| 383 | - |
|
| 384 | - endif; |
|
| 385 | - |
|
| 386 | - } |
|
| 387 | - |
|
| 388 | - return $html; |
|
| 315 | + // check we have the post value |
|
| 316 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 317 | + else{ global $post;} |
|
| 318 | + |
|
| 319 | + if(!is_array($cf) && $cf!=''){ |
|
| 320 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 321 | + if(!$cf){return NULL;} |
|
| 322 | + } |
|
| 323 | + |
|
| 324 | + $html_var = $cf['htmlvar_name']; |
|
| 325 | + |
|
| 326 | + // Check if there is a location specific filter. |
|
| 327 | + if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){ |
|
| 328 | + /** |
|
| 329 | + * Filter the phone html by location. |
|
| 330 | + * |
|
| 331 | + * @param string $html The html to filter. |
|
| 332 | + * @param array $cf The custom field array. |
|
| 333 | + * @since 1.6.6 |
|
| 334 | + */ |
|
| 335 | + $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf); |
|
| 336 | + } |
|
| 337 | + |
|
| 338 | + // Check if there is a custom field specific filter. |
|
| 339 | + if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){ |
|
| 340 | + /** |
|
| 341 | + * Filter the phone html by individual custom field. |
|
| 342 | + * |
|
| 343 | + * @param string $html The html to filter. |
|
| 344 | + * @param string $location The location to output the html. |
|
| 345 | + * @param array $cf The custom field array. |
|
| 346 | + * @since 1.6.6 |
|
| 347 | + */ |
|
| 348 | + $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf); |
|
| 349 | + } |
|
| 350 | + |
|
| 351 | + // Check if there is a custom field key specific filter. |
|
| 352 | + if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){ |
|
| 353 | + /** |
|
| 354 | + * Filter the phone html by field type key. |
|
| 355 | + * |
|
| 356 | + * @param string $html The html to filter. |
|
| 357 | + * @param string $location The location to output the html. |
|
| 358 | + * @param array $cf The custom field array. |
|
| 359 | + * @since 1.6.6 |
|
| 360 | + */ |
|
| 361 | + $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 362 | + } |
|
| 363 | + |
|
| 364 | + // If not html then we run the standard output. |
|
| 365 | + if(empty($html)){ |
|
| 366 | + |
|
| 367 | + if ($post->{$cf['htmlvar_name']}): |
|
| 368 | + |
|
| 369 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 370 | + if (strpos($field_icon, 'http') !== false) { |
|
| 371 | + $field_icon_af = ''; |
|
| 372 | + } elseif ($field_icon == '') { |
|
| 373 | + $field_icon_af = '<i class="fa fa-phone"></i>'; |
|
| 374 | + } else { |
|
| 375 | + $field_icon_af = $field_icon; |
|
| 376 | + $field_icon = ''; |
|
| 377 | + } |
|
| 378 | + |
|
| 379 | + |
|
| 380 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af . |
|
| 381 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
| 382 | + $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>'; |
|
| 383 | + |
|
| 384 | + endif; |
|
| 385 | + |
|
| 386 | + } |
|
| 387 | + |
|
| 388 | + return $html; |
|
| 389 | 389 | } |
| 390 | 390 | add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3); |
| 391 | 391 | |
@@ -402,85 +402,85 @@ discard block |
||
| 402 | 402 | */ |
| 403 | 403 | function geodir_cf_time($html,$location,$cf,$p=''){ |
| 404 | 404 | |
| 405 | - // check we have the post value |
|
| 406 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 407 | - else{ global $post;} |
|
| 408 | - |
|
| 409 | - if(!is_array($cf) && $cf!=''){ |
|
| 410 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 411 | - if(!$cf){return NULL;} |
|
| 412 | - } |
|
| 413 | - |
|
| 414 | - $html_var = $cf['htmlvar_name']; |
|
| 415 | - |
|
| 416 | - // Check if there is a location specific filter. |
|
| 417 | - if(has_filter("geodir_custom_field_output_time_loc_{$location}")){ |
|
| 418 | - /** |
|
| 419 | - * Filter the time html by location. |
|
| 420 | - * |
|
| 421 | - * @param string $html The html to filter. |
|
| 422 | - * @param array $cf The custom field array. |
|
| 423 | - * @since 1.6.6 |
|
| 424 | - */ |
|
| 425 | - $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf); |
|
| 426 | - } |
|
| 427 | - |
|
| 428 | - // Check if there is a custom field specific filter. |
|
| 429 | - if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){ |
|
| 430 | - /** |
|
| 431 | - * Filter the time html by individual custom field. |
|
| 432 | - * |
|
| 433 | - * @param string $html The html to filter. |
|
| 434 | - * @param string $location The location to output the html. |
|
| 435 | - * @param array $cf The custom field array. |
|
| 436 | - * @since 1.6.6 |
|
| 437 | - */ |
|
| 438 | - $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf); |
|
| 439 | - } |
|
| 440 | - |
|
| 441 | - // Check if there is a custom field key specific filter. |
|
| 442 | - if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){ |
|
| 443 | - /** |
|
| 444 | - * Filter the time html by field type key. |
|
| 445 | - * |
|
| 446 | - * @param string $html The html to filter. |
|
| 447 | - * @param string $location The location to output the html. |
|
| 448 | - * @param array $cf The custom field array. |
|
| 449 | - * @since 1.6.6 |
|
| 450 | - */ |
|
| 451 | - $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 452 | - } |
|
| 453 | - |
|
| 454 | - // If not html then we run the standard output. |
|
| 455 | - if(empty($html)){ |
|
| 456 | - |
|
| 457 | - if ($post->{$cf['htmlvar_name']}): |
|
| 458 | - |
|
| 459 | - $value = ''; |
|
| 460 | - if ($post->{$cf['htmlvar_name']} != '') |
|
| 461 | - //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']})); |
|
| 462 | - $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']})); |
|
| 463 | - |
|
| 464 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 465 | - if (strpos($field_icon, 'http') !== false) { |
|
| 466 | - $field_icon_af = ''; |
|
| 467 | - } elseif ($field_icon == '') { |
|
| 468 | - $field_icon_af = '<i class="fa fa-clock-o"></i>'; |
|
| 469 | - } else { |
|
| 470 | - $field_icon_af = $field_icon; |
|
| 471 | - $field_icon = ''; |
|
| 472 | - } |
|
| 473 | - |
|
| 474 | - |
|
| 475 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
| 476 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
| 477 | - $html .= '</span>' . $value . '</div>'; |
|
| 478 | - |
|
| 479 | - endif; |
|
| 480 | - |
|
| 481 | - } |
|
| 482 | - |
|
| 483 | - return $html; |
|
| 405 | + // check we have the post value |
|
| 406 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 407 | + else{ global $post;} |
|
| 408 | + |
|
| 409 | + if(!is_array($cf) && $cf!=''){ |
|
| 410 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 411 | + if(!$cf){return NULL;} |
|
| 412 | + } |
|
| 413 | + |
|
| 414 | + $html_var = $cf['htmlvar_name']; |
|
| 415 | + |
|
| 416 | + // Check if there is a location specific filter. |
|
| 417 | + if(has_filter("geodir_custom_field_output_time_loc_{$location}")){ |
|
| 418 | + /** |
|
| 419 | + * Filter the time html by location. |
|
| 420 | + * |
|
| 421 | + * @param string $html The html to filter. |
|
| 422 | + * @param array $cf The custom field array. |
|
| 423 | + * @since 1.6.6 |
|
| 424 | + */ |
|
| 425 | + $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf); |
|
| 426 | + } |
|
| 427 | + |
|
| 428 | + // Check if there is a custom field specific filter. |
|
| 429 | + if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){ |
|
| 430 | + /** |
|
| 431 | + * Filter the time html by individual custom field. |
|
| 432 | + * |
|
| 433 | + * @param string $html The html to filter. |
|
| 434 | + * @param string $location The location to output the html. |
|
| 435 | + * @param array $cf The custom field array. |
|
| 436 | + * @since 1.6.6 |
|
| 437 | + */ |
|
| 438 | + $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf); |
|
| 439 | + } |
|
| 440 | + |
|
| 441 | + // Check if there is a custom field key specific filter. |
|
| 442 | + if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){ |
|
| 443 | + /** |
|
| 444 | + * Filter the time html by field type key. |
|
| 445 | + * |
|
| 446 | + * @param string $html The html to filter. |
|
| 447 | + * @param string $location The location to output the html. |
|
| 448 | + * @param array $cf The custom field array. |
|
| 449 | + * @since 1.6.6 |
|
| 450 | + */ |
|
| 451 | + $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 452 | + } |
|
| 453 | + |
|
| 454 | + // If not html then we run the standard output. |
|
| 455 | + if(empty($html)){ |
|
| 456 | + |
|
| 457 | + if ($post->{$cf['htmlvar_name']}): |
|
| 458 | + |
|
| 459 | + $value = ''; |
|
| 460 | + if ($post->{$cf['htmlvar_name']} != '') |
|
| 461 | + //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']})); |
|
| 462 | + $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']})); |
|
| 463 | + |
|
| 464 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 465 | + if (strpos($field_icon, 'http') !== false) { |
|
| 466 | + $field_icon_af = ''; |
|
| 467 | + } elseif ($field_icon == '') { |
|
| 468 | + $field_icon_af = '<i class="fa fa-clock-o"></i>'; |
|
| 469 | + } else { |
|
| 470 | + $field_icon_af = $field_icon; |
|
| 471 | + $field_icon = ''; |
|
| 472 | + } |
|
| 473 | + |
|
| 474 | + |
|
| 475 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
| 476 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
| 477 | + $html .= '</span>' . $value . '</div>'; |
|
| 478 | + |
|
| 479 | + endif; |
|
| 480 | + |
|
| 481 | + } |
|
| 482 | + |
|
| 483 | + return $html; |
|
| 484 | 484 | } |
| 485 | 485 | add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3); |
| 486 | 486 | |
@@ -496,111 +496,111 @@ discard block |
||
| 496 | 496 | * @return string The html to output for the custom field. |
| 497 | 497 | */ |
| 498 | 498 | function geodir_cf_datepicker($html,$location,$cf,$p=''){ |
| 499 | - global $preview; |
|
| 500 | - // check we have the post value |
|
| 501 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 502 | - else{ global $post;} |
|
| 503 | - |
|
| 504 | - if(!is_array($cf) && $cf!=''){ |
|
| 505 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 506 | - if(!$cf){return NULL;} |
|
| 507 | - } |
|
| 508 | - |
|
| 509 | - $html_var = $cf['htmlvar_name']; |
|
| 510 | - |
|
| 511 | - // Check if there is a location specific filter. |
|
| 512 | - if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){ |
|
| 513 | - /** |
|
| 514 | - * Filter the datepicker html by location. |
|
| 515 | - * |
|
| 516 | - * @param string $html The html to filter. |
|
| 517 | - * @param array $cf The custom field array. |
|
| 518 | - * @since 1.6.6 |
|
| 519 | - */ |
|
| 520 | - $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf); |
|
| 521 | - } |
|
| 522 | - |
|
| 523 | - // Check if there is a custom field specific filter. |
|
| 524 | - if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){ |
|
| 525 | - /** |
|
| 526 | - * Filter the datepicker html by individual custom field. |
|
| 527 | - * |
|
| 528 | - * @param string $html The html to filter. |
|
| 529 | - * @param string $location The location to output the html. |
|
| 530 | - * @param array $cf The custom field array. |
|
| 531 | - * @since 1.6.6 |
|
| 532 | - */ |
|
| 533 | - $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf); |
|
| 534 | - } |
|
| 535 | - |
|
| 536 | - // Check if there is a custom field key specific filter. |
|
| 537 | - if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){ |
|
| 538 | - /** |
|
| 539 | - * Filter the datepicker html by field type key. |
|
| 540 | - * |
|
| 541 | - * @param string $html The html to filter. |
|
| 542 | - * @param string $location The location to output the html. |
|
| 543 | - * @param array $cf The custom field array. |
|
| 544 | - * @since 1.6.6 |
|
| 545 | - */ |
|
| 546 | - $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 547 | - } |
|
| 548 | - |
|
| 549 | - // If not html then we run the standard output. |
|
| 550 | - if(empty($html)){ |
|
| 551 | - |
|
| 552 | - if ($post->{$cf['htmlvar_name']}): |
|
| 553 | - |
|
| 554 | - $date_format = geodir_default_date_format(); |
|
| 555 | - if ($cf['extra_fields'] != '') { |
|
| 556 | - $date_format = stripslashes_deep(unserialize($cf['extra_fields'])); |
|
| 557 | - $date_format = $date_format['date_format']; |
|
| 558 | - } |
|
| 559 | - // check if we need to change the format or not |
|
| 560 | - $date_format_len = strlen(str_replace(' ', '', $date_format)); |
|
| 561 | - if($date_format_len>5){// if greater then 4 then it's the old style format. |
|
| 562 | - |
|
| 563 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
| 564 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
| 565 | - |
|
| 566 | - $date_format = str_replace($search, $replace, $date_format); |
|
| 567 | - |
|
| 568 | - $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
|
| 569 | - }else{ |
|
| 570 | - $post_htmlvar_value = $post->{$cf['htmlvar_name']}; |
|
| 571 | - } |
|
| 572 | - |
|
| 573 | - if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") { |
|
| 574 | - $date_format_from = $preview ? $date_format : 'Y-m-d'; |
|
| 575 | - $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d |
|
| 576 | - //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value; |
|
| 577 | - //$value = date_i18n($date_format, strtotime($post_htmlvar_value)); |
|
| 578 | - }else{ |
|
| 579 | - return ''; |
|
| 580 | - } |
|
| 581 | - |
|
| 582 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 583 | - |
|
| 584 | - if (strpos($field_icon, 'http') !== false) { |
|
| 585 | - $field_icon_af = ''; |
|
| 586 | - } elseif ($field_icon == '') { |
|
| 587 | - $field_icon_af = '<i class="fa fa-calendar"></i>'; |
|
| 588 | - } else { |
|
| 589 | - $field_icon_af = $field_icon; |
|
| 590 | - $field_icon = ''; |
|
| 591 | - } |
|
| 592 | - |
|
| 593 | - |
|
| 594 | - |
|
| 595 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
| 596 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 597 | - $html .= '</span>' . $value . '</div>'; |
|
| 598 | - |
|
| 599 | - endif; |
|
| 600 | - |
|
| 601 | - } |
|
| 602 | - |
|
| 603 | - return $html; |
|
| 499 | + global $preview; |
|
| 500 | + // check we have the post value |
|
| 501 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 502 | + else{ global $post;} |
|
| 503 | + |
|
| 504 | + if(!is_array($cf) && $cf!=''){ |
|
| 505 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 506 | + if(!$cf){return NULL;} |
|
| 507 | + } |
|
| 508 | + |
|
| 509 | + $html_var = $cf['htmlvar_name']; |
|
| 510 | + |
|
| 511 | + // Check if there is a location specific filter. |
|
| 512 | + if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){ |
|
| 513 | + /** |
|
| 514 | + * Filter the datepicker html by location. |
|
| 515 | + * |
|
| 516 | + * @param string $html The html to filter. |
|
| 517 | + * @param array $cf The custom field array. |
|
| 518 | + * @since 1.6.6 |
|
| 519 | + */ |
|
| 520 | + $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf); |
|
| 521 | + } |
|
| 522 | + |
|
| 523 | + // Check if there is a custom field specific filter. |
|
| 524 | + if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){ |
|
| 525 | + /** |
|
| 526 | + * Filter the datepicker html by individual custom field. |
|
| 527 | + * |
|
| 528 | + * @param string $html The html to filter. |
|
| 529 | + * @param string $location The location to output the html. |
|
| 530 | + * @param array $cf The custom field array. |
|
| 531 | + * @since 1.6.6 |
|
| 532 | + */ |
|
| 533 | + $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf); |
|
| 534 | + } |
|
| 535 | + |
|
| 536 | + // Check if there is a custom field key specific filter. |
|
| 537 | + if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){ |
|
| 538 | + /** |
|
| 539 | + * Filter the datepicker html by field type key. |
|
| 540 | + * |
|
| 541 | + * @param string $html The html to filter. |
|
| 542 | + * @param string $location The location to output the html. |
|
| 543 | + * @param array $cf The custom field array. |
|
| 544 | + * @since 1.6.6 |
|
| 545 | + */ |
|
| 546 | + $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 547 | + } |
|
| 548 | + |
|
| 549 | + // If not html then we run the standard output. |
|
| 550 | + if(empty($html)){ |
|
| 551 | + |
|
| 552 | + if ($post->{$cf['htmlvar_name']}): |
|
| 553 | + |
|
| 554 | + $date_format = geodir_default_date_format(); |
|
| 555 | + if ($cf['extra_fields'] != '') { |
|
| 556 | + $date_format = stripslashes_deep(unserialize($cf['extra_fields'])); |
|
| 557 | + $date_format = $date_format['date_format']; |
|
| 558 | + } |
|
| 559 | + // check if we need to change the format or not |
|
| 560 | + $date_format_len = strlen(str_replace(' ', '', $date_format)); |
|
| 561 | + if($date_format_len>5){// if greater then 4 then it's the old style format. |
|
| 562 | + |
|
| 563 | + $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
| 564 | + $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
| 565 | + |
|
| 566 | + $date_format = str_replace($search, $replace, $date_format); |
|
| 567 | + |
|
| 568 | + $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
|
| 569 | + }else{ |
|
| 570 | + $post_htmlvar_value = $post->{$cf['htmlvar_name']}; |
|
| 571 | + } |
|
| 572 | + |
|
| 573 | + if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") { |
|
| 574 | + $date_format_from = $preview ? $date_format : 'Y-m-d'; |
|
| 575 | + $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d |
|
| 576 | + //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value; |
|
| 577 | + //$value = date_i18n($date_format, strtotime($post_htmlvar_value)); |
|
| 578 | + }else{ |
|
| 579 | + return ''; |
|
| 580 | + } |
|
| 581 | + |
|
| 582 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 583 | + |
|
| 584 | + if (strpos($field_icon, 'http') !== false) { |
|
| 585 | + $field_icon_af = ''; |
|
| 586 | + } elseif ($field_icon == '') { |
|
| 587 | + $field_icon_af = '<i class="fa fa-calendar"></i>'; |
|
| 588 | + } else { |
|
| 589 | + $field_icon_af = $field_icon; |
|
| 590 | + $field_icon = ''; |
|
| 591 | + } |
|
| 592 | + |
|
| 593 | + |
|
| 594 | + |
|
| 595 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
| 596 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 597 | + $html .= '</span>' . $value . '</div>'; |
|
| 598 | + |
|
| 599 | + endif; |
|
| 600 | + |
|
| 601 | + } |
|
| 602 | + |
|
| 603 | + return $html; |
|
| 604 | 604 | } |
| 605 | 605 | add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3); |
| 606 | 606 | |
@@ -617,97 +617,97 @@ discard block |
||
| 617 | 617 | */ |
| 618 | 618 | function geodir_cf_text($html,$location,$cf,$p=''){ |
| 619 | 619 | |
| 620 | - // check we have the post value |
|
| 621 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 622 | - else{ global $post;} |
|
| 623 | - |
|
| 624 | - if(!is_array($cf) && $cf!=''){ |
|
| 625 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 626 | - if(!$cf){return NULL;} |
|
| 627 | - } |
|
| 628 | - |
|
| 629 | - $html_var = $cf['htmlvar_name']; |
|
| 630 | - |
|
| 631 | - // Check if there is a location specific filter. |
|
| 632 | - if(has_filter("geodir_custom_field_output_text_loc_{$location}")){ |
|
| 633 | - /** |
|
| 634 | - * Filter the text html by location. |
|
| 635 | - * |
|
| 636 | - * @param string $html The html to filter. |
|
| 637 | - * @param array $cf The custom field array. |
|
| 638 | - * @since 1.6.6 |
|
| 639 | - */ |
|
| 640 | - $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf); |
|
| 641 | - } |
|
| 642 | - |
|
| 643 | - // Check if there is a custom field specific filter. |
|
| 644 | - if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){ |
|
| 645 | - /** |
|
| 646 | - * Filter the text html by individual custom field. |
|
| 647 | - * |
|
| 648 | - * @param string $html The html to filter. |
|
| 649 | - * @param string $location The location to output the html. |
|
| 650 | - * @param array $cf The custom field array. |
|
| 651 | - * @since 1.6.6 |
|
| 652 | - */ |
|
| 653 | - $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf); |
|
| 654 | - } |
|
| 655 | - |
|
| 656 | - // Check if there is a custom field key specific filter. |
|
| 657 | - if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){ |
|
| 658 | - /** |
|
| 659 | - * Filter the text html by field type key. |
|
| 660 | - * |
|
| 661 | - * @param string $html The html to filter. |
|
| 662 | - * @param string $location The location to output the html. |
|
| 663 | - * @param array $cf The custom field array. |
|
| 664 | - * @since 1.6.6 |
|
| 665 | - */ |
|
| 666 | - $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 667 | - } |
|
| 620 | + // check we have the post value |
|
| 621 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 622 | + else{ global $post;} |
|
| 623 | + |
|
| 624 | + if(!is_array($cf) && $cf!=''){ |
|
| 625 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 626 | + if(!$cf){return NULL;} |
|
| 627 | + } |
|
| 628 | + |
|
| 629 | + $html_var = $cf['htmlvar_name']; |
|
| 630 | + |
|
| 631 | + // Check if there is a location specific filter. |
|
| 632 | + if(has_filter("geodir_custom_field_output_text_loc_{$location}")){ |
|
| 633 | + /** |
|
| 634 | + * Filter the text html by location. |
|
| 635 | + * |
|
| 636 | + * @param string $html The html to filter. |
|
| 637 | + * @param array $cf The custom field array. |
|
| 638 | + * @since 1.6.6 |
|
| 639 | + */ |
|
| 640 | + $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf); |
|
| 641 | + } |
|
| 642 | + |
|
| 643 | + // Check if there is a custom field specific filter. |
|
| 644 | + if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){ |
|
| 645 | + /** |
|
| 646 | + * Filter the text html by individual custom field. |
|
| 647 | + * |
|
| 648 | + * @param string $html The html to filter. |
|
| 649 | + * @param string $location The location to output the html. |
|
| 650 | + * @param array $cf The custom field array. |
|
| 651 | + * @since 1.6.6 |
|
| 652 | + */ |
|
| 653 | + $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf); |
|
| 654 | + } |
|
| 655 | + |
|
| 656 | + // Check if there is a custom field key specific filter. |
|
| 657 | + if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){ |
|
| 658 | + /** |
|
| 659 | + * Filter the text html by field type key. |
|
| 660 | + * |
|
| 661 | + * @param string $html The html to filter. |
|
| 662 | + * @param string $location The location to output the html. |
|
| 663 | + * @param array $cf The custom field array. |
|
| 664 | + * @since 1.6.6 |
|
| 665 | + */ |
|
| 666 | + $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 667 | + } |
|
| 668 | 668 | |
| 669 | 669 | |
| 670 | 670 | |
| 671 | - // If not html then we run the standard output. |
|
| 672 | - if(empty($html)){ |
|
| 671 | + // If not html then we run the standard output. |
|
| 672 | + if(empty($html)){ |
|
| 673 | 673 | |
| 674 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
| 674 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
| 675 | 675 | |
| 676 | - $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
|
| 676 | + $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
|
| 677 | 677 | |
| 678 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 679 | - if (strpos($field_icon, 'http') !== false) { |
|
| 680 | - $field_icon_af = ''; |
|
| 681 | - } elseif ($field_icon == '') { |
|
| 682 | - $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : ""; |
|
| 683 | - } else { |
|
| 684 | - $field_icon_af = $field_icon; |
|
| 685 | - $field_icon = ''; |
|
| 686 | - } |
|
| 678 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 679 | + if (strpos($field_icon, 'http') !== false) { |
|
| 680 | + $field_icon_af = ''; |
|
| 681 | + } elseif ($field_icon == '') { |
|
| 682 | + $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : ""; |
|
| 683 | + } else { |
|
| 684 | + $field_icon_af = $field_icon; |
|
| 685 | + $field_icon = ''; |
|
| 686 | + } |
|
| 687 | 687 | |
| 688 | 688 | |
| 689 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af; |
|
| 690 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 691 | - $html .= '</span>'; |
|
| 689 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af; |
|
| 690 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 691 | + $html .= '</span>'; |
|
| 692 | 692 | |
| 693 | - $value = $post->{$cf['htmlvar_name']}; |
|
| 694 | - if(isset($cf['data_type']) && ($cf['data_type']=='INT' || $cf['data_type']=='FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']){ |
|
| 695 | - $extra_fields = stripslashes_deep(maybe_unserialize($cf['extra_fields'])); |
|
| 696 | - if(isset($extra_fields['is_price']) && $extra_fields['is_price']){ |
|
| 697 | - if(!ceil($value) > 0){return '';}// dont output blank prices |
|
| 698 | - $value = geodir_currency_format_number($value,$cf); |
|
| 699 | - } |
|
| 700 | - } |
|
| 693 | + $value = $post->{$cf['htmlvar_name']}; |
|
| 694 | + if(isset($cf['data_type']) && ($cf['data_type']=='INT' || $cf['data_type']=='FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']){ |
|
| 695 | + $extra_fields = stripslashes_deep(maybe_unserialize($cf['extra_fields'])); |
|
| 696 | + if(isset($extra_fields['is_price']) && $extra_fields['is_price']){ |
|
| 697 | + if(!ceil($value) > 0){return '';}// dont output blank prices |
|
| 698 | + $value = geodir_currency_format_number($value,$cf); |
|
| 699 | + } |
|
| 700 | + } |
|
| 701 | 701 | |
| 702 | 702 | |
| 703 | - $html .= $value; |
|
| 704 | - $html .= '</div>'; |
|
| 703 | + $html .= $value; |
|
| 704 | + $html .= '</div>'; |
|
| 705 | 705 | |
| 706 | - endif; |
|
| 706 | + endif; |
|
| 707 | 707 | |
| 708 | - } |
|
| 708 | + } |
|
| 709 | 709 | |
| 710 | - return $html; |
|
| 710 | + return $html; |
|
| 711 | 711 | } |
| 712 | 712 | add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3); |
| 713 | 713 | |
@@ -724,98 +724,98 @@ discard block |
||
| 724 | 724 | */ |
| 725 | 725 | function geodir_cf_radio($html,$location,$cf,$p=''){ |
| 726 | 726 | |
| 727 | - // check we have the post value |
|
| 728 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 729 | - else{ global $post;} |
|
| 730 | - |
|
| 731 | - if(!is_array($cf) && $cf!=''){ |
|
| 732 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 733 | - if(!$cf){return NULL;} |
|
| 734 | - } |
|
| 735 | - |
|
| 736 | - $html_var = $cf['htmlvar_name']; |
|
| 737 | - |
|
| 738 | - // Check if there is a location specific filter. |
|
| 739 | - if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){ |
|
| 740 | - /** |
|
| 741 | - * Filter the radio html by location. |
|
| 742 | - * |
|
| 743 | - * @param string $html The html to filter. |
|
| 744 | - * @param array $cf The custom field array. |
|
| 745 | - * @since 1.6.6 |
|
| 746 | - */ |
|
| 747 | - $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf); |
|
| 748 | - } |
|
| 749 | - |
|
| 750 | - // Check if there is a custom field specific filter. |
|
| 751 | - if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){ |
|
| 752 | - /** |
|
| 753 | - * Filter the radio html by individual custom field. |
|
| 754 | - * |
|
| 755 | - * @param string $html The html to filter. |
|
| 756 | - * @param string $location The location to output the html. |
|
| 757 | - * @param array $cf The custom field array. |
|
| 758 | - * @since 1.6.6 |
|
| 759 | - */ |
|
| 760 | - $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf); |
|
| 761 | - } |
|
| 762 | - |
|
| 763 | - // Check if there is a custom field key specific filter. |
|
| 764 | - if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){ |
|
| 765 | - /** |
|
| 766 | - * Filter the radio html by field type key. |
|
| 767 | - * |
|
| 768 | - * @param string $html The html to filter. |
|
| 769 | - * @param string $location The location to output the html. |
|
| 770 | - * @param array $cf The custom field array. |
|
| 771 | - * @since 1.6.6 |
|
| 772 | - */ |
|
| 773 | - $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 774 | - } |
|
| 775 | - |
|
| 776 | - // If not html then we run the standard output. |
|
| 777 | - if(empty($html)){ |
|
| 778 | - |
|
| 779 | - $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : ''; |
|
| 780 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
|
| 781 | - |
|
| 782 | - if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') { |
|
| 783 | - $html_val = __('No', 'geodirectory'); |
|
| 784 | - } else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') { |
|
| 785 | - $html_val = __('Yes', 'geodirectory'); |
|
| 786 | - } else { |
|
| 787 | - if (!empty($cf['option_values'])) { |
|
| 788 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
| 789 | - |
|
| 790 | - if (!empty($cf_option_values)) { |
|
| 791 | - foreach ($cf_option_values as $cf_option_value) { |
|
| 792 | - if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) { |
|
| 793 | - $html_val = $cf_option_value['label']; |
|
| 794 | - } |
|
| 795 | - } |
|
| 796 | - } |
|
| 797 | - } |
|
| 798 | - } |
|
| 799 | - |
|
| 800 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 801 | - if (strpos($field_icon, 'http') !== false) { |
|
| 802 | - $field_icon_af = ''; |
|
| 803 | - } elseif ($field_icon == '') { |
|
| 804 | - $field_icon_af = ''; |
|
| 805 | - } else { |
|
| 806 | - $field_icon_af = $field_icon; |
|
| 807 | - $field_icon = ''; |
|
| 808 | - } |
|
| 809 | - |
|
| 810 | - |
|
| 811 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
| 812 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 813 | - $html .= '</span>' . $html_val . '</div>'; |
|
| 814 | - endif; |
|
| 815 | - |
|
| 816 | - } |
|
| 817 | - |
|
| 818 | - return $html; |
|
| 727 | + // check we have the post value |
|
| 728 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 729 | + else{ global $post;} |
|
| 730 | + |
|
| 731 | + if(!is_array($cf) && $cf!=''){ |
|
| 732 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 733 | + if(!$cf){return NULL;} |
|
| 734 | + } |
|
| 735 | + |
|
| 736 | + $html_var = $cf['htmlvar_name']; |
|
| 737 | + |
|
| 738 | + // Check if there is a location specific filter. |
|
| 739 | + if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){ |
|
| 740 | + /** |
|
| 741 | + * Filter the radio html by location. |
|
| 742 | + * |
|
| 743 | + * @param string $html The html to filter. |
|
| 744 | + * @param array $cf The custom field array. |
|
| 745 | + * @since 1.6.6 |
|
| 746 | + */ |
|
| 747 | + $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf); |
|
| 748 | + } |
|
| 749 | + |
|
| 750 | + // Check if there is a custom field specific filter. |
|
| 751 | + if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){ |
|
| 752 | + /** |
|
| 753 | + * Filter the radio html by individual custom field. |
|
| 754 | + * |
|
| 755 | + * @param string $html The html to filter. |
|
| 756 | + * @param string $location The location to output the html. |
|
| 757 | + * @param array $cf The custom field array. |
|
| 758 | + * @since 1.6.6 |
|
| 759 | + */ |
|
| 760 | + $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf); |
|
| 761 | + } |
|
| 762 | + |
|
| 763 | + // Check if there is a custom field key specific filter. |
|
| 764 | + if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){ |
|
| 765 | + /** |
|
| 766 | + * Filter the radio html by field type key. |
|
| 767 | + * |
|
| 768 | + * @param string $html The html to filter. |
|
| 769 | + * @param string $location The location to output the html. |
|
| 770 | + * @param array $cf The custom field array. |
|
| 771 | + * @since 1.6.6 |
|
| 772 | + */ |
|
| 773 | + $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 774 | + } |
|
| 775 | + |
|
| 776 | + // If not html then we run the standard output. |
|
| 777 | + if(empty($html)){ |
|
| 778 | + |
|
| 779 | + $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : ''; |
|
| 780 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
|
| 781 | + |
|
| 782 | + if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') { |
|
| 783 | + $html_val = __('No', 'geodirectory'); |
|
| 784 | + } else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') { |
|
| 785 | + $html_val = __('Yes', 'geodirectory'); |
|
| 786 | + } else { |
|
| 787 | + if (!empty($cf['option_values'])) { |
|
| 788 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
| 789 | + |
|
| 790 | + if (!empty($cf_option_values)) { |
|
| 791 | + foreach ($cf_option_values as $cf_option_value) { |
|
| 792 | + if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) { |
|
| 793 | + $html_val = $cf_option_value['label']; |
|
| 794 | + } |
|
| 795 | + } |
|
| 796 | + } |
|
| 797 | + } |
|
| 798 | + } |
|
| 799 | + |
|
| 800 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 801 | + if (strpos($field_icon, 'http') !== false) { |
|
| 802 | + $field_icon_af = ''; |
|
| 803 | + } elseif ($field_icon == '') { |
|
| 804 | + $field_icon_af = ''; |
|
| 805 | + } else { |
|
| 806 | + $field_icon_af = $field_icon; |
|
| 807 | + $field_icon = ''; |
|
| 808 | + } |
|
| 809 | + |
|
| 810 | + |
|
| 811 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
| 812 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 813 | + $html .= '</span>' . $html_val . '</div>'; |
|
| 814 | + endif; |
|
| 815 | + |
|
| 816 | + } |
|
| 817 | + |
|
| 818 | + return $html; |
|
| 819 | 819 | } |
| 820 | 820 | add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3); |
| 821 | 821 | |
@@ -832,92 +832,92 @@ discard block |
||
| 832 | 832 | */ |
| 833 | 833 | function geodir_cf_select($html,$location,$cf,$p=''){ |
| 834 | 834 | |
| 835 | - // check we have the post value |
|
| 836 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 837 | - else{ global $post;} |
|
| 838 | - |
|
| 839 | - if(!is_array($cf) && $cf!=''){ |
|
| 840 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 841 | - if(!$cf){return NULL;} |
|
| 842 | - } |
|
| 843 | - |
|
| 844 | - $html_var = $cf['htmlvar_name']; |
|
| 845 | - |
|
| 846 | - // Check if there is a location specific filter. |
|
| 847 | - if(has_filter("geodir_custom_field_output_select_loc_{$location}")){ |
|
| 848 | - /** |
|
| 849 | - * Filter the select html by location. |
|
| 850 | - * |
|
| 851 | - * @param string $html The html to filter. |
|
| 852 | - * @param array $cf The custom field array. |
|
| 853 | - * @since 1.6.6 |
|
| 854 | - */ |
|
| 855 | - $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf); |
|
| 856 | - } |
|
| 857 | - |
|
| 858 | - // Check if there is a custom field specific filter. |
|
| 859 | - if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){ |
|
| 860 | - /** |
|
| 861 | - * Filter the select html by individual custom field. |
|
| 862 | - * |
|
| 863 | - * @param string $html The html to filter. |
|
| 864 | - * @param string $location The location to output the html. |
|
| 865 | - * @param array $cf The custom field array. |
|
| 866 | - * @since 1.6.6 |
|
| 867 | - */ |
|
| 868 | - $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf); |
|
| 869 | - } |
|
| 870 | - |
|
| 871 | - // Check if there is a custom field key specific filter. |
|
| 872 | - if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){ |
|
| 873 | - /** |
|
| 874 | - * Filter the select html by field type key. |
|
| 875 | - * |
|
| 876 | - * @param string $html The html to filter. |
|
| 877 | - * @param string $location The location to output the html. |
|
| 878 | - * @param array $cf The custom field array. |
|
| 879 | - * @since 1.6.6 |
|
| 880 | - */ |
|
| 881 | - $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 882 | - } |
|
| 883 | - |
|
| 884 | - // If not html then we run the standard output. |
|
| 885 | - if(empty($html)){ |
|
| 886 | - |
|
| 887 | - if ($post->{$cf['htmlvar_name']}): |
|
| 888 | - $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory'); |
|
| 889 | - |
|
| 890 | - if (!empty($cf['option_values'])) { |
|
| 891 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
| 892 | - |
|
| 893 | - if (!empty($cf_option_values)) { |
|
| 894 | - foreach ($cf_option_values as $cf_option_value) { |
|
| 895 | - if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) { |
|
| 896 | - //$field_value = $cf_option_value['label']; // no longer needed here. |
|
| 897 | - } |
|
| 898 | - } |
|
| 899 | - } |
|
| 900 | - } |
|
| 901 | - |
|
| 902 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 903 | - if (strpos($field_icon, 'http') !== false) { |
|
| 904 | - $field_icon_af = ''; |
|
| 905 | - } elseif ($field_icon == '') { |
|
| 906 | - $field_icon_af = ''; |
|
| 907 | - } else { |
|
| 908 | - $field_icon_af = $field_icon; |
|
| 909 | - $field_icon = ''; |
|
| 910 | - } |
|
| 911 | - |
|
| 912 | - |
|
| 913 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 914 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 915 | - $html .= '</span>' . $field_value . '</div>'; |
|
| 916 | - endif; |
|
| 917 | - |
|
| 918 | - } |
|
| 919 | - |
|
| 920 | - return $html; |
|
| 835 | + // check we have the post value |
|
| 836 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 837 | + else{ global $post;} |
|
| 838 | + |
|
| 839 | + if(!is_array($cf) && $cf!=''){ |
|
| 840 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 841 | + if(!$cf){return NULL;} |
|
| 842 | + } |
|
| 843 | + |
|
| 844 | + $html_var = $cf['htmlvar_name']; |
|
| 845 | + |
|
| 846 | + // Check if there is a location specific filter. |
|
| 847 | + if(has_filter("geodir_custom_field_output_select_loc_{$location}")){ |
|
| 848 | + /** |
|
| 849 | + * Filter the select html by location. |
|
| 850 | + * |
|
| 851 | + * @param string $html The html to filter. |
|
| 852 | + * @param array $cf The custom field array. |
|
| 853 | + * @since 1.6.6 |
|
| 854 | + */ |
|
| 855 | + $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf); |
|
| 856 | + } |
|
| 857 | + |
|
| 858 | + // Check if there is a custom field specific filter. |
|
| 859 | + if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){ |
|
| 860 | + /** |
|
| 861 | + * Filter the select html by individual custom field. |
|
| 862 | + * |
|
| 863 | + * @param string $html The html to filter. |
|
| 864 | + * @param string $location The location to output the html. |
|
| 865 | + * @param array $cf The custom field array. |
|
| 866 | + * @since 1.6.6 |
|
| 867 | + */ |
|
| 868 | + $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf); |
|
| 869 | + } |
|
| 870 | + |
|
| 871 | + // Check if there is a custom field key specific filter. |
|
| 872 | + if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){ |
|
| 873 | + /** |
|
| 874 | + * Filter the select html by field type key. |
|
| 875 | + * |
|
| 876 | + * @param string $html The html to filter. |
|
| 877 | + * @param string $location The location to output the html. |
|
| 878 | + * @param array $cf The custom field array. |
|
| 879 | + * @since 1.6.6 |
|
| 880 | + */ |
|
| 881 | + $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 882 | + } |
|
| 883 | + |
|
| 884 | + // If not html then we run the standard output. |
|
| 885 | + if(empty($html)){ |
|
| 886 | + |
|
| 887 | + if ($post->{$cf['htmlvar_name']}): |
|
| 888 | + $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory'); |
|
| 889 | + |
|
| 890 | + if (!empty($cf['option_values'])) { |
|
| 891 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
| 892 | + |
|
| 893 | + if (!empty($cf_option_values)) { |
|
| 894 | + foreach ($cf_option_values as $cf_option_value) { |
|
| 895 | + if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) { |
|
| 896 | + //$field_value = $cf_option_value['label']; // no longer needed here. |
|
| 897 | + } |
|
| 898 | + } |
|
| 899 | + } |
|
| 900 | + } |
|
| 901 | + |
|
| 902 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 903 | + if (strpos($field_icon, 'http') !== false) { |
|
| 904 | + $field_icon_af = ''; |
|
| 905 | + } elseif ($field_icon == '') { |
|
| 906 | + $field_icon_af = ''; |
|
| 907 | + } else { |
|
| 908 | + $field_icon_af = $field_icon; |
|
| 909 | + $field_icon = ''; |
|
| 910 | + } |
|
| 911 | + |
|
| 912 | + |
|
| 913 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 914 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 915 | + $html .= '</span>' . $field_value . '</div>'; |
|
| 916 | + endif; |
|
| 917 | + |
|
| 918 | + } |
|
| 919 | + |
|
| 920 | + return $html; |
|
| 921 | 921 | } |
| 922 | 922 | add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3); |
| 923 | 923 | |
@@ -934,117 +934,117 @@ discard block |
||
| 934 | 934 | */ |
| 935 | 935 | function geodir_cf_multiselect($html,$location,$cf,$p=''){ |
| 936 | 936 | |
| 937 | - // check we have the post value |
|
| 938 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 939 | - else{ global $post;} |
|
| 940 | - |
|
| 941 | - if(!is_array($cf) && $cf!=''){ |
|
| 942 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 943 | - if(!$cf){return NULL;} |
|
| 944 | - } |
|
| 945 | - |
|
| 946 | - $html_var = $cf['htmlvar_name']; |
|
| 947 | - |
|
| 948 | - // Check if there is a location specific filter. |
|
| 949 | - if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){ |
|
| 950 | - /** |
|
| 951 | - * Filter the multiselect html by location. |
|
| 952 | - * |
|
| 953 | - * @param string $html The html to filter. |
|
| 954 | - * @param array $cf The custom field array. |
|
| 955 | - * @since 1.6.6 |
|
| 956 | - */ |
|
| 957 | - $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf); |
|
| 958 | - } |
|
| 959 | - |
|
| 960 | - // Check if there is a custom field specific filter. |
|
| 961 | - if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){ |
|
| 962 | - /** |
|
| 963 | - * Filter the multiselect html by individual custom field. |
|
| 964 | - * |
|
| 965 | - * @param string $html The html to filter. |
|
| 966 | - * @param string $location The location to output the html. |
|
| 967 | - * @param array $cf The custom field array. |
|
| 968 | - * @since 1.6.6 |
|
| 969 | - */ |
|
| 970 | - $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf); |
|
| 971 | - } |
|
| 972 | - |
|
| 973 | - // Check if there is a custom field key specific filter. |
|
| 974 | - if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){ |
|
| 975 | - /** |
|
| 976 | - * Filter the multiselect html by field type key. |
|
| 977 | - * |
|
| 978 | - * @param string $html The html to filter. |
|
| 979 | - * @param string $location The location to output the html. |
|
| 980 | - * @param array $cf The custom field array. |
|
| 981 | - * @since 1.6.6 |
|
| 982 | - */ |
|
| 983 | - $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 984 | - } |
|
| 985 | - |
|
| 986 | - // If not html then we run the standard output. |
|
| 987 | - if(empty($html)){ |
|
| 988 | - |
|
| 989 | - |
|
| 990 | - if (!empty($post->{$cf['htmlvar_name']})): |
|
| 991 | - |
|
| 992 | - if (is_array($post->{$cf['htmlvar_name']})) { |
|
| 993 | - $post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']}); |
|
| 994 | - } |
|
| 995 | - |
|
| 996 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 997 | - if (strpos($field_icon, 'http') !== false) { |
|
| 998 | - $field_icon_af = ''; |
|
| 999 | - } elseif ($field_icon == '') { |
|
| 1000 | - $field_icon_af = ''; |
|
| 1001 | - } else { |
|
| 1002 | - $field_icon_af = $field_icon; |
|
| 1003 | - $field_icon = ''; |
|
| 1004 | - } |
|
| 1005 | - |
|
| 1006 | - $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ",")); |
|
| 1007 | - |
|
| 1008 | - if(is_array($field_values)){ |
|
| 1009 | - $field_values = array_map('trim', $field_values); |
|
| 1010 | - } |
|
| 1011 | - |
|
| 1012 | - $option_values = array(); |
|
| 1013 | - if (!empty($cf['option_values'])) { |
|
| 1014 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
| 1015 | - |
|
| 1016 | - if (!empty($cf_option_values)) { |
|
| 1017 | - foreach ($cf_option_values as $cf_option_value) { |
|
| 1018 | - if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) { |
|
| 1019 | - $option_values[] = $cf_option_value['label']; |
|
| 1020 | - } |
|
| 1021 | - } |
|
| 1022 | - } |
|
| 1023 | - } |
|
| 1024 | - |
|
| 1025 | - |
|
| 1026 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1027 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1028 | - $html .= '</span>'; |
|
| 1029 | - |
|
| 1030 | - if (count($option_values) > 1) { |
|
| 1031 | - $html .= '<ul>'; |
|
| 1032 | - |
|
| 1033 | - foreach ($option_values as $val) { |
|
| 1034 | - $html .= '<li>' . $val . '</li>'; |
|
| 1035 | - } |
|
| 1036 | - |
|
| 1037 | - $html .= '</ul>'; |
|
| 1038 | - } else { |
|
| 1039 | - $html .= $post->{$cf['htmlvar_name']}; |
|
| 1040 | - } |
|
| 1041 | - |
|
| 1042 | - $html .= '</div>'; |
|
| 1043 | - endif; |
|
| 1044 | - |
|
| 1045 | - } |
|
| 1046 | - |
|
| 1047 | - return $html; |
|
| 937 | + // check we have the post value |
|
| 938 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 939 | + else{ global $post;} |
|
| 940 | + |
|
| 941 | + if(!is_array($cf) && $cf!=''){ |
|
| 942 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 943 | + if(!$cf){return NULL;} |
|
| 944 | + } |
|
| 945 | + |
|
| 946 | + $html_var = $cf['htmlvar_name']; |
|
| 947 | + |
|
| 948 | + // Check if there is a location specific filter. |
|
| 949 | + if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){ |
|
| 950 | + /** |
|
| 951 | + * Filter the multiselect html by location. |
|
| 952 | + * |
|
| 953 | + * @param string $html The html to filter. |
|
| 954 | + * @param array $cf The custom field array. |
|
| 955 | + * @since 1.6.6 |
|
| 956 | + */ |
|
| 957 | + $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf); |
|
| 958 | + } |
|
| 959 | + |
|
| 960 | + // Check if there is a custom field specific filter. |
|
| 961 | + if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){ |
|
| 962 | + /** |
|
| 963 | + * Filter the multiselect html by individual custom field. |
|
| 964 | + * |
|
| 965 | + * @param string $html The html to filter. |
|
| 966 | + * @param string $location The location to output the html. |
|
| 967 | + * @param array $cf The custom field array. |
|
| 968 | + * @since 1.6.6 |
|
| 969 | + */ |
|
| 970 | + $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf); |
|
| 971 | + } |
|
| 972 | + |
|
| 973 | + // Check if there is a custom field key specific filter. |
|
| 974 | + if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){ |
|
| 975 | + /** |
|
| 976 | + * Filter the multiselect html by field type key. |
|
| 977 | + * |
|
| 978 | + * @param string $html The html to filter. |
|
| 979 | + * @param string $location The location to output the html. |
|
| 980 | + * @param array $cf The custom field array. |
|
| 981 | + * @since 1.6.6 |
|
| 982 | + */ |
|
| 983 | + $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 984 | + } |
|
| 985 | + |
|
| 986 | + // If not html then we run the standard output. |
|
| 987 | + if(empty($html)){ |
|
| 988 | + |
|
| 989 | + |
|
| 990 | + if (!empty($post->{$cf['htmlvar_name']})): |
|
| 991 | + |
|
| 992 | + if (is_array($post->{$cf['htmlvar_name']})) { |
|
| 993 | + $post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']}); |
|
| 994 | + } |
|
| 995 | + |
|
| 996 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 997 | + if (strpos($field_icon, 'http') !== false) { |
|
| 998 | + $field_icon_af = ''; |
|
| 999 | + } elseif ($field_icon == '') { |
|
| 1000 | + $field_icon_af = ''; |
|
| 1001 | + } else { |
|
| 1002 | + $field_icon_af = $field_icon; |
|
| 1003 | + $field_icon = ''; |
|
| 1004 | + } |
|
| 1005 | + |
|
| 1006 | + $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ",")); |
|
| 1007 | + |
|
| 1008 | + if(is_array($field_values)){ |
|
| 1009 | + $field_values = array_map('trim', $field_values); |
|
| 1010 | + } |
|
| 1011 | + |
|
| 1012 | + $option_values = array(); |
|
| 1013 | + if (!empty($cf['option_values'])) { |
|
| 1014 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
| 1015 | + |
|
| 1016 | + if (!empty($cf_option_values)) { |
|
| 1017 | + foreach ($cf_option_values as $cf_option_value) { |
|
| 1018 | + if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) { |
|
| 1019 | + $option_values[] = $cf_option_value['label']; |
|
| 1020 | + } |
|
| 1021 | + } |
|
| 1022 | + } |
|
| 1023 | + } |
|
| 1024 | + |
|
| 1025 | + |
|
| 1026 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1027 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1028 | + $html .= '</span>'; |
|
| 1029 | + |
|
| 1030 | + if (count($option_values) > 1) { |
|
| 1031 | + $html .= '<ul>'; |
|
| 1032 | + |
|
| 1033 | + foreach ($option_values as $val) { |
|
| 1034 | + $html .= '<li>' . $val . '</li>'; |
|
| 1035 | + } |
|
| 1036 | + |
|
| 1037 | + $html .= '</ul>'; |
|
| 1038 | + } else { |
|
| 1039 | + $html .= $post->{$cf['htmlvar_name']}; |
|
| 1040 | + } |
|
| 1041 | + |
|
| 1042 | + $html .= '</div>'; |
|
| 1043 | + endif; |
|
| 1044 | + |
|
| 1045 | + } |
|
| 1046 | + |
|
| 1047 | + return $html; |
|
| 1048 | 1048 | } |
| 1049 | 1049 | add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3); |
| 1050 | 1050 | |
@@ -1061,153 +1061,153 @@ discard block |
||
| 1061 | 1061 | */ |
| 1062 | 1062 | function geodir_cf_email($html,$location,$cf,$p=''){ |
| 1063 | 1063 | |
| 1064 | - // check we have the post value |
|
| 1065 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1066 | - else{ global $post;} |
|
| 1067 | - |
|
| 1068 | - if(!is_array($cf) && $cf!=''){ |
|
| 1069 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1070 | - if(!$cf){return NULL;} |
|
| 1071 | - } |
|
| 1072 | - |
|
| 1073 | - $html_var = $cf['htmlvar_name']; |
|
| 1074 | - |
|
| 1075 | - // Check if there is a location specific filter. |
|
| 1076 | - if(has_filter("geodir_custom_field_output_email_loc_{$location}")){ |
|
| 1077 | - /** |
|
| 1078 | - * Filter the email html by location. |
|
| 1079 | - * |
|
| 1080 | - * @param string $html The html to filter. |
|
| 1081 | - * @param array $cf The custom field array. |
|
| 1082 | - * @since 1.6.6 |
|
| 1083 | - */ |
|
| 1084 | - $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf); |
|
| 1085 | - } |
|
| 1086 | - |
|
| 1087 | - // Check if there is a custom field specific filter. |
|
| 1088 | - if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){ |
|
| 1089 | - /** |
|
| 1090 | - * Filter the email html by individual custom field. |
|
| 1091 | - * |
|
| 1092 | - * @param string $html The html to filter. |
|
| 1093 | - * @param string $location The location to output the html. |
|
| 1094 | - * @param array $cf The custom field array. |
|
| 1095 | - * @since 1.6.6 |
|
| 1096 | - */ |
|
| 1097 | - $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf); |
|
| 1098 | - } |
|
| 1099 | - |
|
| 1100 | - // Check if there is a custom field key specific filter. |
|
| 1101 | - if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){ |
|
| 1102 | - /** |
|
| 1103 | - * Filter the email html by field type key. |
|
| 1104 | - * |
|
| 1105 | - * @param string $html The html to filter. |
|
| 1106 | - * @param string $location The location to output the html. |
|
| 1107 | - * @param array $cf The custom field array. |
|
| 1108 | - * @since 1.6.6 |
|
| 1109 | - */ |
|
| 1110 | - $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1111 | - } |
|
| 1112 | - |
|
| 1113 | - // If not html then we run the standard output. |
|
| 1114 | - if(empty($html)){ |
|
| 1115 | - |
|
| 1116 | - global $preview; |
|
| 1117 | - if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) { |
|
| 1118 | - return ''; // Remove Send Enquiry | Send To Friend from listings page |
|
| 1119 | - } |
|
| 1120 | - |
|
| 1121 | - $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type); |
|
| 1122 | - |
|
| 1123 | - if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) { |
|
| 1124 | - global $send_to_friend; |
|
| 1125 | - $send_to_friend = true; |
|
| 1126 | - $b_send_inquiry = ''; |
|
| 1127 | - $b_sendtofriend = ''; |
|
| 1128 | - |
|
| 1129 | - $html = ''; |
|
| 1130 | - if (!$preview) { |
|
| 1131 | - $b_send_inquiry = 'b_send_inquiry'; |
|
| 1132 | - $b_sendtofriend = 'b_sendtofriend'; |
|
| 1133 | - $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>'; |
|
| 1134 | - } |
|
| 1135 | - |
|
| 1136 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 1137 | - if (strpos($field_icon, 'http') !== false) { |
|
| 1138 | - $field_icon_af = ''; |
|
| 1139 | - } elseif ($field_icon == '') { |
|
| 1140 | - $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
| 1141 | - } else { |
|
| 1142 | - $field_icon_af = $field_icon; |
|
| 1143 | - $field_icon = ''; |
|
| 1144 | - } |
|
| 1145 | - |
|
| 1146 | - $html .= '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1147 | - $seperator = ''; |
|
| 1148 | - if ($post->{$cf['htmlvar_name']}) { |
|
| 1149 | - $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>'; |
|
| 1150 | - $seperator = ' | '; |
|
| 1151 | - } |
|
| 1152 | - |
|
| 1153 | - if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) { |
|
| 1154 | - $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>'; |
|
| 1155 | - } |
|
| 1156 | - |
|
| 1157 | - $html .= '</span></div>'; |
|
| 1158 | - |
|
| 1159 | - |
|
| 1160 | - if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') { |
|
| 1161 | - $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>'; |
|
| 1162 | - } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') { |
|
| 1163 | - $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>'; |
|
| 1164 | - } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') { |
|
| 1165 | - $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>'; |
|
| 1166 | - } |
|
| 1167 | - |
|
| 1168 | - /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/ |
|
| 1169 | - |
|
| 1170 | - } else { |
|
| 1171 | - |
|
| 1172 | - if ($post->{$cf['htmlvar_name']}) { |
|
| 1173 | - |
|
| 1174 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 1175 | - if (strpos($field_icon, 'http') !== false) { |
|
| 1176 | - $field_icon_af = ''; |
|
| 1177 | - } elseif ($field_icon == '') { |
|
| 1178 | - $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
| 1179 | - } else { |
|
| 1180 | - $field_icon_af = $field_icon; |
|
| 1181 | - $field_icon = ''; |
|
| 1182 | - } |
|
| 1183 | - |
|
| 1184 | - |
|
| 1185 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1186 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1187 | - $html .= '</span><span class="geodir-email-address-output">'; |
|
| 1188 | - $email = $post->{$cf['htmlvar_name']} ; |
|
| 1189 | - if($e_split = explode('@',$email)){ |
|
| 1190 | - /** |
|
| 1191 | - * Filter email custom field name output. |
|
| 1192 | - * |
|
| 1193 | - * @since 1.5.3 |
|
| 1194 | - * |
|
| 1195 | - * @param string $email The email string being output. |
|
| 1196 | - * @param array $cf Custom field variables array. |
|
| 1197 | - */ |
|
| 1198 | - $email_name = apply_filters('geodir_email_field_name_output',$email,$cf); |
|
| 1199 | - $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
| 1200 | - }else{ |
|
| 1201 | - $html .= $email; |
|
| 1202 | - } |
|
| 1203 | - $html .= '</span></div>'; |
|
| 1204 | - } |
|
| 1205 | - |
|
| 1206 | - } |
|
| 1207 | - |
|
| 1208 | - } |
|
| 1209 | - |
|
| 1210 | - return $html; |
|
| 1064 | + // check we have the post value |
|
| 1065 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1066 | + else{ global $post;} |
|
| 1067 | + |
|
| 1068 | + if(!is_array($cf) && $cf!=''){ |
|
| 1069 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1070 | + if(!$cf){return NULL;} |
|
| 1071 | + } |
|
| 1072 | + |
|
| 1073 | + $html_var = $cf['htmlvar_name']; |
|
| 1074 | + |
|
| 1075 | + // Check if there is a location specific filter. |
|
| 1076 | + if(has_filter("geodir_custom_field_output_email_loc_{$location}")){ |
|
| 1077 | + /** |
|
| 1078 | + * Filter the email html by location. |
|
| 1079 | + * |
|
| 1080 | + * @param string $html The html to filter. |
|
| 1081 | + * @param array $cf The custom field array. |
|
| 1082 | + * @since 1.6.6 |
|
| 1083 | + */ |
|
| 1084 | + $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf); |
|
| 1085 | + } |
|
| 1086 | + |
|
| 1087 | + // Check if there is a custom field specific filter. |
|
| 1088 | + if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){ |
|
| 1089 | + /** |
|
| 1090 | + * Filter the email html by individual custom field. |
|
| 1091 | + * |
|
| 1092 | + * @param string $html The html to filter. |
|
| 1093 | + * @param string $location The location to output the html. |
|
| 1094 | + * @param array $cf The custom field array. |
|
| 1095 | + * @since 1.6.6 |
|
| 1096 | + */ |
|
| 1097 | + $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf); |
|
| 1098 | + } |
|
| 1099 | + |
|
| 1100 | + // Check if there is a custom field key specific filter. |
|
| 1101 | + if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){ |
|
| 1102 | + /** |
|
| 1103 | + * Filter the email html by field type key. |
|
| 1104 | + * |
|
| 1105 | + * @param string $html The html to filter. |
|
| 1106 | + * @param string $location The location to output the html. |
|
| 1107 | + * @param array $cf The custom field array. |
|
| 1108 | + * @since 1.6.6 |
|
| 1109 | + */ |
|
| 1110 | + $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1111 | + } |
|
| 1112 | + |
|
| 1113 | + // If not html then we run the standard output. |
|
| 1114 | + if(empty($html)){ |
|
| 1115 | + |
|
| 1116 | + global $preview; |
|
| 1117 | + if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) { |
|
| 1118 | + return ''; // Remove Send Enquiry | Send To Friend from listings page |
|
| 1119 | + } |
|
| 1120 | + |
|
| 1121 | + $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type); |
|
| 1122 | + |
|
| 1123 | + if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) { |
|
| 1124 | + global $send_to_friend; |
|
| 1125 | + $send_to_friend = true; |
|
| 1126 | + $b_send_inquiry = ''; |
|
| 1127 | + $b_sendtofriend = ''; |
|
| 1128 | + |
|
| 1129 | + $html = ''; |
|
| 1130 | + if (!$preview) { |
|
| 1131 | + $b_send_inquiry = 'b_send_inquiry'; |
|
| 1132 | + $b_sendtofriend = 'b_sendtofriend'; |
|
| 1133 | + $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>'; |
|
| 1134 | + } |
|
| 1135 | + |
|
| 1136 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 1137 | + if (strpos($field_icon, 'http') !== false) { |
|
| 1138 | + $field_icon_af = ''; |
|
| 1139 | + } elseif ($field_icon == '') { |
|
| 1140 | + $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
| 1141 | + } else { |
|
| 1142 | + $field_icon_af = $field_icon; |
|
| 1143 | + $field_icon = ''; |
|
| 1144 | + } |
|
| 1145 | + |
|
| 1146 | + $html .= '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1147 | + $seperator = ''; |
|
| 1148 | + if ($post->{$cf['htmlvar_name']}) { |
|
| 1149 | + $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>'; |
|
| 1150 | + $seperator = ' | '; |
|
| 1151 | + } |
|
| 1152 | + |
|
| 1153 | + if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) { |
|
| 1154 | + $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>'; |
|
| 1155 | + } |
|
| 1156 | + |
|
| 1157 | + $html .= '</span></div>'; |
|
| 1158 | + |
|
| 1159 | + |
|
| 1160 | + if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') { |
|
| 1161 | + $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>'; |
|
| 1162 | + } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') { |
|
| 1163 | + $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>'; |
|
| 1164 | + } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') { |
|
| 1165 | + $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>'; |
|
| 1166 | + } |
|
| 1167 | + |
|
| 1168 | + /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/ |
|
| 1169 | + |
|
| 1170 | + } else { |
|
| 1171 | + |
|
| 1172 | + if ($post->{$cf['htmlvar_name']}) { |
|
| 1173 | + |
|
| 1174 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 1175 | + if (strpos($field_icon, 'http') !== false) { |
|
| 1176 | + $field_icon_af = ''; |
|
| 1177 | + } elseif ($field_icon == '') { |
|
| 1178 | + $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
| 1179 | + } else { |
|
| 1180 | + $field_icon_af = $field_icon; |
|
| 1181 | + $field_icon = ''; |
|
| 1182 | + } |
|
| 1183 | + |
|
| 1184 | + |
|
| 1185 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1186 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1187 | + $html .= '</span><span class="geodir-email-address-output">'; |
|
| 1188 | + $email = $post->{$cf['htmlvar_name']} ; |
|
| 1189 | + if($e_split = explode('@',$email)){ |
|
| 1190 | + /** |
|
| 1191 | + * Filter email custom field name output. |
|
| 1192 | + * |
|
| 1193 | + * @since 1.5.3 |
|
| 1194 | + * |
|
| 1195 | + * @param string $email The email string being output. |
|
| 1196 | + * @param array $cf Custom field variables array. |
|
| 1197 | + */ |
|
| 1198 | + $email_name = apply_filters('geodir_email_field_name_output',$email,$cf); |
|
| 1199 | + $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
| 1200 | + }else{ |
|
| 1201 | + $html .= $email; |
|
| 1202 | + } |
|
| 1203 | + $html .= '</span></div>'; |
|
| 1204 | + } |
|
| 1205 | + |
|
| 1206 | + } |
|
| 1207 | + |
|
| 1208 | + } |
|
| 1209 | + |
|
| 1210 | + return $html; |
|
| 1211 | 1211 | } |
| 1212 | 1212 | add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3); |
| 1213 | 1213 | |
@@ -1224,130 +1224,130 @@ discard block |
||
| 1224 | 1224 | */ |
| 1225 | 1225 | function geodir_cf_file($html,$location,$cf,$p=''){ |
| 1226 | 1226 | |
| 1227 | - // check we have the post value |
|
| 1228 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1229 | - else{ global $post;} |
|
| 1230 | - |
|
| 1231 | - if(!is_array($cf) && $cf!=''){ |
|
| 1232 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1233 | - if(!$cf){return NULL;} |
|
| 1234 | - } |
|
| 1235 | - |
|
| 1236 | - $html_var = $cf['htmlvar_name']; |
|
| 1237 | - |
|
| 1238 | - // Check if there is a location specific filter. |
|
| 1239 | - if(has_filter("geodir_custom_field_output_file_loc_{$location}")){ |
|
| 1240 | - /** |
|
| 1241 | - * Filter the file html by location. |
|
| 1242 | - * |
|
| 1243 | - * @param string $html The html to filter. |
|
| 1244 | - * @param array $cf The custom field array. |
|
| 1245 | - * @since 1.6.6 |
|
| 1246 | - */ |
|
| 1247 | - $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf); |
|
| 1248 | - } |
|
| 1249 | - |
|
| 1250 | - // Check if there is a custom field specific filter. |
|
| 1251 | - if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){ |
|
| 1252 | - /** |
|
| 1253 | - * Filter the file html by individual custom field. |
|
| 1254 | - * |
|
| 1255 | - * @param string $html The html to filter. |
|
| 1256 | - * @param string $location The location to output the html. |
|
| 1257 | - * @param array $cf The custom field array. |
|
| 1258 | - * @since 1.6.6 |
|
| 1259 | - */ |
|
| 1260 | - $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf); |
|
| 1261 | - } |
|
| 1262 | - |
|
| 1263 | - // Check if there is a custom field key specific filter. |
|
| 1264 | - if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){ |
|
| 1265 | - /** |
|
| 1266 | - * Filter the file html by field type key. |
|
| 1267 | - * |
|
| 1268 | - * @param string $html The html to filter. |
|
| 1269 | - * @param string $location The location to output the html. |
|
| 1270 | - * @param array $cf The custom field array. |
|
| 1271 | - * @since 1.6.6 |
|
| 1272 | - */ |
|
| 1273 | - $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1274 | - } |
|
| 1275 | - |
|
| 1276 | - // If not html then we run the standard output. |
|
| 1277 | - if(empty($html)){ |
|
| 1278 | - |
|
| 1279 | - if (!empty($post->{$cf['htmlvar_name']})): |
|
| 1280 | - |
|
| 1281 | - $files = explode(",", $post->{$cf['htmlvar_name']}); |
|
| 1282 | - if (!empty($files)): |
|
| 1283 | - |
|
| 1284 | - $extra_fields = !empty($cf['extra_fields']) ? stripslashes_deep(maybe_unserialize($cf['extra_fields'])) : NULL; |
|
| 1285 | - $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : ''; |
|
| 1286 | - |
|
| 1287 | - $file_paths = ''; |
|
| 1288 | - foreach ($files as $file) { |
|
| 1289 | - if (!empty($file)) { |
|
| 1290 | - |
|
| 1291 | - // $filetype = wp_check_filetype($file); |
|
| 1292 | - |
|
| 1293 | - $image_name_arr = explode('/', $file); |
|
| 1294 | - $curr_img_dir = $image_name_arr[count($image_name_arr) - 2]; |
|
| 1295 | - $filename = end($image_name_arr); |
|
| 1296 | - $img_name_arr = explode('.', $filename); |
|
| 1297 | - |
|
| 1298 | - $arr_file_type = wp_check_filetype($filename); |
|
| 1299 | - if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) { |
|
| 1300 | - continue; |
|
| 1301 | - } |
|
| 1302 | - |
|
| 1303 | - $uploaded_file_type = $arr_file_type['type']; |
|
| 1304 | - $uploaded_file_ext = $arr_file_type['ext']; |
|
| 1305 | - |
|
| 1306 | - if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) { |
|
| 1307 | - continue; // Invalid file type. |
|
| 1308 | - } |
|
| 1309 | - |
|
| 1310 | - //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain'); |
|
| 1311 | - $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon'); |
|
| 1312 | - |
|
| 1313 | - // If the uploaded file is image |
|
| 1314 | - if (in_array($uploaded_file_type, $image_file_types)) { |
|
| 1315 | - $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">'; |
|
| 1316 | - $file_paths .= '<a href="'.$file.'">'; |
|
| 1317 | - $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false); |
|
| 1318 | - $file_paths .= '</a>'; |
|
| 1319 | - //$file_paths .= '<img src="'.$file.'" />'; |
|
| 1320 | - $file_paths .= '</div>'; |
|
| 1321 | - } else { |
|
| 1322 | - $ext_path = '_' . $html_var . '_'; |
|
| 1323 | - $filename = explode($ext_path, $filename); |
|
| 1324 | - $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
| 1325 | - } |
|
| 1326 | - } |
|
| 1327 | - } |
|
| 1328 | - |
|
| 1329 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 1330 | - if (strpos($field_icon, 'http') !== false) { |
|
| 1331 | - $field_icon_af = ''; |
|
| 1332 | - } elseif ($field_icon == '') { |
|
| 1333 | - $field_icon_af = ''; |
|
| 1334 | - } else { |
|
| 1335 | - $field_icon_af = $field_icon; |
|
| 1336 | - $field_icon = ''; |
|
| 1337 | - } |
|
| 1338 | - |
|
| 1339 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1340 | - $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">'; |
|
| 1341 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1342 | - $html .= '</span>'; |
|
| 1343 | - $html .= $file_paths . '</div></div>'; |
|
| 1344 | - |
|
| 1345 | - endif; |
|
| 1346 | - endif; |
|
| 1347 | - |
|
| 1348 | - } |
|
| 1349 | - |
|
| 1350 | - return $html; |
|
| 1227 | + // check we have the post value |
|
| 1228 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1229 | + else{ global $post;} |
|
| 1230 | + |
|
| 1231 | + if(!is_array($cf) && $cf!=''){ |
|
| 1232 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1233 | + if(!$cf){return NULL;} |
|
| 1234 | + } |
|
| 1235 | + |
|
| 1236 | + $html_var = $cf['htmlvar_name']; |
|
| 1237 | + |
|
| 1238 | + // Check if there is a location specific filter. |
|
| 1239 | + if(has_filter("geodir_custom_field_output_file_loc_{$location}")){ |
|
| 1240 | + /** |
|
| 1241 | + * Filter the file html by location. |
|
| 1242 | + * |
|
| 1243 | + * @param string $html The html to filter. |
|
| 1244 | + * @param array $cf The custom field array. |
|
| 1245 | + * @since 1.6.6 |
|
| 1246 | + */ |
|
| 1247 | + $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf); |
|
| 1248 | + } |
|
| 1249 | + |
|
| 1250 | + // Check if there is a custom field specific filter. |
|
| 1251 | + if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){ |
|
| 1252 | + /** |
|
| 1253 | + * Filter the file html by individual custom field. |
|
| 1254 | + * |
|
| 1255 | + * @param string $html The html to filter. |
|
| 1256 | + * @param string $location The location to output the html. |
|
| 1257 | + * @param array $cf The custom field array. |
|
| 1258 | + * @since 1.6.6 |
|
| 1259 | + */ |
|
| 1260 | + $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf); |
|
| 1261 | + } |
|
| 1262 | + |
|
| 1263 | + // Check if there is a custom field key specific filter. |
|
| 1264 | + if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){ |
|
| 1265 | + /** |
|
| 1266 | + * Filter the file html by field type key. |
|
| 1267 | + * |
|
| 1268 | + * @param string $html The html to filter. |
|
| 1269 | + * @param string $location The location to output the html. |
|
| 1270 | + * @param array $cf The custom field array. |
|
| 1271 | + * @since 1.6.6 |
|
| 1272 | + */ |
|
| 1273 | + $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1274 | + } |
|
| 1275 | + |
|
| 1276 | + // If not html then we run the standard output. |
|
| 1277 | + if(empty($html)){ |
|
| 1278 | + |
|
| 1279 | + if (!empty($post->{$cf['htmlvar_name']})): |
|
| 1280 | + |
|
| 1281 | + $files = explode(",", $post->{$cf['htmlvar_name']}); |
|
| 1282 | + if (!empty($files)): |
|
| 1283 | + |
|
| 1284 | + $extra_fields = !empty($cf['extra_fields']) ? stripslashes_deep(maybe_unserialize($cf['extra_fields'])) : NULL; |
|
| 1285 | + $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : ''; |
|
| 1286 | + |
|
| 1287 | + $file_paths = ''; |
|
| 1288 | + foreach ($files as $file) { |
|
| 1289 | + if (!empty($file)) { |
|
| 1290 | + |
|
| 1291 | + // $filetype = wp_check_filetype($file); |
|
| 1292 | + |
|
| 1293 | + $image_name_arr = explode('/', $file); |
|
| 1294 | + $curr_img_dir = $image_name_arr[count($image_name_arr) - 2]; |
|
| 1295 | + $filename = end($image_name_arr); |
|
| 1296 | + $img_name_arr = explode('.', $filename); |
|
| 1297 | + |
|
| 1298 | + $arr_file_type = wp_check_filetype($filename); |
|
| 1299 | + if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) { |
|
| 1300 | + continue; |
|
| 1301 | + } |
|
| 1302 | + |
|
| 1303 | + $uploaded_file_type = $arr_file_type['type']; |
|
| 1304 | + $uploaded_file_ext = $arr_file_type['ext']; |
|
| 1305 | + |
|
| 1306 | + if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) { |
|
| 1307 | + continue; // Invalid file type. |
|
| 1308 | + } |
|
| 1309 | + |
|
| 1310 | + //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain'); |
|
| 1311 | + $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon'); |
|
| 1312 | + |
|
| 1313 | + // If the uploaded file is image |
|
| 1314 | + if (in_array($uploaded_file_type, $image_file_types)) { |
|
| 1315 | + $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">'; |
|
| 1316 | + $file_paths .= '<a href="'.$file.'">'; |
|
| 1317 | + $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false); |
|
| 1318 | + $file_paths .= '</a>'; |
|
| 1319 | + //$file_paths .= '<img src="'.$file.'" />'; |
|
| 1320 | + $file_paths .= '</div>'; |
|
| 1321 | + } else { |
|
| 1322 | + $ext_path = '_' . $html_var . '_'; |
|
| 1323 | + $filename = explode($ext_path, $filename); |
|
| 1324 | + $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
| 1325 | + } |
|
| 1326 | + } |
|
| 1327 | + } |
|
| 1328 | + |
|
| 1329 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 1330 | + if (strpos($field_icon, 'http') !== false) { |
|
| 1331 | + $field_icon_af = ''; |
|
| 1332 | + } elseif ($field_icon == '') { |
|
| 1333 | + $field_icon_af = ''; |
|
| 1334 | + } else { |
|
| 1335 | + $field_icon_af = $field_icon; |
|
| 1336 | + $field_icon = ''; |
|
| 1337 | + } |
|
| 1338 | + |
|
| 1339 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1340 | + $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">'; |
|
| 1341 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1342 | + $html .= '</span>'; |
|
| 1343 | + $html .= $file_paths . '</div></div>'; |
|
| 1344 | + |
|
| 1345 | + endif; |
|
| 1346 | + endif; |
|
| 1347 | + |
|
| 1348 | + } |
|
| 1349 | + |
|
| 1350 | + return $html; |
|
| 1351 | 1351 | } |
| 1352 | 1352 | add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3); |
| 1353 | 1353 | |
@@ -1365,80 +1365,80 @@ discard block |
||
| 1365 | 1365 | */ |
| 1366 | 1366 | function geodir_cf_textarea($html,$location,$cf,$p=''){ |
| 1367 | 1367 | |
| 1368 | - // check we have the post value |
|
| 1369 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1370 | - else{ global $post;} |
|
| 1371 | - |
|
| 1372 | - if(!is_array($cf) && $cf!=''){ |
|
| 1373 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1374 | - if(!$cf){return NULL;} |
|
| 1375 | - } |
|
| 1376 | - |
|
| 1377 | - $html_var = $cf['htmlvar_name']; |
|
| 1378 | - |
|
| 1379 | - // Check if there is a location specific filter. |
|
| 1380 | - if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){ |
|
| 1381 | - /** |
|
| 1382 | - * Filter the textarea html by location. |
|
| 1383 | - * |
|
| 1384 | - * @param string $html The html to filter. |
|
| 1385 | - * @param array $cf The custom field array. |
|
| 1386 | - * @since 1.6.6 |
|
| 1387 | - */ |
|
| 1388 | - $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf); |
|
| 1389 | - } |
|
| 1390 | - |
|
| 1391 | - // Check if there is a custom field specific filter. |
|
| 1392 | - if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){ |
|
| 1393 | - /** |
|
| 1394 | - * Filter the textarea html by individual custom field. |
|
| 1395 | - * |
|
| 1396 | - * @param string $html The html to filter. |
|
| 1397 | - * @param string $location The location to output the html. |
|
| 1398 | - * @param array $cf The custom field array. |
|
| 1399 | - * @since 1.6.6 |
|
| 1400 | - */ |
|
| 1401 | - $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf); |
|
| 1402 | - } |
|
| 1403 | - |
|
| 1404 | - // Check if there is a custom field key specific filter. |
|
| 1405 | - if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){ |
|
| 1406 | - /** |
|
| 1407 | - * Filter the textarea html by field type key. |
|
| 1408 | - * |
|
| 1409 | - * @param string $html The html to filter. |
|
| 1410 | - * @param string $location The location to output the html. |
|
| 1411 | - * @param array $cf The custom field array. |
|
| 1412 | - * @since 1.6.6 |
|
| 1413 | - */ |
|
| 1414 | - $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1415 | - } |
|
| 1416 | - |
|
| 1417 | - // If not html then we run the standard output. |
|
| 1418 | - if(empty($html)){ |
|
| 1419 | - |
|
| 1420 | - if (!empty($post->{$cf['htmlvar_name']})) { |
|
| 1421 | - |
|
| 1422 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 1423 | - if (strpos($field_icon, 'http') !== false) { |
|
| 1424 | - $field_icon_af = ''; |
|
| 1425 | - } elseif ($field_icon == '') { |
|
| 1426 | - $field_icon_af = ''; |
|
| 1427 | - } else { |
|
| 1428 | - $field_icon_af = $field_icon; |
|
| 1429 | - $field_icon = ''; |
|
| 1430 | - } |
|
| 1431 | - |
|
| 1432 | - |
|
| 1433 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1434 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1435 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
| 1436 | - |
|
| 1437 | - } |
|
| 1438 | - |
|
| 1439 | - } |
|
| 1440 | - |
|
| 1441 | - return $html; |
|
| 1368 | + // check we have the post value |
|
| 1369 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1370 | + else{ global $post;} |
|
| 1371 | + |
|
| 1372 | + if(!is_array($cf) && $cf!=''){ |
|
| 1373 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1374 | + if(!$cf){return NULL;} |
|
| 1375 | + } |
|
| 1376 | + |
|
| 1377 | + $html_var = $cf['htmlvar_name']; |
|
| 1378 | + |
|
| 1379 | + // Check if there is a location specific filter. |
|
| 1380 | + if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){ |
|
| 1381 | + /** |
|
| 1382 | + * Filter the textarea html by location. |
|
| 1383 | + * |
|
| 1384 | + * @param string $html The html to filter. |
|
| 1385 | + * @param array $cf The custom field array. |
|
| 1386 | + * @since 1.6.6 |
|
| 1387 | + */ |
|
| 1388 | + $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf); |
|
| 1389 | + } |
|
| 1390 | + |
|
| 1391 | + // Check if there is a custom field specific filter. |
|
| 1392 | + if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){ |
|
| 1393 | + /** |
|
| 1394 | + * Filter the textarea html by individual custom field. |
|
| 1395 | + * |
|
| 1396 | + * @param string $html The html to filter. |
|
| 1397 | + * @param string $location The location to output the html. |
|
| 1398 | + * @param array $cf The custom field array. |
|
| 1399 | + * @since 1.6.6 |
|
| 1400 | + */ |
|
| 1401 | + $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf); |
|
| 1402 | + } |
|
| 1403 | + |
|
| 1404 | + // Check if there is a custom field key specific filter. |
|
| 1405 | + if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){ |
|
| 1406 | + /** |
|
| 1407 | + * Filter the textarea html by field type key. |
|
| 1408 | + * |
|
| 1409 | + * @param string $html The html to filter. |
|
| 1410 | + * @param string $location The location to output the html. |
|
| 1411 | + * @param array $cf The custom field array. |
|
| 1412 | + * @since 1.6.6 |
|
| 1413 | + */ |
|
| 1414 | + $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1415 | + } |
|
| 1416 | + |
|
| 1417 | + // If not html then we run the standard output. |
|
| 1418 | + if(empty($html)){ |
|
| 1419 | + |
|
| 1420 | + if (!empty($post->{$cf['htmlvar_name']})) { |
|
| 1421 | + |
|
| 1422 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 1423 | + if (strpos($field_icon, 'http') !== false) { |
|
| 1424 | + $field_icon_af = ''; |
|
| 1425 | + } elseif ($field_icon == '') { |
|
| 1426 | + $field_icon_af = ''; |
|
| 1427 | + } else { |
|
| 1428 | + $field_icon_af = $field_icon; |
|
| 1429 | + $field_icon = ''; |
|
| 1430 | + } |
|
| 1431 | + |
|
| 1432 | + |
|
| 1433 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1434 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1435 | + $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
| 1436 | + |
|
| 1437 | + } |
|
| 1438 | + |
|
| 1439 | + } |
|
| 1440 | + |
|
| 1441 | + return $html; |
|
| 1442 | 1442 | } |
| 1443 | 1443 | add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3); |
| 1444 | 1444 | |
@@ -1456,79 +1456,79 @@ discard block |
||
| 1456 | 1456 | */ |
| 1457 | 1457 | function geodir_cf_html($html,$location,$cf,$p=''){ |
| 1458 | 1458 | |
| 1459 | - // check we have the post value |
|
| 1460 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1461 | - else{ global $post;} |
|
| 1462 | - |
|
| 1463 | - if(!is_array($cf) && $cf!=''){ |
|
| 1464 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1465 | - if(!$cf){return NULL;} |
|
| 1466 | - } |
|
| 1467 | - |
|
| 1468 | - $html_var = $cf['htmlvar_name']; |
|
| 1469 | - |
|
| 1470 | - // Check if there is a location specific filter. |
|
| 1471 | - if(has_filter("geodir_custom_field_output_html_loc_{$location}")){ |
|
| 1472 | - /** |
|
| 1473 | - * Filter the html html by location. |
|
| 1474 | - * |
|
| 1475 | - * @param string $html The html to filter. |
|
| 1476 | - * @param array $cf The custom field array. |
|
| 1477 | - * @since 1.6.6 |
|
| 1478 | - */ |
|
| 1479 | - $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf); |
|
| 1480 | - } |
|
| 1481 | - |
|
| 1482 | - // Check if there is a custom field specific filter. |
|
| 1483 | - if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){ |
|
| 1484 | - /** |
|
| 1485 | - * Filter the html html by individual custom field. |
|
| 1486 | - * |
|
| 1487 | - * @param string $html The html to filter. |
|
| 1488 | - * @param string $location The location to output the html. |
|
| 1489 | - * @param array $cf The custom field array. |
|
| 1490 | - * @since 1.6.6 |
|
| 1491 | - */ |
|
| 1492 | - $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf); |
|
| 1493 | - } |
|
| 1494 | - |
|
| 1495 | - // Check if there is a custom field key specific filter. |
|
| 1496 | - if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){ |
|
| 1497 | - /** |
|
| 1498 | - * Filter the html html by field type key. |
|
| 1499 | - * |
|
| 1500 | - * @param string $html The html to filter. |
|
| 1501 | - * @param string $location The location to output the html. |
|
| 1502 | - * @param array $cf The custom field array. |
|
| 1503 | - * @since 1.6.6 |
|
| 1504 | - */ |
|
| 1505 | - $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1506 | - } |
|
| 1507 | - |
|
| 1508 | - // If not html then we run the standard output. |
|
| 1509 | - if(empty($html)){ |
|
| 1510 | - |
|
| 1511 | - if (!empty($post->{$cf['htmlvar_name']})) { |
|
| 1512 | - |
|
| 1513 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 1514 | - if (strpos($field_icon, 'http') !== false) { |
|
| 1515 | - $field_icon_af = ''; |
|
| 1516 | - } elseif ($field_icon == '') { |
|
| 1517 | - $field_icon_af = ''; |
|
| 1518 | - } else { |
|
| 1519 | - $field_icon_af = $field_icon; |
|
| 1520 | - $field_icon = ''; |
|
| 1521 | - } |
|
| 1522 | - |
|
| 1523 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1524 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1525 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
| 1526 | - |
|
| 1527 | - } |
|
| 1528 | - |
|
| 1529 | - } |
|
| 1530 | - |
|
| 1531 | - return $html; |
|
| 1459 | + // check we have the post value |
|
| 1460 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1461 | + else{ global $post;} |
|
| 1462 | + |
|
| 1463 | + if(!is_array($cf) && $cf!=''){ |
|
| 1464 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1465 | + if(!$cf){return NULL;} |
|
| 1466 | + } |
|
| 1467 | + |
|
| 1468 | + $html_var = $cf['htmlvar_name']; |
|
| 1469 | + |
|
| 1470 | + // Check if there is a location specific filter. |
|
| 1471 | + if(has_filter("geodir_custom_field_output_html_loc_{$location}")){ |
|
| 1472 | + /** |
|
| 1473 | + * Filter the html html by location. |
|
| 1474 | + * |
|
| 1475 | + * @param string $html The html to filter. |
|
| 1476 | + * @param array $cf The custom field array. |
|
| 1477 | + * @since 1.6.6 |
|
| 1478 | + */ |
|
| 1479 | + $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf); |
|
| 1480 | + } |
|
| 1481 | + |
|
| 1482 | + // Check if there is a custom field specific filter. |
|
| 1483 | + if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){ |
|
| 1484 | + /** |
|
| 1485 | + * Filter the html html by individual custom field. |
|
| 1486 | + * |
|
| 1487 | + * @param string $html The html to filter. |
|
| 1488 | + * @param string $location The location to output the html. |
|
| 1489 | + * @param array $cf The custom field array. |
|
| 1490 | + * @since 1.6.6 |
|
| 1491 | + */ |
|
| 1492 | + $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf); |
|
| 1493 | + } |
|
| 1494 | + |
|
| 1495 | + // Check if there is a custom field key specific filter. |
|
| 1496 | + if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){ |
|
| 1497 | + /** |
|
| 1498 | + * Filter the html html by field type key. |
|
| 1499 | + * |
|
| 1500 | + * @param string $html The html to filter. |
|
| 1501 | + * @param string $location The location to output the html. |
|
| 1502 | + * @param array $cf The custom field array. |
|
| 1503 | + * @since 1.6.6 |
|
| 1504 | + */ |
|
| 1505 | + $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1506 | + } |
|
| 1507 | + |
|
| 1508 | + // If not html then we run the standard output. |
|
| 1509 | + if(empty($html)){ |
|
| 1510 | + |
|
| 1511 | + if (!empty($post->{$cf['htmlvar_name']})) { |
|
| 1512 | + |
|
| 1513 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 1514 | + if (strpos($field_icon, 'http') !== false) { |
|
| 1515 | + $field_icon_af = ''; |
|
| 1516 | + } elseif ($field_icon == '') { |
|
| 1517 | + $field_icon_af = ''; |
|
| 1518 | + } else { |
|
| 1519 | + $field_icon_af = $field_icon; |
|
| 1520 | + $field_icon = ''; |
|
| 1521 | + } |
|
| 1522 | + |
|
| 1523 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1524 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1525 | + $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
| 1526 | + |
|
| 1527 | + } |
|
| 1528 | + |
|
| 1529 | + } |
|
| 1530 | + |
|
| 1531 | + return $html; |
|
| 1532 | 1532 | } |
| 1533 | 1533 | add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3); |
| 1534 | 1534 | |
@@ -1546,113 +1546,113 @@ discard block |
||
| 1546 | 1546 | */ |
| 1547 | 1547 | function geodir_cf_taxonomy($html,$location,$cf,$p=''){ |
| 1548 | 1548 | |
| 1549 | - // check we have the post value |
|
| 1550 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1551 | - else{ global $post;} |
|
| 1552 | - |
|
| 1553 | - if(!is_array($cf) && $cf!=''){ |
|
| 1554 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1555 | - if(!$cf){return NULL;} |
|
| 1556 | - } |
|
| 1557 | - |
|
| 1558 | - $html_var = $cf['htmlvar_name']; |
|
| 1559 | - |
|
| 1560 | - // Check if there is a location specific filter. |
|
| 1561 | - if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){ |
|
| 1562 | - /** |
|
| 1563 | - * Filter the taxonomy html by location. |
|
| 1564 | - * |
|
| 1565 | - * @param string $html The html to filter. |
|
| 1566 | - * @param array $cf The custom field array. |
|
| 1567 | - * @since 1.6.6 |
|
| 1568 | - */ |
|
| 1569 | - $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf); |
|
| 1570 | - } |
|
| 1571 | - |
|
| 1572 | - // Check if there is a custom field specific filter. |
|
| 1573 | - if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){ |
|
| 1574 | - /** |
|
| 1575 | - * Filter the taxonomy html by individual custom field. |
|
| 1576 | - * |
|
| 1577 | - * @param string $html The html to filter. |
|
| 1578 | - * @param string $location The location to output the html. |
|
| 1579 | - * @param array $cf The custom field array. |
|
| 1580 | - * @since 1.6.6 |
|
| 1581 | - */ |
|
| 1582 | - $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf); |
|
| 1583 | - } |
|
| 1584 | - |
|
| 1585 | - // Check if there is a custom field key specific filter. |
|
| 1586 | - if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){ |
|
| 1587 | - /** |
|
| 1588 | - * Filter the taxonomy html by field type key. |
|
| 1589 | - * |
|
| 1590 | - * @param string $html The html to filter. |
|
| 1591 | - * @param string $location The location to output the html. |
|
| 1592 | - * @param array $cf The custom field array. |
|
| 1593 | - * @since 1.6.6 |
|
| 1594 | - */ |
|
| 1595 | - $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1596 | - } |
|
| 1597 | - |
|
| 1598 | - // If not html then we run the standard output. |
|
| 1599 | - if(empty($html)){ |
|
| 1600 | - |
|
| 1601 | - if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) { |
|
| 1602 | - $post_taxonomy = $post->post_type . 'category'; |
|
| 1603 | - $field_value = $post->{$html_var}; |
|
| 1604 | - $links = array(); |
|
| 1605 | - $terms = array(); |
|
| 1606 | - $termsOrdered = array(); |
|
| 1607 | - if (!is_array($field_value)) { |
|
| 1608 | - $field_value = explode(",", trim($field_value, ",")); |
|
| 1609 | - } |
|
| 1610 | - |
|
| 1611 | - $field_value = array_unique($field_value); |
|
| 1612 | - |
|
| 1613 | - if (!empty($field_value)) { |
|
| 1614 | - foreach ($field_value as $term) { |
|
| 1615 | - $term = trim($term); |
|
| 1616 | - |
|
| 1617 | - if ($term != '') { |
|
| 1618 | - $term = get_term_by('id', $term, $html_var); |
|
| 1619 | - if (is_object($term)) { |
|
| 1620 | - $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>"; |
|
| 1621 | - $terms[] = $term; |
|
| 1622 | - } |
|
| 1623 | - } |
|
| 1624 | - } |
|
| 1625 | - if (!empty($links)) { |
|
| 1626 | - // order alphabetically |
|
| 1627 | - asort($links); |
|
| 1628 | - foreach (array_keys($links) as $key) { |
|
| 1629 | - $termsOrdered[$key] = $terms[$key]; |
|
| 1630 | - } |
|
| 1631 | - $terms = $termsOrdered; |
|
| 1632 | - } |
|
| 1633 | - } |
|
| 1634 | - $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : ''; |
|
| 1635 | - |
|
| 1636 | - if ($html_value != '') { |
|
| 1637 | - $field_icon = geodir_field_icon_proccess($cf); |
|
| 1638 | - if (strpos($field_icon, 'http') !== false) { |
|
| 1639 | - $field_icon_af = ''; |
|
| 1640 | - } else if ($field_icon == '') { |
|
| 1641 | - $field_icon_af = ''; |
|
| 1642 | - } else { |
|
| 1643 | - $field_icon_af = $field_icon; |
|
| 1644 | - $field_icon = ''; |
|
| 1645 | - } |
|
| 1646 | - |
|
| 1647 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1648 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1649 | - $html .= '</span> ' . $html_value . '</div>'; |
|
| 1650 | - } |
|
| 1651 | - } |
|
| 1652 | - |
|
| 1653 | - } |
|
| 1654 | - |
|
| 1655 | - return $html; |
|
| 1549 | + // check we have the post value |
|
| 1550 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1551 | + else{ global $post;} |
|
| 1552 | + |
|
| 1553 | + if(!is_array($cf) && $cf!=''){ |
|
| 1554 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1555 | + if(!$cf){return NULL;} |
|
| 1556 | + } |
|
| 1557 | + |
|
| 1558 | + $html_var = $cf['htmlvar_name']; |
|
| 1559 | + |
|
| 1560 | + // Check if there is a location specific filter. |
|
| 1561 | + if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){ |
|
| 1562 | + /** |
|
| 1563 | + * Filter the taxonomy html by location. |
|
| 1564 | + * |
|
| 1565 | + * @param string $html The html to filter. |
|
| 1566 | + * @param array $cf The custom field array. |
|
| 1567 | + * @since 1.6.6 |
|
| 1568 | + */ |
|
| 1569 | + $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf); |
|
| 1570 | + } |
|
| 1571 | + |
|
| 1572 | + // Check if there is a custom field specific filter. |
|
| 1573 | + if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){ |
|
| 1574 | + /** |
|
| 1575 | + * Filter the taxonomy html by individual custom field. |
|
| 1576 | + * |
|
| 1577 | + * @param string $html The html to filter. |
|
| 1578 | + * @param string $location The location to output the html. |
|
| 1579 | + * @param array $cf The custom field array. |
|
| 1580 | + * @since 1.6.6 |
|
| 1581 | + */ |
|
| 1582 | + $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf); |
|
| 1583 | + } |
|
| 1584 | + |
|
| 1585 | + // Check if there is a custom field key specific filter. |
|
| 1586 | + if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){ |
|
| 1587 | + /** |
|
| 1588 | + * Filter the taxonomy html by field type key. |
|
| 1589 | + * |
|
| 1590 | + * @param string $html The html to filter. |
|
| 1591 | + * @param string $location The location to output the html. |
|
| 1592 | + * @param array $cf The custom field array. |
|
| 1593 | + * @since 1.6.6 |
|
| 1594 | + */ |
|
| 1595 | + $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1596 | + } |
|
| 1597 | + |
|
| 1598 | + // If not html then we run the standard output. |
|
| 1599 | + if(empty($html)){ |
|
| 1600 | + |
|
| 1601 | + if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) { |
|
| 1602 | + $post_taxonomy = $post->post_type . 'category'; |
|
| 1603 | + $field_value = $post->{$html_var}; |
|
| 1604 | + $links = array(); |
|
| 1605 | + $terms = array(); |
|
| 1606 | + $termsOrdered = array(); |
|
| 1607 | + if (!is_array($field_value)) { |
|
| 1608 | + $field_value = explode(",", trim($field_value, ",")); |
|
| 1609 | + } |
|
| 1610 | + |
|
| 1611 | + $field_value = array_unique($field_value); |
|
| 1612 | + |
|
| 1613 | + if (!empty($field_value)) { |
|
| 1614 | + foreach ($field_value as $term) { |
|
| 1615 | + $term = trim($term); |
|
| 1616 | + |
|
| 1617 | + if ($term != '') { |
|
| 1618 | + $term = get_term_by('id', $term, $html_var); |
|
| 1619 | + if (is_object($term)) { |
|
| 1620 | + $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>"; |
|
| 1621 | + $terms[] = $term; |
|
| 1622 | + } |
|
| 1623 | + } |
|
| 1624 | + } |
|
| 1625 | + if (!empty($links)) { |
|
| 1626 | + // order alphabetically |
|
| 1627 | + asort($links); |
|
| 1628 | + foreach (array_keys($links) as $key) { |
|
| 1629 | + $termsOrdered[$key] = $terms[$key]; |
|
| 1630 | + } |
|
| 1631 | + $terms = $termsOrdered; |
|
| 1632 | + } |
|
| 1633 | + } |
|
| 1634 | + $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : ''; |
|
| 1635 | + |
|
| 1636 | + if ($html_value != '') { |
|
| 1637 | + $field_icon = geodir_field_icon_proccess($cf); |
|
| 1638 | + if (strpos($field_icon, 'http') !== false) { |
|
| 1639 | + $field_icon_af = ''; |
|
| 1640 | + } else if ($field_icon == '') { |
|
| 1641 | + $field_icon_af = ''; |
|
| 1642 | + } else { |
|
| 1643 | + $field_icon_af = $field_icon; |
|
| 1644 | + $field_icon = ''; |
|
| 1645 | + } |
|
| 1646 | + |
|
| 1647 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1648 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
| 1649 | + $html .= '</span> ' . $html_value . '</div>'; |
|
| 1650 | + } |
|
| 1651 | + } |
|
| 1652 | + |
|
| 1653 | + } |
|
| 1654 | + |
|
| 1655 | + return $html; |
|
| 1656 | 1656 | } |
| 1657 | 1657 | add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3); |
| 1658 | 1658 | |
@@ -1669,161 +1669,161 @@ discard block |
||
| 1669 | 1669 | */ |
| 1670 | 1670 | function geodir_cf_address($html,$location,$cf,$p=''){ |
| 1671 | 1671 | |
| 1672 | - // check we have the post value |
|
| 1673 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1674 | - else{ global $post;} |
|
| 1675 | - |
|
| 1676 | - if(!is_array($cf) && $cf!=''){ |
|
| 1677 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1678 | - if(!$cf){return NULL;} |
|
| 1679 | - } |
|
| 1680 | - |
|
| 1681 | - $html_var = $cf['htmlvar_name']; |
|
| 1682 | - |
|
| 1683 | - // Check if there is a location specific filter. |
|
| 1684 | - if(has_filter("geodir_custom_field_output_address_loc_{$location}")){ |
|
| 1685 | - /** |
|
| 1686 | - * Filter the address html by location. |
|
| 1687 | - * |
|
| 1688 | - * @param string $html The html to filter. |
|
| 1689 | - * @param array $cf The custom field array. |
|
| 1690 | - * @since 1.6.6 |
|
| 1691 | - */ |
|
| 1692 | - $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf); |
|
| 1693 | - } |
|
| 1694 | - |
|
| 1695 | - // Check if there is a custom field specific filter. |
|
| 1696 | - if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){ |
|
| 1697 | - /** |
|
| 1698 | - * Filter the address html by individual custom field. |
|
| 1699 | - * |
|
| 1700 | - * @param string $html The html to filter. |
|
| 1701 | - * @param string $location The location to output the html. |
|
| 1702 | - * @param array $cf The custom field array. |
|
| 1703 | - * @since 1.6.6 |
|
| 1704 | - */ |
|
| 1705 | - $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf); |
|
| 1706 | - } |
|
| 1707 | - |
|
| 1708 | - // Check if there is a custom field key specific filter. |
|
| 1709 | - if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){ |
|
| 1710 | - /** |
|
| 1711 | - * Filter the address html by field type key. |
|
| 1712 | - * |
|
| 1713 | - * @param string $html The html to filter. |
|
| 1714 | - * @param string $location The location to output the html. |
|
| 1715 | - * @param array $cf The custom field array. |
|
| 1716 | - * @since 1.6.6 |
|
| 1717 | - */ |
|
| 1718 | - $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1719 | - } |
|
| 1720 | - |
|
| 1721 | - // If not html then we run the standard output. |
|
| 1722 | - if(empty($html)){ |
|
| 1723 | - |
|
| 1724 | - global $preview; |
|
| 1725 | - $html_var = $cf['htmlvar_name'] . '_address'; |
|
| 1726 | - |
|
| 1727 | - if ($cf['extra_fields']) { |
|
| 1728 | - |
|
| 1729 | - $extra_fields = stripslashes_deep(unserialize($cf['extra_fields'])); |
|
| 1730 | - |
|
| 1731 | - $addition_fields = ''; |
|
| 1732 | - |
|
| 1733 | - if (!empty($extra_fields)) { |
|
| 1734 | - |
|
| 1735 | - $show_city_in_address = false; |
|
| 1736 | - if (isset($extra_fields['show_city']) && $extra_fields['show_city']) { |
|
| 1737 | - $show_city_in_address = true; |
|
| 1738 | - } |
|
| 1739 | - /** |
|
| 1740 | - * Filter "show city in address" value. |
|
| 1741 | - * |
|
| 1742 | - * @since 1.0.0 |
|
| 1743 | - */ |
|
| 1744 | - $show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address); |
|
| 1745 | - |
|
| 1746 | - |
|
| 1747 | - $show_region_in_address = false; |
|
| 1748 | - if (isset($extra_fields['show_region']) && $extra_fields['show_region']) { |
|
| 1749 | - $show_region_in_address = true; |
|
| 1750 | - } |
|
| 1751 | - /** |
|
| 1752 | - * Filter "show region in address" value. |
|
| 1753 | - * |
|
| 1754 | - * @since 1.6.6 |
|
| 1755 | - */ |
|
| 1756 | - $show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address); |
|
| 1757 | - |
|
| 1758 | - $show_country_in_address = false; |
|
| 1759 | - if (isset($extra_fields['show_country']) && $extra_fields['show_country']) { |
|
| 1760 | - $show_country_in_address = true; |
|
| 1761 | - } |
|
| 1762 | - /** |
|
| 1763 | - * Filter "show country in address" value. |
|
| 1764 | - * |
|
| 1765 | - * @since 1.6.6 |
|
| 1766 | - */ |
|
| 1767 | - $show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address); |
|
| 1768 | - |
|
| 1769 | - $show_zip_in_address = false; |
|
| 1770 | - if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { |
|
| 1771 | - $show_zip_in_address = true; |
|
| 1772 | - } |
|
| 1773 | - /** |
|
| 1774 | - * Filter "show zip in address" value. |
|
| 1775 | - * |
|
| 1776 | - * @since 1.6.6 |
|
| 1777 | - */ |
|
| 1778 | - $show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address); |
|
| 1779 | - |
|
| 1780 | - |
|
| 1781 | - } |
|
| 1782 | - |
|
| 1783 | - } |
|
| 1784 | - |
|
| 1785 | - |
|
| 1786 | - if ($post->{$html_var}) { |
|
| 1787 | - |
|
| 1788 | - $field_icon = geodir_field_icon_proccess( $cf ); |
|
| 1789 | - if ( strpos( $field_icon, 'http' ) !== false ) { |
|
| 1790 | - $field_icon_af = ''; |
|
| 1791 | - } elseif ( $field_icon == '' ) { |
|
| 1792 | - $field_icon_af = '<i class="fa fa-home"></i>'; |
|
| 1793 | - } else { |
|
| 1794 | - $field_icon_af = $field_icon; |
|
| 1795 | - $field_icon = ''; |
|
| 1796 | - } |
|
| 1672 | + // check we have the post value |
|
| 1673 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1674 | + else{ global $post;} |
|
| 1675 | + |
|
| 1676 | + if(!is_array($cf) && $cf!=''){ |
|
| 1677 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
| 1678 | + if(!$cf){return NULL;} |
|
| 1679 | + } |
|
| 1680 | + |
|
| 1681 | + $html_var = $cf['htmlvar_name']; |
|
| 1682 | + |
|
| 1683 | + // Check if there is a location specific filter. |
|
| 1684 | + if(has_filter("geodir_custom_field_output_address_loc_{$location}")){ |
|
| 1685 | + /** |
|
| 1686 | + * Filter the address html by location. |
|
| 1687 | + * |
|
| 1688 | + * @param string $html The html to filter. |
|
| 1689 | + * @param array $cf The custom field array. |
|
| 1690 | + * @since 1.6.6 |
|
| 1691 | + */ |
|
| 1692 | + $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf); |
|
| 1693 | + } |
|
| 1694 | + |
|
| 1695 | + // Check if there is a custom field specific filter. |
|
| 1696 | + if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){ |
|
| 1697 | + /** |
|
| 1698 | + * Filter the address html by individual custom field. |
|
| 1699 | + * |
|
| 1700 | + * @param string $html The html to filter. |
|
| 1701 | + * @param string $location The location to output the html. |
|
| 1702 | + * @param array $cf The custom field array. |
|
| 1703 | + * @since 1.6.6 |
|
| 1704 | + */ |
|
| 1705 | + $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf); |
|
| 1706 | + } |
|
| 1707 | + |
|
| 1708 | + // Check if there is a custom field key specific filter. |
|
| 1709 | + if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){ |
|
| 1710 | + /** |
|
| 1711 | + * Filter the address html by field type key. |
|
| 1712 | + * |
|
| 1713 | + * @param string $html The html to filter. |
|
| 1714 | + * @param string $location The location to output the html. |
|
| 1715 | + * @param array $cf The custom field array. |
|
| 1716 | + * @since 1.6.6 |
|
| 1717 | + */ |
|
| 1718 | + $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
| 1719 | + } |
|
| 1720 | + |
|
| 1721 | + // If not html then we run the standard output. |
|
| 1722 | + if(empty($html)){ |
|
| 1723 | + |
|
| 1724 | + global $preview; |
|
| 1725 | + $html_var = $cf['htmlvar_name'] . '_address'; |
|
| 1726 | + |
|
| 1727 | + if ($cf['extra_fields']) { |
|
| 1728 | + |
|
| 1729 | + $extra_fields = stripslashes_deep(unserialize($cf['extra_fields'])); |
|
| 1730 | + |
|
| 1731 | + $addition_fields = ''; |
|
| 1732 | + |
|
| 1733 | + if (!empty($extra_fields)) { |
|
| 1734 | + |
|
| 1735 | + $show_city_in_address = false; |
|
| 1736 | + if (isset($extra_fields['show_city']) && $extra_fields['show_city']) { |
|
| 1737 | + $show_city_in_address = true; |
|
| 1738 | + } |
|
| 1739 | + /** |
|
| 1740 | + * Filter "show city in address" value. |
|
| 1741 | + * |
|
| 1742 | + * @since 1.0.0 |
|
| 1743 | + */ |
|
| 1744 | + $show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address); |
|
| 1745 | + |
|
| 1746 | + |
|
| 1747 | + $show_region_in_address = false; |
|
| 1748 | + if (isset($extra_fields['show_region']) && $extra_fields['show_region']) { |
|
| 1749 | + $show_region_in_address = true; |
|
| 1750 | + } |
|
| 1751 | + /** |
|
| 1752 | + * Filter "show region in address" value. |
|
| 1753 | + * |
|
| 1754 | + * @since 1.6.6 |
|
| 1755 | + */ |
|
| 1756 | + $show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address); |
|
| 1757 | + |
|
| 1758 | + $show_country_in_address = false; |
|
| 1759 | + if (isset($extra_fields['show_country']) && $extra_fields['show_country']) { |
|
| 1760 | + $show_country_in_address = true; |
|
| 1761 | + } |
|
| 1762 | + /** |
|
| 1763 | + * Filter "show country in address" value. |
|
| 1764 | + * |
|
| 1765 | + * @since 1.6.6 |
|
| 1766 | + */ |
|
| 1767 | + $show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address); |
|
| 1768 | + |
|
| 1769 | + $show_zip_in_address = false; |
|
| 1770 | + if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { |
|
| 1771 | + $show_zip_in_address = true; |
|
| 1772 | + } |
|
| 1773 | + /** |
|
| 1774 | + * Filter "show zip in address" value. |
|
| 1775 | + * |
|
| 1776 | + * @since 1.6.6 |
|
| 1777 | + */ |
|
| 1778 | + $show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address); |
|
| 1779 | + |
|
| 1780 | + |
|
| 1781 | + } |
|
| 1782 | + |
|
| 1783 | + } |
|
| 1784 | + |
|
| 1785 | + |
|
| 1786 | + if ($post->{$html_var}) { |
|
| 1787 | + |
|
| 1788 | + $field_icon = geodir_field_icon_proccess( $cf ); |
|
| 1789 | + if ( strpos( $field_icon, 'http' ) !== false ) { |
|
| 1790 | + $field_icon_af = ''; |
|
| 1791 | + } elseif ( $field_icon == '' ) { |
|
| 1792 | + $field_icon_af = '<i class="fa fa-home"></i>'; |
|
| 1793 | + } else { |
|
| 1794 | + $field_icon_af = $field_icon; |
|
| 1795 | + $field_icon = ''; |
|
| 1796 | + } |
|
| 1797 | 1797 | |
| 1798 | 1798 | |
| 1799 | 1799 | |
| 1800 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;" itemscope itemtype="https://schema.org/PostalAddress">'; |
|
| 1801 | - $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1802 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ' '; |
|
| 1803 | - $html .= '</span>'; |
|
| 1800 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;" itemscope itemtype="https://schema.org/PostalAddress">'; |
|
| 1801 | + $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af; |
|
| 1802 | + $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ' '; |
|
| 1803 | + $html .= '</span>'; |
|
| 1804 | 1804 | |
| 1805 | - if ( isset($post->post_address) ) { |
|
| 1806 | - $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>'; |
|
| 1807 | - } |
|
| 1808 | - if ($show_city_in_address && isset( $post->post_city ) && $post->post_city ) { |
|
| 1809 | - $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>'; |
|
| 1810 | - } |
|
| 1811 | - if ($show_region_in_address && isset( $post->post_region ) && $post->post_region ) { |
|
| 1812 | - $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>'; |
|
| 1813 | - } |
|
| 1814 | - if ($show_zip_in_address && isset( $post->post_zip ) && $post->post_zip ) { |
|
| 1815 | - $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>'; |
|
| 1816 | - } |
|
| 1817 | - if ($show_country_in_address && isset( $post->post_country ) && $post->post_country ) { |
|
| 1818 | - $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>'; |
|
| 1819 | - } |
|
| 1820 | - $html .= '</div>'; |
|
| 1805 | + if ( isset($post->post_address) ) { |
|
| 1806 | + $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>'; |
|
| 1807 | + } |
|
| 1808 | + if ($show_city_in_address && isset( $post->post_city ) && $post->post_city ) { |
|
| 1809 | + $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>'; |
|
| 1810 | + } |
|
| 1811 | + if ($show_region_in_address && isset( $post->post_region ) && $post->post_region ) { |
|
| 1812 | + $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>'; |
|
| 1813 | + } |
|
| 1814 | + if ($show_zip_in_address && isset( $post->post_zip ) && $post->post_zip ) { |
|
| 1815 | + $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>'; |
|
| 1816 | + } |
|
| 1817 | + if ($show_country_in_address && isset( $post->post_country ) && $post->post_country ) { |
|
| 1818 | + $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>'; |
|
| 1819 | + } |
|
| 1820 | + $html .= '</div>'; |
|
| 1821 | 1821 | |
| 1822 | - } |
|
| 1822 | + } |
|
| 1823 | 1823 | |
| 1824 | - } |
|
| 1824 | + } |
|
| 1825 | 1825 | |
| 1826 | 1826 | |
| 1827 | - return $html; |
|
| 1827 | + return $html; |
|
| 1828 | 1828 | } |
| 1829 | 1829 | add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3); |
| 1830 | 1830 | \ No newline at end of file |
@@ -33,265 +33,265 @@ discard block |
||
| 33 | 33 | */ |
| 34 | 34 | function geodir_add_nav_menu_items() |
| 35 | 35 | {
|
| 36 | - $items = ''; |
|
| 37 | - // apply filter to add more navigations // -Filter-Location-Manager |
|
| 38 | - |
|
| 39 | - if (get_option('geodir_show_listing_nav')) {
|
|
| 40 | - |
|
| 41 | - $menu_class = ''; |
|
| 42 | - if (geodir_is_page('listing'))
|
|
| 43 | - $menu_class = 'current-menu-item'; |
|
| 44 | - |
|
| 45 | - |
|
| 46 | - //SHOW LISTING OF POST TYPE IN MAIN NAVIGATION |
|
| 47 | - $post_types = geodir_get_posttypes('object');
|
|
| 48 | - $show_post_type_main_nav = get_option('geodir_add_posttype_in_main_nav');
|
|
| 49 | - if (!empty($post_types)) {
|
|
| 50 | - foreach ($post_types as $post_type => $args) {
|
|
| 51 | - if (!empty($show_post_type_main_nav)) {
|
|
| 52 | - if (in_array($post_type, $show_post_type_main_nav)) {
|
|
| 53 | - if (get_post_type_archive_link($post_type)) {
|
|
| 54 | - $menu_class = ''; |
|
| 55 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing'))
|
|
| 56 | - $menu_class = 'current-menu-item'; |
|
| 57 | - /** |
|
| 58 | - * Filter the menu li class. |
|
| 59 | - * |
|
| 60 | - * @since 1.0.0 |
|
| 61 | - * @param string $menu_class The menu HTML class. |
|
| 62 | - */ |
|
| 63 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 64 | - /** |
|
| 65 | - * Filter the menu a class. |
|
| 66 | - * |
|
| 67 | - * @since 1.0.0 |
|
| 68 | - */ |
|
| 69 | - $a_class = apply_filters('geodir_menu_a_class', '');
|
|
| 70 | - $items .= '<li class="' . $li_class . '"> |
|
| 36 | + $items = ''; |
|
| 37 | + // apply filter to add more navigations // -Filter-Location-Manager |
|
| 38 | + |
|
| 39 | + if (get_option('geodir_show_listing_nav')) {
|
|
| 40 | + |
|
| 41 | + $menu_class = ''; |
|
| 42 | + if (geodir_is_page('listing'))
|
|
| 43 | + $menu_class = 'current-menu-item'; |
|
| 44 | + |
|
| 45 | + |
|
| 46 | + //SHOW LISTING OF POST TYPE IN MAIN NAVIGATION |
|
| 47 | + $post_types = geodir_get_posttypes('object');
|
|
| 48 | + $show_post_type_main_nav = get_option('geodir_add_posttype_in_main_nav');
|
|
| 49 | + if (!empty($post_types)) {
|
|
| 50 | + foreach ($post_types as $post_type => $args) {
|
|
| 51 | + if (!empty($show_post_type_main_nav)) {
|
|
| 52 | + if (in_array($post_type, $show_post_type_main_nav)) {
|
|
| 53 | + if (get_post_type_archive_link($post_type)) {
|
|
| 54 | + $menu_class = ''; |
|
| 55 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing'))
|
|
| 56 | + $menu_class = 'current-menu-item'; |
|
| 57 | + /** |
|
| 58 | + * Filter the menu li class. |
|
| 59 | + * |
|
| 60 | + * @since 1.0.0 |
|
| 61 | + * @param string $menu_class The menu HTML class. |
|
| 62 | + */ |
|
| 63 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 64 | + /** |
|
| 65 | + * Filter the menu a class. |
|
| 66 | + * |
|
| 67 | + * @since 1.0.0 |
|
| 68 | + */ |
|
| 69 | + $a_class = apply_filters('geodir_menu_a_class', '');
|
|
| 70 | + $items .= '<li class="' . $li_class . '"> |
|
| 71 | 71 | <a href="' . get_post_type_archive_link($post_type) . '" class="' . $a_class . '"> |
| 72 | 72 | ' . __(ucfirst($args->labels->name),'geodirectory') . ' |
| 73 | 73 | </a> |
| 74 | 74 | </li>'; |
| 75 | - } |
|
| 76 | - } |
|
| 77 | - } |
|
| 78 | - } |
|
| 79 | - } |
|
| 80 | - //END LISTING OF POST TYPE IN MAIN NAVIGATION |
|
| 81 | - |
|
| 82 | - $view_posttype_listing = get_option('geodir_add_posttype_in_listing_nav');
|
|
| 83 | - $is_listing_sub_meny_exists = (!empty($view_posttype_listing)) ? true : false; |
|
| 84 | - if ($is_listing_sub_meny_exists) {
|
|
| 85 | - /** |
|
| 86 | - * Filter the menu li class. |
|
| 87 | - * |
|
| 88 | - * @since 1.0.0 |
|
| 89 | - * @param string $menu_class The menu HTML class. |
|
| 90 | - */ |
|
| 91 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-listings ' . $menu_class);
|
|
| 92 | - /** |
|
| 93 | - * Filter the sub menu li class. |
|
| 94 | - * |
|
| 95 | - * @since 1.0.0 |
|
| 96 | - * @param string $menu_class The menu HTML class. |
|
| 97 | - */ |
|
| 98 | - $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 99 | - /** |
|
| 100 | - * Filter the sub menu ul class. |
|
| 101 | - * |
|
| 102 | - * @since 1.0.0 |
|
| 103 | - */ |
|
| 104 | - $sub_ul_class = apply_filters('geodir_sub_menu_ul_class', 'sub-menu');
|
|
| 105 | - /** |
|
| 106 | - * Filter the menu a class. |
|
| 107 | - * |
|
| 108 | - * @since 1.0.0 |
|
| 109 | - */ |
|
| 110 | - $a_class = apply_filters('geodir_menu_a_class', '');
|
|
| 111 | - /** |
|
| 112 | - * Filter the sub menu a class. |
|
| 113 | - * |
|
| 114 | - * @since 1.0.0 |
|
| 115 | - */ |
|
| 116 | - $sub_a_class = apply_filters('geodir_sub_menu_a_class', '');
|
|
| 117 | - $items .= '<li class="' . $li_class . '"> |
|
| 75 | + } |
|
| 76 | + } |
|
| 77 | + } |
|
| 78 | + } |
|
| 79 | + } |
|
| 80 | + //END LISTING OF POST TYPE IN MAIN NAVIGATION |
|
| 81 | + |
|
| 82 | + $view_posttype_listing = get_option('geodir_add_posttype_in_listing_nav');
|
|
| 83 | + $is_listing_sub_meny_exists = (!empty($view_posttype_listing)) ? true : false; |
|
| 84 | + if ($is_listing_sub_meny_exists) {
|
|
| 85 | + /** |
|
| 86 | + * Filter the menu li class. |
|
| 87 | + * |
|
| 88 | + * @since 1.0.0 |
|
| 89 | + * @param string $menu_class The menu HTML class. |
|
| 90 | + */ |
|
| 91 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-listings ' . $menu_class);
|
|
| 92 | + /** |
|
| 93 | + * Filter the sub menu li class. |
|
| 94 | + * |
|
| 95 | + * @since 1.0.0 |
|
| 96 | + * @param string $menu_class The menu HTML class. |
|
| 97 | + */ |
|
| 98 | + $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 99 | + /** |
|
| 100 | + * Filter the sub menu ul class. |
|
| 101 | + * |
|
| 102 | + * @since 1.0.0 |
|
| 103 | + */ |
|
| 104 | + $sub_ul_class = apply_filters('geodir_sub_menu_ul_class', 'sub-menu');
|
|
| 105 | + /** |
|
| 106 | + * Filter the menu a class. |
|
| 107 | + * |
|
| 108 | + * @since 1.0.0 |
|
| 109 | + */ |
|
| 110 | + $a_class = apply_filters('geodir_menu_a_class', '');
|
|
| 111 | + /** |
|
| 112 | + * Filter the sub menu a class. |
|
| 113 | + * |
|
| 114 | + * @since 1.0.0 |
|
| 115 | + */ |
|
| 116 | + $sub_a_class = apply_filters('geodir_sub_menu_a_class', '');
|
|
| 117 | + $items .= '<li class="' . $li_class . '"> |
|
| 118 | 118 | <a href="#" class="' . $a_class . '">' . __('Listing', 'geodirectory') . '</a>
|
| 119 | 119 | <ul class="' . $sub_ul_class . '">'; |
| 120 | - $post_types = geodir_get_posttypes('object');
|
|
| 120 | + $post_types = geodir_get_posttypes('object');
|
|
| 121 | 121 | |
| 122 | - $show_listing_post_types = get_option('geodir_add_posttype_in_listing_nav');
|
|
| 122 | + $show_listing_post_types = get_option('geodir_add_posttype_in_listing_nav');
|
|
| 123 | 123 | |
| 124 | - if (!empty($post_types)) {
|
|
| 125 | - global $geodir_add_location_url; |
|
| 126 | - $geodir_add_location_url = true; |
|
| 127 | - foreach ($post_types as $post_type => $args) {
|
|
| 128 | - if (!empty($show_listing_post_types)) {
|
|
| 129 | - if (in_array($post_type, $show_listing_post_types)) {
|
|
| 130 | - if (get_post_type_archive_link($post_type)) {
|
|
| 124 | + if (!empty($post_types)) {
|
|
| 125 | + global $geodir_add_location_url; |
|
| 126 | + $geodir_add_location_url = true; |
|
| 127 | + foreach ($post_types as $post_type => $args) {
|
|
| 128 | + if (!empty($show_listing_post_types)) {
|
|
| 129 | + if (in_array($post_type, $show_listing_post_types)) {
|
|
| 130 | + if (get_post_type_archive_link($post_type)) {
|
|
| 131 | 131 | |
| 132 | - $menu_class = ''; |
|
| 133 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing'))
|
|
| 134 | - $menu_class = 'current-menu-item'; |
|
| 132 | + $menu_class = ''; |
|
| 133 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('listing'))
|
|
| 134 | + $menu_class = 'current-menu-item'; |
|
| 135 | 135 | |
| 136 | - $items .= '<li class="' . $sub_li_class . '"> |
|
| 136 | + $items .= '<li class="' . $sub_li_class . '"> |
|
| 137 | 137 | <a href="' . get_post_type_archive_link($post_type) . '" class="' . $sub_a_class . '"> |
| 138 | 138 | ' . __(ucfirst($args->labels->name),'geodirectory') . ' |
| 139 | 139 | </a> |
| 140 | 140 | </li>'; |
| 141 | - } |
|
| 142 | - } |
|
| 143 | - } |
|
| 144 | - } |
|
| 145 | - $geodir_add_location_url = NULL; |
|
| 146 | - } |
|
| 141 | + } |
|
| 142 | + } |
|
| 143 | + } |
|
| 144 | + } |
|
| 145 | + $geodir_add_location_url = NULL; |
|
| 146 | + } |
|
| 147 | 147 | |
| 148 | - $items .= ' </ul> '; |
|
| 149 | - /** |
|
| 150 | - * Filter called after the sub menu closing ul tag for dynamic added menu items. |
|
| 151 | - * |
|
| 152 | - * @since 1.5.9 |
|
| 153 | - */ |
|
| 154 | - $items .= apply_filters('geodir_menu_after_sub_ul','');
|
|
| 155 | - $items .= '</li>'; |
|
| 156 | - } |
|
| 157 | - } |
|
| 158 | - |
|
| 159 | - if (get_option('geodir_show_addlisting_nav')) {
|
|
| 160 | - |
|
| 161 | - $menu_class = ''; |
|
| 162 | - if (geodir_is_page('add-listing'))
|
|
| 163 | - $menu_class = 'current-menu-item'; |
|
| 164 | - |
|
| 165 | - //SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
|
| 166 | - $post_types = geodir_get_posttypes('object');
|
|
| 167 | - $show_add_listing_post_types_main_nav = get_option('geodir_add_listing_link_main_nav');
|
|
| 168 | - $geodir_allow_posttype_frontend = get_option('geodir_allow_posttype_frontend');
|
|
| 169 | - |
|
| 170 | - if (!empty($post_types)) {
|
|
| 171 | - foreach ($post_types as $post_type => $args) {
|
|
| 172 | - if (!empty($geodir_allow_posttype_frontend)) {
|
|
| 173 | - if (in_array($post_type, $geodir_allow_posttype_frontend)) {
|
|
| 174 | - if (!empty($show_add_listing_post_types_main_nav)) {
|
|
| 175 | - if (in_array($post_type, $show_add_listing_post_types_main_nav)) {
|
|
| 176 | - if (geodir_get_addlisting_link($post_type)) {
|
|
| 177 | - |
|
| 178 | - $menu_class = ''; |
|
| 179 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing'))
|
|
| 180 | - $menu_class = 'current-menu-item'; |
|
| 181 | - /** |
|
| 182 | - * Filter the menu li class. |
|
| 183 | - * |
|
| 184 | - * @since 1.0.0 |
|
| 185 | - * @param string $menu_class The menu HTML class. |
|
| 186 | - */ |
|
| 187 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 188 | - /** |
|
| 189 | - * Filter the menu a class. |
|
| 190 | - * |
|
| 191 | - * @since 1.0.0 |
|
| 192 | - */ |
|
| 193 | - $a_class = apply_filters('geodir_menu_a_class', '');
|
|
| 194 | - $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
|
| 195 | - $items .= '<li class="' . $li_class . '"> |
|
| 148 | + $items .= ' </ul> '; |
|
| 149 | + /** |
|
| 150 | + * Filter called after the sub menu closing ul tag for dynamic added menu items. |
|
| 151 | + * |
|
| 152 | + * @since 1.5.9 |
|
| 153 | + */ |
|
| 154 | + $items .= apply_filters('geodir_menu_after_sub_ul','');
|
|
| 155 | + $items .= '</li>'; |
|
| 156 | + } |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + if (get_option('geodir_show_addlisting_nav')) {
|
|
| 160 | + |
|
| 161 | + $menu_class = ''; |
|
| 162 | + if (geodir_is_page('add-listing'))
|
|
| 163 | + $menu_class = 'current-menu-item'; |
|
| 164 | + |
|
| 165 | + //SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
|
| 166 | + $post_types = geodir_get_posttypes('object');
|
|
| 167 | + $show_add_listing_post_types_main_nav = get_option('geodir_add_listing_link_main_nav');
|
|
| 168 | + $geodir_allow_posttype_frontend = get_option('geodir_allow_posttype_frontend');
|
|
| 169 | + |
|
| 170 | + if (!empty($post_types)) {
|
|
| 171 | + foreach ($post_types as $post_type => $args) {
|
|
| 172 | + if (!empty($geodir_allow_posttype_frontend)) {
|
|
| 173 | + if (in_array($post_type, $geodir_allow_posttype_frontend)) {
|
|
| 174 | + if (!empty($show_add_listing_post_types_main_nav)) {
|
|
| 175 | + if (in_array($post_type, $show_add_listing_post_types_main_nav)) {
|
|
| 176 | + if (geodir_get_addlisting_link($post_type)) {
|
|
| 177 | + |
|
| 178 | + $menu_class = ''; |
|
| 179 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing'))
|
|
| 180 | + $menu_class = 'current-menu-item'; |
|
| 181 | + /** |
|
| 182 | + * Filter the menu li class. |
|
| 183 | + * |
|
| 184 | + * @since 1.0.0 |
|
| 185 | + * @param string $menu_class The menu HTML class. |
|
| 186 | + */ |
|
| 187 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 188 | + /** |
|
| 189 | + * Filter the menu a class. |
|
| 190 | + * |
|
| 191 | + * @since 1.0.0 |
|
| 192 | + */ |
|
| 193 | + $a_class = apply_filters('geodir_menu_a_class', '');
|
|
| 194 | + $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
|
| 195 | + $items .= '<li class="' . $li_class . '"> |
|
| 196 | 196 | <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $a_class . '"> |
| 197 | 197 | ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . '
|
| 198 | 198 | </a> |
| 199 | 199 | </li>'; |
| 200 | - } |
|
| 201 | - } |
|
| 202 | - } |
|
| 203 | - } |
|
| 204 | - } |
|
| 205 | - } |
|
| 206 | - } |
|
| 207 | - //END SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
|
| 208 | - } |
|
| 209 | - |
|
| 210 | - $view_add_posttype_listing = get_option('geodir_add_listing_link_add_listing_nav');
|
|
| 211 | - $is_add_listing_sub_meny_exists = (!empty($view_add_posttype_listing)) ? true : false; |
|
| 212 | - if ($is_add_listing_sub_meny_exists) {
|
|
| 213 | - |
|
| 214 | - if (get_option('geodir_show_addlisting_nav')) {
|
|
| 215 | - /** |
|
| 216 | - * Filter the menu li class. |
|
| 217 | - * |
|
| 218 | - * @since 1.0.0 |
|
| 219 | - * @param string $menu_class The menu HTML class. |
|
| 220 | - */ |
|
| 221 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-add-listing ' . $menu_class);
|
|
| 222 | - /** |
|
| 223 | - * Filter the sub menu li class. |
|
| 224 | - * |
|
| 225 | - * @since 1.0.0 |
|
| 226 | - * @param string $menu_class The menu HTML class. |
|
| 227 | - */ |
|
| 228 | - $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 229 | - /** |
|
| 230 | - * Filter the sub menu ul class. |
|
| 231 | - * |
|
| 232 | - * @since 1.0.0 |
|
| 233 | - */ |
|
| 234 | - $sub_ul_class = apply_filters('geodir_sub_menu_ul_class', 'sub-menu');
|
|
| 235 | - /** |
|
| 236 | - * Filter the menu a class. |
|
| 237 | - * |
|
| 238 | - * @since 1.0.0 |
|
| 239 | - */ |
|
| 240 | - $a_class = apply_filters('geodir_menu_a_class', '');
|
|
| 241 | - /** |
|
| 242 | - * Filter the sub menu a class. |
|
| 243 | - * |
|
| 244 | - * @since 1.0.0 |
|
| 245 | - */ |
|
| 246 | - $sub_a_class = apply_filters('geodir_sub_menu_a_class', '');
|
|
| 247 | - $items .= '<li class="' . $li_class . '"> |
|
| 200 | + } |
|
| 201 | + } |
|
| 202 | + } |
|
| 203 | + } |
|
| 204 | + } |
|
| 205 | + } |
|
| 206 | + } |
|
| 207 | + //END SHOW ADD LISTING POST TYPE IN MAIN NAVIGATION |
|
| 208 | + } |
|
| 209 | + |
|
| 210 | + $view_add_posttype_listing = get_option('geodir_add_listing_link_add_listing_nav');
|
|
| 211 | + $is_add_listing_sub_meny_exists = (!empty($view_add_posttype_listing)) ? true : false; |
|
| 212 | + if ($is_add_listing_sub_meny_exists) {
|
|
| 213 | + |
|
| 214 | + if (get_option('geodir_show_addlisting_nav')) {
|
|
| 215 | + /** |
|
| 216 | + * Filter the menu li class. |
|
| 217 | + * |
|
| 218 | + * @since 1.0.0 |
|
| 219 | + * @param string $menu_class The menu HTML class. |
|
| 220 | + */ |
|
| 221 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item menu-item-has-children menu-gd-add-listing ' . $menu_class);
|
|
| 222 | + /** |
|
| 223 | + * Filter the sub menu li class. |
|
| 224 | + * |
|
| 225 | + * @since 1.0.0 |
|
| 226 | + * @param string $menu_class The menu HTML class. |
|
| 227 | + */ |
|
| 228 | + $sub_li_class = apply_filters('geodir_sub_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 229 | + /** |
|
| 230 | + * Filter the sub menu ul class. |
|
| 231 | + * |
|
| 232 | + * @since 1.0.0 |
|
| 233 | + */ |
|
| 234 | + $sub_ul_class = apply_filters('geodir_sub_menu_ul_class', 'sub-menu');
|
|
| 235 | + /** |
|
| 236 | + * Filter the menu a class. |
|
| 237 | + * |
|
| 238 | + * @since 1.0.0 |
|
| 239 | + */ |
|
| 240 | + $a_class = apply_filters('geodir_menu_a_class', '');
|
|
| 241 | + /** |
|
| 242 | + * Filter the sub menu a class. |
|
| 243 | + * |
|
| 244 | + * @since 1.0.0 |
|
| 245 | + */ |
|
| 246 | + $sub_a_class = apply_filters('geodir_sub_menu_a_class', '');
|
|
| 247 | + $items .= '<li class="' . $li_class . '"> |
|
| 248 | 248 | <a href="#" class="' . $a_class . '">' . __('Add Listing', 'geodirectory') . '</a>
|
| 249 | 249 | <ul class="' . $sub_ul_class . '">'; |
| 250 | 250 | |
| 251 | - $post_types = geodir_get_posttypes('object');
|
|
| 252 | - |
|
| 253 | - $show_add_listing_post_types = get_option('geodir_add_listing_link_add_listing_nav');
|
|
| 254 | - |
|
| 255 | - if (!empty($post_types)) {
|
|
| 256 | - foreach ($post_types as $post_type => $args) {
|
|
| 257 | - if (!empty($geodir_allow_posttype_frontend)) {
|
|
| 258 | - if (in_array($post_type, $geodir_allow_posttype_frontend)) {
|
|
| 259 | - if (!empty($show_add_listing_post_types)) {
|
|
| 260 | - if (in_array($post_type, $show_add_listing_post_types)) {
|
|
| 261 | - if (geodir_get_addlisting_link($post_type)) {
|
|
| 262 | - |
|
| 263 | - $menu_class = ''; |
|
| 264 | - if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing'))
|
|
| 265 | - $menu_class = 'current-menu-item'; |
|
| 266 | - /** |
|
| 267 | - * Filter the menu li class. |
|
| 268 | - * |
|
| 269 | - * @since 1.0.0 |
|
| 270 | - * @param string $menu_class The menu HTML class. |
|
| 271 | - */ |
|
| 272 | - $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 273 | - $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
|
| 274 | - $items .= '<li class="' . $li_class . '"> |
|
| 251 | + $post_types = geodir_get_posttypes('object');
|
|
| 252 | + |
|
| 253 | + $show_add_listing_post_types = get_option('geodir_add_listing_link_add_listing_nav');
|
|
| 254 | + |
|
| 255 | + if (!empty($post_types)) {
|
|
| 256 | + foreach ($post_types as $post_type => $args) {
|
|
| 257 | + if (!empty($geodir_allow_posttype_frontend)) {
|
|
| 258 | + if (in_array($post_type, $geodir_allow_posttype_frontend)) {
|
|
| 259 | + if (!empty($show_add_listing_post_types)) {
|
|
| 260 | + if (in_array($post_type, $show_add_listing_post_types)) {
|
|
| 261 | + if (geodir_get_addlisting_link($post_type)) {
|
|
| 262 | + |
|
| 263 | + $menu_class = ''; |
|
| 264 | + if (geodir_get_current_posttype() == $post_type && geodir_is_page('add-listing'))
|
|
| 265 | + $menu_class = 'current-menu-item'; |
|
| 266 | + /** |
|
| 267 | + * Filter the menu li class. |
|
| 268 | + * |
|
| 269 | + * @since 1.0.0 |
|
| 270 | + * @param string $menu_class The menu HTML class. |
|
| 271 | + */ |
|
| 272 | + $li_class = apply_filters('geodir_menu_li_class', 'menu-item ' . $menu_class);
|
|
| 273 | + $cpt_name = __($args->labels->singular_name, 'geodirectory'); |
|
| 274 | + $items .= '<li class="' . $li_class . '"> |
|
| 275 | 275 | <a href="' . geodir_get_addlisting_link($post_type) . '" class="' . $sub_a_class . '"> |
| 276 | 276 | ' . sprintf( __('Add %s', 'geodirectory'), $cpt_name ) . '
|
| 277 | 277 | </a> |
| 278 | 278 | </li>'; |
| 279 | - } |
|
| 280 | - } |
|
| 281 | - } |
|
| 282 | - } |
|
| 283 | - } |
|
| 284 | - } |
|
| 285 | - } |
|
| 279 | + } |
|
| 280 | + } |
|
| 281 | + } |
|
| 282 | + } |
|
| 283 | + } |
|
| 284 | + } |
|
| 285 | + } |
|
| 286 | 286 | |
| 287 | - $items .= ' </ul> '; |
|
| 288 | - $items .= apply_filters('geodir_menu_after_sub_ul','');
|
|
| 289 | - $items .= '</li>'; |
|
| 287 | + $items .= ' </ul> '; |
|
| 288 | + $items .= apply_filters('geodir_menu_after_sub_ul','');
|
|
| 289 | + $items .= '</li>'; |
|
| 290 | 290 | |
| 291 | - } |
|
| 292 | - } |
|
| 293 | - // apply filter to add more navigations // -Filter-Location-Manager |
|
| 294 | - return $items; |
|
| 291 | + } |
|
| 292 | + } |
|
| 293 | + // apply filter to add more navigations // -Filter-Location-Manager |
|
| 294 | + return $items; |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | |
@@ -309,20 +309,20 @@ discard block |
||
| 309 | 309 | */ |
| 310 | 310 | function geodir_pagemenu_items($menu, $args) |
| 311 | 311 | {
|
| 312 | - $locations = get_nav_menu_locations(); |
|
| 313 | - $geodir_theme_location = get_option('geodir_theme_location_nav');
|
|
| 314 | - $geodir_theme_location_nav = array(); |
|
| 315 | - if (empty($locations) && empty($geodir_theme_location)) {
|
|
| 316 | - $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu);
|
|
| 317 | - $geodir_theme_location_nav[] = $args['theme_location']; |
|
| 318 | - update_option('geodir_theme_location_nav', $geodir_theme_location_nav);
|
|
| 319 | - } |
|
| 320 | - //else if(empty($geodir_theme_location)) // It means 'Show geodirectory navigation in selected menu locations' is not set yet. |
|
| 312 | + $locations = get_nav_menu_locations(); |
|
| 313 | + $geodir_theme_location = get_option('geodir_theme_location_nav');
|
|
| 314 | + $geodir_theme_location_nav = array(); |
|
| 315 | + if (empty($locations) && empty($geodir_theme_location)) {
|
|
| 316 | + $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu);
|
|
| 317 | + $geodir_theme_location_nav[] = $args['theme_location']; |
|
| 318 | + update_option('geodir_theme_location_nav', $geodir_theme_location_nav);
|
|
| 319 | + } |
|
| 320 | + //else if(empty($geodir_theme_location)) // It means 'Show geodirectory navigation in selected menu locations' is not set yet. |
|
| 321 | 321 | // $menu = str_replace("</ul></div>",geodir_add_nav_menu_items()."</ul></div>",$menu);
|
| 322 | - else if (is_array($geodir_theme_location) && isset($args['theme_location']) && in_array($args['theme_location'], $geodir_theme_location)) |
|
| 323 | - $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu);
|
|
| 322 | + else if (is_array($geodir_theme_location) && isset($args['theme_location']) && in_array($args['theme_location'], $geodir_theme_location)) |
|
| 323 | + $menu = str_replace("</ul></div>", geodir_add_nav_menu_items() . "</ul></div>", $menu);
|
|
| 324 | 324 | |
| 325 | - return $menu; |
|
| 325 | + return $menu; |
|
| 326 | 326 | |
| 327 | 327 | } |
| 328 | 328 | |
@@ -342,18 +342,18 @@ discard block |
||
| 342 | 342 | function geodir_menu_items($items, $args) |
| 343 | 343 | {
|
| 344 | 344 | |
| 345 | - $location = $args->theme_location; |
|
| 345 | + $location = $args->theme_location; |
|
| 346 | 346 | |
| 347 | - $geodir_theme_location = get_option('geodir_theme_location_nav');
|
|
| 347 | + $geodir_theme_location = get_option('geodir_theme_location_nav');
|
|
| 348 | 348 | |
| 349 | - if (has_nav_menu($location) == '1' && is_array($geodir_theme_location) && in_array($location, $geodir_theme_location)) {
|
|
| 349 | + if (has_nav_menu($location) == '1' && is_array($geodir_theme_location) && in_array($location, $geodir_theme_location)) {
|
|
| 350 | 350 | |
| 351 | - $items = $items . geodir_add_nav_menu_items(); |
|
| 352 | - return $items; |
|
| 351 | + $items = $items . geodir_add_nav_menu_items(); |
|
| 352 | + return $items; |
|
| 353 | 353 | |
| 354 | - } else {
|
|
| 355 | - return $items; |
|
| 356 | - } |
|
| 354 | + } else {
|
|
| 355 | + return $items; |
|
| 356 | + } |
|
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | /** |
@@ -368,25 +368,25 @@ discard block |
||
| 368 | 368 | */ |
| 369 | 369 | function geodir_get_category_all_array() |
| 370 | 370 | {
|
| 371 | - global $wpdb; |
|
| 372 | - $return_array = array(); |
|
| 373 | - |
|
| 374 | - $taxonomies = geodir_get_taxonomies(); |
|
| 375 | - $taxonomies = implode("','", $taxonomies);
|
|
| 376 | - $taxonomies = "'" . $taxonomies . "'"; |
|
| 377 | - |
|
| 378 | - $pn_categories = $wpdb->get_results( |
|
| 379 | - $wpdb->prepare( |
|
| 380 | - "SELECT $wpdb->terms.name as name, $wpdb->term_taxonomy.count as count, $wpdb->terms.term_id as cat_ID FROM $wpdb->term_taxonomy, $wpdb->terms WHERE $wpdb->term_taxonomy.term_id = %d AND $wpdb->term_taxonomy.taxonomy in ( $taxonomies ) ORDER BY name", |
|
| 381 | - array($wpdb->terms . term_id) |
|
| 382 | - ) |
|
| 383 | - ); |
|
| 384 | - |
|
| 385 | - foreach ($pn_categories as $pn_categories_obj) {
|
|
| 386 | - $return_array[] = array("id" => $pn_categories_obj->cat_ID,
|
|
| 387 | - "title" => $pn_categories_obj->name,); |
|
| 388 | - } |
|
| 389 | - return $return_array; |
|
| 371 | + global $wpdb; |
|
| 372 | + $return_array = array(); |
|
| 373 | + |
|
| 374 | + $taxonomies = geodir_get_taxonomies(); |
|
| 375 | + $taxonomies = implode("','", $taxonomies);
|
|
| 376 | + $taxonomies = "'" . $taxonomies . "'"; |
|
| 377 | + |
|
| 378 | + $pn_categories = $wpdb->get_results( |
|
| 379 | + $wpdb->prepare( |
|
| 380 | + "SELECT $wpdb->terms.name as name, $wpdb->term_taxonomy.count as count, $wpdb->terms.term_id as cat_ID FROM $wpdb->term_taxonomy, $wpdb->terms WHERE $wpdb->term_taxonomy.term_id = %d AND $wpdb->term_taxonomy.taxonomy in ( $taxonomies ) ORDER BY name", |
|
| 381 | + array($wpdb->terms . term_id) |
|
| 382 | + ) |
|
| 383 | + ); |
|
| 384 | + |
|
| 385 | + foreach ($pn_categories as $pn_categories_obj) {
|
|
| 386 | + $return_array[] = array("id" => $pn_categories_obj->cat_ID,
|
|
| 387 | + "title" => $pn_categories_obj->name,); |
|
| 388 | + } |
|
| 389 | + return $return_array; |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | |
@@ -401,41 +401,41 @@ discard block |
||
| 401 | 401 | */ |
| 402 | 402 | function geodir_get_current_posttype() |
| 403 | 403 | {
|
| 404 | - global $wp_query, $geodir_post_type; |
|
| 404 | + global $wp_query, $geodir_post_type; |
|
| 405 | 405 | |
| 406 | - $geodir_post_type = get_query_var('post_type');
|
|
| 406 | + $geodir_post_type = get_query_var('post_type');
|
|
| 407 | 407 | |
| 408 | - if (geodir_is_page('add-listing') || geodir_is_page('preview')) {
|
|
| 409 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
| 410 | - $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
| 411 | - elseif (isset($_REQUEST['listing_type'])) |
|
| 412 | - $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 413 | - } |
|
| 408 | + if (geodir_is_page('add-listing') || geodir_is_page('preview')) {
|
|
| 409 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') |
|
| 410 | + $geodir_post_type = get_post_type((int)$_REQUEST['pid']); |
|
| 411 | + elseif (isset($_REQUEST['listing_type'])) |
|
| 412 | + $geodir_post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 413 | + } |
|
| 414 | 414 | |
| 415 | - if ((geodir_is_page('search') || geodir_is_page('author')) && isset($_REQUEST['stype']))
|
|
| 416 | - $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
|
| 415 | + if ((geodir_is_page('search') || geodir_is_page('author')) && isset($_REQUEST['stype']))
|
|
| 416 | + $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
|
| 417 | 417 | |
| 418 | - if (is_tax()) |
|
| 419 | - $geodir_post_type = geodir_get_taxonomy_posttype(); |
|
| 418 | + if (is_tax()) |
|
| 419 | + $geodir_post_type = geodir_get_taxonomy_posttype(); |
|
| 420 | 420 | |
| 421 | 421 | |
| 422 | - $all_postypes = geodir_get_posttypes(); |
|
| 423 | - $all_postypes = stripslashes_deep($all_postypes); |
|
| 422 | + $all_postypes = geodir_get_posttypes(); |
|
| 423 | + $all_postypes = stripslashes_deep($all_postypes); |
|
| 424 | 424 | |
| 425 | - if (is_array($all_postypes) && !in_array($geodir_post_type, $all_postypes)) |
|
| 426 | - $geodir_post_type = ''; |
|
| 425 | + if (is_array($all_postypes) && !in_array($geodir_post_type, $all_postypes)) |
|
| 426 | + $geodir_post_type = ''; |
|
| 427 | 427 | |
| 428 | - if( defined( 'DOING_AJAX' ) && isset($_REQUEST['stype'])){
|
|
| 429 | - $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
|
| 430 | - } |
|
| 428 | + if( defined( 'DOING_AJAX' ) && isset($_REQUEST['stype'])){
|
|
| 429 | + $geodir_post_type = sanitize_text_field($_REQUEST['stype']); |
|
| 430 | + } |
|
| 431 | 431 | |
| 432 | 432 | |
| 433 | - /** |
|
| 434 | - * Filter the default CPT return. |
|
| 435 | - * |
|
| 436 | - * @since 1.6.9 |
|
| 437 | - */ |
|
| 438 | - return apply_filters('geodir_get_current_posttype',$geodir_post_type);
|
|
| 433 | + /** |
|
| 434 | + * Filter the default CPT return. |
|
| 435 | + * |
|
| 436 | + * @since 1.6.9 |
|
| 437 | + */ |
|
| 438 | + return apply_filters('geodir_get_current_posttype',$geodir_post_type);
|
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | /** |
@@ -449,22 +449,22 @@ discard block |
||
| 449 | 449 | */ |
| 450 | 450 | function geodir_get_default_posttype() |
| 451 | 451 | {
|
| 452 | - $post_types = apply_filters( 'geodir_get_default_posttype', geodir_get_posttypes( 'object' ) ); |
|
| 453 | - |
|
| 454 | - $stype = false; |
|
| 455 | - foreach ( $post_types as $post_type => $info ) {
|
|
| 456 | - global $wpdb; |
|
| 457 | - $has_posts = $wpdb->get_row( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_status='publish' LIMIT 1", $post_type ) ); |
|
| 458 | - if ( $has_posts ) {
|
|
| 459 | - $stype = $post_type; break; |
|
| 460 | - } |
|
| 461 | - } |
|
| 462 | - |
|
| 463 | - if(!$stype){
|
|
| 464 | - $stype = 'gd_place'; |
|
| 465 | - } |
|
| 466 | - |
|
| 467 | - return $stype; |
|
| 452 | + $post_types = apply_filters( 'geodir_get_default_posttype', geodir_get_posttypes( 'object' ) ); |
|
| 453 | + |
|
| 454 | + $stype = false; |
|
| 455 | + foreach ( $post_types as $post_type => $info ) {
|
|
| 456 | + global $wpdb; |
|
| 457 | + $has_posts = $wpdb->get_row( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type = %s AND post_status='publish' LIMIT 1", $post_type ) ); |
|
| 458 | + if ( $has_posts ) {
|
|
| 459 | + $stype = $post_type; break; |
|
| 460 | + } |
|
| 461 | + } |
|
| 462 | + |
|
| 463 | + if(!$stype){
|
|
| 464 | + $stype = 'gd_place'; |
|
| 465 | + } |
|
| 466 | + |
|
| 467 | + return $stype; |
|
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | /** |
@@ -478,21 +478,21 @@ discard block |
||
| 478 | 478 | */ |
| 479 | 479 | function geodir_get_posttypes($output = 'names') |
| 480 | 480 | {
|
| 481 | - $post_types = array(); |
|
| 482 | - $post_types = get_option('geodir_post_types');
|
|
| 483 | - $post_types = stripslashes_deep($post_types); |
|
| 484 | - if (!empty($post_types)) {
|
|
| 485 | - switch ($output): |
|
| 486 | - case 'object': |
|
| 487 | - case 'Object': |
|
| 488 | - $post_types = json_decode(json_encode($post_types), FALSE);//(object)$post_types; |
|
| 489 | - break; |
|
| 490 | - case 'array': |
|
| 491 | - case 'Array': |
|
| 492 | - $post_types = (array)$post_types; |
|
| 493 | - break; |
|
| 481 | + $post_types = array(); |
|
| 482 | + $post_types = get_option('geodir_post_types');
|
|
| 483 | + $post_types = stripslashes_deep($post_types); |
|
| 484 | + if (!empty($post_types)) {
|
|
| 485 | + switch ($output): |
|
| 486 | + case 'object': |
|
| 487 | + case 'Object': |
|
| 488 | + $post_types = json_decode(json_encode($post_types), FALSE);//(object)$post_types; |
|
| 489 | + break; |
|
| 490 | + case 'array': |
|
| 491 | + case 'Array': |
|
| 492 | + $post_types = (array)$post_types; |
|
| 493 | + break; |
|
| 494 | 494 | case 'options': |
| 495 | - $post_types = (array)$post_types; |
|
| 495 | + $post_types = (array)$post_types; |
|
| 496 | 496 | |
| 497 | 497 | $options = array(); |
| 498 | 498 | if (!empty($post_types)) {
|
@@ -501,17 +501,17 @@ discard block |
||
| 501 | 501 | } |
| 502 | 502 | } |
| 503 | 503 | $post_types = $options; |
| 504 | - break; |
|
| 505 | - default: |
|
| 506 | - $post_types = array_keys($post_types); |
|
| 507 | - break; |
|
| 508 | - endswitch; |
|
| 509 | - } |
|
| 510 | - |
|
| 511 | - if (!empty($post_types)) |
|
| 512 | - return $post_types; |
|
| 513 | - else |
|
| 514 | - return array(); |
|
| 504 | + break; |
|
| 505 | + default: |
|
| 506 | + $post_types = array_keys($post_types); |
|
| 507 | + break; |
|
| 508 | + endswitch; |
|
| 509 | + } |
|
| 510 | + |
|
| 511 | + if (!empty($post_types)) |
|
| 512 | + return $post_types; |
|
| 513 | + else |
|
| 514 | + return array(); |
|
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | /** |
@@ -524,108 +524,108 @@ discard block |
||
| 524 | 524 | */ |
| 525 | 525 | function geodir_get_posttype_info($post_type = '') |
| 526 | 526 | {
|
| 527 | - $post_types = array(); |
|
| 528 | - $post_types = get_option('geodir_post_types');
|
|
| 529 | - $post_types = stripslashes_deep($post_types); |
|
| 530 | - if (!empty($post_types) && $post_type != '') {
|
|
| 531 | - return $post_types[$post_type]; |
|
| 532 | - } else |
|
| 533 | - return false; |
|
| 527 | + $post_types = array(); |
|
| 528 | + $post_types = get_option('geodir_post_types');
|
|
| 529 | + $post_types = stripslashes_deep($post_types); |
|
| 530 | + if (!empty($post_types) && $post_type != '') {
|
|
| 531 | + return $post_types[$post_type]; |
|
| 532 | + } else |
|
| 533 | + return false; |
|
| 534 | 534 | } |
| 535 | 535 | |
| 536 | 536 | if (!function_exists('geodir_get_taxonomies')) {
|
| 537 | - /** |
|
| 538 | - * Get all custom taxonomies. |
|
| 539 | - * |
|
| 540 | - * @since 1.0.0 |
|
| 541 | - * @package GeoDirectory |
|
| 542 | - * @param string $post_type The post type. |
|
| 543 | - * @param bool $tages_taxonomies Is this a tag taxonomy?. Default: false. |
|
| 544 | - * @return array|bool Taxonomies on success. false on failure. |
|
| 545 | - */ |
|
| 546 | - function geodir_get_taxonomies($post_type = '', $tages_taxonomies = false) |
|
| 547 | - {
|
|
| 537 | + /** |
|
| 538 | + * Get all custom taxonomies. |
|
| 539 | + * |
|
| 540 | + * @since 1.0.0 |
|
| 541 | + * @package GeoDirectory |
|
| 542 | + * @param string $post_type The post type. |
|
| 543 | + * @param bool $tages_taxonomies Is this a tag taxonomy?. Default: false. |
|
| 544 | + * @return array|bool Taxonomies on success. false on failure. |
|
| 545 | + */ |
|
| 546 | + function geodir_get_taxonomies($post_type = '', $tages_taxonomies = false) |
|
| 547 | + {
|
|
| 548 | 548 | |
| 549 | - $taxonomies = array(); |
|
| 550 | - $gd_taxonomies = array(); |
|
| 549 | + $taxonomies = array(); |
|
| 550 | + $gd_taxonomies = array(); |
|
| 551 | 551 | |
| 552 | - if ($taxonomies = get_option('geodir_taxonomies')) {
|
|
| 552 | + if ($taxonomies = get_option('geodir_taxonomies')) {
|
|
| 553 | 553 | |
| 554 | 554 | |
| 555 | - $gd_taxonomies = array_keys($taxonomies); |
|
| 555 | + $gd_taxonomies = array_keys($taxonomies); |
|
| 556 | 556 | |
| 557 | 557 | |
| 558 | - if ($post_type != '') |
|
| 559 | - $gd_taxonomies = array(); |
|
| 558 | + if ($post_type != '') |
|
| 559 | + $gd_taxonomies = array(); |
|
| 560 | 560 | |
| 561 | - $i = 0; |
|
| 562 | - foreach ($taxonomies as $taxonomy => $args) {
|
|
| 561 | + $i = 0; |
|
| 562 | + foreach ($taxonomies as $taxonomy => $args) {
|
|
| 563 | 563 | |
| 564 | - if ($post_type != '' && $args['object_type'] == $post_type) |
|
| 565 | - $gd_taxonomies[] = $taxonomy; |
|
| 564 | + if ($post_type != '' && $args['object_type'] == $post_type) |
|
| 565 | + $gd_taxonomies[] = $taxonomy; |
|
| 566 | 566 | |
| 567 | - if ($tages_taxonomies === false && strpos($taxonomy, '_tag') !== false) {
|
|
| 568 | - if (array_search($taxonomy, $gd_taxonomies) !== false) |
|
| 569 | - unset($gd_taxonomies[array_search($taxonomy, $gd_taxonomies)]); |
|
| 570 | - } |
|
| 567 | + if ($tages_taxonomies === false && strpos($taxonomy, '_tag') !== false) {
|
|
| 568 | + if (array_search($taxonomy, $gd_taxonomies) !== false) |
|
| 569 | + unset($gd_taxonomies[array_search($taxonomy, $gd_taxonomies)]); |
|
| 570 | + } |
|
| 571 | 571 | |
| 572 | - } |
|
| 572 | + } |
|
| 573 | + |
|
| 574 | + $gd_taxonomies = array_values($gd_taxonomies); |
|
| 575 | + } |
|
| 573 | 576 | |
| 574 | - $gd_taxonomies = array_values($gd_taxonomies); |
|
| 575 | - } |
|
| 576 | - |
|
| 577 | - /** |
|
| 578 | - * Filter the taxonomies. |
|
| 579 | - * |
|
| 580 | - * @since 1.0.0 |
|
| 581 | - * @param array $gd_taxonomies The taxonomy array. |
|
| 582 | - */ |
|
| 583 | - $taxonomies = apply_filters('geodir_taxonomy', $gd_taxonomies);
|
|
| 584 | - |
|
| 585 | - if (!empty($taxonomies)) {
|
|
| 586 | - return $taxonomies; |
|
| 587 | - } else {
|
|
| 588 | - return false; |
|
| 589 | - } |
|
| 590 | - } |
|
| 577 | + /** |
|
| 578 | + * Filter the taxonomies. |
|
| 579 | + * |
|
| 580 | + * @since 1.0.0 |
|
| 581 | + * @param array $gd_taxonomies The taxonomy array. |
|
| 582 | + */ |
|
| 583 | + $taxonomies = apply_filters('geodir_taxonomy', $gd_taxonomies);
|
|
| 584 | + |
|
| 585 | + if (!empty($taxonomies)) {
|
|
| 586 | + return $taxonomies; |
|
| 587 | + } else {
|
|
| 588 | + return false; |
|
| 589 | + } |
|
| 590 | + } |
|
| 591 | 591 | } |
| 592 | 592 | |
| 593 | 593 | if (!function_exists(' geodir_get_categories_dl')) {
|
| 594 | - /** |
|
| 595 | - * Get categories dropdown HTML. |
|
| 596 | - * |
|
| 597 | - * @since 1.0.0 |
|
| 598 | - * @package GeoDirectory |
|
| 599 | - * @param string $post_type The post type. |
|
| 600 | - * @param string $selected The selected value. |
|
| 601 | - * @param bool $tages_taxonomies Is this a tag taxonomy?. Default: false. |
|
| 602 | - * @param bool $echo Prints the HTML when set to true. Default: true. |
|
| 603 | - * @return void|string Dropdown HTML. |
|
| 604 | - */ |
|
| 605 | - function geodir_get_categories_dl($post_type = '', $selected = '', $tages_taxonomies = false, $echo = true) |
|
| 606 | - {
|
|
| 607 | - |
|
| 608 | - $html = ''; |
|
| 609 | - $taxonomies = geodir_get_taxonomies($post_type, $tages_taxonomies); |
|
| 610 | - |
|
| 611 | - $categories = get_terms($taxonomies); |
|
| 612 | - |
|
| 613 | - $html .= '<option value="0">' . __('All', 'geodirectory') . '</option>';
|
|
| 614 | - |
|
| 615 | - foreach ($categories as $category_obj) {
|
|
| 616 | - $select_opt = ''; |
|
| 617 | - if ($selected == $category_obj->term_id) {
|
|
| 618 | - $select_opt = 'selected="selected"'; |
|
| 619 | - } |
|
| 620 | - $html .= '<option ' . $select_opt . ' value="' . $category_obj->term_id . '">' |
|
| 621 | - . ucfirst($category_obj->name) . '</option>'; |
|
| 622 | - } |
|
| 623 | - |
|
| 624 | - if ($echo) |
|
| 625 | - echo $html; |
|
| 626 | - else |
|
| 627 | - return $html; |
|
| 628 | - } |
|
| 594 | + /** |
|
| 595 | + * Get categories dropdown HTML. |
|
| 596 | + * |
|
| 597 | + * @since 1.0.0 |
|
| 598 | + * @package GeoDirectory |
|
| 599 | + * @param string $post_type The post type. |
|
| 600 | + * @param string $selected The selected value. |
|
| 601 | + * @param bool $tages_taxonomies Is this a tag taxonomy?. Default: false. |
|
| 602 | + * @param bool $echo Prints the HTML when set to true. Default: true. |
|
| 603 | + * @return void|string Dropdown HTML. |
|
| 604 | + */ |
|
| 605 | + function geodir_get_categories_dl($post_type = '', $selected = '', $tages_taxonomies = false, $echo = true) |
|
| 606 | + {
|
|
| 607 | + |
|
| 608 | + $html = ''; |
|
| 609 | + $taxonomies = geodir_get_taxonomies($post_type, $tages_taxonomies); |
|
| 610 | + |
|
| 611 | + $categories = get_terms($taxonomies); |
|
| 612 | + |
|
| 613 | + $html .= '<option value="0">' . __('All', 'geodirectory') . '</option>';
|
|
| 614 | + |
|
| 615 | + foreach ($categories as $category_obj) {
|
|
| 616 | + $select_opt = ''; |
|
| 617 | + if ($selected == $category_obj->term_id) {
|
|
| 618 | + $select_opt = 'selected="selected"'; |
|
| 619 | + } |
|
| 620 | + $html .= '<option ' . $select_opt . ' value="' . $category_obj->term_id . '">' |
|
| 621 | + . ucfirst($category_obj->name) . '</option>'; |
|
| 622 | + } |
|
| 623 | + |
|
| 624 | + if ($echo) |
|
| 625 | + echo $html; |
|
| 626 | + else |
|
| 627 | + return $html; |
|
| 628 | + } |
|
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | |
@@ -640,28 +640,28 @@ discard block |
||
| 640 | 640 | function geodir_get_listing_slug($object_type = '') |
| 641 | 641 | {
|
| 642 | 642 | |
| 643 | - $listing_slug = ''; |
|
| 643 | + $listing_slug = ''; |
|
| 644 | 644 | |
| 645 | - $post_types = get_option('geodir_post_types');
|
|
| 646 | - $taxonomies = get_option('geodir_taxonomies');
|
|
| 645 | + $post_types = get_option('geodir_post_types');
|
|
| 646 | + $taxonomies = get_option('geodir_taxonomies');
|
|
| 647 | 647 | |
| 648 | 648 | |
| 649 | - if ($object_type != '') {
|
|
| 650 | - if (!empty($post_types) && array_key_exists($object_type, $post_types)) {
|
|
| 649 | + if ($object_type != '') {
|
|
| 650 | + if (!empty($post_types) && array_key_exists($object_type, $post_types)) {
|
|
| 651 | 651 | |
| 652 | - $object_info = $post_types[$object_type]; |
|
| 653 | - $listing_slug = $object_info['listing_slug']; |
|
| 654 | - } elseif (!empty($taxonomies) && array_key_exists($object_type, $taxonomies)) {
|
|
| 655 | - $object_info = $taxonomies[$object_type]; |
|
| 656 | - $listing_slug = $object_info['listing_slug']; |
|
| 657 | - } |
|
| 652 | + $object_info = $post_types[$object_type]; |
|
| 653 | + $listing_slug = $object_info['listing_slug']; |
|
| 654 | + } elseif (!empty($taxonomies) && array_key_exists($object_type, $taxonomies)) {
|
|
| 655 | + $object_info = $taxonomies[$object_type]; |
|
| 656 | + $listing_slug = $object_info['listing_slug']; |
|
| 657 | + } |
|
| 658 | 658 | |
| 659 | - } |
|
| 659 | + } |
|
| 660 | 660 | |
| 661 | - if (!empty($listing_slug)) |
|
| 662 | - return $listing_slug; |
|
| 663 | - else |
|
| 664 | - return false; |
|
| 661 | + if (!empty($listing_slug)) |
|
| 662 | + return $listing_slug; |
|
| 663 | + else |
|
| 664 | + return false; |
|
| 665 | 665 | } |
| 666 | 666 | |
| 667 | 667 | |
@@ -676,212 +676,212 @@ discard block |
||
| 676 | 676 | */ |
| 677 | 677 | function geodir_get_taxonomy_posttype($taxonomy = '') |
| 678 | 678 | {
|
| 679 | - global $wp_query; |
|
| 680 | - |
|
| 681 | - $post_type = array(); |
|
| 682 | - $taxonomies = array(); |
|
| 683 | - |
|
| 684 | - if (!empty($taxonomy)) {
|
|
| 685 | - $taxonomies[] = $taxonomy; |
|
| 686 | - } elseif (isset($wp_query->tax_query->queries)) {
|
|
| 687 | - $tax_arr = $wp_query->tax_query->queries; |
|
| 688 | - //if tax query has 'relation' set then it will break wp_list_pluck so we remove it |
|
| 689 | - if(isset( $tax_arr['relation'])){unset( $tax_arr['relation']);}
|
|
| 690 | - $taxonomies = wp_list_pluck($tax_arr, 'taxonomy'); |
|
| 691 | - } |
|
| 692 | - |
|
| 693 | - if (!empty($taxonomies)) {
|
|
| 694 | - foreach (geodir_get_posttypes() as $pt) {
|
|
| 695 | - $object_taxonomies = $pt === 'attachment' ? get_taxonomies_for_attachments() : get_object_taxonomies($pt); |
|
| 696 | - if (array_intersect($taxonomies, $object_taxonomies)) |
|
| 697 | - $post_type[] = $pt; |
|
| 698 | - } |
|
| 699 | - } |
|
| 700 | - |
|
| 701 | - if (!empty($post_type)) |
|
| 702 | - return $post_type[0]; |
|
| 703 | - else |
|
| 704 | - return false; |
|
| 679 | + global $wp_query; |
|
| 680 | + |
|
| 681 | + $post_type = array(); |
|
| 682 | + $taxonomies = array(); |
|
| 683 | + |
|
| 684 | + if (!empty($taxonomy)) {
|
|
| 685 | + $taxonomies[] = $taxonomy; |
|
| 686 | + } elseif (isset($wp_query->tax_query->queries)) {
|
|
| 687 | + $tax_arr = $wp_query->tax_query->queries; |
|
| 688 | + //if tax query has 'relation' set then it will break wp_list_pluck so we remove it |
|
| 689 | + if(isset( $tax_arr['relation'])){unset( $tax_arr['relation']);}
|
|
| 690 | + $taxonomies = wp_list_pluck($tax_arr, 'taxonomy'); |
|
| 691 | + } |
|
| 692 | + |
|
| 693 | + if (!empty($taxonomies)) {
|
|
| 694 | + foreach (geodir_get_posttypes() as $pt) {
|
|
| 695 | + $object_taxonomies = $pt === 'attachment' ? get_taxonomies_for_attachments() : get_object_taxonomies($pt); |
|
| 696 | + if (array_intersect($taxonomies, $object_taxonomies)) |
|
| 697 | + $post_type[] = $pt; |
|
| 698 | + } |
|
| 699 | + } |
|
| 700 | + |
|
| 701 | + if (!empty($post_type)) |
|
| 702 | + return $post_type[0]; |
|
| 703 | + else |
|
| 704 | + return false; |
|
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | if (!function_exists('geodir_custom_taxonomy_walker')) {
|
| 708 | - /** |
|
| 709 | - * Custom taxonomy walker function. |
|
| 710 | - * |
|
| 711 | - * @since 1.0.0 |
|
| 712 | - * @package GeoDirectory |
|
| 713 | - * @param string $cat_taxonomy The taxonomy name. |
|
| 714 | - * @param int $cat_parent The parent term ID. |
|
| 715 | - * @param bool $hide_empty Hide empty taxonomies? Default: false. |
|
| 716 | - * @param int $pading CSS padding in pixels. |
|
| 717 | - * @return string|void taxonomy HTML. |
|
| 718 | - */ |
|
| 719 | - function geodir_custom_taxonomy_walker($cat_taxonomy, $cat_parent = 0, $hide_empty = false, $pading = 0) |
|
| 720 | - {
|
|
| 721 | - global $cat_display, $post_cat, $exclude_cats; |
|
| 722 | - |
|
| 723 | - $search_terms = trim($post_cat, ","); |
|
| 724 | - |
|
| 725 | - $search_terms = explode(",", $search_terms);
|
|
| 726 | - |
|
| 727 | - $cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'hide_empty' => $hide_empty, 'exclude' => $exclude_cats));
|
|
| 728 | - |
|
| 729 | - $display = ''; |
|
| 730 | - $onchange = ''; |
|
| 731 | - $term_check = ''; |
|
| 732 | - $main_list_class = ''; |
|
| 733 | - $out = ''; |
|
| 734 | - //If there are terms, start displaying |
|
| 735 | - if (count($cat_terms) > 0) {
|
|
| 736 | - //Displaying as a list |
|
| 737 | - $p = $pading * 20; |
|
| 738 | - $pading++; |
|
| 739 | - |
|
| 740 | - |
|
| 741 | - if ((!geodir_is_page('listing')) || (is_search() && $_REQUEST['search_taxonomy'] == '')) {
|
|
| 742 | - if ($cat_parent == 0) {
|
|
| 743 | - $list_class = 'main_list gd-parent-cats-list gd-cats-display-' . $cat_display; |
|
| 744 | - $main_list_class = 'class="main_list_selecter"'; |
|
| 745 | - } else {
|
|
| 746 | - //$display = 'display:none'; |
|
| 747 | - $list_class = 'sub_list gd-sub-cats-list'; |
|
| 748 | - } |
|
| 749 | - } |
|
| 708 | + /** |
|
| 709 | + * Custom taxonomy walker function. |
|
| 710 | + * |
|
| 711 | + * @since 1.0.0 |
|
| 712 | + * @package GeoDirectory |
|
| 713 | + * @param string $cat_taxonomy The taxonomy name. |
|
| 714 | + * @param int $cat_parent The parent term ID. |
|
| 715 | + * @param bool $hide_empty Hide empty taxonomies? Default: false. |
|
| 716 | + * @param int $pading CSS padding in pixels. |
|
| 717 | + * @return string|void taxonomy HTML. |
|
| 718 | + */ |
|
| 719 | + function geodir_custom_taxonomy_walker($cat_taxonomy, $cat_parent = 0, $hide_empty = false, $pading = 0) |
|
| 720 | + {
|
|
| 721 | + global $cat_display, $post_cat, $exclude_cats; |
|
| 722 | + |
|
| 723 | + $search_terms = trim($post_cat, ","); |
|
| 724 | + |
|
| 725 | + $search_terms = explode(",", $search_terms);
|
|
| 726 | + |
|
| 727 | + $cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'hide_empty' => $hide_empty, 'exclude' => $exclude_cats));
|
|
| 728 | + |
|
| 729 | + $display = ''; |
|
| 730 | + $onchange = ''; |
|
| 731 | + $term_check = ''; |
|
| 732 | + $main_list_class = ''; |
|
| 733 | + $out = ''; |
|
| 734 | + //If there are terms, start displaying |
|
| 735 | + if (count($cat_terms) > 0) {
|
|
| 736 | + //Displaying as a list |
|
| 737 | + $p = $pading * 20; |
|
| 738 | + $pading++; |
|
| 739 | + |
|
| 740 | + |
|
| 741 | + if ((!geodir_is_page('listing')) || (is_search() && $_REQUEST['search_taxonomy'] == '')) {
|
|
| 742 | + if ($cat_parent == 0) {
|
|
| 743 | + $list_class = 'main_list gd-parent-cats-list gd-cats-display-' . $cat_display; |
|
| 744 | + $main_list_class = 'class="main_list_selecter"'; |
|
| 745 | + } else {
|
|
| 746 | + //$display = 'display:none'; |
|
| 747 | + $list_class = 'sub_list gd-sub-cats-list'; |
|
| 748 | + } |
|
| 749 | + } |
|
| 750 | 750 | |
| 751 | - if ($cat_display == 'checkbox' || $cat_display == 'radio') {
|
|
| 752 | - $p = 0; |
|
| 753 | - $out = '<div class="' . $list_class . ' gd-cat-row-' . $cat_parent . '" style="margin-left:' . $p . 'px;' . $display . ';">'; |
|
| 754 | - } |
|
| 751 | + if ($cat_display == 'checkbox' || $cat_display == 'radio') {
|
|
| 752 | + $p = 0; |
|
| 753 | + $out = '<div class="' . $list_class . ' gd-cat-row-' . $cat_parent . '" style="margin-left:' . $p . 'px;' . $display . ';">'; |
|
| 754 | + } |
|
| 755 | 755 | |
| 756 | - foreach ($cat_terms as $cat_term) {
|
|
| 756 | + foreach ($cat_terms as $cat_term) {
|
|
| 757 | 757 | |
| 758 | - $checked = ''; |
|
| 758 | + $checked = ''; |
|
| 759 | 759 | |
| 760 | - if (in_array($cat_term->term_id, $search_terms)) {
|
|
| 761 | - if ($cat_display == 'select' || $cat_display == 'multiselect') |
|
| 762 | - $checked = 'selected="selected"'; |
|
| 763 | - else |
|
| 764 | - $checked = 'checked="checked"'; |
|
| 765 | - } |
|
| 760 | + if (in_array($cat_term->term_id, $search_terms)) {
|
|
| 761 | + if ($cat_display == 'select' || $cat_display == 'multiselect') |
|
| 762 | + $checked = 'selected="selected"'; |
|
| 763 | + else |
|
| 764 | + $checked = 'checked="checked"'; |
|
| 765 | + } |
|
| 766 | 766 | |
| 767 | - if ($cat_display == 'radio') |
|
| 768 | - $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
| 769 | - elseif ($cat_display == 'select' || $cat_display == 'multiselect') |
|
| 770 | - $out .= '<option ' . $main_list_class . ' style="margin-left:' . $p . 'px;" alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' >' . $term_check . ucfirst($cat_term->name) . '</option>'; |
|
| 767 | + if ($cat_display == 'radio') |
|
| 768 | + $out .= '<span style="display:block" ><input type="radio" field_type="radio" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
| 769 | + elseif ($cat_display == 'select' || $cat_display == 'multiselect') |
|
| 770 | + $out .= '<option ' . $main_list_class . ' style="margin-left:' . $p . 'px;" alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' >' . $term_check . ucfirst($cat_term->name) . '</option>'; |
|
| 771 | 771 | |
| 772 | - else {
|
|
| 773 | - $out .= '<span style="display:block"><input style="display:inline-block" type="checkbox" field_type="checkbox" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
| 774 | - } |
|
| 772 | + else {
|
|
| 773 | + $out .= '<span style="display:block"><input style="display:inline-block" type="checkbox" field_type="checkbox" name="post_category[' . $cat_term->taxonomy . '][]" ' . $main_list_class . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" ' . $checked . $onchange . ' id="gd-cat-' . $cat_term->term_id . '" >' . $term_check . ucfirst($cat_term->name) . '</span>'; |
|
| 774 | + } |
|
| 775 | 775 | |
| 776 | - // Call recurson to print sub cats |
|
| 777 | - $out .= geodir_custom_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading); |
|
| 776 | + // Call recurson to print sub cats |
|
| 777 | + $out .= geodir_custom_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading); |
|
| 778 | 778 | |
| 779 | - } |
|
| 779 | + } |
|
| 780 | 780 | |
| 781 | - if ($cat_display == 'checkbox' || $cat_display == 'radio') |
|
| 782 | - $out .= '</div>'; |
|
| 781 | + if ($cat_display == 'checkbox' || $cat_display == 'radio') |
|
| 782 | + $out .= '</div>'; |
|
| 783 | 783 | |
| 784 | - return $out; |
|
| 785 | - } |
|
| 786 | - return; |
|
| 787 | - } |
|
| 784 | + return $out; |
|
| 785 | + } |
|
| 786 | + return; |
|
| 787 | + } |
|
| 788 | 788 | } |
| 789 | 789 | |
| 790 | 790 | if (!function_exists('geodir_custom_taxonomy_walker2')) {
|
| 791 | - /** |
|
| 792 | - * Custom taxonomy walker function. |
|
| 793 | - * |
|
| 794 | - * @since 1.0.0 |
|
| 795 | - * @package GeoDirectory |
|
| 796 | - * @global object $post WordPress Post object. |
|
| 797 | - * @global object $gd_session GeoDirectory Session object. |
|
| 798 | - * @param string $cat_taxonomy The taxonomy name. |
|
| 799 | - * @param string $cat_limit Number of categories to display. |
|
| 800 | - */ |
|
| 801 | - function geodir_custom_taxonomy_walker2($cat_taxonomy, $cat_limit = '') |
|
| 802 | - {
|
|
| 803 | - $post_category = ''; |
|
| 804 | - $post_category_str = ''; |
|
| 805 | - global $exclude_cats, $gd_session; |
|
| 806 | - |
|
| 807 | - $cat_exclude = ''; |
|
| 808 | - if (is_array($exclude_cats) && !empty($exclude_cats)) |
|
| 809 | - $cat_exclude = serialize($exclude_cats); |
|
| 810 | - |
|
| 811 | - if (isset($_REQUEST['backandedit'])) {
|
|
| 812 | - $post = (object)$gd_session->get('listing');
|
|
| 813 | - |
|
| 814 | - if (!is_array($post->post_category[$cat_taxonomy])) |
|
| 815 | - $post_category = $post->post_category[$cat_taxonomy]; |
|
| 816 | - |
|
| 817 | - $post_categories = $post->post_category_str; |
|
| 818 | - if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) |
|
| 819 | - $post_category_str = $post_categories[$cat_taxonomy]; |
|
| 820 | - |
|
| 821 | - } elseif ((geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') || (is_admin())) {
|
|
| 822 | - global $post; |
|
| 823 | - |
|
| 824 | - $post_category = geodir_get_post_meta($post->ID, $cat_taxonomy, true); |
|
| 825 | - if (empty($post_category) && isset($post->{$cat_taxonomy})) {
|
|
| 826 | - $post_category = $post->{$cat_taxonomy};
|
|
| 827 | - } |
|
| 791 | + /** |
|
| 792 | + * Custom taxonomy walker function. |
|
| 793 | + * |
|
| 794 | + * @since 1.0.0 |
|
| 795 | + * @package GeoDirectory |
|
| 796 | + * @global object $post WordPress Post object. |
|
| 797 | + * @global object $gd_session GeoDirectory Session object. |
|
| 798 | + * @param string $cat_taxonomy The taxonomy name. |
|
| 799 | + * @param string $cat_limit Number of categories to display. |
|
| 800 | + */ |
|
| 801 | + function geodir_custom_taxonomy_walker2($cat_taxonomy, $cat_limit = '') |
|
| 802 | + {
|
|
| 803 | + $post_category = ''; |
|
| 804 | + $post_category_str = ''; |
|
| 805 | + global $exclude_cats, $gd_session; |
|
| 806 | + |
|
| 807 | + $cat_exclude = ''; |
|
| 808 | + if (is_array($exclude_cats) && !empty($exclude_cats)) |
|
| 809 | + $cat_exclude = serialize($exclude_cats); |
|
| 810 | + |
|
| 811 | + if (isset($_REQUEST['backandedit'])) {
|
|
| 812 | + $post = (object)$gd_session->get('listing');
|
|
| 813 | + |
|
| 814 | + if (!is_array($post->post_category[$cat_taxonomy])) |
|
| 815 | + $post_category = $post->post_category[$cat_taxonomy]; |
|
| 816 | + |
|
| 817 | + $post_categories = $post->post_category_str; |
|
| 818 | + if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) |
|
| 819 | + $post_category_str = $post_categories[$cat_taxonomy]; |
|
| 820 | + |
|
| 821 | + } elseif ((geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') || (is_admin())) {
|
|
| 822 | + global $post; |
|
| 823 | + |
|
| 824 | + $post_category = geodir_get_post_meta($post->ID, $cat_taxonomy, true); |
|
| 825 | + if (empty($post_category) && isset($post->{$cat_taxonomy})) {
|
|
| 826 | + $post_category = $post->{$cat_taxonomy};
|
|
| 827 | + } |
|
| 828 | 828 | |
| 829 | - $post_categories = get_post_meta($post->ID, 'post_categories', true); |
|
| 829 | + $post_categories = get_post_meta($post->ID, 'post_categories', true); |
|
| 830 | 830 | |
| 831 | - if (empty($post_category) && !empty($post_categories) && !empty($post_categories[$cat_taxonomy])) {
|
|
| 832 | - foreach (explode(",", $post_categories[$cat_taxonomy]) as $cat_part) {
|
|
| 833 | - if (is_numeric($cat_part)) {
|
|
| 834 | - $cat_part_arr[] = $cat_part; |
|
| 835 | - } |
|
| 836 | - } |
|
| 837 | - if (is_array($cat_part_arr)) {
|
|
| 838 | - $post_category = implode(',', $cat_part_arr);
|
|
| 839 | - } |
|
| 840 | - } |
|
| 831 | + if (empty($post_category) && !empty($post_categories) && !empty($post_categories[$cat_taxonomy])) {
|
|
| 832 | + foreach (explode(",", $post_categories[$cat_taxonomy]) as $cat_part) {
|
|
| 833 | + if (is_numeric($cat_part)) {
|
|
| 834 | + $cat_part_arr[] = $cat_part; |
|
| 835 | + } |
|
| 836 | + } |
|
| 837 | + if (is_array($cat_part_arr)) {
|
|
| 838 | + $post_category = implode(',', $cat_part_arr);
|
|
| 839 | + } |
|
| 840 | + } |
|
| 841 | 841 | |
| 842 | - if (!empty($post_category)) {
|
|
| 843 | - $cat1 = array_filter(explode(',', $post_category));
|
|
| 844 | - $post_category = ',' . implode(',', $cat1) . ',';
|
|
| 842 | + if (!empty($post_category)) {
|
|
| 843 | + $cat1 = array_filter(explode(',', $post_category));
|
|
| 844 | + $post_category = ',' . implode(',', $cat1) . ',';
|
|
| 845 | 845 | |
| 846 | - } |
|
| 846 | + } |
|
| 847 | 847 | |
| 848 | - if ($post_category != '' && is_array($exclude_cats) && !empty($exclude_cats)) {
|
|
| 848 | + if ($post_category != '' && is_array($exclude_cats) && !empty($exclude_cats)) {
|
|
| 849 | 849 | |
| 850 | - $post_category_upd = explode(',', $post_category);
|
|
| 851 | - $post_category_change = ''; |
|
| 852 | - foreach ($post_category_upd as $cat) {
|
|
| 850 | + $post_category_upd = explode(',', $post_category);
|
|
| 851 | + $post_category_change = ''; |
|
| 852 | + foreach ($post_category_upd as $cat) {
|
|
| 853 | 853 | |
| 854 | - if (!in_array($cat, $exclude_cats) && $cat != '') {
|
|
| 855 | - $post_category_change .= ',' . $cat; |
|
| 856 | - } |
|
| 857 | - } |
|
| 858 | - $post_category = $post_category_change; |
|
| 859 | - } |
|
| 854 | + if (!in_array($cat, $exclude_cats) && $cat != '') {
|
|
| 855 | + $post_category_change .= ',' . $cat; |
|
| 856 | + } |
|
| 857 | + } |
|
| 858 | + $post_category = $post_category_change; |
|
| 859 | + } |
|
| 860 | 860 | |
| 861 | 861 | |
| 862 | - if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) {
|
|
| 863 | - $post_category_str = $post_categories[$cat_taxonomy]; |
|
| 864 | - } |
|
| 865 | - } |
|
| 862 | + if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) {
|
|
| 863 | + $post_category_str = $post_categories[$cat_taxonomy]; |
|
| 864 | + } |
|
| 865 | + } |
|
| 866 | 866 | |
| 867 | - echo '<input type="hidden" id="cat_limit" value="' . $cat_limit . '" name="cat_limit[' . $cat_taxonomy . ']" />'; |
|
| 867 | + echo '<input type="hidden" id="cat_limit" value="' . $cat_limit . '" name="cat_limit[' . $cat_taxonomy . ']" />'; |
|
| 868 | 868 | |
| 869 | - echo '<input type="hidden" id="post_category" value="' . $post_category . '" name="post_category[' . $cat_taxonomy . ']" />'; |
|
| 869 | + echo '<input type="hidden" id="post_category" value="' . $post_category . '" name="post_category[' . $cat_taxonomy . ']" />'; |
|
| 870 | 870 | |
| 871 | - echo '<input type="hidden" id="post_category_str" value="' . $post_category_str . '" name="post_category_str[' . $cat_taxonomy . ']" />'; |
|
| 871 | + echo '<input type="hidden" id="post_category_str" value="' . $post_category_str . '" name="post_category_str[' . $cat_taxonomy . ']" />'; |
|
| 872 | 872 | |
| 873 | 873 | |
| 874 | - ?> |
|
| 874 | + ?> |
|
| 875 | 875 | <div class="cat_sublist"> |
| 876 | 876 | <?php |
| 877 | 877 | |
| 878 | - $post_id = isset($post->ID) ? $post->ID : ''; |
|
| 878 | + $post_id = isset($post->ID) ? $post->ID : ''; |
|
| 879 | 879 | |
| 880 | - if ((geodir_is_page('add-listing') || is_admin()) && !empty($post_categories[$cat_taxonomy])) {
|
|
| 880 | + if ((geodir_is_page('add-listing') || is_admin()) && !empty($post_categories[$cat_taxonomy])) {
|
|
| 881 | 881 | |
| 882 | - geodir_editpost_categories_html($cat_taxonomy, $post_id, $post_categories); |
|
| 883 | - } |
|
| 884 | - ?> |
|
| 882 | + geodir_editpost_categories_html($cat_taxonomy, $post_id, $post_categories); |
|
| 883 | + } |
|
| 884 | + ?> |
|
| 885 | 885 | </div> |
| 886 | 886 | <script type="text/javascript"> |
| 887 | 887 | |
@@ -1004,22 +1004,22 @@ discard block |
||
| 1004 | 1004 | |
| 1005 | 1005 | </script> |
| 1006 | 1006 | <?php |
| 1007 | - if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) {
|
|
| 1008 | - $post_cat_str = $post_categories[$cat_taxonomy]; |
|
| 1009 | - $post_cat_array = explode("#", $post_cat_str);
|
|
| 1010 | - if (count($post_cat_array) >= $cat_limit && $cat_limit != 0) |
|
| 1011 | - $style = "display:none;"; |
|
| 1012 | - } |
|
| 1013 | - ?> |
|
| 1007 | + if (!empty($post_categories) && array_key_exists($cat_taxonomy, $post_categories)) {
|
|
| 1008 | + $post_cat_str = $post_categories[$cat_taxonomy]; |
|
| 1009 | + $post_cat_array = explode("#", $post_cat_str);
|
|
| 1010 | + if (count($post_cat_array) >= $cat_limit && $cat_limit != 0) |
|
| 1011 | + $style = "display:none;"; |
|
| 1012 | + } |
|
| 1013 | + ?> |
|
| 1014 | 1014 | <div class="main_cat_list" style=" <?php if (isset($style)) {
|
| 1015 | - echo $style; |
|
| 1016 | - }?> "> |
|
| 1015 | + echo $style; |
|
| 1016 | + }?> "> |
|
| 1017 | 1017 | <?php geodir_get_catlist($cat_taxonomy, 0); // print main categories list |
| 1018 | - ?> |
|
| 1018 | + ?> |
|
| 1019 | 1019 | </div> |
| 1020 | 1020 | <?php |
| 1021 | 1021 | |
| 1022 | - } |
|
| 1022 | + } |
|
| 1023 | 1023 | } |
| 1024 | 1024 | |
| 1025 | 1025 | /** |
@@ -1036,23 +1036,23 @@ discard block |
||
| 1036 | 1036 | */ |
| 1037 | 1037 | function geodir_addpost_categories_html($request_taxonomy, $parrent, $selected = false, $main_selected = true, $default = false, $exclude = '') |
| 1038 | 1038 | {
|
| 1039 | - global $exclude_cats; |
|
| 1039 | + global $exclude_cats; |
|
| 1040 | 1040 | |
| 1041 | - if ($exclude != '') {
|
|
| 1042 | - $exclude_cats = maybe_unserialize(base64_decode($exclude)); |
|
| 1041 | + if ($exclude != '') {
|
|
| 1042 | + $exclude_cats = maybe_unserialize(base64_decode($exclude)); |
|
| 1043 | 1043 | |
| 1044 | - if(is_array( $exclude_cats)){
|
|
| 1045 | - $exclude_cats = array_map( 'intval', $exclude_cats ); |
|
| 1046 | - }else{
|
|
| 1047 | - $exclude_cats = intval($exclude_cats); |
|
| 1048 | - } |
|
| 1044 | + if(is_array( $exclude_cats)){
|
|
| 1045 | + $exclude_cats = array_map( 'intval', $exclude_cats ); |
|
| 1046 | + }else{
|
|
| 1047 | + $exclude_cats = intval($exclude_cats); |
|
| 1048 | + } |
|
| 1049 | 1049 | |
| 1050 | - } |
|
| 1050 | + } |
|
| 1051 | 1051 | |
| 1052 | - if ((is_array($exclude_cats) && !empty($exclude_cats) && !in_array($parrent, $exclude_cats)) || |
|
| 1053 | - (!is_array($exclude_cats) || empty($exclude_cats)) |
|
| 1054 | - ) {
|
|
| 1055 | - ?> |
|
| 1052 | + if ((is_array($exclude_cats) && !empty($exclude_cats) && !in_array($parrent, $exclude_cats)) || |
|
| 1053 | + (!is_array($exclude_cats) || empty($exclude_cats)) |
|
| 1054 | + ) {
|
|
| 1055 | + ?> |
|
| 1056 | 1056 | |
| 1057 | 1057 | <?php $main_cat = get_term($parrent, $request_taxonomy); ?> |
| 1058 | 1058 | |
@@ -1081,8 +1081,8 @@ discard block |
||
| 1081 | 1081 | |
| 1082 | 1082 | <br/> |
| 1083 | 1083 | <?php |
| 1084 | - $cat_terms = get_terms($request_taxonomy, array('parent' => $main_cat->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats));
|
|
| 1085 | - if (!empty($cat_terms)) { ?>
|
|
| 1084 | + $cat_terms = get_terms($request_taxonomy, array('parent' => $main_cat->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats));
|
|
| 1085 | + if (!empty($cat_terms)) { ?>
|
|
| 1086 | 1086 | <span> <?php printf(__('Add listing in category', 'geodirectory')); ?></span>
|
| 1087 | 1087 | <?php geodir_get_catlist($request_taxonomy, $parrent, $selected) ?> |
| 1088 | 1088 | <?php } ?> |
@@ -1104,53 +1104,53 @@ discard block |
||
| 1104 | 1104 | function geodir_editpost_categories_html($request_taxonomy, $request_postid, $post_categories) |
| 1105 | 1105 | {
|
| 1106 | 1106 | |
| 1107 | - if (!empty($post_categories) && array_key_exists($request_taxonomy, $post_categories)) {
|
|
| 1108 | - $post_cat_str = $post_categories[$request_taxonomy]; |
|
| 1109 | - $post_cat_array = explode("#", $post_cat_str);
|
|
| 1110 | - if (is_array($post_cat_array)) {
|
|
| 1111 | - $post_cat_array = array_unique( $post_cat_array ); |
|
| 1107 | + if (!empty($post_categories) && array_key_exists($request_taxonomy, $post_categories)) {
|
|
| 1108 | + $post_cat_str = $post_categories[$request_taxonomy]; |
|
| 1109 | + $post_cat_array = explode("#", $post_cat_str);
|
|
| 1110 | + if (is_array($post_cat_array)) {
|
|
| 1111 | + $post_cat_array = array_unique( $post_cat_array ); |
|
| 1112 | 1112 | |
| 1113 | 1113 | foreach ($post_cat_array as $post_cat_html) {
|
| 1114 | 1114 | |
| 1115 | - $post_cat_info = explode(":", $post_cat_html);
|
|
| 1116 | - $post_maincat_str = $post_cat_info[0]; |
|
| 1115 | + $post_cat_info = explode(":", $post_cat_html);
|
|
| 1116 | + $post_maincat_str = $post_cat_info[0]; |
|
| 1117 | 1117 | |
| 1118 | - if (!empty($post_maincat_str)) {
|
|
| 1119 | - $post_maincat_info = explode(",", $post_maincat_str);
|
|
| 1120 | - $post_maincat_id = $post_maincat_info[0]; |
|
| 1121 | - ($post_maincat_info[1] == 'y') ? $post_maincat_selected = true : $post_maincat_selected = false; |
|
| 1122 | - (end($post_maincat_info) == 'd') ? $post_maincat_default = true : $post_maincat_default = false; |
|
| 1123 | - } |
|
| 1124 | - $post_sub_catid = ''; |
|
| 1125 | - if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) {
|
|
| 1126 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
| 1127 | - } |
|
| 1118 | + if (!empty($post_maincat_str)) {
|
|
| 1119 | + $post_maincat_info = explode(",", $post_maincat_str);
|
|
| 1120 | + $post_maincat_id = $post_maincat_info[0]; |
|
| 1121 | + ($post_maincat_info[1] == 'y') ? $post_maincat_selected = true : $post_maincat_selected = false; |
|
| 1122 | + (end($post_maincat_info) == 'd') ? $post_maincat_default = true : $post_maincat_default = false; |
|
| 1123 | + } |
|
| 1124 | + $post_sub_catid = ''; |
|
| 1125 | + if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) {
|
|
| 1126 | + $post_sub_catid = (int)$post_cat_info[1]; |
|
| 1127 | + } |
|
| 1128 | 1128 | |
| 1129 | - geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
|
| 1129 | + geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
|
| 1130 | 1130 | |
| 1131 | - } |
|
| 1132 | - } else {
|
|
| 1131 | + } |
|
| 1132 | + } else {
|
|
| 1133 | 1133 | |
| 1134 | - $post_cat_info = explode(":", $post_cat_str);
|
|
| 1135 | - $post_maincat_str = $post_cat_info[0]; |
|
| 1134 | + $post_cat_info = explode(":", $post_cat_str);
|
|
| 1135 | + $post_maincat_str = $post_cat_info[0]; |
|
| 1136 | 1136 | |
| 1137 | - $post_sub_catid = ''; |
|
| 1137 | + $post_sub_catid = ''; |
|
| 1138 | 1138 | |
| 1139 | - if (!empty($post_maincat_str)) {
|
|
| 1140 | - $post_maincat_info = explode(",", $post_maincat_str);
|
|
| 1141 | - $post_maincat_id = $post_maincat_info[0]; |
|
| 1142 | - ($post_maincat_info[1] == 'y') ? $post_maincat_selected = true : $post_maincat_selected = false; |
|
| 1143 | - (end($post_maincat_info) == 'd') ? $post_maincat_default = true : $post_maincat_default = false; |
|
| 1144 | - } |
|
| 1139 | + if (!empty($post_maincat_str)) {
|
|
| 1140 | + $post_maincat_info = explode(",", $post_maincat_str);
|
|
| 1141 | + $post_maincat_id = $post_maincat_info[0]; |
|
| 1142 | + ($post_maincat_info[1] == 'y') ? $post_maincat_selected = true : $post_maincat_selected = false; |
|
| 1143 | + (end($post_maincat_info) == 'd') ? $post_maincat_default = true : $post_maincat_default = false; |
|
| 1144 | + } |
|
| 1145 | 1145 | |
| 1146 | - if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) {
|
|
| 1147 | - $post_sub_catid = (int)$post_cat_info[1]; |
|
| 1148 | - } |
|
| 1146 | + if (isset($post_cat_info[1]) && !empty($post_cat_info[1])) {
|
|
| 1147 | + $post_sub_catid = (int)$post_cat_info[1]; |
|
| 1148 | + } |
|
| 1149 | 1149 | |
| 1150 | - geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
|
| 1150 | + geodir_addpost_categories_html($request_taxonomy, $post_maincat_id, $post_sub_catid, $post_maincat_selected, $post_maincat_default); |
|
| 1151 | 1151 | |
| 1152 | - } |
|
| 1153 | - } |
|
| 1152 | + } |
|
| 1153 | + } |
|
| 1154 | 1154 | } |
| 1155 | 1155 | |
| 1156 | 1156 | /** |
@@ -1164,35 +1164,35 @@ discard block |
||
| 1164 | 1164 | */ |
| 1165 | 1165 | function geodir_get_catlist($cat_taxonomy, $parrent = 0, $selected = false) |
| 1166 | 1166 | {
|
| 1167 | - global $exclude_cats; |
|
| 1167 | + global $exclude_cats; |
|
| 1168 | 1168 | |
| 1169 | - $cat_terms = get_terms($cat_taxonomy, array('parent' => $parrent, 'hide_empty' => false, 'exclude' => $exclude_cats));
|
|
| 1169 | + $cat_terms = get_terms($cat_taxonomy, array('parent' => $parrent, 'hide_empty' => false, 'exclude' => $exclude_cats));
|
|
| 1170 | 1170 | |
| 1171 | - if (!empty($cat_terms)) {
|
|
| 1172 | - $onchange = ''; |
|
| 1173 | - $onchange = ' onchange="show_subcatlist(this.value, this)" '; |
|
| 1171 | + if (!empty($cat_terms)) {
|
|
| 1172 | + $onchange = ''; |
|
| 1173 | + $onchange = ' onchange="show_subcatlist(this.value, this)" '; |
|
| 1174 | 1174 | |
| 1175 | - $option_selected = ''; |
|
| 1176 | - if (!$selected) |
|
| 1177 | - $option_slected = ' selected="selected" '; |
|
| 1175 | + $option_selected = ''; |
|
| 1176 | + if (!$selected) |
|
| 1177 | + $option_slected = ' selected="selected" '; |
|
| 1178 | 1178 | |
| 1179 | - echo '<select field_type="select" id="' . sanitize_text_field($cat_taxonomy) . '" class="chosen_select" ' . $onchange . ' option-ajaxChosen="false" >'; |
|
| 1179 | + echo '<select field_type="select" id="' . sanitize_text_field($cat_taxonomy) . '" class="chosen_select" ' . $onchange . ' option-ajaxChosen="false" >'; |
|
| 1180 | 1180 | |
| 1181 | - echo '<option value="" ' . $option_selected . ' >' . __('Select Category', 'geodirectory') . '</option>';
|
|
| 1181 | + echo '<option value="" ' . $option_selected . ' >' . __('Select Category', 'geodirectory') . '</option>';
|
|
| 1182 | 1182 | |
| 1183 | - foreach ($cat_terms as $cat_term) {
|
|
| 1184 | - $option_selected = ''; |
|
| 1185 | - if ($selected == $cat_term->term_id) |
|
| 1186 | - $option_selected = ' selected="selected" '; |
|
| 1183 | + foreach ($cat_terms as $cat_term) {
|
|
| 1184 | + $option_selected = ''; |
|
| 1185 | + if ($selected == $cat_term->term_id) |
|
| 1186 | + $option_selected = ' selected="selected" '; |
|
| 1187 | 1187 | |
| 1188 | - // Count child terms |
|
| 1189 | - $child_terms = get_terms( $cat_taxonomy, array( 'parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1 ) ); |
|
| 1190 | - $has_child = !empty( $child_terms ) ? 't' : 'f'; |
|
| 1188 | + // Count child terms |
|
| 1189 | + $child_terms = get_terms( $cat_taxonomy, array( 'parent' => $cat_term->term_id, 'hide_empty' => false, 'exclude' => $exclude_cats, 'number' => 1 ) ); |
|
| 1190 | + $has_child = !empty( $child_terms ) ? 't' : 'f'; |
|
| 1191 | 1191 | |
| 1192 | - echo '<option ' . $option_selected . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" _hc="' . $has_child . '" >' . ucfirst($cat_term->name) . '</option>'; |
|
| 1193 | - } |
|
| 1194 | - echo '</select>'; |
|
| 1195 | - } |
|
| 1192 | + echo '<option ' . $option_selected . ' alt="' . $cat_term->taxonomy . '" title="' . ucfirst($cat_term->name) . '" value="' . $cat_term->term_id . '" _hc="' . $has_child . '" >' . ucfirst($cat_term->name) . '</option>'; |
|
| 1193 | + } |
|
| 1194 | + echo '</select>'; |
|
| 1195 | + } |
|
| 1196 | 1196 | } |
| 1197 | 1197 | |
| 1198 | 1198 | /** |
@@ -1208,28 +1208,28 @@ discard block |
||
| 1208 | 1208 | */ |
| 1209 | 1209 | function geodir_custom_update_messages($messages) |
| 1210 | 1210 | {
|
| 1211 | - global $post, $post_ID; |
|
| 1212 | - |
|
| 1213 | - $post_types = get_post_types(array('show_ui' => true, '_builtin' => false), 'objects');
|
|
| 1214 | - |
|
| 1215 | - foreach ($post_types as $post_type => $post_object) {
|
|
| 1216 | - |
|
| 1217 | - $messages[$post_type] = array( |
|
| 1218 | - 0 => '', // Unused. Messages start at index 1. |
|
| 1219 | - 1 => sprintf(__('%s updated. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name),
|
|
| 1220 | - 2 => __('Custom field updated.', 'geodirectory'),
|
|
| 1221 | - 3 => __('Custom field deleted.', 'geodirectory'),
|
|
| 1222 | - 4 => sprintf(__('%s updated.', 'geodirectory'), $post_object->labels->singular_name),
|
|
| 1223 | - 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int)$_GET['revision'], false)) : false,
|
|
| 1224 | - 6 => sprintf(__('%s published. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name),
|
|
| 1225 | - 7 => sprintf(__('%s saved.', 'geodirectory'), $post_object->labels->singular_name),
|
|
| 1226 | - 8 => sprintf(__('%s submitted. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name),
|
|
| 1227 | - 9 => sprintf(__('%s scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, date_i18n(__('M j, Y @ G:i', 'geodirectory'), strtotime($post->post_date)), esc_url(get_permalink($post_ID)), $post_object->labels->singular_name),
|
|
| 1228 | - 10 => sprintf(__('%s draft updated. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name),
|
|
| 1229 | - ); |
|
| 1230 | - } |
|
| 1231 | - |
|
| 1232 | - return $messages; |
|
| 1211 | + global $post, $post_ID; |
|
| 1212 | + |
|
| 1213 | + $post_types = get_post_types(array('show_ui' => true, '_builtin' => false), 'objects');
|
|
| 1214 | + |
|
| 1215 | + foreach ($post_types as $post_type => $post_object) {
|
|
| 1216 | + |
|
| 1217 | + $messages[$post_type] = array( |
|
| 1218 | + 0 => '', // Unused. Messages start at index 1. |
|
| 1219 | + 1 => sprintf(__('%s updated. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name),
|
|
| 1220 | + 2 => __('Custom field updated.', 'geodirectory'),
|
|
| 1221 | + 3 => __('Custom field deleted.', 'geodirectory'),
|
|
| 1222 | + 4 => sprintf(__('%s updated.', 'geodirectory'), $post_object->labels->singular_name),
|
|
| 1223 | + 5 => isset($_GET['revision']) ? sprintf(__('%s restored to revision from %s', 'geodirectory'), $post_object->labels->singular_name, wp_post_revision_title((int)$_GET['revision'], false)) : false,
|
|
| 1224 | + 6 => sprintf(__('%s published. <a href="%s">View %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(get_permalink($post_ID)), $post_object->labels->singular_name),
|
|
| 1225 | + 7 => sprintf(__('%s saved.', 'geodirectory'), $post_object->labels->singular_name),
|
|
| 1226 | + 8 => sprintf(__('%s submitted. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name),
|
|
| 1227 | + 9 => sprintf(__('%s scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, date_i18n(__('M j, Y @ G:i', 'geodirectory'), strtotime($post->post_date)), esc_url(get_permalink($post_ID)), $post_object->labels->singular_name),
|
|
| 1228 | + 10 => sprintf(__('%s draft updated. <a target="_blank" href="%s">Preview %s</a>', 'geodirectory'), $post_object->labels->singular_name, esc_url(add_query_arg('preview', 'true', get_permalink($post_ID))), $post_object->labels->singular_name),
|
|
| 1229 | + ); |
|
| 1230 | + } |
|
| 1231 | + |
|
| 1232 | + return $messages; |
|
| 1233 | 1233 | } |
| 1234 | 1234 | |
| 1235 | 1235 | |
@@ -1244,183 +1244,183 @@ discard block |
||
| 1244 | 1244 | function geodir_register_defaults() |
| 1245 | 1245 | {
|
| 1246 | 1246 | |
| 1247 | - global $wpdb; |
|
| 1248 | - |
|
| 1249 | - $menu_icon = geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico'; |
|
| 1250 | - |
|
| 1251 | - if (!$listing_slug = get_option('geodir_listing_prefix'))
|
|
| 1252 | - $listing_slug = 'places'; |
|
| 1253 | - |
|
| 1254 | - /** |
|
| 1255 | - * Taxonomies |
|
| 1256 | - **/ |
|
| 1257 | - //if ( ! taxonomy_exists('gd_place_tags') )
|
|
| 1258 | - {
|
|
| 1259 | - |
|
| 1260 | - $gd_placetags = array(); |
|
| 1261 | - $gd_placetags['object_type'] = 'gd_place'; |
|
| 1262 | - $gd_placetags['listing_slug'] = $listing_slug . '/tags'; |
|
| 1263 | - $gd_placetags['args'] = array( |
|
| 1264 | - 'public' => true, |
|
| 1265 | - 'hierarchical' => false, |
|
| 1266 | - 'rewrite' => array('slug' => $listing_slug . '/tags', 'with_front' => false, 'hierarchical' => true),
|
|
| 1267 | - 'query_var' => true, |
|
| 1268 | - |
|
| 1269 | - 'labels' => array( |
|
| 1270 | - 'name' => __('Place Tags', 'geodirectory'),
|
|
| 1271 | - 'singular_name' => __('Place Tag', 'geodirectory'),
|
|
| 1272 | - 'search_items' => __('Search Place Tags', 'geodirectory'),
|
|
| 1273 | - 'popular_items' => __('Popular Place Tags', 'geodirectory'),
|
|
| 1274 | - 'all_items' => __('All Place Tags', 'geodirectory'),
|
|
| 1275 | - 'edit_item' => __('Edit Place Tag', 'geodirectory'),
|
|
| 1276 | - 'update_item' => __('Update Place Tag', 'geodirectory'),
|
|
| 1277 | - 'add_new_item' => __('Add New Place Tag', 'geodirectory'),
|
|
| 1278 | - 'new_item_name' => __('New Place Tag Name', 'geodirectory'),
|
|
| 1279 | - 'add_or_remove_items' => __('Add or remove Place tags', 'geodirectory'),
|
|
| 1280 | - 'choose_from_most_used' => __('Choose from the most used Place tags', 'geodirectory'),
|
|
| 1281 | - 'separate_items_with_commas' => __('Separate Place tags with commas', 'geodirectory'),
|
|
| 1282 | - ), |
|
| 1283 | - ); |
|
| 1284 | - |
|
| 1285 | - |
|
| 1286 | - $geodir_taxonomies = get_option('geodir_taxonomies');
|
|
| 1287 | - $geodir_taxonomies['gd_place_tags'] = $gd_placetags; |
|
| 1288 | - update_option('geodir_taxonomies', $geodir_taxonomies);
|
|
| 1289 | - |
|
| 1290 | - |
|
| 1291 | - // Update post types and delete tmp options |
|
| 1292 | - flush_rewrite_rules(); |
|
| 1293 | - |
|
| 1294 | - } |
|
| 1295 | - |
|
| 1296 | - //if ( ! taxonomy_exists('gd_placecategory') )
|
|
| 1297 | - {
|
|
| 1298 | - |
|
| 1299 | - $gd_placecategory = array(); |
|
| 1300 | - $gd_placecategory['object_type'] = 'gd_place'; |
|
| 1301 | - $gd_placecategory['listing_slug'] = $listing_slug; |
|
| 1302 | - $gd_placecategory['args'] = array( |
|
| 1303 | - 'public' => true, |
|
| 1304 | - 'hierarchical' => true, |
|
| 1305 | - 'rewrite' => array('slug' => $listing_slug, 'with_front' => false, 'hierarchical' => true),
|
|
| 1306 | - 'query_var' => true, |
|
| 1307 | - 'labels' => array( |
|
| 1308 | - 'name' => __('Place Categories', 'geodirectory'),
|
|
| 1309 | - 'singular_name' => __('Place Category', 'geodirectory'),
|
|
| 1310 | - 'search_items' => __('Search Place Categories', 'geodirectory'),
|
|
| 1311 | - 'popular_items' => __('Popular Place Categories', 'geodirectory'),
|
|
| 1312 | - 'all_items' => __('All Place Categories', 'geodirectory'),
|
|
| 1313 | - 'edit_item' => __('Edit Place Category', 'geodirectory'),
|
|
| 1314 | - 'update_item' => __('Update Place Category', 'geodirectory'),
|
|
| 1315 | - 'add_new_item' => __('Add New Place Category', 'geodirectory'),
|
|
| 1316 | - 'new_item_name' => __('New Place Category', 'geodirectory'),
|
|
| 1317 | - 'add_or_remove_items' => __('Add or remove Place categories', 'geodirectory'),
|
|
| 1318 | - ), |
|
| 1319 | - ); |
|
| 1320 | - |
|
| 1321 | - |
|
| 1322 | - $geodir_taxonomies = get_option('geodir_taxonomies');
|
|
| 1323 | - $geodir_taxonomies['gd_placecategory'] = $gd_placecategory; |
|
| 1324 | - update_option('geodir_taxonomies', $geodir_taxonomies);
|
|
| 1325 | - |
|
| 1326 | - |
|
| 1327 | - flush_rewrite_rules(); |
|
| 1328 | - } |
|
| 1329 | - |
|
| 1330 | - /** |
|
| 1331 | - * Post Types |
|
| 1332 | - **/ |
|
| 1333 | - |
|
| 1334 | - //if ( ! post_type_exists('gd_place') )
|
|
| 1335 | - {
|
|
| 1336 | - |
|
| 1337 | - $labels = array( |
|
| 1338 | - 'name' => __('Places', 'geodirectory'),
|
|
| 1339 | - 'singular_name' => __('Place', 'geodirectory'),
|
|
| 1340 | - 'add_new' => __('Add New', 'geodirectory'),
|
|
| 1341 | - 'add_new_item' => __('Add New Place', 'geodirectory'),
|
|
| 1342 | - 'edit_item' => __('Edit Place', 'geodirectory'),
|
|
| 1343 | - 'new_item' => __('New Place', 'geodirectory'),
|
|
| 1344 | - 'view_item' => __('View Place', 'geodirectory'),
|
|
| 1345 | - 'search_items' => __('Search Places', 'geodirectory'),
|
|
| 1346 | - 'not_found' => __('No Place Found', 'geodirectory'),
|
|
| 1347 | - 'not_found_in_trash' => __('No Place Found In Trash', 'geodirectory'));
|
|
| 1348 | - |
|
| 1349 | - $place_default = array( |
|
| 1350 | - 'labels' => $labels, |
|
| 1351 | - 'can_export' => true, |
|
| 1352 | - 'capability_type' => 'post', |
|
| 1353 | - 'description' => 'Place post type.', |
|
| 1354 | - 'has_archive' => $listing_slug, |
|
| 1355 | - 'hierarchical' => false, |
|
| 1356 | - 'map_meta_cap' => true, |
|
| 1357 | - 'menu_icon' => $menu_icon, |
|
| 1358 | - 'public' => true, |
|
| 1359 | - 'query_var' => true, |
|
| 1360 | - 'rewrite' => array('slug' => $listing_slug , 'with_front' => false, 'hierarchical' => true, 'feeds' => true),
|
|
| 1361 | - 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', /*'revisions', 'post-formats'*/),
|
|
| 1362 | - 'taxonomies' => array('gd_placecategory', 'gd_place_tags'));
|
|
| 1363 | - |
|
| 1364 | - //Update custom post types |
|
| 1365 | - $geodir_post_types = get_option('geodir_post_types');
|
|
| 1366 | - $geodir_post_types['gd_place'] = $place_default; |
|
| 1367 | - update_option('geodir_post_types', $geodir_post_types);
|
|
| 1368 | - |
|
| 1369 | - // Update post types and delete tmp options |
|
| 1370 | - flush_rewrite_rules(); |
|
| 1371 | - } |
|
| 1372 | - |
|
| 1373 | - |
|
| 1374 | - geodir_register_taxonomies(); |
|
| 1375 | - geodir_register_post_types(); |
|
| 1376 | - |
|
| 1377 | - //die; |
|
| 1247 | + global $wpdb; |
|
| 1248 | + |
|
| 1249 | + $menu_icon = geodir_plugin_url() . '/geodirectory-assets/images/favicon.ico'; |
|
| 1250 | + |
|
| 1251 | + if (!$listing_slug = get_option('geodir_listing_prefix'))
|
|
| 1252 | + $listing_slug = 'places'; |
|
| 1253 | + |
|
| 1254 | + /** |
|
| 1255 | + * Taxonomies |
|
| 1256 | + **/ |
|
| 1257 | + //if ( ! taxonomy_exists('gd_place_tags') )
|
|
| 1258 | + {
|
|
| 1259 | + |
|
| 1260 | + $gd_placetags = array(); |
|
| 1261 | + $gd_placetags['object_type'] = 'gd_place'; |
|
| 1262 | + $gd_placetags['listing_slug'] = $listing_slug . '/tags'; |
|
| 1263 | + $gd_placetags['args'] = array( |
|
| 1264 | + 'public' => true, |
|
| 1265 | + 'hierarchical' => false, |
|
| 1266 | + 'rewrite' => array('slug' => $listing_slug . '/tags', 'with_front' => false, 'hierarchical' => true),
|
|
| 1267 | + 'query_var' => true, |
|
| 1268 | + |
|
| 1269 | + 'labels' => array( |
|
| 1270 | + 'name' => __('Place Tags', 'geodirectory'),
|
|
| 1271 | + 'singular_name' => __('Place Tag', 'geodirectory'),
|
|
| 1272 | + 'search_items' => __('Search Place Tags', 'geodirectory'),
|
|
| 1273 | + 'popular_items' => __('Popular Place Tags', 'geodirectory'),
|
|
| 1274 | + 'all_items' => __('All Place Tags', 'geodirectory'),
|
|
| 1275 | + 'edit_item' => __('Edit Place Tag', 'geodirectory'),
|
|
| 1276 | + 'update_item' => __('Update Place Tag', 'geodirectory'),
|
|
| 1277 | + 'add_new_item' => __('Add New Place Tag', 'geodirectory'),
|
|
| 1278 | + 'new_item_name' => __('New Place Tag Name', 'geodirectory'),
|
|
| 1279 | + 'add_or_remove_items' => __('Add or remove Place tags', 'geodirectory'),
|
|
| 1280 | + 'choose_from_most_used' => __('Choose from the most used Place tags', 'geodirectory'),
|
|
| 1281 | + 'separate_items_with_commas' => __('Separate Place tags with commas', 'geodirectory'),
|
|
| 1282 | + ), |
|
| 1283 | + ); |
|
| 1284 | + |
|
| 1285 | + |
|
| 1286 | + $geodir_taxonomies = get_option('geodir_taxonomies');
|
|
| 1287 | + $geodir_taxonomies['gd_place_tags'] = $gd_placetags; |
|
| 1288 | + update_option('geodir_taxonomies', $geodir_taxonomies);
|
|
| 1289 | + |
|
| 1290 | + |
|
| 1291 | + // Update post types and delete tmp options |
|
| 1292 | + flush_rewrite_rules(); |
|
| 1293 | + |
|
| 1294 | + } |
|
| 1295 | + |
|
| 1296 | + //if ( ! taxonomy_exists('gd_placecategory') )
|
|
| 1297 | + {
|
|
| 1298 | + |
|
| 1299 | + $gd_placecategory = array(); |
|
| 1300 | + $gd_placecategory['object_type'] = 'gd_place'; |
|
| 1301 | + $gd_placecategory['listing_slug'] = $listing_slug; |
|
| 1302 | + $gd_placecategory['args'] = array( |
|
| 1303 | + 'public' => true, |
|
| 1304 | + 'hierarchical' => true, |
|
| 1305 | + 'rewrite' => array('slug' => $listing_slug, 'with_front' => false, 'hierarchical' => true),
|
|
| 1306 | + 'query_var' => true, |
|
| 1307 | + 'labels' => array( |
|
| 1308 | + 'name' => __('Place Categories', 'geodirectory'),
|
|
| 1309 | + 'singular_name' => __('Place Category', 'geodirectory'),
|
|
| 1310 | + 'search_items' => __('Search Place Categories', 'geodirectory'),
|
|
| 1311 | + 'popular_items' => __('Popular Place Categories', 'geodirectory'),
|
|
| 1312 | + 'all_items' => __('All Place Categories', 'geodirectory'),
|
|
| 1313 | + 'edit_item' => __('Edit Place Category', 'geodirectory'),
|
|
| 1314 | + 'update_item' => __('Update Place Category', 'geodirectory'),
|
|
| 1315 | + 'add_new_item' => __('Add New Place Category', 'geodirectory'),
|
|
| 1316 | + 'new_item_name' => __('New Place Category', 'geodirectory'),
|
|
| 1317 | + 'add_or_remove_items' => __('Add or remove Place categories', 'geodirectory'),
|
|
| 1318 | + ), |
|
| 1319 | + ); |
|
| 1320 | + |
|
| 1321 | + |
|
| 1322 | + $geodir_taxonomies = get_option('geodir_taxonomies');
|
|
| 1323 | + $geodir_taxonomies['gd_placecategory'] = $gd_placecategory; |
|
| 1324 | + update_option('geodir_taxonomies', $geodir_taxonomies);
|
|
| 1325 | + |
|
| 1326 | + |
|
| 1327 | + flush_rewrite_rules(); |
|
| 1328 | + } |
|
| 1329 | + |
|
| 1330 | + /** |
|
| 1331 | + * Post Types |
|
| 1332 | + **/ |
|
| 1333 | + |
|
| 1334 | + //if ( ! post_type_exists('gd_place') )
|
|
| 1335 | + {
|
|
| 1336 | + |
|
| 1337 | + $labels = array( |
|
| 1338 | + 'name' => __('Places', 'geodirectory'),
|
|
| 1339 | + 'singular_name' => __('Place', 'geodirectory'),
|
|
| 1340 | + 'add_new' => __('Add New', 'geodirectory'),
|
|
| 1341 | + 'add_new_item' => __('Add New Place', 'geodirectory'),
|
|
| 1342 | + 'edit_item' => __('Edit Place', 'geodirectory'),
|
|
| 1343 | + 'new_item' => __('New Place', 'geodirectory'),
|
|
| 1344 | + 'view_item' => __('View Place', 'geodirectory'),
|
|
| 1345 | + 'search_items' => __('Search Places', 'geodirectory'),
|
|
| 1346 | + 'not_found' => __('No Place Found', 'geodirectory'),
|
|
| 1347 | + 'not_found_in_trash' => __('No Place Found In Trash', 'geodirectory'));
|
|
| 1348 | + |
|
| 1349 | + $place_default = array( |
|
| 1350 | + 'labels' => $labels, |
|
| 1351 | + 'can_export' => true, |
|
| 1352 | + 'capability_type' => 'post', |
|
| 1353 | + 'description' => 'Place post type.', |
|
| 1354 | + 'has_archive' => $listing_slug, |
|
| 1355 | + 'hierarchical' => false, |
|
| 1356 | + 'map_meta_cap' => true, |
|
| 1357 | + 'menu_icon' => $menu_icon, |
|
| 1358 | + 'public' => true, |
|
| 1359 | + 'query_var' => true, |
|
| 1360 | + 'rewrite' => array('slug' => $listing_slug , 'with_front' => false, 'hierarchical' => true, 'feeds' => true),
|
|
| 1361 | + 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'custom-fields', 'comments', /*'revisions', 'post-formats'*/),
|
|
| 1362 | + 'taxonomies' => array('gd_placecategory', 'gd_place_tags'));
|
|
| 1363 | + |
|
| 1364 | + //Update custom post types |
|
| 1365 | + $geodir_post_types = get_option('geodir_post_types');
|
|
| 1366 | + $geodir_post_types['gd_place'] = $place_default; |
|
| 1367 | + update_option('geodir_post_types', $geodir_post_types);
|
|
| 1368 | + |
|
| 1369 | + // Update post types and delete tmp options |
|
| 1370 | + flush_rewrite_rules(); |
|
| 1371 | + } |
|
| 1372 | + |
|
| 1373 | + |
|
| 1374 | + geodir_register_taxonomies(); |
|
| 1375 | + geodir_register_post_types(); |
|
| 1376 | + |
|
| 1377 | + //die; |
|
| 1378 | 1378 | |
| 1379 | 1379 | } |
| 1380 | 1380 | |
| 1381 | 1381 | $gd_wpml_get_languages = ""; |
| 1382 | 1382 | function gd_wpml_get_lang_from_url($url){
|
| 1383 | 1383 | |
| 1384 | - global $gd_wpml_get_languages; |
|
| 1385 | - if(isset($_REQUEST['lang']) && $_REQUEST['lang']){return $_REQUEST['lang'];}
|
|
| 1384 | + global $gd_wpml_get_languages; |
|
| 1385 | + if(isset($_REQUEST['lang']) && $_REQUEST['lang']){return $_REQUEST['lang'];}
|
|
| 1386 | 1386 | |
| 1387 | 1387 | |
| 1388 | - // |
|
| 1389 | - $url = str_replace(array("http://","https://"),"",$url);
|
|
| 1388 | + // |
|
| 1389 | + $url = str_replace(array("http://","https://"),"",$url);
|
|
| 1390 | 1390 | |
| 1391 | - // site_url() seems to work better than get_bloginfo('url') here, WPML can change get_bloginfo('url') to add the lang.
|
|
| 1392 | - $site_url = str_replace(array("http://","https://"),"",site_url());
|
|
| 1391 | + // site_url() seems to work better than get_bloginfo('url') here, WPML can change get_bloginfo('url') to add the lang.
|
|
| 1392 | + $site_url = str_replace(array("http://","https://"),"",site_url());
|
|
| 1393 | 1393 | |
| 1394 | - $url = str_replace($site_url,"",$url); |
|
| 1394 | + $url = str_replace($site_url,"",$url); |
|
| 1395 | 1395 | |
| 1396 | 1396 | |
| 1397 | - $segments = explode('/', trim($url, '/'));
|
|
| 1397 | + $segments = explode('/', trim($url, '/'));
|
|
| 1398 | 1398 | |
| 1399 | - //print_r( $segments); |
|
| 1400 | - if($gd_wpml_get_languages){
|
|
| 1401 | - $langs = $gd_wpml_get_languages; |
|
| 1402 | - }else{
|
|
| 1403 | - global $sitepress; |
|
| 1404 | - $gd_wpml_get_languages = $sitepress->get_active_languages(); |
|
| 1405 | - } |
|
| 1399 | + //print_r( $segments); |
|
| 1400 | + if($gd_wpml_get_languages){
|
|
| 1401 | + $langs = $gd_wpml_get_languages; |
|
| 1402 | + }else{
|
|
| 1403 | + global $sitepress; |
|
| 1404 | + $gd_wpml_get_languages = $sitepress->get_active_languages(); |
|
| 1405 | + } |
|
| 1406 | 1406 | |
| 1407 | - if (isset($segments[0]) && $segments[0] && array_key_exists($segments[0], $gd_wpml_get_languages)) {
|
|
| 1408 | - return $segments[0]; |
|
| 1409 | - } |
|
| 1407 | + if (isset($segments[0]) && $segments[0] && array_key_exists($segments[0], $gd_wpml_get_languages)) {
|
|
| 1408 | + return $segments[0]; |
|
| 1409 | + } |
|
| 1410 | 1410 | |
| 1411 | - return false; |
|
| 1411 | + return false; |
|
| 1412 | 1412 | |
| 1413 | 1413 | |
| 1414 | 1414 | } |
| 1415 | 1415 | |
| 1416 | 1416 | function gd_wpml_slug_translation_turned_on($post_type) {
|
| 1417 | 1417 | |
| 1418 | - global $sitepress; |
|
| 1419 | - $settings = $sitepress->get_settings(); |
|
| 1420 | - return isset($settings['posts_slug_translation']['types'][$post_type]) |
|
| 1421 | - && $settings['posts_slug_translation']['types'][$post_type] |
|
| 1422 | - && isset($settings['posts_slug_translation']['on']) |
|
| 1423 | - && $settings['posts_slug_translation']['on']; |
|
| 1418 | + global $sitepress; |
|
| 1419 | + $settings = $sitepress->get_settings(); |
|
| 1420 | + return isset($settings['posts_slug_translation']['types'][$post_type]) |
|
| 1421 | + && $settings['posts_slug_translation']['types'][$post_type] |
|
| 1422 | + && isset($settings['posts_slug_translation']['on']) |
|
| 1423 | + && $settings['posts_slug_translation']['on']; |
|
| 1424 | 1424 | } |
| 1425 | 1425 | |
| 1426 | 1426 | |
@@ -1445,150 +1445,150 @@ discard block |
||
| 1445 | 1445 | */ |
| 1446 | 1446 | function geodir_listing_permalink_structure($post_link, $post_obj, $leavename, $sample) |
| 1447 | 1447 | {
|
| 1448 | - //echo $post_link."<br />".$sample ; |
|
| 1448 | + //echo $post_link."<br />".$sample ; |
|
| 1449 | 1449 | |
| 1450 | 1450 | |
| 1451 | - global $wpdb, $wp_query, $plugin_prefix, $post, $comment_post_cache, $gd_permalink_cache; |
|
| 1452 | - if (isset($post_obj->ID) && isset($post->ID) && $post_obj->ID == $post->ID) {
|
|
| 1453 | - } elseif (isset($post_obj->post_status) && $post_obj->post_status == 'auto-draft') {
|
|
| 1454 | - return $post_link; |
|
| 1455 | - } else {
|
|
| 1456 | - $orig_post = $post; |
|
| 1457 | - $post = $post_obj; |
|
| 1458 | - } |
|
| 1451 | + global $wpdb, $wp_query, $plugin_prefix, $post, $comment_post_cache, $gd_permalink_cache; |
|
| 1452 | + if (isset($post_obj->ID) && isset($post->ID) && $post_obj->ID == $post->ID) {
|
|
| 1453 | + } elseif (isset($post_obj->post_status) && $post_obj->post_status == 'auto-draft') {
|
|
| 1454 | + return $post_link; |
|
| 1455 | + } else {
|
|
| 1456 | + $orig_post = $post; |
|
| 1457 | + $post = $post_obj; |
|
| 1458 | + } |
|
| 1459 | 1459 | |
| 1460 | - if (in_array($post->post_type, geodir_get_posttypes())) {
|
|
| 1460 | + if (in_array($post->post_type, geodir_get_posttypes())) {
|
|
| 1461 | 1461 | |
| 1462 | 1462 | |
| 1463 | - $post_types = get_option('geodir_post_types');
|
|
| 1464 | - $slug = $post_types[$post->post_type]['rewrite']['slug']; |
|
| 1463 | + $post_types = get_option('geodir_post_types');
|
|
| 1464 | + $slug = $post_types[$post->post_type]['rewrite']['slug']; |
|
| 1465 | 1465 | |
| 1466 | - // Alter the CPT slug if WPML is set to do so |
|
| 1467 | - if(function_exists('icl_object_id')){
|
|
| 1468 | - if ( gd_wpml_slug_translation_turned_on( $post->post_type ) && $language_code = gd_wpml_get_lang_from_url($post_link)) {
|
|
| 1466 | + // Alter the CPT slug if WPML is set to do so |
|
| 1467 | + if(function_exists('icl_object_id')){
|
|
| 1468 | + if ( gd_wpml_slug_translation_turned_on( $post->post_type ) && $language_code = gd_wpml_get_lang_from_url($post_link)) {
|
|
| 1469 | 1469 | |
| 1470 | - $org_slug = $slug; |
|
| 1471 | - $slug = apply_filters( 'wpml_translate_single_string', |
|
| 1472 | - $slug, |
|
| 1473 | - 'WordPress', |
|
| 1474 | - 'URL slug: ' . $slug, |
|
| 1475 | - $language_code); |
|
| 1470 | + $org_slug = $slug; |
|
| 1471 | + $slug = apply_filters( 'wpml_translate_single_string', |
|
| 1472 | + $slug, |
|
| 1473 | + 'WordPress', |
|
| 1474 | + 'URL slug: ' . $slug, |
|
| 1475 | + $language_code); |
|
| 1476 | 1476 | |
| 1477 | - if(!$slug){$slug = $org_slug;}
|
|
| 1477 | + if(!$slug){$slug = $org_slug;}
|
|
| 1478 | 1478 | |
| 1479 | - } |
|
| 1480 | - } |
|
| 1479 | + } |
|
| 1480 | + } |
|
| 1481 | 1481 | |
| 1482 | - if (function_exists('geodir_location_geo_home_link')) {
|
|
| 1483 | - remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
|
|
| 1484 | - } |
|
| 1482 | + if (function_exists('geodir_location_geo_home_link')) {
|
|
| 1483 | + remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
|
|
| 1484 | + } |
|
| 1485 | 1485 | |
| 1486 | - // Fix slug problem when slug matches part of host or base url/ Ex: url -> www.abcxyz.com & slug -> xyz. |
|
| 1487 | - $site_url = trailingslashit(get_bloginfo('url'));
|
|
| 1486 | + // Fix slug problem when slug matches part of host or base url/ Ex: url -> www.abcxyz.com & slug -> xyz. |
|
| 1487 | + $site_url = trailingslashit(get_bloginfo('url'));
|
|
| 1488 | 1488 | |
| 1489 | - if (function_exists('geodir_location_geo_home_link')) {
|
|
| 1490 | - add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
|
|
| 1491 | - } |
|
| 1492 | - |
|
| 1493 | - $fix_url = strpos($post_link, $site_url) === 0 ? true : false; |
|
| 1494 | - if ($fix_url) {
|
|
| 1495 | - $post_link = str_replace($site_url, '', $post_link); |
|
| 1496 | - } |
|
| 1497 | - |
|
| 1498 | - $post_link = trailingslashit( |
|
| 1499 | - preg_replace( "/" . preg_quote( $slug, "/" ) . "/", $slug ."/%gd_taxonomy%",$post_link, 1 ) |
|
| 1500 | - ); |
|
| 1501 | - |
|
| 1502 | - if ($fix_url) {
|
|
| 1503 | - $post_link = $site_url . $post_link; |
|
| 1504 | - } |
|
| 1505 | - |
|
| 1506 | - if (isset($comment_post_cache[$post->ID])) {
|
|
| 1507 | - $post = $comment_post_cache[$post->ID]; |
|
| 1508 | - } |
|
| 1509 | - if (isset($gd_permalink_cache[$post->ID]) && $gd_permalink_cache[$post->ID] && !$sample) {
|
|
| 1510 | - $post_id = $post->ID; |
|
| 1511 | - if (isset($orig_post)) {
|
|
| 1512 | - $post = $orig_post; |
|
| 1513 | - } |
|
| 1514 | - return $gd_permalink_cache[$post_id]; |
|
| 1515 | - } |
|
| 1489 | + if (function_exists('geodir_location_geo_home_link')) {
|
|
| 1490 | + add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
|
|
| 1491 | + } |
|
| 1516 | 1492 | |
| 1517 | - if (!isset($post->post_locations)) {
|
|
| 1518 | - $post_type = $post->post_type; |
|
| 1519 | - $ID = $post->ID; |
|
| 1520 | - $post2 = $wpdb->get_row( |
|
| 1521 | - $wpdb->prepare( |
|
| 1522 | - "SELECT * from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
| 1523 | - array($post->ID) |
|
| 1524 | - ) |
|
| 1525 | - ); |
|
| 1493 | + $fix_url = strpos($post_link, $site_url) === 0 ? true : false; |
|
| 1494 | + if ($fix_url) {
|
|
| 1495 | + $post_link = str_replace($site_url, '', $post_link); |
|
| 1496 | + } |
|
| 1526 | 1497 | |
| 1527 | - $post = (object)array_merge((array)$post, (array)$post2); |
|
| 1498 | + $post_link = trailingslashit( |
|
| 1499 | + preg_replace( "/" . preg_quote( $slug, "/" ) . "/", $slug ."/%gd_taxonomy%",$post_link, 1 ) |
|
| 1500 | + ); |
|
| 1528 | 1501 | |
| 1529 | - $comment_post_cache[$post->ID] = $post; |
|
| 1530 | - } |
|
| 1502 | + if ($fix_url) {
|
|
| 1503 | + $post_link = $site_url . $post_link; |
|
| 1504 | + } |
|
| 1531 | 1505 | |
| 1506 | + if (isset($comment_post_cache[$post->ID])) {
|
|
| 1507 | + $post = $comment_post_cache[$post->ID]; |
|
| 1508 | + } |
|
| 1509 | + if (isset($gd_permalink_cache[$post->ID]) && $gd_permalink_cache[$post->ID] && !$sample) {
|
|
| 1510 | + $post_id = $post->ID; |
|
| 1511 | + if (isset($orig_post)) {
|
|
| 1512 | + $post = $orig_post; |
|
| 1513 | + } |
|
| 1514 | + return $gd_permalink_cache[$post_id]; |
|
| 1515 | + } |
|
| 1532 | 1516 | |
| 1517 | + if (!isset($post->post_locations)) {
|
|
| 1518 | + $post_type = $post->post_type; |
|
| 1519 | + $ID = $post->ID; |
|
| 1520 | + $post2 = $wpdb->get_row( |
|
| 1521 | + $wpdb->prepare( |
|
| 1522 | + "SELECT * from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
| 1523 | + array($post->ID) |
|
| 1524 | + ) |
|
| 1525 | + ); |
|
| 1533 | 1526 | |
| 1534 | - if (false !== strpos($post_link, '%gd_taxonomy%')) {
|
|
| 1527 | + $post = (object)array_merge((array)$post, (array)$post2); |
|
| 1535 | 1528 | |
| 1536 | - if ( apply_filters("geodir_add_location_url_to_url",get_option('geodir_add_location_url'),$post->post_type,$post)) {
|
|
| 1537 | - $location_request = ''; |
|
| 1529 | + $comment_post_cache[$post->ID] = $post; |
|
| 1530 | + } |
|
| 1538 | 1531 | |
| 1539 | 1532 | |
| 1540 | - if (!empty($post->post_locations)) {
|
|
| 1541 | - $geodir_arr_locations = explode(',', $post->post_locations);
|
|
| 1542 | - if (count($geodir_arr_locations) == 3) {
|
|
| 1543 | - $post->city_slug = str_replace('[', '', $geodir_arr_locations[0]);
|
|
| 1544 | - $post->city_slug = str_replace(']', '', $post->city_slug);
|
|
| 1545 | - $post->region_slug = str_replace('[', '', $geodir_arr_locations[1]);
|
|
| 1546 | - $post->region_slug = str_replace(']', '', $post->region_slug);
|
|
| 1547 | - $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]);
|
|
| 1548 | - $post->country_slug = str_replace(']', '', $post->country_slug);
|
|
| 1549 | 1533 | |
| 1550 | - $post_location = (object)array('country_slug' => $post->country_slug,
|
|
| 1551 | - 'region_slug' => $post->region_slug, |
|
| 1552 | - 'city_slug' => $post->city_slug |
|
| 1553 | - ); |
|
| 1534 | + if (false !== strpos($post_link, '%gd_taxonomy%')) {
|
|
| 1554 | 1535 | |
| 1555 | - } else |
|
| 1556 | - $post_location = geodir_get_location(); |
|
| 1536 | + if ( apply_filters("geodir_add_location_url_to_url",get_option('geodir_add_location_url'),$post->post_type,$post)) {
|
|
| 1537 | + $location_request = ''; |
|
| 1557 | 1538 | |
| 1558 | 1539 | |
| 1559 | - } else {
|
|
| 1540 | + if (!empty($post->post_locations)) {
|
|
| 1541 | + $geodir_arr_locations = explode(',', $post->post_locations);
|
|
| 1542 | + if (count($geodir_arr_locations) == 3) {
|
|
| 1543 | + $post->city_slug = str_replace('[', '', $geodir_arr_locations[0]);
|
|
| 1544 | + $post->city_slug = str_replace(']', '', $post->city_slug);
|
|
| 1545 | + $post->region_slug = str_replace('[', '', $geodir_arr_locations[1]);
|
|
| 1546 | + $post->region_slug = str_replace(']', '', $post->region_slug);
|
|
| 1547 | + $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]);
|
|
| 1548 | + $post->country_slug = str_replace(']', '', $post->country_slug);
|
|
| 1560 | 1549 | |
| 1561 | - $post_location_sql = $wpdb->get_results( |
|
| 1562 | - $wpdb->prepare( |
|
| 1563 | - "SELECT post_locations from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
| 1564 | - array($post->ID) |
|
| 1565 | - ) |
|
| 1566 | - ); |
|
| 1567 | - |
|
| 1568 | - if (!empty($post_location_sql) && is_array($post_location_sql) && !empty($post_location_sql[0]->post_locations)) {
|
|
| 1569 | - |
|
| 1570 | - $geodir_arr_locations = explode(',', $post_location_sql[0]->post_locations);
|
|
| 1571 | - if (count($geodir_arr_locations) == 3) {
|
|
| 1572 | - $post->city_slug = str_replace('[', '', $geodir_arr_locations[0]);
|
|
| 1573 | - $post->city_slug = str_replace(']', '', $post->city_slug);
|
|
| 1574 | - $post->region_slug = str_replace('[', '', $geodir_arr_locations[1]);
|
|
| 1575 | - $post->region_slug = str_replace(']', '', $post->region_slug);
|
|
| 1576 | - $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]);
|
|
| 1577 | - $post->country_slug = str_replace(']', '', $post->country_slug);
|
|
| 1578 | - |
|
| 1579 | - $post_location = (object)array('country_slug' => $post->country_slug,
|
|
| 1580 | - 'region_slug' => $post->region_slug, |
|
| 1581 | - 'city_slug' => $post->city_slug |
|
| 1582 | - ); |
|
| 1550 | + $post_location = (object)array('country_slug' => $post->country_slug,
|
|
| 1551 | + 'region_slug' => $post->region_slug, |
|
| 1552 | + 'city_slug' => $post->city_slug |
|
| 1553 | + ); |
|
| 1583 | 1554 | |
| 1584 | - } |
|
| 1585 | - } else |
|
| 1586 | - $post_location = geodir_get_location(); |
|
| 1587 | - } |
|
| 1555 | + } else |
|
| 1556 | + $post_location = geodir_get_location(); |
|
| 1588 | 1557 | |
| 1589 | 1558 | |
| 1590 | - if (!empty($post_location)) {
|
|
| 1591 | - $country_slug = isset($post_location->country_slug) ? $post_location->country_slug : ''; |
|
| 1559 | + } else {
|
|
| 1560 | + |
|
| 1561 | + $post_location_sql = $wpdb->get_results( |
|
| 1562 | + $wpdb->prepare( |
|
| 1563 | + "SELECT post_locations from " . $plugin_prefix . $post->post_type . "_detail WHERE post_id = %d ", |
|
| 1564 | + array($post->ID) |
|
| 1565 | + ) |
|
| 1566 | + ); |
|
| 1567 | + |
|
| 1568 | + if (!empty($post_location_sql) && is_array($post_location_sql) && !empty($post_location_sql[0]->post_locations)) {
|
|
| 1569 | + |
|
| 1570 | + $geodir_arr_locations = explode(',', $post_location_sql[0]->post_locations);
|
|
| 1571 | + if (count($geodir_arr_locations) == 3) {
|
|
| 1572 | + $post->city_slug = str_replace('[', '', $geodir_arr_locations[0]);
|
|
| 1573 | + $post->city_slug = str_replace(']', '', $post->city_slug);
|
|
| 1574 | + $post->region_slug = str_replace('[', '', $geodir_arr_locations[1]);
|
|
| 1575 | + $post->region_slug = str_replace(']', '', $post->region_slug);
|
|
| 1576 | + $post->country_slug = str_replace('[', '', $geodir_arr_locations[2]);
|
|
| 1577 | + $post->country_slug = str_replace(']', '', $post->country_slug);
|
|
| 1578 | + |
|
| 1579 | + $post_location = (object)array('country_slug' => $post->country_slug,
|
|
| 1580 | + 'region_slug' => $post->region_slug, |
|
| 1581 | + 'city_slug' => $post->city_slug |
|
| 1582 | + ); |
|
| 1583 | + |
|
| 1584 | + } |
|
| 1585 | + } else |
|
| 1586 | + $post_location = geodir_get_location(); |
|
| 1587 | + } |
|
| 1588 | + |
|
| 1589 | + |
|
| 1590 | + if (!empty($post_location)) {
|
|
| 1591 | + $country_slug = isset($post_location->country_slug) ? $post_location->country_slug : ''; |
|
| 1592 | 1592 | $region_slug = isset($post_location->region_slug) ? $post_location->region_slug : ''; |
| 1593 | 1593 | $city_slug = isset($post_location->city_slug) ? $post_location->city_slug : ''; |
| 1594 | 1594 | |
@@ -1606,78 +1606,78 @@ discard block |
||
| 1606 | 1606 | $location_slug[] = $city_slug; |
| 1607 | 1607 | |
| 1608 | 1608 | $location_request .= implode('/', $location_slug) . '/';
|
| 1609 | - } |
|
| 1610 | - } |
|
| 1609 | + } |
|
| 1610 | + } |
|
| 1611 | 1611 | |
| 1612 | - if (get_option('geodir_add_categories_url')) {
|
|
| 1612 | + if (get_option('geodir_add_categories_url')) {
|
|
| 1613 | 1613 | |
| 1614 | - $term_request = ''; |
|
| 1615 | - $taxonomies = geodir_get_taxonomies($post->post_type); |
|
| 1614 | + $term_request = ''; |
|
| 1615 | + $taxonomies = geodir_get_taxonomies($post->post_type); |
|
| 1616 | 1616 | |
| 1617 | - $taxonomies = end($taxonomies); |
|
| 1617 | + $taxonomies = end($taxonomies); |
|
| 1618 | 1618 | |
| 1619 | - if (!empty($post->default_category)) {
|
|
| 1620 | - $post_terms = $post->default_category; |
|
| 1621 | - } else {
|
|
| 1622 | - $post_terms = ''; |
|
| 1619 | + if (!empty($post->default_category)) {
|
|
| 1620 | + $post_terms = $post->default_category; |
|
| 1621 | + } else {
|
|
| 1622 | + $post_terms = ''; |
|
| 1623 | 1623 | |
| 1624 | - if (isset($post->{$taxonomies})) {
|
|
| 1625 | - $post_terms = explode(",", trim($post->{$taxonomies}, ","));
|
|
| 1626 | - $post_terms = $post_terms[0]; |
|
| 1627 | - } |
|
| 1624 | + if (isset($post->{$taxonomies})) {
|
|
| 1625 | + $post_terms = explode(",", trim($post->{$taxonomies}, ","));
|
|
| 1626 | + $post_terms = $post_terms[0]; |
|
| 1627 | + } |
|
| 1628 | 1628 | |
| 1629 | - if (!$post_terms) |
|
| 1630 | - $post_terms = geodir_get_post_meta($post->ID, 'default_category', true); |
|
| 1629 | + if (!$post_terms) |
|
| 1630 | + $post_terms = geodir_get_post_meta($post->ID, 'default_category', true); |
|
| 1631 | 1631 | |
| 1632 | - if (!$post_terms) {
|
|
| 1633 | - $post_terms = geodir_get_post_meta($post->ID, $taxonomies, true); |
|
| 1632 | + if (!$post_terms) {
|
|
| 1633 | + $post_terms = geodir_get_post_meta($post->ID, $taxonomies, true); |
|
| 1634 | 1634 | |
| 1635 | - if ($post_terms) {
|
|
| 1636 | - $post_terms = explode(",", trim($post_terms, ","));
|
|
| 1637 | - $post_terms = $post_terms[0]; |
|
| 1638 | - } |
|
| 1639 | - } |
|
| 1640 | - } |
|
| 1635 | + if ($post_terms) {
|
|
| 1636 | + $post_terms = explode(",", trim($post_terms, ","));
|
|
| 1637 | + $post_terms = $post_terms[0]; |
|
| 1638 | + } |
|
| 1639 | + } |
|
| 1640 | + } |
|
| 1641 | 1641 | |
| 1642 | - $term = get_term_by('id', $post_terms, $taxonomies);
|
|
| 1642 | + $term = get_term_by('id', $post_terms, $taxonomies);
|
|
| 1643 | 1643 | |
| 1644 | - if (!empty($term)) |
|
| 1645 | - $term_request = $term->slug; |
|
| 1646 | - //$term_request = $term->slug.'/'; |
|
| 1647 | - } |
|
| 1644 | + if (!empty($term)) |
|
| 1645 | + $term_request = $term->slug; |
|
| 1646 | + //$term_request = $term->slug.'/'; |
|
| 1647 | + } |
|
| 1648 | 1648 | |
| 1649 | - $request_term = ''; |
|
| 1650 | - $listingurl_separator = ''; |
|
| 1651 | - //$detailurl_separator = get_option('geodir_detailurl_separator');
|
|
| 1652 | - $detailurl_separator = ''; |
|
| 1653 | - if (isset($location_request) && $location_request != '' && isset($term_request) && $term_request != '') {
|
|
| 1654 | - $request_term = $location_request; |
|
| 1655 | - //$listingurl_separator = get_option('geodir_listingurl_separator');
|
|
| 1656 | - //$request_term .= $listingurl_separator.'/'.$term_request; |
|
| 1657 | - $request_term .= $term_request; |
|
| 1649 | + $request_term = ''; |
|
| 1650 | + $listingurl_separator = ''; |
|
| 1651 | + //$detailurl_separator = get_option('geodir_detailurl_separator');
|
|
| 1652 | + $detailurl_separator = ''; |
|
| 1653 | + if (isset($location_request) && $location_request != '' && isset($term_request) && $term_request != '') {
|
|
| 1654 | + $request_term = $location_request; |
|
| 1655 | + //$listingurl_separator = get_option('geodir_listingurl_separator');
|
|
| 1656 | + //$request_term .= $listingurl_separator.'/'.$term_request; |
|
| 1657 | + $request_term .= $term_request; |
|
| 1658 | 1658 | |
| 1659 | - } else {
|
|
| 1660 | - if (isset($location_request) && $location_request != '') $request_term = $location_request; |
|
| 1659 | + } else {
|
|
| 1660 | + if (isset($location_request) && $location_request != '') $request_term = $location_request; |
|
| 1661 | 1661 | |
| 1662 | - if (isset($term_request) && $term_request != '') $request_term .= $term_request; |
|
| 1663 | - } |
|
| 1664 | - $request_term = trim($request_term, '/'); |
|
| 1665 | - if (!empty($request_term)) |
|
| 1666 | - $post_link = str_replace('%gd_taxonomy%', $request_term . $detailurl_separator, $post_link);
|
|
| 1667 | - else |
|
| 1668 | - $post_link = str_replace('/%gd_taxonomy%', $request_term . $detailurl_separator, $post_link);
|
|
| 1669 | - //echo $post_link ; |
|
| 1670 | - } |
|
| 1671 | - // temp cache the permalink |
|
| 1672 | - if (!$sample && (!isset($_REQUEST['geodir_ajax']) || (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] != 'add_listing'))) {
|
|
| 1673 | - $gd_permalink_cache[$post->ID] = $post_link; |
|
| 1674 | - } |
|
| 1675 | - } |
|
| 1676 | - if (isset($orig_post)) {
|
|
| 1677 | - $post = $orig_post; |
|
| 1678 | - } |
|
| 1679 | - |
|
| 1680 | - return $post_link; |
|
| 1662 | + if (isset($term_request) && $term_request != '') $request_term .= $term_request; |
|
| 1663 | + } |
|
| 1664 | + $request_term = trim($request_term, '/'); |
|
| 1665 | + if (!empty($request_term)) |
|
| 1666 | + $post_link = str_replace('%gd_taxonomy%', $request_term . $detailurl_separator, $post_link);
|
|
| 1667 | + else |
|
| 1668 | + $post_link = str_replace('/%gd_taxonomy%', $request_term . $detailurl_separator, $post_link);
|
|
| 1669 | + //echo $post_link ; |
|
| 1670 | + } |
|
| 1671 | + // temp cache the permalink |
|
| 1672 | + if (!$sample && (!isset($_REQUEST['geodir_ajax']) || (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] != 'add_listing'))) {
|
|
| 1673 | + $gd_permalink_cache[$post->ID] = $post_link; |
|
| 1674 | + } |
|
| 1675 | + } |
|
| 1676 | + if (isset($orig_post)) {
|
|
| 1677 | + $post = $orig_post; |
|
| 1678 | + } |
|
| 1679 | + |
|
| 1680 | + return $post_link; |
|
| 1681 | 1681 | } |
| 1682 | 1682 | |
| 1683 | 1683 | /** |
@@ -1693,99 +1693,99 @@ discard block |
||
| 1693 | 1693 | * @return string The term link. |
| 1694 | 1694 | */ |
| 1695 | 1695 | function geodir_term_link($termlink, $term, $taxonomy) {
|
| 1696 | - $geodir_taxonomies = geodir_get_taxonomies('', true);
|
|
| 1696 | + $geodir_taxonomies = geodir_get_taxonomies('', true);
|
|
| 1697 | 1697 | |
| 1698 | - if (isset($taxonomy) && !empty($geodir_taxonomies) && in_array($taxonomy, $geodir_taxonomies)) {
|
|
| 1699 | - global $geodir_add_location_url, $gd_session; |
|
| 1700 | - $include_location = false; |
|
| 1701 | - $request_term = array(); |
|
| 1702 | - $add_location_url = get_option('geodir_add_location_url');
|
|
| 1703 | - $location_manager = defined('POST_LOCATION_TABLE') ? true : false;
|
|
| 1698 | + if (isset($taxonomy) && !empty($geodir_taxonomies) && in_array($taxonomy, $geodir_taxonomies)) {
|
|
| 1699 | + global $geodir_add_location_url, $gd_session; |
|
| 1700 | + $include_location = false; |
|
| 1701 | + $request_term = array(); |
|
| 1702 | + $add_location_url = get_option('geodir_add_location_url');
|
|
| 1703 | + $location_manager = defined('POST_LOCATION_TABLE') ? true : false;
|
|
| 1704 | 1704 | |
| 1705 | - $listing_slug = geodir_get_listing_slug($taxonomy); |
|
| 1705 | + $listing_slug = geodir_get_listing_slug($taxonomy); |
|
| 1706 | 1706 | |
| 1707 | - if ($geodir_add_location_url != NULL && $geodir_add_location_url != '') {
|
|
| 1708 | - if ($geodir_add_location_url && $add_location_url) {
|
|
| 1709 | - $include_location = true; |
|
| 1710 | - } |
|
| 1711 | - } elseif ($add_location_url && $gd_session->get('gd_multi_location') == 1) {
|
|
| 1712 | - $include_location = true; |
|
| 1713 | - } elseif ($add_location_url && $location_manager && geodir_is_page('detail')) {
|
|
| 1714 | - $include_location = true; |
|
| 1715 | - } |
|
| 1716 | - |
|
| 1717 | - if ($include_location) {
|
|
| 1718 | - global $post; |
|
| 1707 | + if ($geodir_add_location_url != NULL && $geodir_add_location_url != '') {
|
|
| 1708 | + if ($geodir_add_location_url && $add_location_url) {
|
|
| 1709 | + $include_location = true; |
|
| 1710 | + } |
|
| 1711 | + } elseif ($add_location_url && $gd_session->get('gd_multi_location') == 1) {
|
|
| 1712 | + $include_location = true; |
|
| 1713 | + } elseif ($add_location_url && $location_manager && geodir_is_page('detail')) {
|
|
| 1714 | + $include_location = true; |
|
| 1715 | + } |
|
| 1716 | + |
|
| 1717 | + if ($include_location) {
|
|
| 1718 | + global $post; |
|
| 1719 | 1719 | |
| 1720 | - $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
|
|
| 1720 | + $neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
|
|
| 1721 | 1721 | |
| 1722 | - if (geodir_is_page('detail') && isset($post->country_slug)) {
|
|
| 1723 | - $location_terms = array( |
|
| 1724 | - 'gd_country' => $post->country_slug, |
|
| 1725 | - 'gd_region' => $post->region_slug, |
|
| 1726 | - 'gd_city' => $post->city_slug |
|
| 1727 | - ); |
|
| 1722 | + if (geodir_is_page('detail') && isset($post->country_slug)) {
|
|
| 1723 | + $location_terms = array( |
|
| 1724 | + 'gd_country' => $post->country_slug, |
|
| 1725 | + 'gd_region' => $post->region_slug, |
|
| 1726 | + 'gd_city' => $post->city_slug |
|
| 1727 | + ); |
|
| 1728 | 1728 | |
| 1729 | - if ($neighbourhood_active && !empty($location_terms['gd_city']) && $gd_ses_neighbourhood = $gd_session->get('gd_neighbourhood')) {
|
|
| 1730 | - $location_terms['gd_neighbourhood'] = $gd_ses_neighbourhood; |
|
| 1731 | - } |
|
| 1732 | - } else {
|
|
| 1733 | - $location_terms = geodir_get_current_location_terms('query_vars');
|
|
| 1734 | - } |
|
| 1729 | + if ($neighbourhood_active && !empty($location_terms['gd_city']) && $gd_ses_neighbourhood = $gd_session->get('gd_neighbourhood')) {
|
|
| 1730 | + $location_terms['gd_neighbourhood'] = $gd_ses_neighbourhood; |
|
| 1731 | + } |
|
| 1732 | + } else {
|
|
| 1733 | + $location_terms = geodir_get_current_location_terms('query_vars');
|
|
| 1734 | + } |
|
| 1735 | 1735 | |
| 1736 | - $geodir_show_location_url = get_option('geodir_show_location_url');
|
|
| 1737 | - $location_terms = geodir_remove_location_terms($location_terms); |
|
| 1736 | + $geodir_show_location_url = get_option('geodir_show_location_url');
|
|
| 1737 | + $location_terms = geodir_remove_location_terms($location_terms); |
|
| 1738 | 1738 | |
| 1739 | - if (!empty($location_terms)) {
|
|
| 1740 | - $url_separator = ''; |
|
| 1739 | + if (!empty($location_terms)) {
|
|
| 1740 | + $url_separator = ''; |
|
| 1741 | 1741 | |
| 1742 | - if (get_option('permalink_structure') != '') {
|
|
| 1743 | - $old_listing_slug = '/' . $listing_slug . '/'; |
|
| 1744 | - $request_term = implode("/", $location_terms);
|
|
| 1745 | - $new_listing_slug = '/' . $listing_slug . '/' . $request_term . '/'; |
|
| 1742 | + if (get_option('permalink_structure') != '') {
|
|
| 1743 | + $old_listing_slug = '/' . $listing_slug . '/'; |
|
| 1744 | + $request_term = implode("/", $location_terms);
|
|
| 1745 | + $new_listing_slug = '/' . $listing_slug . '/' . $request_term . '/'; |
|
| 1746 | 1746 | |
| 1747 | - $termlink = substr_replace($termlink, $new_listing_slug, strpos($termlink, $old_listing_slug), strlen($old_listing_slug)); |
|
| 1748 | - } else {
|
|
| 1749 | - $termlink = geodir_getlink($termlink, $request_term); |
|
| 1750 | - } |
|
| 1751 | - } |
|
| 1752 | - } |
|
| 1747 | + $termlink = substr_replace($termlink, $new_listing_slug, strpos($termlink, $old_listing_slug), strlen($old_listing_slug)); |
|
| 1748 | + } else {
|
|
| 1749 | + $termlink = geodir_getlink($termlink, $request_term); |
|
| 1750 | + } |
|
| 1751 | + } |
|
| 1752 | + } |
|
| 1753 | 1753 | |
| 1754 | - // Alter the CPT slug is WPML is set to do so |
|
| 1755 | - /* we can replace this with the below function |
|
| 1754 | + // Alter the CPT slug is WPML is set to do so |
|
| 1755 | + /* we can replace this with the below function |
|
| 1756 | 1756 | if(function_exists('icl_object_id')){
|
| 1757 | 1757 | global $sitepress; |
| 1758 | 1758 | $post_type = str_replace("category","",$taxonomy);
|
| 1759 | 1759 | $termlink = $sitepress->post_type_archive_link_filter( $termlink, $post_type); |
| 1760 | 1760 | }*/ |
| 1761 | 1761 | |
| 1762 | - // Alter the CPT slug if WPML is set to do so |
|
| 1763 | - if (function_exists('icl_object_id')) {
|
|
| 1764 | - $post_types = get_option('geodir_post_types');
|
|
| 1765 | - $post_type = str_replace("category","",$taxonomy);
|
|
| 1766 | - $post_type = str_replace("_tags","",$post_type);
|
|
| 1767 | - $slug = $post_types[$post_type]['rewrite']['slug']; |
|
| 1768 | - if (gd_wpml_slug_translation_turned_on($post_type)) {
|
|
| 1769 | - global $sitepress; |
|
| 1770 | - $default_lang = $sitepress->get_default_language(); |
|
| 1771 | - $language_code = gd_wpml_get_lang_from_url($termlink); |
|
| 1772 | - if (!$language_code ) {
|
|
| 1773 | - $language_code = $default_lang; |
|
| 1774 | - } |
|
| 1762 | + // Alter the CPT slug if WPML is set to do so |
|
| 1763 | + if (function_exists('icl_object_id')) {
|
|
| 1764 | + $post_types = get_option('geodir_post_types');
|
|
| 1765 | + $post_type = str_replace("category","",$taxonomy);
|
|
| 1766 | + $post_type = str_replace("_tags","",$post_type);
|
|
| 1767 | + $slug = $post_types[$post_type]['rewrite']['slug']; |
|
| 1768 | + if (gd_wpml_slug_translation_turned_on($post_type)) {
|
|
| 1769 | + global $sitepress; |
|
| 1770 | + $default_lang = $sitepress->get_default_language(); |
|
| 1771 | + $language_code = gd_wpml_get_lang_from_url($termlink); |
|
| 1772 | + if (!$language_code ) {
|
|
| 1773 | + $language_code = $default_lang; |
|
| 1774 | + } |
|
| 1775 | 1775 | |
| 1776 | - $org_slug = $slug; |
|
| 1777 | - $slug = apply_filters('wpml_translate_single_string', $slug, 'WordPress', 'URL slug: ' . $slug, $language_code);
|
|
| 1776 | + $org_slug = $slug; |
|
| 1777 | + $slug = apply_filters('wpml_translate_single_string', $slug, 'WordPress', 'URL slug: ' . $slug, $language_code);
|
|
| 1778 | 1778 | |
| 1779 | - if (!$slug) {
|
|
| 1780 | - $slug = $org_slug; |
|
| 1781 | - } |
|
| 1779 | + if (!$slug) {
|
|
| 1780 | + $slug = $org_slug; |
|
| 1781 | + } |
|
| 1782 | 1782 | |
| 1783 | - $termlink = trailingslashit(preg_replace("/" . preg_quote($org_slug, "/") . "/", $slug ,$termlink, 1));
|
|
| 1784 | - } |
|
| 1785 | - } |
|
| 1786 | - } |
|
| 1783 | + $termlink = trailingslashit(preg_replace("/" . preg_quote($org_slug, "/") . "/", $slug ,$termlink, 1));
|
|
| 1784 | + } |
|
| 1785 | + } |
|
| 1786 | + } |
|
| 1787 | 1787 | |
| 1788 | - return $termlink; |
|
| 1788 | + return $termlink; |
|
| 1789 | 1789 | } |
| 1790 | 1790 | |
| 1791 | 1791 | /** |
@@ -1811,14 +1811,14 @@ discard block |
||
| 1811 | 1811 | if (in_array($post_type, geodir_get_posttypes())) {
|
| 1812 | 1812 | if (get_option('geodir_add_location_url') && $gd_session->get('gd_multi_location') == 1) {
|
| 1813 | 1813 | if(geodir_is_page('detail') && !empty($post) && isset($post->country_slug)) {
|
| 1814 | - $location_terms = array( |
|
| 1815 | - 'gd_country' => $post->country_slug, |
|
| 1816 | - 'gd_region' => $post->region_slug, |
|
| 1817 | - 'gd_city' => $post->city_slug |
|
| 1818 | - ); |
|
| 1819 | - } else {
|
|
| 1820 | - $location_terms = geodir_get_current_location_terms('query_vars');
|
|
| 1821 | - } |
|
| 1814 | + $location_terms = array( |
|
| 1815 | + 'gd_country' => $post->country_slug, |
|
| 1816 | + 'gd_region' => $post->region_slug, |
|
| 1817 | + 'gd_city' => $post->city_slug |
|
| 1818 | + ); |
|
| 1819 | + } else {
|
|
| 1820 | + $location_terms = geodir_get_current_location_terms('query_vars');
|
|
| 1821 | + } |
|
| 1822 | 1822 | |
| 1823 | 1823 | $location_terms = geodir_remove_location_terms($location_terms); |
| 1824 | 1824 | |
@@ -1849,14 +1849,14 @@ discard block |
||
| 1849 | 1849 | */ |
| 1850 | 1850 | function get_post_type_singular_label($post_type, $echo = false) |
| 1851 | 1851 | {
|
| 1852 | - $obj_post_type = get_post_type_object($post_type); |
|
| 1853 | - if (!is_object($obj_post_type)) {
|
|
| 1854 | - return; |
|
| 1855 | - } |
|
| 1856 | - if ($echo) |
|
| 1857 | - echo $obj_post_type->labels->singular_name; |
|
| 1858 | - else |
|
| 1859 | - return $obj_post_type->labels->singular_name; |
|
| 1852 | + $obj_post_type = get_post_type_object($post_type); |
|
| 1853 | + if (!is_object($obj_post_type)) {
|
|
| 1854 | + return; |
|
| 1855 | + } |
|
| 1856 | + if ($echo) |
|
| 1857 | + echo $obj_post_type->labels->singular_name; |
|
| 1858 | + else |
|
| 1859 | + return $obj_post_type->labels->singular_name; |
|
| 1860 | 1860 | |
| 1861 | 1861 | } |
| 1862 | 1862 | |
@@ -1871,16 +1871,16 @@ discard block |
||
| 1871 | 1871 | */ |
| 1872 | 1872 | function get_post_type_plural_label($post_type, $echo = false) |
| 1873 | 1873 | {
|
| 1874 | - $all_postypes = geodir_get_posttypes(); |
|
| 1874 | + $all_postypes = geodir_get_posttypes(); |
|
| 1875 | 1875 | |
| 1876 | - if (!in_array($post_type, $all_postypes)) |
|
| 1877 | - return false; |
|
| 1876 | + if (!in_array($post_type, $all_postypes)) |
|
| 1877 | + return false; |
|
| 1878 | 1878 | |
| 1879 | - $obj_post_type = get_post_type_object($post_type); |
|
| 1880 | - if ($echo) |
|
| 1881 | - echo $obj_post_type->labels->name; |
|
| 1882 | - else |
|
| 1883 | - return $obj_post_type->labels->name; |
|
| 1879 | + $obj_post_type = get_post_type_object($post_type); |
|
| 1880 | + if ($echo) |
|
| 1881 | + echo $obj_post_type->labels->name; |
|
| 1882 | + else |
|
| 1883 | + return $obj_post_type->labels->name; |
|
| 1884 | 1884 | |
| 1885 | 1885 | } |
| 1886 | 1886 | |
@@ -1899,51 +1899,51 @@ discard block |
||
| 1899 | 1899 | */ |
| 1900 | 1900 | function geodir_term_exists($term, $taxonomy = '', $parent = 0) |
| 1901 | 1901 | {
|
| 1902 | - global $wpdb; |
|
| 1903 | - |
|
| 1904 | - $select = "SELECT term_id FROM $wpdb->terms as t WHERE "; |
|
| 1905 | - $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE "; |
|
| 1906 | - |
|
| 1907 | - if (is_int($term)) {
|
|
| 1908 | - if (0 == $term) |
|
| 1909 | - return 0; |
|
| 1910 | - $where = 't.term_id = %d'; |
|
| 1911 | - if (!empty($taxonomy)) |
|
| 1912 | - return $wpdb->get_row($wpdb->prepare($tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
| 1913 | - else |
|
| 1914 | - return $wpdb->get_var($wpdb->prepare($select . $where, $term)); |
|
| 1915 | - } |
|
| 1902 | + global $wpdb; |
|
| 1903 | + |
|
| 1904 | + $select = "SELECT term_id FROM $wpdb->terms as t WHERE "; |
|
| 1905 | + $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE "; |
|
| 1906 | + |
|
| 1907 | + if (is_int($term)) {
|
|
| 1908 | + if (0 == $term) |
|
| 1909 | + return 0; |
|
| 1910 | + $where = 't.term_id = %d'; |
|
| 1911 | + if (!empty($taxonomy)) |
|
| 1912 | + return $wpdb->get_row($wpdb->prepare($tax_select . $where . " AND tt.taxonomy = %s", $term, $taxonomy), ARRAY_A); |
|
| 1913 | + else |
|
| 1914 | + return $wpdb->get_var($wpdb->prepare($select . $where, $term)); |
|
| 1915 | + } |
|
| 1916 | 1916 | |
| 1917 | - $term = trim(wp_unslash($term)); |
|
| 1917 | + $term = trim(wp_unslash($term)); |
|
| 1918 | 1918 | |
| 1919 | - if ('' === $slug = sanitize_title($term))
|
|
| 1920 | - return 0; |
|
| 1919 | + if ('' === $slug = sanitize_title($term))
|
|
| 1920 | + return 0; |
|
| 1921 | 1921 | |
| 1922 | - $where = 't.slug = %s'; |
|
| 1922 | + $where = 't.slug = %s'; |
|
| 1923 | 1923 | |
| 1924 | - $where_fields = array($slug); |
|
| 1925 | - if (!empty($taxonomy)) {
|
|
| 1926 | - $parent = (int)$parent; |
|
| 1927 | - if ($parent > 0) {
|
|
| 1928 | - $where_fields[] = $parent; |
|
| 1929 | - $else_where_fields[] = $parent; |
|
| 1930 | - $where .= ' AND tt.parent = %d'; |
|
| 1924 | + $where_fields = array($slug); |
|
| 1925 | + if (!empty($taxonomy)) {
|
|
| 1926 | + $parent = (int)$parent; |
|
| 1927 | + if ($parent > 0) {
|
|
| 1928 | + $where_fields[] = $parent; |
|
| 1929 | + $else_where_fields[] = $parent; |
|
| 1930 | + $where .= ' AND tt.parent = %d'; |
|
| 1931 | 1931 | |
| 1932 | - } |
|
| 1932 | + } |
|
| 1933 | 1933 | |
| 1934 | - $where_fields[] = $taxonomy; |
|
| 1934 | + $where_fields[] = $taxonomy; |
|
| 1935 | 1935 | |
| 1936 | 1936 | |
| 1937 | - if ($result = $wpdb->get_row($wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $where_fields), ARRAY_A))
|
|
| 1938 | - return $result; |
|
| 1937 | + if ($result = $wpdb->get_row($wpdb->prepare("SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE $where AND tt.taxonomy = %s", $where_fields), ARRAY_A))
|
|
| 1938 | + return $result; |
|
| 1939 | 1939 | |
| 1940 | - return false; |
|
| 1941 | - } |
|
| 1940 | + return false; |
|
| 1941 | + } |
|
| 1942 | 1942 | |
| 1943 | - if ($result = $wpdb->get_var($wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $where_fields)))
|
|
| 1944 | - return $result; |
|
| 1943 | + if ($result = $wpdb->get_var($wpdb->prepare("SELECT term_id FROM $wpdb->terms as t WHERE $where", $where_fields)))
|
|
| 1944 | + return $result; |
|
| 1945 | 1945 | |
| 1946 | - return false; |
|
| 1946 | + return false; |
|
| 1947 | 1947 | } |
| 1948 | 1948 | |
| 1949 | 1949 | /** |
@@ -1955,7 +1955,7 @@ discard block |
||
| 1955 | 1955 | function geodir_get_term_icon_rebuild() |
| 1956 | 1956 | {
|
| 1957 | 1957 | |
| 1958 | - update_option('gd_term_icons', '');
|
|
| 1958 | + update_option('gd_term_icons', '');
|
|
| 1959 | 1959 | |
| 1960 | 1960 | } |
| 1961 | 1961 | |
@@ -1973,60 +1973,60 @@ discard block |
||
| 1973 | 1973 | */ |
| 1974 | 1974 | function geodir_get_term_icon($term_id = false, $rebuild = false) |
| 1975 | 1975 | {
|
| 1976 | - global $wpdb; |
|
| 1977 | - if (!$rebuild) {
|
|
| 1978 | - $terms_icons = get_option('gd_term_icons');
|
|
| 1979 | - } else {
|
|
| 1980 | - $terms_icons = ''; |
|
| 1981 | - } |
|
| 1982 | - |
|
| 1983 | - if (empty($terms_icons)) {
|
|
| 1984 | - $default_icon_url = get_option('geodir_default_marker_icon');
|
|
| 1985 | - $taxonomy = geodir_get_taxonomies(); |
|
| 1986 | - $post_types = geodir_get_posttypes(); |
|
| 1987 | - $tax_arr = array(); |
|
| 1988 | - foreach ($post_types as $post_type) {
|
|
| 1989 | - $tax_arr[] = "'" . $post_type . "category'"; |
|
| 1990 | - } |
|
| 1991 | - $tax_c = implode(',', $tax_arr);
|
|
| 1992 | - $terms = $wpdb->get_results("SELECT * FROM $wpdb->term_taxonomy WHERE taxonomy IN ($tax_c)");
|
|
| 1993 | - //$terms = get_terms( $taxonomy ); |
|
| 1994 | - |
|
| 1995 | - if($terms) {
|
|
| 1996 | - foreach ($terms as $term) {
|
|
| 1997 | - $post_type = str_replace("category", "", $term->taxonomy);
|
|
| 1998 | - $a_terms[$post_type][] = $term; |
|
| 1976 | + global $wpdb; |
|
| 1977 | + if (!$rebuild) {
|
|
| 1978 | + $terms_icons = get_option('gd_term_icons');
|
|
| 1979 | + } else {
|
|
| 1980 | + $terms_icons = ''; |
|
| 1981 | + } |
|
| 1999 | 1982 | |
| 2000 | - } |
|
| 2001 | - } |
|
| 1983 | + if (empty($terms_icons)) {
|
|
| 1984 | + $default_icon_url = get_option('geodir_default_marker_icon');
|
|
| 1985 | + $taxonomy = geodir_get_taxonomies(); |
|
| 1986 | + $post_types = geodir_get_posttypes(); |
|
| 1987 | + $tax_arr = array(); |
|
| 1988 | + foreach ($post_types as $post_type) {
|
|
| 1989 | + $tax_arr[] = "'" . $post_type . "category'"; |
|
| 1990 | + } |
|
| 1991 | + $tax_c = implode(',', $tax_arr);
|
|
| 1992 | + $terms = $wpdb->get_results("SELECT * FROM $wpdb->term_taxonomy WHERE taxonomy IN ($tax_c)");
|
|
| 1993 | + //$terms = get_terms( $taxonomy ); |
|
| 2002 | 1994 | |
| 2003 | - if($a_terms) {
|
|
| 2004 | - foreach ($a_terms as $pt => $t2) {
|
|
| 1995 | + if($terms) {
|
|
| 1996 | + foreach ($terms as $term) {
|
|
| 1997 | + $post_type = str_replace("category", "", $term->taxonomy);
|
|
| 1998 | + $a_terms[$post_type][] = $term; |
|
| 2005 | 1999 | |
| 2006 | - foreach ($t2 as $term) {
|
|
| 2007 | - $term_icon = get_tax_meta($term->term_id, 'ct_cat_icon', false, $pt); |
|
| 2008 | - if ($term_icon) {
|
|
| 2009 | - $term_icon_url = $term_icon["src"]; |
|
| 2010 | - } else {
|
|
| 2011 | - $term_icon_url = $default_icon_url; |
|
| 2012 | - } |
|
| 2013 | - $terms_icons[$term->term_id] = $term_icon_url; |
|
| 2014 | - } |
|
| 2015 | - } |
|
| 2016 | - } |
|
| 2000 | + } |
|
| 2001 | + } |
|
| 2002 | + |
|
| 2003 | + if($a_terms) {
|
|
| 2004 | + foreach ($a_terms as $pt => $t2) {
|
|
| 2005 | + |
|
| 2006 | + foreach ($t2 as $term) {
|
|
| 2007 | + $term_icon = get_tax_meta($term->term_id, 'ct_cat_icon', false, $pt); |
|
| 2008 | + if ($term_icon) {
|
|
| 2009 | + $term_icon_url = $term_icon["src"]; |
|
| 2010 | + } else {
|
|
| 2011 | + $term_icon_url = $default_icon_url; |
|
| 2012 | + } |
|
| 2013 | + $terms_icons[$term->term_id] = $term_icon_url; |
|
| 2014 | + } |
|
| 2015 | + } |
|
| 2016 | + } |
|
| 2017 | 2017 | |
| 2018 | - update_option('gd_term_icons', $terms_icons);
|
|
| 2019 | - } |
|
| 2018 | + update_option('gd_term_icons', $terms_icons);
|
|
| 2019 | + } |
|
| 2020 | 2020 | |
| 2021 | - if ($term_id && isset($terms_icons[$term_id])) {
|
|
| 2022 | - return $terms_icons[$term_id]; |
|
| 2023 | - } elseif ($term_id && !isset($terms_icons[$term_id])) {
|
|
| 2024 | - return get_option('geodir_default_marker_icon');
|
|
| 2025 | - } |
|
| 2021 | + if ($term_id && isset($terms_icons[$term_id])) {
|
|
| 2022 | + return $terms_icons[$term_id]; |
|
| 2023 | + } elseif ($term_id && !isset($terms_icons[$term_id])) {
|
|
| 2024 | + return get_option('geodir_default_marker_icon');
|
|
| 2025 | + } |
|
| 2026 | 2026 | |
| 2027 | - if (is_ssl()) {
|
|
| 2028 | - $terms_icons = str_replace("http:","https:",$terms_icons );
|
|
| 2029 | - } |
|
| 2027 | + if (is_ssl()) {
|
|
| 2028 | + $terms_icons = str_replace("http:","https:",$terms_icons );
|
|
| 2029 | + } |
|
| 2030 | 2030 | |
| 2031 | - return apply_filters('geodir_get_term_icons', $terms_icons, $term_id);
|
|
| 2031 | + return apply_filters('geodir_get_term_icons', $terms_icons, $term_id);
|
|
| 2032 | 2032 | } |
| 2033 | 2033 | \ No newline at end of file |
@@ -10,52 +10,52 @@ discard block |
||
| 10 | 10 | global $wpdb, $table_prefix; |
| 11 | 11 | |
| 12 | 12 | if (!function_exists('geodir_column_exist')) {
|
| 13 | - /** |
|
| 14 | - * Check table column exist or not. |
|
| 15 | - * |
|
| 16 | - * @since 1.0.0 |
|
| 17 | - * @package GeoDirectory |
|
| 18 | - * @global object $wpdb WordPress Database object. |
|
| 19 | - * @param string $db The table name. |
|
| 20 | - * @param string $column The column name. |
|
| 21 | - * @return bool If column exists returns true. Otherwise false. |
|
| 22 | - */ |
|
| 23 | - function geodir_column_exist($db, $column) |
|
| 24 | - {
|
|
| 25 | - global $wpdb; |
|
| 26 | - $exists = false; |
|
| 27 | - $columns = $wpdb->get_col("show columns from $db");
|
|
| 28 | - foreach ($columns as $c) {
|
|
| 29 | - if ($c == $column) {
|
|
| 30 | - $exists = true; |
|
| 31 | - break; |
|
| 32 | - } |
|
| 33 | - } |
|
| 34 | - return $exists; |
|
| 35 | - } |
|
| 13 | + /** |
|
| 14 | + * Check table column exist or not. |
|
| 15 | + * |
|
| 16 | + * @since 1.0.0 |
|
| 17 | + * @package GeoDirectory |
|
| 18 | + * @global object $wpdb WordPress Database object. |
|
| 19 | + * @param string $db The table name. |
|
| 20 | + * @param string $column The column name. |
|
| 21 | + * @return bool If column exists returns true. Otherwise false. |
|
| 22 | + */ |
|
| 23 | + function geodir_column_exist($db, $column) |
|
| 24 | + {
|
|
| 25 | + global $wpdb; |
|
| 26 | + $exists = false; |
|
| 27 | + $columns = $wpdb->get_col("show columns from $db");
|
|
| 28 | + foreach ($columns as $c) {
|
|
| 29 | + if ($c == $column) {
|
|
| 30 | + $exists = true; |
|
| 31 | + break; |
|
| 32 | + } |
|
| 33 | + } |
|
| 34 | + return $exists; |
|
| 35 | + } |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | if (!function_exists('geodir_add_column_if_not_exist')) {
|
| 39 | - /** |
|
| 40 | - * Add column if table column not exist. |
|
| 41 | - * |
|
| 42 | - * @since 1.0.0 |
|
| 43 | - * @package GeoDirectory |
|
| 44 | - * @global object $wpdb WordPress Database object. |
|
| 45 | - * @param string $db The table name. |
|
| 46 | - * @param string $column The column name. |
|
| 47 | - * @param string $column_attr The column attributes. |
|
| 48 | - */ |
|
| 49 | - function geodir_add_column_if_not_exist($db, $column, $column_attr = "VARCHAR( 255 ) NOT NULL") |
|
| 50 | - {
|
|
| 51 | - global $wpdb; |
|
| 52 | - $result = 0;// no rows affected |
|
| 53 | - if (!geodir_column_exist($db, $column)) {
|
|
| 54 | - if (!empty($db) && !empty($column)) |
|
| 55 | - $result = $wpdb->query("ALTER TABLE `$db` ADD `$column` $column_attr");
|
|
| 56 | - } |
|
| 57 | - return $result; |
|
| 58 | - } |
|
| 39 | + /** |
|
| 40 | + * Add column if table column not exist. |
|
| 41 | + * |
|
| 42 | + * @since 1.0.0 |
|
| 43 | + * @package GeoDirectory |
|
| 44 | + * @global object $wpdb WordPress Database object. |
|
| 45 | + * @param string $db The table name. |
|
| 46 | + * @param string $column The column name. |
|
| 47 | + * @param string $column_attr The column attributes. |
|
| 48 | + */ |
|
| 49 | + function geodir_add_column_if_not_exist($db, $column, $column_attr = "VARCHAR( 255 ) NOT NULL") |
|
| 50 | + {
|
|
| 51 | + global $wpdb; |
|
| 52 | + $result = 0;// no rows affected |
|
| 53 | + if (!geodir_column_exist($db, $column)) {
|
|
| 54 | + if (!empty($db) && !empty($column)) |
|
| 55 | + $result = $wpdb->query("ALTER TABLE `$db` ADD `$column` $column_attr");
|
|
| 56 | + } |
|
| 57 | + return $result; |
|
| 58 | + } |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -72,706 +72,706 @@ discard block |
||
| 72 | 72 | */ |
| 73 | 73 | function geodir_post_custom_fields($package_id = '', $default = 'all', $post_type = 'gd_place', $fields_location = 'none') |
| 74 | 74 | {
|
| 75 | - global $wpdb, $geodir_post_custom_fields_cache; |
|
| 76 | - |
|
| 77 | - $cache_stored = $post_type . '_' . $package_id . '_' . $default . '_' . $fields_location; |
|
| 78 | - |
|
| 79 | - if (array_key_exists($cache_stored, $geodir_post_custom_fields_cache)) {
|
|
| 80 | - return $geodir_post_custom_fields_cache[$cache_stored]; |
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - $default_query = ''; |
|
| 84 | - |
|
| 85 | - if ($default == 'default') |
|
| 86 | - $default_query .= " and is_admin IN ('1') ";
|
|
| 87 | - elseif ($default == 'custom') |
|
| 88 | - $default_query .= " and is_admin = '0' "; |
|
| 89 | - |
|
| 90 | - if ($fields_location == 'none') {
|
|
| 91 | - } else{
|
|
| 92 | - $fields_location = esc_sql( $fields_location ); |
|
| 93 | - $default_query .= " and show_in LIKE '%%[$fields_location]%%' "; |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - $post_meta_info = $wpdb->get_results( |
|
| 97 | - $wpdb->prepare( |
|
| 98 | - "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
|
|
| 99 | - array($post_type) |
|
| 100 | - ) |
|
| 101 | - ); |
|
| 102 | - |
|
| 103 | - |
|
| 104 | - $return_arr = array(); |
|
| 105 | - if ($post_meta_info) {
|
|
| 106 | - |
|
| 107 | - foreach ($post_meta_info as $post_meta_info_obj) {
|
|
| 108 | - |
|
| 109 | - $custom_fields = array( |
|
| 110 | - "name" => $post_meta_info_obj->htmlvar_name, |
|
| 111 | - "label" => $post_meta_info_obj->clabels, |
|
| 112 | - "default" => $post_meta_info_obj->default_value, |
|
| 113 | - "type" => $post_meta_info_obj->field_type, |
|
| 114 | - "desc" => $post_meta_info_obj->admin_desc); |
|
| 115 | - |
|
| 116 | - if ($post_meta_info_obj->field_type) {
|
|
| 117 | - $options = explode(',', $post_meta_info_obj->option_values);
|
|
| 118 | - $custom_fields["options"] = $options; |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - foreach ($post_meta_info_obj as $key => $val) {
|
|
| 122 | - $custom_fields[$key] = $val; |
|
| 123 | - } |
|
| 124 | - |
|
| 125 | - $pricearr = array(); |
|
| 126 | - $pricearr = explode(',', $post_meta_info_obj->packages);
|
|
| 127 | - |
|
| 128 | - if ($package_id != '' && in_array($package_id, $pricearr)) {
|
|
| 129 | - $return_arr[$post_meta_info_obj->sort_order] = $custom_fields; |
|
| 130 | - } elseif ($package_id == '') {
|
|
| 131 | - $return_arr[$post_meta_info_obj->sort_order] = $custom_fields; |
|
| 132 | - } |
|
| 133 | - } |
|
| 134 | - } |
|
| 135 | - $geodir_post_custom_fields_cache[$cache_stored] = $return_arr; |
|
| 136 | - |
|
| 137 | - if (has_filter('geodir_filter_geodir_post_custom_fields')) {
|
|
| 138 | - /** |
|
| 139 | - * Filter the post custom fields array. |
|
| 140 | - * |
|
| 141 | - * @since 1.0.0 |
|
| 142 | - * |
|
| 143 | - * @param array $return_arr Post custom fields array. |
|
| 144 | - * @param int|string $package_id The package ID. |
|
| 145 | - * @param string $post_type Optional. The wordpress post type. |
|
| 146 | - * @param string $fields_location Optional. Where exactly are you going to place this custom fields?. |
|
| 147 | - */ |
|
| 148 | - $return_arr = apply_filters('geodir_filter_geodir_post_custom_fields', $return_arr, $package_id, $post_type, $fields_location);
|
|
| 149 | - } |
|
| 150 | - |
|
| 151 | - return $return_arr; |
|
| 75 | + global $wpdb, $geodir_post_custom_fields_cache; |
|
| 76 | + |
|
| 77 | + $cache_stored = $post_type . '_' . $package_id . '_' . $default . '_' . $fields_location; |
|
| 78 | + |
|
| 79 | + if (array_key_exists($cache_stored, $geodir_post_custom_fields_cache)) {
|
|
| 80 | + return $geodir_post_custom_fields_cache[$cache_stored]; |
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + $default_query = ''; |
|
| 84 | + |
|
| 85 | + if ($default == 'default') |
|
| 86 | + $default_query .= " and is_admin IN ('1') ";
|
|
| 87 | + elseif ($default == 'custom') |
|
| 88 | + $default_query .= " and is_admin = '0' "; |
|
| 89 | + |
|
| 90 | + if ($fields_location == 'none') {
|
|
| 91 | + } else{
|
|
| 92 | + $fields_location = esc_sql( $fields_location ); |
|
| 93 | + $default_query .= " and show_in LIKE '%%[$fields_location]%%' "; |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + $post_meta_info = $wpdb->get_results( |
|
| 97 | + $wpdb->prepare( |
|
| 98 | + "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
|
|
| 99 | + array($post_type) |
|
| 100 | + ) |
|
| 101 | + ); |
|
| 102 | + |
|
| 103 | + |
|
| 104 | + $return_arr = array(); |
|
| 105 | + if ($post_meta_info) {
|
|
| 106 | + |
|
| 107 | + foreach ($post_meta_info as $post_meta_info_obj) {
|
|
| 108 | + |
|
| 109 | + $custom_fields = array( |
|
| 110 | + "name" => $post_meta_info_obj->htmlvar_name, |
|
| 111 | + "label" => $post_meta_info_obj->clabels, |
|
| 112 | + "default" => $post_meta_info_obj->default_value, |
|
| 113 | + "type" => $post_meta_info_obj->field_type, |
|
| 114 | + "desc" => $post_meta_info_obj->admin_desc); |
|
| 115 | + |
|
| 116 | + if ($post_meta_info_obj->field_type) {
|
|
| 117 | + $options = explode(',', $post_meta_info_obj->option_values);
|
|
| 118 | + $custom_fields["options"] = $options; |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + foreach ($post_meta_info_obj as $key => $val) {
|
|
| 122 | + $custom_fields[$key] = $val; |
|
| 123 | + } |
|
| 124 | + |
|
| 125 | + $pricearr = array(); |
|
| 126 | + $pricearr = explode(',', $post_meta_info_obj->packages);
|
|
| 127 | + |
|
| 128 | + if ($package_id != '' && in_array($package_id, $pricearr)) {
|
|
| 129 | + $return_arr[$post_meta_info_obj->sort_order] = $custom_fields; |
|
| 130 | + } elseif ($package_id == '') {
|
|
| 131 | + $return_arr[$post_meta_info_obj->sort_order] = $custom_fields; |
|
| 132 | + } |
|
| 133 | + } |
|
| 134 | + } |
|
| 135 | + $geodir_post_custom_fields_cache[$cache_stored] = $return_arr; |
|
| 136 | + |
|
| 137 | + if (has_filter('geodir_filter_geodir_post_custom_fields')) {
|
|
| 138 | + /** |
|
| 139 | + * Filter the post custom fields array. |
|
| 140 | + * |
|
| 141 | + * @since 1.0.0 |
|
| 142 | + * |
|
| 143 | + * @param array $return_arr Post custom fields array. |
|
| 144 | + * @param int|string $package_id The package ID. |
|
| 145 | + * @param string $post_type Optional. The wordpress post type. |
|
| 146 | + * @param string $fields_location Optional. Where exactly are you going to place this custom fields?. |
|
| 147 | + */ |
|
| 148 | + $return_arr = apply_filters('geodir_filter_geodir_post_custom_fields', $return_arr, $package_id, $post_type, $fields_location);
|
|
| 149 | + } |
|
| 150 | + |
|
| 151 | + return $return_arr; |
|
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - /** |
|
| 155 | - * Adds admin html for custom fields. |
|
| 156 | - * |
|
| 157 | - * @since 1.0.0 |
|
| 158 | - * @package GeoDirectory |
|
| 159 | - * @global object $wpdb WordPress Database object. |
|
| 160 | - * @param string $field_type The form field type. |
|
| 161 | - * @param object|int $result_str The custom field results object or row id. |
|
| 162 | - * @param string $field_ins_upd When set to "submit" displays form. |
|
| 163 | - * @param string $field_type_key The key of the custom field. |
|
| 164 | - */ |
|
| 165 | - function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key ='') |
|
| 166 | - {
|
|
| 167 | - global $wpdb; |
|
| 168 | - $cf = $result_str; |
|
| 169 | - if (!is_object($cf)) {
|
|
| 170 | - |
|
| 171 | - $field_info = $wpdb->get_row($wpdb->prepare("select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)));
|
|
| 172 | - |
|
| 173 | - } else {
|
|
| 174 | - $field_info = $cf; |
|
| 175 | - $result_str = $cf->id; |
|
| 176 | - } |
|
| 177 | - /** |
|
| 178 | - * Contains custom field html. |
|
| 179 | - * |
|
| 180 | - * @since 1.0.0 |
|
| 181 | - */ |
|
| 182 | - include('custom_field_html.php');
|
|
| 183 | - |
|
| 184 | - } |
|
| 154 | + /** |
|
| 155 | + * Adds admin html for custom fields. |
|
| 156 | + * |
|
| 157 | + * @since 1.0.0 |
|
| 158 | + * @package GeoDirectory |
|
| 159 | + * @global object $wpdb WordPress Database object. |
|
| 160 | + * @param string $field_type The form field type. |
|
| 161 | + * @param object|int $result_str The custom field results object or row id. |
|
| 162 | + * @param string $field_ins_upd When set to "submit" displays form. |
|
| 163 | + * @param string $field_type_key The key of the custom field. |
|
| 164 | + */ |
|
| 165 | + function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key ='') |
|
| 166 | + {
|
|
| 167 | + global $wpdb; |
|
| 168 | + $cf = $result_str; |
|
| 169 | + if (!is_object($cf)) {
|
|
| 170 | + |
|
| 171 | + $field_info = $wpdb->get_row($wpdb->prepare("select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)));
|
|
| 172 | + |
|
| 173 | + } else {
|
|
| 174 | + $field_info = $cf; |
|
| 175 | + $result_str = $cf->id; |
|
| 176 | + } |
|
| 177 | + /** |
|
| 178 | + * Contains custom field html. |
|
| 179 | + * |
|
| 180 | + * @since 1.0.0 |
|
| 181 | + */ |
|
| 182 | + include('custom_field_html.php');
|
|
| 183 | + |
|
| 184 | + } |
|
| 185 | 185 | |
| 186 | 186 | |
| 187 | 187 | if (!function_exists('geodir_custom_field_delete')) {
|
| 188 | - /** |
|
| 189 | - * Delete custom field using field id. |
|
| 190 | - * |
|
| 191 | - * @since 1.0.0 |
|
| 192 | - * @since 1.5.7 Delete field from sorting fields table when custom field deleted. |
|
| 193 | - * @package GeoDirectory |
|
| 194 | - * @global object $wpdb WordPress Database object. |
|
| 195 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 196 | - * @param string $field_id The custom field ID. |
|
| 197 | - * @return int|string If field deleted successfully, returns field id. Otherwise returns 0. |
|
| 198 | - */ |
|
| 199 | - function geodir_custom_field_delete($field_id = '') {
|
|
| 200 | - global $wpdb, $plugin_prefix; |
|
| 201 | - |
|
| 202 | - if ($field_id != '') {
|
|
| 203 | - $cf = trim($field_id, '_'); |
|
| 204 | - |
|
| 205 | - if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)))) {
|
|
| 206 | - $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d ", array($cf)));
|
|
| 207 | - |
|
| 208 | - $post_type = $field->post_type; |
|
| 209 | - $htmlvar_name = $field->htmlvar_name; |
|
| 210 | - |
|
| 211 | - if ($post_type != '' && $htmlvar_name != '') {
|
|
| 212 | - $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
|
|
| 213 | - } |
|
| 214 | - |
|
| 215 | - /** |
|
| 216 | - * Called after a custom field is deleted. |
|
| 217 | - * |
|
| 218 | - * @since 1.0.0 |
|
| 219 | - * @param string $cf The fields ID. |
|
| 220 | - * @param string $field->htmlvar_name The html variable name for the field. |
|
| 221 | - * @param string $post_type The post type the field belongs to. |
|
| 222 | - */ |
|
| 223 | - do_action('geodir_after_custom_field_deleted', $cf, $field->htmlvar_name, $post_type);
|
|
| 224 | - |
|
| 225 | - if ($field->field_type == 'address') {
|
|
| 226 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_address`");
|
|
| 227 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_city`");
|
|
| 228 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_region`");
|
|
| 229 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_country`");
|
|
| 230 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_zip`");
|
|
| 231 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_latitude`");
|
|
| 232 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_longitude`");
|
|
| 233 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapview`");
|
|
| 234 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapzoom`");
|
|
| 235 | - } else {
|
|
| 236 | - if ($field->field_type != 'fieldset') {
|
|
| 237 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "`");
|
|
| 238 | - } |
|
| 239 | - } |
|
| 240 | - |
|
| 241 | - return $field_id; |
|
| 242 | - } else |
|
| 243 | - return 0; |
|
| 244 | - } else |
|
| 245 | - return 0; |
|
| 246 | - } |
|
| 188 | + /** |
|
| 189 | + * Delete custom field using field id. |
|
| 190 | + * |
|
| 191 | + * @since 1.0.0 |
|
| 192 | + * @since 1.5.7 Delete field from sorting fields table when custom field deleted. |
|
| 193 | + * @package GeoDirectory |
|
| 194 | + * @global object $wpdb WordPress Database object. |
|
| 195 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 196 | + * @param string $field_id The custom field ID. |
|
| 197 | + * @return int|string If field deleted successfully, returns field id. Otherwise returns 0. |
|
| 198 | + */ |
|
| 199 | + function geodir_custom_field_delete($field_id = '') {
|
|
| 200 | + global $wpdb, $plugin_prefix; |
|
| 201 | + |
|
| 202 | + if ($field_id != '') {
|
|
| 203 | + $cf = trim($field_id, '_'); |
|
| 204 | + |
|
| 205 | + if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)))) {
|
|
| 206 | + $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d ", array($cf)));
|
|
| 207 | + |
|
| 208 | + $post_type = $field->post_type; |
|
| 209 | + $htmlvar_name = $field->htmlvar_name; |
|
| 210 | + |
|
| 211 | + if ($post_type != '' && $htmlvar_name != '') {
|
|
| 212 | + $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
|
|
| 213 | + } |
|
| 214 | + |
|
| 215 | + /** |
|
| 216 | + * Called after a custom field is deleted. |
|
| 217 | + * |
|
| 218 | + * @since 1.0.0 |
|
| 219 | + * @param string $cf The fields ID. |
|
| 220 | + * @param string $field->htmlvar_name The html variable name for the field. |
|
| 221 | + * @param string $post_type The post type the field belongs to. |
|
| 222 | + */ |
|
| 223 | + do_action('geodir_after_custom_field_deleted', $cf, $field->htmlvar_name, $post_type);
|
|
| 224 | + |
|
| 225 | + if ($field->field_type == 'address') {
|
|
| 226 | + $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_address`");
|
|
| 227 | + $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_city`");
|
|
| 228 | + $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_region`");
|
|
| 229 | + $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_country`");
|
|
| 230 | + $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_zip`");
|
|
| 231 | + $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_latitude`");
|
|
| 232 | + $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_longitude`");
|
|
| 233 | + $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapview`");
|
|
| 234 | + $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapzoom`");
|
|
| 235 | + } else {
|
|
| 236 | + if ($field->field_type != 'fieldset') {
|
|
| 237 | + $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "`");
|
|
| 238 | + } |
|
| 239 | + } |
|
| 240 | + |
|
| 241 | + return $field_id; |
|
| 242 | + } else |
|
| 243 | + return 0; |
|
| 244 | + } else |
|
| 245 | + return 0; |
|
| 246 | + } |
|
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | if (!function_exists('geodir_custom_field_save')) {
|
| 250 | - /** |
|
| 251 | - * Save or Update custom fields into the database. |
|
| 252 | - * |
|
| 253 | - * @since 1.0.0 |
|
| 254 | - * @since 1.5.6 Fix for saving multiselect custom field "Display Type" on first attempt. |
|
| 255 | - * @package GeoDirectory |
|
| 256 | - * @global object $wpdb WordPress Database object. |
|
| 257 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 258 | - * @param array $request_field {
|
|
| 259 | - * Attributes of the request field array. |
|
| 260 | - * |
|
| 261 | - * @type string $action Ajax Action name. Default "geodir_ajax_action". |
|
| 262 | - * @type string $manage_field_type Field type Default "custom_fields". |
|
| 263 | - * @type string $create_field Create field Default "true". |
|
| 264 | - * @type string $field_ins_upd Field ins upd Default "submit". |
|
| 265 | - * @type string $_wpnonce WP nonce value. |
|
| 266 | - * @type string $listing_type Listing type Example "gd_place". |
|
| 267 | - * @type string $field_type Field type Example "radio". |
|
| 268 | - * @type string $field_id Field id Example "12". |
|
| 269 | - * @type string $data_type Data type Example "VARCHAR". |
|
| 270 | - * @type string $is_active Either "1" or "0". If "0" is used then the field will not be displayed anywhere. |
|
| 271 | - * @type array $show_on_pkg Package list to display this field. |
|
| 272 | - * @type string $admin_title Personal comment, it would not be displayed anywhere except in custom field settings. |
|
| 273 | - * @type string $site_title Section title which you wish to display in frontend. |
|
| 274 | - * @type string $admin_desc Section description which will appear in frontend. |
|
| 275 | - * @type string $htmlvar_name Html variable name. This should be a unique name. |
|
| 276 | - * @type string $clabels Section Title which will appear in backend. |
|
| 277 | - * @type string $default_value The default value (for "link" this will be used as the link text). |
|
| 278 | - * @type string $sort_order The display order of this field in backend. e.g. 5. |
|
| 279 | - * @type string $is_default Either "1" or "0". If "0" is used then the field will be displayed as main form field or additional field. |
|
| 280 | - * @type string $for_admin_use Either "1" or "0". If "0" is used then only site admin can edit this field. |
|
| 281 | - * @type string $is_required Use "1" to set field as required. |
|
| 282 | - * @type string $required_msg Enter text for error message if field required and have not full fill requirement. |
|
| 283 | - * @type string $show_on_listing Want to show this on listing page?. |
|
| 284 | - * @type string $show_in What locations to show the custom field in. |
|
| 285 | - * @type string $show_on_detail Want to show this in More Info tab on detail page?. |
|
| 286 | - * @type string $show_as_tab Want to display this as a tab on detail page? If "1" then "Show on detail page?" must be Yes. |
|
| 287 | - * @type string $option_values Option Values should be separated by comma. |
|
| 288 | - * @type string $field_icon Upload icon using media and enter its url path, or enter font awesome class. |
|
| 289 | - * @type string $css_class Enter custom css class for field custom style. |
|
| 290 | - * @type array $extra_fields An array of extra fields to store. |
|
| 291 | - * |
|
| 292 | - * } |
|
| 293 | - * @param bool $default Not yet implemented. |
|
| 294 | - * @return int|string If field is unique returns inserted row id. Otherwise returns error string. |
|
| 295 | - */ |
|
| 296 | - function geodir_custom_field_save($request_field = array(), $default = false) |
|
| 297 | - {
|
|
| 298 | - |
|
| 299 | - global $wpdb, $plugin_prefix; |
|
| 300 | - |
|
| 301 | - $old_html_variable = ''; |
|
| 302 | - |
|
| 303 | - $data_type = trim($request_field['data_type']); |
|
| 304 | - |
|
| 305 | - $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : ''; |
|
| 306 | - |
|
| 307 | - // some servers fail if a POST value is VARCHAR so we change it. |
|
| 308 | - if(isset($request_field['data_type']) && $request_field['data_type']=='XVARCHAR'){
|
|
| 309 | - $request_field['data_type'] = 'VARCHAR'; |
|
| 310 | - } |
|
| 311 | - |
|
| 312 | - $cf = trim($result_str, '_'); |
|
| 313 | - |
|
| 314 | - |
|
| 315 | - /*-------- check duplicate validation --------*/ |
|
| 316 | - |
|
| 317 | - $cehhtmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : ''; |
|
| 318 | - $post_type = $request_field['listing_type']; |
|
| 319 | - |
|
| 320 | - if ($request_field['field_type'] != 'address' && $request_field['field_type'] != 'taxonomy' && $request_field['field_type'] != 'fieldset') {
|
|
| 321 | - $cehhtmlvar_name = 'geodir_' . $cehhtmlvar_name; |
|
| 322 | - } |
|
| 323 | - |
|
| 324 | - $check_html_variable = $wpdb->get_var( |
|
| 325 | - $wpdb->prepare( |
|
| 326 | - "select htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id <> %d and htmlvar_name = %s and post_type = %s ", |
|
| 327 | - array($cf, $cehhtmlvar_name, $post_type) |
|
| 328 | - ) |
|
| 329 | - ); |
|
| 330 | - |
|
| 331 | - |
|
| 332 | - if (!$check_html_variable || $request_field['field_type'] == 'fieldset') {
|
|
| 333 | - |
|
| 334 | - if ($cf != '') {
|
|
| 335 | - |
|
| 336 | - $post_meta_info = $wpdb->get_row( |
|
| 337 | - $wpdb->prepare( |
|
| 338 | - "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id = %d", |
|
| 339 | - array($cf) |
|
| 340 | - ) |
|
| 341 | - ); |
|
| 342 | - |
|
| 343 | - } |
|
| 344 | - |
|
| 345 | - if (!empty($post_meta_info)) {
|
|
| 346 | - $post_val = $post_meta_info; |
|
| 347 | - $old_html_variable = $post_val->htmlvar_name; |
|
| 348 | - |
|
| 349 | - } |
|
| 350 | - |
|
| 351 | - |
|
| 352 | - |
|
| 353 | - if ($post_type == '') $post_type = 'gd_place'; |
|
| 354 | - |
|
| 355 | - |
|
| 356 | - $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
| 357 | - |
|
| 358 | - $admin_title = $request_field['admin_title']; |
|
| 359 | - $site_title = $request_field['site_title']; |
|
| 360 | - $data_type = $request_field['data_type']; |
|
| 361 | - $field_type = $request_field['field_type']; |
|
| 362 | - $field_type_key = isset($request_field['field_type_key']) ? $request_field['field_type_key'] : $field_type; |
|
| 363 | - $htmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : ''; |
|
| 364 | - $admin_desc = $request_field['admin_desc']; |
|
| 365 | - $clabels = isset($request_field['clabels']) ? $request_field['clabels'] : ''; |
|
| 366 | - $default_value = isset($request_field['default_value']) ? $request_field['default_value'] : ''; |
|
| 367 | - $sort_order = isset($request_field['sort_order']) ? $request_field['sort_order'] : ''; |
|
| 368 | - $is_active = isset($request_field['is_active']) ? $request_field['is_active'] : ''; |
|
| 369 | - $is_required = isset($request_field['is_required']) ? $request_field['is_required'] : ''; |
|
| 370 | - $required_msg = isset($request_field['required_msg']) ? $request_field['required_msg'] : ''; |
|
| 371 | - $css_class = isset($request_field['css_class']) ? $request_field['css_class'] : ''; |
|
| 372 | - $field_icon = isset($request_field['field_icon']) ? $request_field['field_icon'] : ''; |
|
| 373 | - $show_on_listing = isset($request_field['show_on_listing']) ? $request_field['show_on_listing'] : ''; |
|
| 374 | - $show_in = isset($request_field['show_in']) ? $request_field['show_in'] : ''; |
|
| 375 | - $show_on_detail = isset($request_field['show_on_detail']) ? $request_field['show_on_detail'] : ''; |
|
| 376 | - $show_as_tab = isset($request_field['show_as_tab']) ? $request_field['show_as_tab'] : ''; |
|
| 377 | - $decimal_point = isset($request_field['decimal_point']) ? trim($request_field['decimal_point']) : ''; // decimal point for DECIMAL data type |
|
| 378 | - $decimal_point = $decimal_point > 0 ? ($decimal_point > 10 ? 10 : $decimal_point) : ''; |
|
| 379 | - $validation_pattern = isset($request_field['validation_pattern']) ? $request_field['validation_pattern'] : ''; |
|
| 380 | - $validation_msg = isset($request_field['validation_msg']) ? $request_field['validation_msg'] : ''; |
|
| 381 | - $for_admin_use = isset($request_field['for_admin_use']) ? $request_field['for_admin_use'] : ''; |
|
| 250 | + /** |
|
| 251 | + * Save or Update custom fields into the database. |
|
| 252 | + * |
|
| 253 | + * @since 1.0.0 |
|
| 254 | + * @since 1.5.6 Fix for saving multiselect custom field "Display Type" on first attempt. |
|
| 255 | + * @package GeoDirectory |
|
| 256 | + * @global object $wpdb WordPress Database object. |
|
| 257 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 258 | + * @param array $request_field {
|
|
| 259 | + * Attributes of the request field array. |
|
| 260 | + * |
|
| 261 | + * @type string $action Ajax Action name. Default "geodir_ajax_action". |
|
| 262 | + * @type string $manage_field_type Field type Default "custom_fields". |
|
| 263 | + * @type string $create_field Create field Default "true". |
|
| 264 | + * @type string $field_ins_upd Field ins upd Default "submit". |
|
| 265 | + * @type string $_wpnonce WP nonce value. |
|
| 266 | + * @type string $listing_type Listing type Example "gd_place". |
|
| 267 | + * @type string $field_type Field type Example "radio". |
|
| 268 | + * @type string $field_id Field id Example "12". |
|
| 269 | + * @type string $data_type Data type Example "VARCHAR". |
|
| 270 | + * @type string $is_active Either "1" or "0". If "0" is used then the field will not be displayed anywhere. |
|
| 271 | + * @type array $show_on_pkg Package list to display this field. |
|
| 272 | + * @type string $admin_title Personal comment, it would not be displayed anywhere except in custom field settings. |
|
| 273 | + * @type string $site_title Section title which you wish to display in frontend. |
|
| 274 | + * @type string $admin_desc Section description which will appear in frontend. |
|
| 275 | + * @type string $htmlvar_name Html variable name. This should be a unique name. |
|
| 276 | + * @type string $clabels Section Title which will appear in backend. |
|
| 277 | + * @type string $default_value The default value (for "link" this will be used as the link text). |
|
| 278 | + * @type string $sort_order The display order of this field in backend. e.g. 5. |
|
| 279 | + * @type string $is_default Either "1" or "0". If "0" is used then the field will be displayed as main form field or additional field. |
|
| 280 | + * @type string $for_admin_use Either "1" or "0". If "0" is used then only site admin can edit this field. |
|
| 281 | + * @type string $is_required Use "1" to set field as required. |
|
| 282 | + * @type string $required_msg Enter text for error message if field required and have not full fill requirement. |
|
| 283 | + * @type string $show_on_listing Want to show this on listing page?. |
|
| 284 | + * @type string $show_in What locations to show the custom field in. |
|
| 285 | + * @type string $show_on_detail Want to show this in More Info tab on detail page?. |
|
| 286 | + * @type string $show_as_tab Want to display this as a tab on detail page? If "1" then "Show on detail page?" must be Yes. |
|
| 287 | + * @type string $option_values Option Values should be separated by comma. |
|
| 288 | + * @type string $field_icon Upload icon using media and enter its url path, or enter font awesome class. |
|
| 289 | + * @type string $css_class Enter custom css class for field custom style. |
|
| 290 | + * @type array $extra_fields An array of extra fields to store. |
|
| 291 | + * |
|
| 292 | + * } |
|
| 293 | + * @param bool $default Not yet implemented. |
|
| 294 | + * @return int|string If field is unique returns inserted row id. Otherwise returns error string. |
|
| 295 | + */ |
|
| 296 | + function geodir_custom_field_save($request_field = array(), $default = false) |
|
| 297 | + {
|
|
| 298 | + |
|
| 299 | + global $wpdb, $plugin_prefix; |
|
| 300 | + |
|
| 301 | + $old_html_variable = ''; |
|
| 302 | + |
|
| 303 | + $data_type = trim($request_field['data_type']); |
|
| 304 | + |
|
| 305 | + $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : ''; |
|
| 306 | + |
|
| 307 | + // some servers fail if a POST value is VARCHAR so we change it. |
|
| 308 | + if(isset($request_field['data_type']) && $request_field['data_type']=='XVARCHAR'){
|
|
| 309 | + $request_field['data_type'] = 'VARCHAR'; |
|
| 310 | + } |
|
| 311 | + |
|
| 312 | + $cf = trim($result_str, '_'); |
|
| 313 | + |
|
| 314 | + |
|
| 315 | + /*-------- check duplicate validation --------*/ |
|
| 316 | + |
|
| 317 | + $cehhtmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : ''; |
|
| 318 | + $post_type = $request_field['listing_type']; |
|
| 319 | + |
|
| 320 | + if ($request_field['field_type'] != 'address' && $request_field['field_type'] != 'taxonomy' && $request_field['field_type'] != 'fieldset') {
|
|
| 321 | + $cehhtmlvar_name = 'geodir_' . $cehhtmlvar_name; |
|
| 322 | + } |
|
| 323 | + |
|
| 324 | + $check_html_variable = $wpdb->get_var( |
|
| 325 | + $wpdb->prepare( |
|
| 326 | + "select htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id <> %d and htmlvar_name = %s and post_type = %s ", |
|
| 327 | + array($cf, $cehhtmlvar_name, $post_type) |
|
| 328 | + ) |
|
| 329 | + ); |
|
| 330 | + |
|
| 331 | + |
|
| 332 | + if (!$check_html_variable || $request_field['field_type'] == 'fieldset') {
|
|
| 333 | + |
|
| 334 | + if ($cf != '') {
|
|
| 335 | + |
|
| 336 | + $post_meta_info = $wpdb->get_row( |
|
| 337 | + $wpdb->prepare( |
|
| 338 | + "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id = %d", |
|
| 339 | + array($cf) |
|
| 340 | + ) |
|
| 341 | + ); |
|
| 342 | + |
|
| 343 | + } |
|
| 344 | + |
|
| 345 | + if (!empty($post_meta_info)) {
|
|
| 346 | + $post_val = $post_meta_info; |
|
| 347 | + $old_html_variable = $post_val->htmlvar_name; |
|
| 348 | + |
|
| 349 | + } |
|
| 350 | + |
|
| 351 | + |
|
| 352 | + |
|
| 353 | + if ($post_type == '') $post_type = 'gd_place'; |
|
| 354 | + |
|
| 355 | + |
|
| 356 | + $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
| 357 | + |
|
| 358 | + $admin_title = $request_field['admin_title']; |
|
| 359 | + $site_title = $request_field['site_title']; |
|
| 360 | + $data_type = $request_field['data_type']; |
|
| 361 | + $field_type = $request_field['field_type']; |
|
| 362 | + $field_type_key = isset($request_field['field_type_key']) ? $request_field['field_type_key'] : $field_type; |
|
| 363 | + $htmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : ''; |
|
| 364 | + $admin_desc = $request_field['admin_desc']; |
|
| 365 | + $clabels = isset($request_field['clabels']) ? $request_field['clabels'] : ''; |
|
| 366 | + $default_value = isset($request_field['default_value']) ? $request_field['default_value'] : ''; |
|
| 367 | + $sort_order = isset($request_field['sort_order']) ? $request_field['sort_order'] : ''; |
|
| 368 | + $is_active = isset($request_field['is_active']) ? $request_field['is_active'] : ''; |
|
| 369 | + $is_required = isset($request_field['is_required']) ? $request_field['is_required'] : ''; |
|
| 370 | + $required_msg = isset($request_field['required_msg']) ? $request_field['required_msg'] : ''; |
|
| 371 | + $css_class = isset($request_field['css_class']) ? $request_field['css_class'] : ''; |
|
| 372 | + $field_icon = isset($request_field['field_icon']) ? $request_field['field_icon'] : ''; |
|
| 373 | + $show_on_listing = isset($request_field['show_on_listing']) ? $request_field['show_on_listing'] : ''; |
|
| 374 | + $show_in = isset($request_field['show_in']) ? $request_field['show_in'] : ''; |
|
| 375 | + $show_on_detail = isset($request_field['show_on_detail']) ? $request_field['show_on_detail'] : ''; |
|
| 376 | + $show_as_tab = isset($request_field['show_as_tab']) ? $request_field['show_as_tab'] : ''; |
|
| 377 | + $decimal_point = isset($request_field['decimal_point']) ? trim($request_field['decimal_point']) : ''; // decimal point for DECIMAL data type |
|
| 378 | + $decimal_point = $decimal_point > 0 ? ($decimal_point > 10 ? 10 : $decimal_point) : ''; |
|
| 379 | + $validation_pattern = isset($request_field['validation_pattern']) ? $request_field['validation_pattern'] : ''; |
|
| 380 | + $validation_msg = isset($request_field['validation_msg']) ? $request_field['validation_msg'] : ''; |
|
| 381 | + $for_admin_use = isset($request_field['for_admin_use']) ? $request_field['for_admin_use'] : ''; |
|
| 382 | 382 | |
| 383 | 383 | |
| 384 | - if(is_array($show_in)){
|
|
| 385 | - $show_in = implode(",", $request_field['show_in']);
|
|
| 386 | - } |
|
| 384 | + if(is_array($show_in)){
|
|
| 385 | + $show_in = implode(",", $request_field['show_in']);
|
|
| 386 | + } |
|
| 387 | 387 | |
| 388 | - if ($field_type != 'address' && $field_type != 'taxonomy' && $field_type != 'fieldset') {
|
|
| 389 | - $htmlvar_name = 'geodir_' . $htmlvar_name; |
|
| 390 | - } |
|
| 388 | + if ($field_type != 'address' && $field_type != 'taxonomy' && $field_type != 'fieldset') {
|
|
| 389 | + $htmlvar_name = 'geodir_' . $htmlvar_name; |
|
| 390 | + } |
|
| 391 | 391 | |
| 392 | - $option_values = ''; |
|
| 393 | - if (isset($request_field['option_values'])) |
|
| 394 | - $option_values = $request_field['option_values']; |
|
| 392 | + $option_values = ''; |
|
| 393 | + if (isset($request_field['option_values'])) |
|
| 394 | + $option_values = $request_field['option_values']; |
|
| 395 | 395 | |
| 396 | - $cat_sort = isset($request_field['cat_sort']) ? $request_field['cat_sort'] : '0'; |
|
| 396 | + $cat_sort = isset($request_field['cat_sort']) ? $request_field['cat_sort'] : '0'; |
|
| 397 | 397 | |
| 398 | - $cat_filter = isset($request_field['cat_filter']) ? $request_field['cat_filter'] : '0'; |
|
| 398 | + $cat_filter = isset($request_field['cat_filter']) ? $request_field['cat_filter'] : '0'; |
|
| 399 | 399 | |
| 400 | - if (isset($request_field['show_on_pkg']) && !empty($request_field['show_on_pkg'])) |
|
| 401 | - $price_pkg = implode(",", $request_field['show_on_pkg']);
|
|
| 402 | - else {
|
|
| 403 | - $package_info = array(); |
|
| 400 | + if (isset($request_field['show_on_pkg']) && !empty($request_field['show_on_pkg'])) |
|
| 401 | + $price_pkg = implode(",", $request_field['show_on_pkg']);
|
|
| 402 | + else {
|
|
| 403 | + $package_info = array(); |
|
| 404 | 404 | |
| 405 | - $package_info = geodir_post_package_info($package_info, '', $post_type); |
|
| 406 | - $price_pkg = !empty($package_info->pid) ? $package_info->pid : ''; |
|
| 407 | - } |
|
| 405 | + $package_info = geodir_post_package_info($package_info, '', $post_type); |
|
| 406 | + $price_pkg = !empty($package_info->pid) ? $package_info->pid : ''; |
|
| 407 | + } |
|
| 408 | 408 | |
| 409 | 409 | |
| 410 | - if (isset($request_field['extra']) && !empty($request_field['extra'])) |
|
| 411 | - $extra_fields = $request_field['extra']; |
|
| 410 | + if (isset($request_field['extra']) && !empty($request_field['extra'])) |
|
| 411 | + $extra_fields = $request_field['extra']; |
|
| 412 | 412 | |
| 413 | - if (isset($request_field['is_default']) && $request_field['is_default'] != '') |
|
| 414 | - $is_default = $request_field['is_default']; |
|
| 415 | - else |
|
| 416 | - $is_default = '0'; |
|
| 413 | + if (isset($request_field['is_default']) && $request_field['is_default'] != '') |
|
| 414 | + $is_default = $request_field['is_default']; |
|
| 415 | + else |
|
| 416 | + $is_default = '0'; |
|
| 417 | 417 | |
| 418 | - if (isset($request_field['is_admin']) && $request_field['is_admin'] != '') |
|
| 419 | - $is_admin = $request_field['is_admin']; |
|
| 420 | - else |
|
| 421 | - $is_admin = '0'; |
|
| 418 | + if (isset($request_field['is_admin']) && $request_field['is_admin'] != '') |
|
| 419 | + $is_admin = $request_field['is_admin']; |
|
| 420 | + else |
|
| 421 | + $is_admin = '0'; |
|
| 422 | 422 | |
| 423 | 423 | |
| 424 | - if ($is_active == '') $is_active = 1; |
|
| 425 | - if ($is_required == '') $is_required = 0; |
|
| 424 | + if ($is_active == '') $is_active = 1; |
|
| 425 | + if ($is_required == '') $is_required = 0; |
|
| 426 | 426 | |
| 427 | 427 | |
| 428 | - if ($sort_order == '') {
|
|
| 428 | + if ($sort_order == '') {
|
|
| 429 | 429 | |
| 430 | - $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM " . GEODIR_CUSTOM_FIELDS_TABLE);
|
|
| 430 | + $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM " . GEODIR_CUSTOM_FIELDS_TABLE);
|
|
| 431 | 431 | |
| 432 | - $sort_order = (int)$last_order + 1; |
|
| 433 | - } |
|
| 432 | + $sort_order = (int)$last_order + 1; |
|
| 433 | + } |
|
| 434 | 434 | |
| 435 | - $default_value_add = ''; |
|
| 435 | + $default_value_add = ''; |
|
| 436 | 436 | |
| 437 | 437 | |
| 438 | - if (!empty($post_meta_info)) {
|
|
| 439 | - switch ($field_type): |
|
| 438 | + if (!empty($post_meta_info)) {
|
|
| 439 | + switch ($field_type): |
|
| 440 | 440 | |
| 441 | - case 'address': |
|
| 441 | + case 'address': |
|
| 442 | 442 | |
| 443 | - if ($htmlvar_name != '') {
|
|
| 444 | - $prefix = $htmlvar_name . '_'; |
|
| 445 | - } |
|
| 446 | - $old_prefix = $old_html_variable . '_'; |
|
| 443 | + if ($htmlvar_name != '') {
|
|
| 444 | + $prefix = $htmlvar_name . '_'; |
|
| 445 | + } |
|
| 446 | + $old_prefix = $old_html_variable . '_'; |
|
| 447 | 447 | |
| 448 | 448 | |
| 449 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "address` `" . $prefix . "address` VARCHAR( 254 ) NULL"; |
|
| 449 | + $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "address` `" . $prefix . "address` VARCHAR( 254 ) NULL"; |
|
| 450 | 450 | |
| 451 | - if ($default_value != '') {
|
|
| 452 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 453 | - } |
|
| 451 | + if ($default_value != '') {
|
|
| 452 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 453 | + } |
|
| 454 | 454 | |
| 455 | - $wpdb->query($meta_field_add); |
|
| 455 | + $wpdb->query($meta_field_add); |
|
| 456 | 456 | |
| 457 | - if ($extra_fields != '') {
|
|
| 457 | + if ($extra_fields != '') {
|
|
| 458 | 458 | |
| 459 | - if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
|
|
| 459 | + if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
|
|
| 460 | 460 | |
| 461 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "city'");
|
|
| 462 | - if ($is_column) {
|
|
| 463 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "city` `" . $prefix . "city` VARCHAR( 50 ) NULL"; |
|
| 461 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "city'");
|
|
| 462 | + if ($is_column) {
|
|
| 463 | + $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "city` `" . $prefix . "city` VARCHAR( 50 ) NULL"; |
|
| 464 | 464 | |
| 465 | - if ($default_value != '') {
|
|
| 466 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 467 | - } |
|
| 465 | + if ($default_value != '') {
|
|
| 466 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 467 | + } |
|
| 468 | 468 | |
| 469 | - $wpdb->query($meta_field_add); |
|
| 470 | - } else {
|
|
| 469 | + $wpdb->query($meta_field_add); |
|
| 470 | + } else {
|
|
| 471 | 471 | |
| 472 | - $meta_field_add = "VARCHAR( 50 ) NULL"; |
|
| 473 | - if ($default_value != '') {
|
|
| 474 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 475 | - } |
|
| 476 | - geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add); |
|
| 472 | + $meta_field_add = "VARCHAR( 50 ) NULL"; |
|
| 473 | + if ($default_value != '') {
|
|
| 474 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 475 | + } |
|
| 476 | + geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add); |
|
| 477 | 477 | |
| 478 | - } |
|
| 478 | + } |
|
| 479 | 479 | |
| 480 | 480 | |
| 481 | - } |
|
| 481 | + } |
|
| 482 | 482 | |
| 483 | 483 | |
| 484 | - if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
|
|
| 484 | + if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
|
|
| 485 | 485 | |
| 486 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "region'");
|
|
| 486 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "region'");
|
|
| 487 | 487 | |
| 488 | - if ($is_column) {
|
|
| 489 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "region` `" . $prefix . "region` VARCHAR( 50 ) NULL"; |
|
| 488 | + if ($is_column) {
|
|
| 489 | + $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "region` `" . $prefix . "region` VARCHAR( 50 ) NULL"; |
|
| 490 | 490 | |
| 491 | - if ($default_value != '') {
|
|
| 492 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 493 | - } |
|
| 491 | + if ($default_value != '') {
|
|
| 492 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 493 | + } |
|
| 494 | 494 | |
| 495 | - $wpdb->query($meta_field_add); |
|
| 496 | - } else {
|
|
| 497 | - $meta_field_add = "VARCHAR( 50 ) NULL"; |
|
| 498 | - if ($default_value != '') {
|
|
| 499 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 500 | - } |
|
| 495 | + $wpdb->query($meta_field_add); |
|
| 496 | + } else {
|
|
| 497 | + $meta_field_add = "VARCHAR( 50 ) NULL"; |
|
| 498 | + if ($default_value != '') {
|
|
| 499 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 500 | + } |
|
| 501 | 501 | |
| 502 | - geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add); |
|
| 503 | - } |
|
| 502 | + geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add); |
|
| 503 | + } |
|
| 504 | 504 | |
| 505 | - } |
|
| 506 | - if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
|
|
| 505 | + } |
|
| 506 | + if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
|
|
| 507 | 507 | |
| 508 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "country'");
|
|
| 508 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "country'");
|
|
| 509 | 509 | |
| 510 | - if ($is_column) {
|
|
| 510 | + if ($is_column) {
|
|
| 511 | 511 | |
| 512 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "country` `" . $prefix . "country` VARCHAR( 50 ) NULL"; |
|
| 512 | + $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "country` `" . $prefix . "country` VARCHAR( 50 ) NULL"; |
|
| 513 | 513 | |
| 514 | - if ($default_value != '') {
|
|
| 515 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 516 | - } |
|
| 514 | + if ($default_value != '') {
|
|
| 515 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 516 | + } |
|
| 517 | 517 | |
| 518 | - $wpdb->query($meta_field_add); |
|
| 519 | - } else {
|
|
| 518 | + $wpdb->query($meta_field_add); |
|
| 519 | + } else {
|
|
| 520 | 520 | |
| 521 | - $meta_field_add = "VARCHAR( 50 ) NULL"; |
|
| 522 | - if ($default_value != '') {
|
|
| 523 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 524 | - } |
|
| 521 | + $meta_field_add = "VARCHAR( 50 ) NULL"; |
|
| 522 | + if ($default_value != '') {
|
|
| 523 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 524 | + } |
|
| 525 | 525 | |
| 526 | - geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add); |
|
| 526 | + geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add); |
|
| 527 | 527 | |
| 528 | - } |
|
| 528 | + } |
|
| 529 | 529 | |
| 530 | - } |
|
| 531 | - if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
|
|
| 530 | + } |
|
| 531 | + if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
|
|
| 532 | 532 | |
| 533 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "zip'");
|
|
| 533 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "zip'");
|
|
| 534 | 534 | |
| 535 | - if ($is_column) {
|
|
| 535 | + if ($is_column) {
|
|
| 536 | 536 | |
| 537 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "zip` `" . $prefix . "zip` VARCHAR( 50 ) NULL"; |
|
| 537 | + $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "zip` `" . $prefix . "zip` VARCHAR( 50 ) NULL"; |
|
| 538 | 538 | |
| 539 | - if ($default_value != '') {
|
|
| 540 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 541 | - } |
|
| 539 | + if ($default_value != '') {
|
|
| 540 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 541 | + } |
|
| 542 | 542 | |
| 543 | - $wpdb->query($meta_field_add); |
|
| 544 | - } else {
|
|
| 543 | + $wpdb->query($meta_field_add); |
|
| 544 | + } else {
|
|
| 545 | 545 | |
| 546 | - $meta_field_add = "VARCHAR( 50 ) NULL"; |
|
| 547 | - if ($default_value != '') {
|
|
| 548 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 549 | - } |
|
| 546 | + $meta_field_add = "VARCHAR( 50 ) NULL"; |
|
| 547 | + if ($default_value != '') {
|
|
| 548 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 549 | + } |
|
| 550 | 550 | |
| 551 | - geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add); |
|
| 551 | + geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add); |
|
| 552 | 552 | |
| 553 | - } |
|
| 553 | + } |
|
| 554 | 554 | |
| 555 | - } |
|
| 556 | - if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
|
|
| 555 | + } |
|
| 556 | + if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
|
|
| 557 | 557 | |
| 558 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latitude'");
|
|
| 559 | - if ($is_column) {
|
|
| 558 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latitude'");
|
|
| 559 | + if ($is_column) {
|
|
| 560 | 560 | |
| 561 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latitude` `" . $prefix . "latitude` VARCHAR( 20 ) NULL"; |
|
| 561 | + $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latitude` `" . $prefix . "latitude` VARCHAR( 20 ) NULL"; |
|
| 562 | 562 | |
| 563 | - if ($default_value != '') {
|
|
| 564 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 565 | - } |
|
| 563 | + if ($default_value != '') {
|
|
| 564 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 565 | + } |
|
| 566 | 566 | |
| 567 | - $wpdb->query($meta_field_add); |
|
| 568 | - } else {
|
|
| 567 | + $wpdb->query($meta_field_add); |
|
| 568 | + } else {
|
|
| 569 | 569 | |
| 570 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL"; |
|
| 571 | - $meta_field_add = "VARCHAR( 20 ) NULL"; |
|
| 572 | - if ($default_value != '') {
|
|
| 573 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 574 | - } |
|
| 570 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL"; |
|
| 571 | + $meta_field_add = "VARCHAR( 20 ) NULL"; |
|
| 572 | + if ($default_value != '') {
|
|
| 573 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 574 | + } |
|
| 575 | 575 | |
| 576 | - geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add); |
|
| 576 | + geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add); |
|
| 577 | 577 | |
| 578 | - } |
|
| 578 | + } |
|
| 579 | 579 | |
| 580 | 580 | |
| 581 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "longitude'");
|
|
| 581 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "longitude'");
|
|
| 582 | 582 | |
| 583 | - if ($is_column) {
|
|
| 584 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "longitude` `" . $prefix . "longitude` VARCHAR( 20 ) NULL"; |
|
| 583 | + if ($is_column) {
|
|
| 584 | + $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "longitude` `" . $prefix . "longitude` VARCHAR( 20 ) NULL"; |
|
| 585 | 585 | |
| 586 | - if ($default_value != '') {
|
|
| 587 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 588 | - } |
|
| 586 | + if ($default_value != '') {
|
|
| 587 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 588 | + } |
|
| 589 | 589 | |
| 590 | - $wpdb->query($meta_field_add); |
|
| 591 | - } else {
|
|
| 590 | + $wpdb->query($meta_field_add); |
|
| 591 | + } else {
|
|
| 592 | 592 | |
| 593 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL"; |
|
| 594 | - $meta_field_add = "VARCHAR( 20 ) NULL"; |
|
| 595 | - if ($default_value != '') {
|
|
| 596 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 597 | - } |
|
| 593 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL"; |
|
| 594 | + $meta_field_add = "VARCHAR( 20 ) NULL"; |
|
| 595 | + if ($default_value != '') {
|
|
| 596 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 597 | + } |
|
| 598 | 598 | |
| 599 | - geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add); |
|
| 600 | - } |
|
| 599 | + geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add); |
|
| 600 | + } |
|
| 601 | 601 | |
| 602 | - } |
|
| 603 | - if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
|
|
| 602 | + } |
|
| 603 | + if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
|
|
| 604 | 604 | |
| 605 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapview'");
|
|
| 605 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapview'");
|
|
| 606 | 606 | |
| 607 | - if ($is_column) {
|
|
| 608 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapview` `" . $prefix . "mapview` VARCHAR( 15 ) NULL"; |
|
| 607 | + if ($is_column) {
|
|
| 608 | + $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapview` `" . $prefix . "mapview` VARCHAR( 15 ) NULL"; |
|
| 609 | 609 | |
| 610 | - if ($default_value != '') {
|
|
| 611 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 612 | - } |
|
| 610 | + if ($default_value != '') {
|
|
| 611 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 612 | + } |
|
| 613 | 613 | |
| 614 | - $wpdb->query($meta_field_add); |
|
| 615 | - } else {
|
|
| 614 | + $wpdb->query($meta_field_add); |
|
| 615 | + } else {
|
|
| 616 | 616 | |
| 617 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL"; |
|
| 617 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL"; |
|
| 618 | 618 | |
| 619 | - $meta_field_add = "VARCHAR( 15 ) NULL"; |
|
| 620 | - if ($default_value != '') {
|
|
| 621 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 622 | - } |
|
| 619 | + $meta_field_add = "VARCHAR( 15 ) NULL"; |
|
| 620 | + if ($default_value != '') {
|
|
| 621 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 622 | + } |
|
| 623 | 623 | |
| 624 | - geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add); |
|
| 625 | - } |
|
| 624 | + geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add); |
|
| 625 | + } |
|
| 626 | 626 | |
| 627 | 627 | |
| 628 | - } |
|
| 629 | - if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
|
|
| 628 | + } |
|
| 629 | + if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
|
|
| 630 | 630 | |
| 631 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapzoom'");
|
|
| 632 | - if ($is_column) {
|
|
| 633 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapzoom` `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL"; |
|
| 631 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapzoom'");
|
|
| 632 | + if ($is_column) {
|
|
| 633 | + $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapzoom` `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL"; |
|
| 634 | 634 | |
| 635 | - if ($default_value != '') {
|
|
| 636 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 637 | - } |
|
| 635 | + if ($default_value != '') {
|
|
| 636 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 637 | + } |
|
| 638 | 638 | |
| 639 | - $wpdb->query($meta_field_add); |
|
| 639 | + $wpdb->query($meta_field_add); |
|
| 640 | 640 | |
| 641 | - } else {
|
|
| 641 | + } else {
|
|
| 642 | 642 | |
| 643 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL"; |
|
| 643 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL"; |
|
| 644 | 644 | |
| 645 | - $meta_field_add = "VARCHAR( 3 ) NULL"; |
|
| 646 | - if ($default_value != '') {
|
|
| 647 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 648 | - } |
|
| 645 | + $meta_field_add = "VARCHAR( 3 ) NULL"; |
|
| 646 | + if ($default_value != '') {
|
|
| 647 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 648 | + } |
|
| 649 | 649 | |
| 650 | - geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add); |
|
| 651 | - } |
|
| 650 | + geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add); |
|
| 651 | + } |
|
| 652 | 652 | |
| 653 | - } |
|
| 654 | - // show lat lng |
|
| 655 | - if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
|
|
| 656 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latlng'");
|
|
| 653 | + } |
|
| 654 | + // show lat lng |
|
| 655 | + if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
|
|
| 656 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latlng'");
|
|
| 657 | 657 | |
| 658 | - if ($is_column) {
|
|
| 659 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latlng` `" . $prefix . "latlng` VARCHAR( 3 ) NULL"; |
|
| 660 | - $meta_field_add .= " DEFAULT '1'"; |
|
| 658 | + if ($is_column) {
|
|
| 659 | + $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latlng` `" . $prefix . "latlng` VARCHAR( 3 ) NULL"; |
|
| 660 | + $meta_field_add .= " DEFAULT '1'"; |
|
| 661 | 661 | |
| 662 | - $wpdb->query($meta_field_add); |
|
| 663 | - } else {
|
|
| 664 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL"; |
|
| 662 | + $wpdb->query($meta_field_add); |
|
| 663 | + } else {
|
|
| 664 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL"; |
|
| 665 | 665 | |
| 666 | - $meta_field_add = "VARCHAR( 3 ) NULL"; |
|
| 667 | - $meta_field_add .= " DEFAULT '1'"; |
|
| 666 | + $meta_field_add = "VARCHAR( 3 ) NULL"; |
|
| 667 | + $meta_field_add .= " DEFAULT '1'"; |
|
| 668 | 668 | |
| 669 | - geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add); |
|
| 670 | - } |
|
| 669 | + geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add); |
|
| 670 | + } |
|
| 671 | 671 | |
| 672 | - } |
|
| 673 | - }// end extra |
|
| 672 | + } |
|
| 673 | + }// end extra |
|
| 674 | 674 | |
| 675 | - break; |
|
| 675 | + break; |
|
| 676 | 676 | |
| 677 | - case 'checkbox': |
|
| 678 | - case 'multiselect': |
|
| 679 | - case 'select': |
|
| 680 | - case 'taxonomy': |
|
| 677 | + case 'checkbox': |
|
| 678 | + case 'multiselect': |
|
| 679 | + case 'select': |
|
| 680 | + case 'taxonomy': |
|
| 681 | 681 | |
| 682 | - $op_size = '500'; |
|
| 682 | + $op_size = '500'; |
|
| 683 | 683 | |
| 684 | - // only make the field as big as it needs to be. |
|
| 685 | - if(isset($option_values) && $option_values && $field_type=='select'){
|
|
| 686 | - $option_values_arr = explode(',',$option_values);
|
|
| 687 | - if(is_array($option_values_arr)){
|
|
| 688 | - $op_max = 0; |
|
| 689 | - foreach($option_values_arr as $op_val){
|
|
| 690 | - if(strlen($op_val) && strlen($op_val)>$op_max){$op_max = strlen($op_val);}
|
|
| 691 | - } |
|
| 692 | - if($op_max){$op_size =$op_max; }
|
|
| 693 | - } |
|
| 694 | - }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
|
|
| 695 | - if(strlen($option_values)){
|
|
| 696 | - $op_size = strlen($option_values); |
|
| 697 | - } |
|
| 698 | - } |
|
| 684 | + // only make the field as big as it needs to be. |
|
| 685 | + if(isset($option_values) && $option_values && $field_type=='select'){
|
|
| 686 | + $option_values_arr = explode(',',$option_values);
|
|
| 687 | + if(is_array($option_values_arr)){
|
|
| 688 | + $op_max = 0; |
|
| 689 | + foreach($option_values_arr as $op_val){
|
|
| 690 | + if(strlen($op_val) && strlen($op_val)>$op_max){$op_max = strlen($op_val);}
|
|
| 691 | + } |
|
| 692 | + if($op_max){$op_size =$op_max; }
|
|
| 693 | + } |
|
| 694 | + }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
|
|
| 695 | + if(strlen($option_values)){
|
|
| 696 | + $op_size = strlen($option_values); |
|
| 697 | + } |
|
| 698 | + } |
|
| 699 | 699 | |
| 700 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "`VARCHAR( $op_size ) NULL"; |
|
| 700 | + $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "`VARCHAR( $op_size ) NULL"; |
|
| 701 | 701 | |
| 702 | - if ($default_value != '') {
|
|
| 703 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 704 | - } |
|
| 702 | + if ($default_value != '') {
|
|
| 703 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 704 | + } |
|
| 705 | 705 | |
| 706 | - $alter_result = $wpdb->query($meta_field_add); |
|
| 707 | - if($alter_result===false){
|
|
| 708 | - return __('Column change failed, you may have too many columns.','geodirectory');
|
|
| 709 | - } |
|
| 706 | + $alter_result = $wpdb->query($meta_field_add); |
|
| 707 | + if($alter_result===false){
|
|
| 708 | + return __('Column change failed, you may have too many columns.','geodirectory');
|
|
| 709 | + } |
|
| 710 | 710 | |
| 711 | - if (isset($request_field['cat_display_type'])) |
|
| 712 | - $extra_fields = $request_field['cat_display_type']; |
|
| 711 | + if (isset($request_field['cat_display_type'])) |
|
| 712 | + $extra_fields = $request_field['cat_display_type']; |
|
| 713 | 713 | |
| 714 | - if (isset($request_field['multi_display_type'])) |
|
| 715 | - $extra_fields = $request_field['multi_display_type']; |
|
| 714 | + if (isset($request_field['multi_display_type'])) |
|
| 715 | + $extra_fields = $request_field['multi_display_type']; |
|
| 716 | 716 | |
| 717 | 717 | |
| 718 | - break; |
|
| 718 | + break; |
|
| 719 | 719 | |
| 720 | - case 'textarea': |
|
| 721 | - case 'html': |
|
| 722 | - case 'url': |
|
| 723 | - case 'file': |
|
| 720 | + case 'textarea': |
|
| 721 | + case 'html': |
|
| 722 | + case 'url': |
|
| 723 | + case 'file': |
|
| 724 | 724 | |
| 725 | - $alter_result = $wpdb->query("ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TEXT NULL");
|
|
| 726 | - if($alter_result===false){
|
|
| 727 | - return __('Column change failed, you may have too many columns.','geodirectory');
|
|
| 728 | - } |
|
| 729 | - if (isset($request_field['advanced_editor'])) |
|
| 730 | - $extra_fields = $request_field['advanced_editor']; |
|
| 731 | - |
|
| 732 | - break; |
|
| 725 | + $alter_result = $wpdb->query("ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TEXT NULL");
|
|
| 726 | + if($alter_result===false){
|
|
| 727 | + return __('Column change failed, you may have too many columns.','geodirectory');
|
|
| 728 | + } |
|
| 729 | + if (isset($request_field['advanced_editor'])) |
|
| 730 | + $extra_fields = $request_field['advanced_editor']; |
|
| 731 | + |
|
| 732 | + break; |
|
| 733 | 733 | |
| 734 | - case 'fieldset': |
|
| 735 | - // Nothing happened for fieldset |
|
| 736 | - break; |
|
| 734 | + case 'fieldset': |
|
| 735 | + // Nothing happened for fieldset |
|
| 736 | + break; |
|
| 737 | 737 | |
| 738 | - default: |
|
| 739 | - if ($data_type != 'VARCHAR' && $data_type != '') {
|
|
| 740 | - if ($data_type == 'FLOAT' && $decimal_point > 0) {
|
|
| 741 | - $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` DECIMAL(11, " . (int)$decimal_point . ") NULL"; |
|
| 742 | - } else {
|
|
| 743 | - $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` " . $data_type . " NULL"; |
|
| 744 | - } |
|
| 745 | - |
|
| 746 | - if (is_numeric($default_value) && $default_value != '') {
|
|
| 747 | - $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
| 748 | - } |
|
| 749 | - } else {
|
|
| 750 | - $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` VARCHAR( 254 ) NULL"; |
|
| 751 | - if ($default_value != '') {
|
|
| 752 | - $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
| 753 | - } |
|
| 754 | - } |
|
| 755 | - |
|
| 756 | - $alter_result = $wpdb->query($default_value_add); |
|
| 757 | - if($alter_result===false){
|
|
| 758 | - return __('Column change failed, you may have too many columns.','geodirectory');
|
|
| 759 | - } |
|
| 760 | - break; |
|
| 761 | - endswitch; |
|
| 762 | - |
|
| 763 | - $extra_field_query = ''; |
|
| 764 | - if (!empty($extra_fields)) {
|
|
| 765 | - $extra_field_query = serialize($extra_fields); |
|
| 766 | - } |
|
| 767 | - |
|
| 768 | - $decimal_point = $field_type == 'text' && $data_type == 'FLOAT' ? $decimal_point : ''; |
|
| 769 | - |
|
| 770 | - $wpdb->query( |
|
| 771 | - |
|
| 772 | - $wpdb->prepare( |
|
| 773 | - |
|
| 774 | - "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set |
|
| 738 | + default: |
|
| 739 | + if ($data_type != 'VARCHAR' && $data_type != '') {
|
|
| 740 | + if ($data_type == 'FLOAT' && $decimal_point > 0) {
|
|
| 741 | + $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` DECIMAL(11, " . (int)$decimal_point . ") NULL"; |
|
| 742 | + } else {
|
|
| 743 | + $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` " . $data_type . " NULL"; |
|
| 744 | + } |
|
| 745 | + |
|
| 746 | + if (is_numeric($default_value) && $default_value != '') {
|
|
| 747 | + $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
| 748 | + } |
|
| 749 | + } else {
|
|
| 750 | + $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` VARCHAR( 254 ) NULL"; |
|
| 751 | + if ($default_value != '') {
|
|
| 752 | + $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
| 753 | + } |
|
| 754 | + } |
|
| 755 | + |
|
| 756 | + $alter_result = $wpdb->query($default_value_add); |
|
| 757 | + if($alter_result===false){
|
|
| 758 | + return __('Column change failed, you may have too many columns.','geodirectory');
|
|
| 759 | + } |
|
| 760 | + break; |
|
| 761 | + endswitch; |
|
| 762 | + |
|
| 763 | + $extra_field_query = ''; |
|
| 764 | + if (!empty($extra_fields)) {
|
|
| 765 | + $extra_field_query = serialize($extra_fields); |
|
| 766 | + } |
|
| 767 | + |
|
| 768 | + $decimal_point = $field_type == 'text' && $data_type == 'FLOAT' ? $decimal_point : ''; |
|
| 769 | + |
|
| 770 | + $wpdb->query( |
|
| 771 | + |
|
| 772 | + $wpdb->prepare( |
|
| 773 | + |
|
| 774 | + "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set |
|
| 775 | 775 | post_type = %s, |
| 776 | 776 | admin_title = %s, |
| 777 | 777 | site_title = %s, |
@@ -805,308 +805,308 @@ discard block |
||
| 805 | 805 | for_admin_use = %s |
| 806 | 806 | where id = %d", |
| 807 | 807 | |
| 808 | - array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use, $cf) |
|
| 809 | - ) |
|
| 808 | + array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use, $cf) |
|
| 809 | + ) |
|
| 810 | 810 | |
| 811 | - ); |
|
| 811 | + ); |
|
| 812 | 812 | |
| 813 | - $lastid = trim($cf); |
|
| 813 | + $lastid = trim($cf); |
|
| 814 | 814 | |
| 815 | 815 | |
| 816 | - $wpdb->query( |
|
| 817 | - $wpdb->prepare( |
|
| 818 | - "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
| 816 | + $wpdb->query( |
|
| 817 | + $wpdb->prepare( |
|
| 818 | + "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
| 819 | 819 | site_title=%s |
| 820 | 820 | where post_type = %s and htmlvar_name = %s", |
| 821 | - array($site_title, $post_type, $htmlvar_name) |
|
| 822 | - ) |
|
| 823 | - ); |
|
| 824 | - |
|
| 825 | - |
|
| 826 | - if ($cat_sort == '') |
|
| 827 | - $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
|
|
| 828 | - |
|
| 829 | - |
|
| 830 | - /** |
|
| 831 | - * Called after all custom fields are saved for a post. |
|
| 832 | - * |
|
| 833 | - * @since 1.0.0 |
|
| 834 | - * @param int $lastid The post ID. |
|
| 835 | - */ |
|
| 836 | - do_action('geodir_after_custom_fields_updated', $lastid);
|
|
| 837 | - |
|
| 838 | - } else {
|
|
| 839 | - |
|
| 840 | - switch ($field_type): |
|
| 841 | - |
|
| 842 | - case 'address': |
|
| 843 | - |
|
| 844 | - $data_type = ''; |
|
| 845 | - |
|
| 846 | - if ($htmlvar_name != '') {
|
|
| 847 | - $prefix = $htmlvar_name . '_'; |
|
| 848 | - } |
|
| 849 | - $old_prefix = $old_html_variable; |
|
| 850 | - |
|
| 851 | - //$meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."address` VARCHAR( 254 ) NULL"; |
|
| 852 | - |
|
| 853 | - $meta_field_add = "VARCHAR( 254 ) NULL"; |
|
| 854 | - if ($default_value != '') {
|
|
| 855 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 856 | - } |
|
| 857 | - |
|
| 858 | - geodir_add_column_if_not_exist($detail_table, $prefix . "address", $meta_field_add); |
|
| 859 | - //$wpdb->query($meta_field_add); |
|
| 860 | - |
|
| 861 | - |
|
| 862 | - if (!empty($extra_fields)) {
|
|
| 821 | + array($site_title, $post_type, $htmlvar_name) |
|
| 822 | + ) |
|
| 823 | + ); |
|
| 824 | + |
|
| 825 | + |
|
| 826 | + if ($cat_sort == '') |
|
| 827 | + $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
|
|
| 828 | + |
|
| 829 | + |
|
| 830 | + /** |
|
| 831 | + * Called after all custom fields are saved for a post. |
|
| 832 | + * |
|
| 833 | + * @since 1.0.0 |
|
| 834 | + * @param int $lastid The post ID. |
|
| 835 | + */ |
|
| 836 | + do_action('geodir_after_custom_fields_updated', $lastid);
|
|
| 837 | + |
|
| 838 | + } else {
|
|
| 839 | + |
|
| 840 | + switch ($field_type): |
|
| 841 | + |
|
| 842 | + case 'address': |
|
| 843 | + |
|
| 844 | + $data_type = ''; |
|
| 845 | + |
|
| 846 | + if ($htmlvar_name != '') {
|
|
| 847 | + $prefix = $htmlvar_name . '_'; |
|
| 848 | + } |
|
| 849 | + $old_prefix = $old_html_variable; |
|
| 850 | + |
|
| 851 | + //$meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."address` VARCHAR( 254 ) NULL"; |
|
| 852 | + |
|
| 853 | + $meta_field_add = "VARCHAR( 254 ) NULL"; |
|
| 854 | + if ($default_value != '') {
|
|
| 855 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 856 | + } |
|
| 857 | + |
|
| 858 | + geodir_add_column_if_not_exist($detail_table, $prefix . "address", $meta_field_add); |
|
| 859 | + //$wpdb->query($meta_field_add); |
|
| 860 | + |
|
| 861 | + |
|
| 862 | + if (!empty($extra_fields)) {
|
|
| 863 | 863 | |
| 864 | - if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
|
|
| 865 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "city` VARCHAR( 30 ) NULL"; |
|
| 866 | - $meta_field_add = "VARCHAR( 30 ) NULL"; |
|
| 867 | - if ($default_value != '') {
|
|
| 868 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 869 | - } |
|
| 870 | - |
|
| 871 | - geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add); |
|
| 872 | - //$wpdb->query($meta_field_add); |
|
| 873 | - } |
|
| 874 | - if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
|
|
| 875 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "region` VARCHAR( 30 ) NULL"; |
|
| 876 | - $meta_field_add = "VARCHAR( 30 ) NULL"; |
|
| 877 | - if ($default_value != '') {
|
|
| 878 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 879 | - } |
|
| 880 | - |
|
| 881 | - geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add); |
|
| 882 | - //$wpdb->query($meta_field_add); |
|
| 883 | - } |
|
| 884 | - if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
|
|
| 885 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "country` VARCHAR( 30 ) NULL"; |
|
| 886 | - |
|
| 887 | - $meta_field_add = "VARCHAR( 30 ) NULL"; |
|
| 888 | - if ($default_value != '') {
|
|
| 889 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 890 | - } |
|
| 891 | - |
|
| 892 | - geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add); |
|
| 893 | - //$wpdb->query($meta_field_add); |
|
| 894 | - } |
|
| 895 | - if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
|
|
| 896 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "zip` VARCHAR( 15 ) NULL"; |
|
| 897 | - $meta_field_add = "VARCHAR( 15 ) NULL"; |
|
| 898 | - if ($default_value != '') {
|
|
| 899 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 900 | - } |
|
| 901 | - |
|
| 902 | - geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add); |
|
| 903 | - //$wpdb->query($meta_field_add); |
|
| 904 | - } |
|
| 905 | - if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
|
|
| 906 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL"; |
|
| 907 | - $meta_field_add = "VARCHAR( 20 ) NULL"; |
|
| 908 | - if ($default_value != '') {
|
|
| 909 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 910 | - } |
|
| 911 | - |
|
| 912 | - geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add); |
|
| 913 | - //$wpdb->query($meta_field_add); |
|
| 914 | - |
|
| 915 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL"; |
|
| 916 | - |
|
| 917 | - $meta_field_add = "VARCHAR( 20 ) NULL"; |
|
| 918 | - if ($default_value != '') {
|
|
| 919 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 920 | - } |
|
| 921 | - |
|
| 922 | - geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add); |
|
| 923 | - |
|
| 924 | - //$wpdb->query($meta_field_add); |
|
| 925 | - } |
|
| 926 | - if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
|
|
| 927 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL"; |
|
| 928 | - |
|
| 929 | - $meta_field_add = "VARCHAR( 15 ) NULL"; |
|
| 930 | - if ($default_value != '') {
|
|
| 931 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 932 | - } |
|
| 933 | - |
|
| 934 | - geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add); |
|
| 935 | - |
|
| 936 | - //$wpdb->query($meta_field_add); |
|
| 937 | - } |
|
| 938 | - if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
|
|
| 939 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL"; |
|
| 940 | - |
|
| 941 | - $meta_field_add = "VARCHAR( 3 ) NULL"; |
|
| 942 | - if ($default_value != '') {
|
|
| 943 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 944 | - } |
|
| 945 | - |
|
| 946 | - geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add); |
|
| 947 | - |
|
| 948 | - //$wpdb->query($meta_field_add); |
|
| 949 | - } |
|
| 950 | - // show lat lng |
|
| 951 | - if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
|
|
| 952 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL"; |
|
| 953 | - |
|
| 954 | - $meta_field_add = "VARCHAR( 3 ) NULL"; |
|
| 955 | - $meta_field_add .= " DEFAULT '1'"; |
|
| 956 | - |
|
| 957 | - geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add); |
|
| 958 | - //$wpdb->query($meta_field_add); |
|
| 959 | - } |
|
| 960 | - } |
|
| 961 | - |
|
| 962 | - break; |
|
| 963 | - |
|
| 964 | - case 'checkbox': |
|
| 965 | - $data_type = 'TINYINT'; |
|
| 966 | - |
|
| 967 | - $meta_field_add = $data_type . "( 1 ) NOT NULL "; |
|
| 968 | - if ((int)$default_value === 1) {
|
|
| 969 | - $meta_field_add .= " DEFAULT '1'"; |
|
| 970 | - } |
|
| 971 | - |
|
| 972 | - $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
|
| 973 | - if ($add_result === false) {
|
|
| 974 | - return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
|
|
| 975 | - } |
|
| 976 | - break; |
|
| 977 | - case 'multiselect': |
|
| 978 | - case 'select': |
|
| 979 | - $data_type = 'VARCHAR'; |
|
| 980 | - $op_size = '500'; |
|
| 981 | - |
|
| 982 | - // only make the field as big as it needs to be. |
|
| 983 | - if (isset($option_values) && $option_values && $field_type == 'select') {
|
|
| 984 | - $option_values_arr = explode(',', $option_values);
|
|
| 985 | - |
|
| 986 | - if (is_array($option_values_arr)) {
|
|
| 987 | - $op_max = 0; |
|
| 988 | - |
|
| 989 | - foreach ($option_values_arr as $op_val) {
|
|
| 990 | - if (strlen($op_val) && strlen($op_val) > $op_max) {
|
|
| 991 | - $op_max = strlen($op_val); |
|
| 992 | - } |
|
| 993 | - } |
|
| 994 | - |
|
| 995 | - if ($op_max) {
|
|
| 996 | - $op_size = $op_max; |
|
| 997 | - } |
|
| 998 | - } |
|
| 999 | - } elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
|
|
| 1000 | - if (strlen($option_values)) {
|
|
| 1001 | - $op_size = strlen($option_values); |
|
| 1002 | - } |
|
| 1003 | - |
|
| 1004 | - if (isset($request_field['multi_display_type'])) {
|
|
| 1005 | - $extra_fields = $request_field['multi_display_type']; |
|
| 1006 | - } |
|
| 1007 | - } |
|
| 1008 | - |
|
| 1009 | - $meta_field_add = $data_type . "( $op_size ) NULL "; |
|
| 1010 | - if ($default_value != '') {
|
|
| 1011 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1012 | - } |
|
| 1013 | - |
|
| 1014 | - $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
|
| 1015 | - if ($add_result === false) {
|
|
| 1016 | - return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
|
|
| 1017 | - } |
|
| 1018 | - break; |
|
| 1019 | - case 'textarea': |
|
| 1020 | - case 'html': |
|
| 1021 | - case 'url': |
|
| 1022 | - case 'file': |
|
| 1023 | - |
|
| 1024 | - $data_type = 'TEXT'; |
|
| 1025 | - |
|
| 1026 | - $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL "; |
|
| 1027 | - |
|
| 1028 | - $meta_field_add = $data_type . " NULL "; |
|
| 1029 | - /*if($default_value != '') |
|
| 864 | + if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
|
|
| 865 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "city` VARCHAR( 30 ) NULL"; |
|
| 866 | + $meta_field_add = "VARCHAR( 30 ) NULL"; |
|
| 867 | + if ($default_value != '') {
|
|
| 868 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 869 | + } |
|
| 870 | + |
|
| 871 | + geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add); |
|
| 872 | + //$wpdb->query($meta_field_add); |
|
| 873 | + } |
|
| 874 | + if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
|
|
| 875 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "region` VARCHAR( 30 ) NULL"; |
|
| 876 | + $meta_field_add = "VARCHAR( 30 ) NULL"; |
|
| 877 | + if ($default_value != '') {
|
|
| 878 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 879 | + } |
|
| 880 | + |
|
| 881 | + geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add); |
|
| 882 | + //$wpdb->query($meta_field_add); |
|
| 883 | + } |
|
| 884 | + if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
|
|
| 885 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "country` VARCHAR( 30 ) NULL"; |
|
| 886 | + |
|
| 887 | + $meta_field_add = "VARCHAR( 30 ) NULL"; |
|
| 888 | + if ($default_value != '') {
|
|
| 889 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 890 | + } |
|
| 891 | + |
|
| 892 | + geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add); |
|
| 893 | + //$wpdb->query($meta_field_add); |
|
| 894 | + } |
|
| 895 | + if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
|
|
| 896 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "zip` VARCHAR( 15 ) NULL"; |
|
| 897 | + $meta_field_add = "VARCHAR( 15 ) NULL"; |
|
| 898 | + if ($default_value != '') {
|
|
| 899 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 900 | + } |
|
| 901 | + |
|
| 902 | + geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add); |
|
| 903 | + //$wpdb->query($meta_field_add); |
|
| 904 | + } |
|
| 905 | + if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
|
|
| 906 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL"; |
|
| 907 | + $meta_field_add = "VARCHAR( 20 ) NULL"; |
|
| 908 | + if ($default_value != '') {
|
|
| 909 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 910 | + } |
|
| 911 | + |
|
| 912 | + geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add); |
|
| 913 | + //$wpdb->query($meta_field_add); |
|
| 914 | + |
|
| 915 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL"; |
|
| 916 | + |
|
| 917 | + $meta_field_add = "VARCHAR( 20 ) NULL"; |
|
| 918 | + if ($default_value != '') {
|
|
| 919 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 920 | + } |
|
| 921 | + |
|
| 922 | + geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add); |
|
| 923 | + |
|
| 924 | + //$wpdb->query($meta_field_add); |
|
| 925 | + } |
|
| 926 | + if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
|
|
| 927 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL"; |
|
| 928 | + |
|
| 929 | + $meta_field_add = "VARCHAR( 15 ) NULL"; |
|
| 930 | + if ($default_value != '') {
|
|
| 931 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 932 | + } |
|
| 933 | + |
|
| 934 | + geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add); |
|
| 935 | + |
|
| 936 | + //$wpdb->query($meta_field_add); |
|
| 937 | + } |
|
| 938 | + if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
|
|
| 939 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL"; |
|
| 940 | + |
|
| 941 | + $meta_field_add = "VARCHAR( 3 ) NULL"; |
|
| 942 | + if ($default_value != '') {
|
|
| 943 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 944 | + } |
|
| 945 | + |
|
| 946 | + geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add); |
|
| 947 | + |
|
| 948 | + //$wpdb->query($meta_field_add); |
|
| 949 | + } |
|
| 950 | + // show lat lng |
|
| 951 | + if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
|
|
| 952 | + $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL"; |
|
| 953 | + |
|
| 954 | + $meta_field_add = "VARCHAR( 3 ) NULL"; |
|
| 955 | + $meta_field_add .= " DEFAULT '1'"; |
|
| 956 | + |
|
| 957 | + geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add); |
|
| 958 | + //$wpdb->query($meta_field_add); |
|
| 959 | + } |
|
| 960 | + } |
|
| 961 | + |
|
| 962 | + break; |
|
| 963 | + |
|
| 964 | + case 'checkbox': |
|
| 965 | + $data_type = 'TINYINT'; |
|
| 966 | + |
|
| 967 | + $meta_field_add = $data_type . "( 1 ) NOT NULL "; |
|
| 968 | + if ((int)$default_value === 1) {
|
|
| 969 | + $meta_field_add .= " DEFAULT '1'"; |
|
| 970 | + } |
|
| 971 | + |
|
| 972 | + $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
|
| 973 | + if ($add_result === false) {
|
|
| 974 | + return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
|
|
| 975 | + } |
|
| 976 | + break; |
|
| 977 | + case 'multiselect': |
|
| 978 | + case 'select': |
|
| 979 | + $data_type = 'VARCHAR'; |
|
| 980 | + $op_size = '500'; |
|
| 981 | + |
|
| 982 | + // only make the field as big as it needs to be. |
|
| 983 | + if (isset($option_values) && $option_values && $field_type == 'select') {
|
|
| 984 | + $option_values_arr = explode(',', $option_values);
|
|
| 985 | + |
|
| 986 | + if (is_array($option_values_arr)) {
|
|
| 987 | + $op_max = 0; |
|
| 988 | + |
|
| 989 | + foreach ($option_values_arr as $op_val) {
|
|
| 990 | + if (strlen($op_val) && strlen($op_val) > $op_max) {
|
|
| 991 | + $op_max = strlen($op_val); |
|
| 992 | + } |
|
| 993 | + } |
|
| 994 | + |
|
| 995 | + if ($op_max) {
|
|
| 996 | + $op_size = $op_max; |
|
| 997 | + } |
|
| 998 | + } |
|
| 999 | + } elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
|
|
| 1000 | + if (strlen($option_values)) {
|
|
| 1001 | + $op_size = strlen($option_values); |
|
| 1002 | + } |
|
| 1003 | + |
|
| 1004 | + if (isset($request_field['multi_display_type'])) {
|
|
| 1005 | + $extra_fields = $request_field['multi_display_type']; |
|
| 1006 | + } |
|
| 1007 | + } |
|
| 1008 | + |
|
| 1009 | + $meta_field_add = $data_type . "( $op_size ) NULL "; |
|
| 1010 | + if ($default_value != '') {
|
|
| 1011 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1012 | + } |
|
| 1013 | + |
|
| 1014 | + $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
|
| 1015 | + if ($add_result === false) {
|
|
| 1016 | + return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
|
|
| 1017 | + } |
|
| 1018 | + break; |
|
| 1019 | + case 'textarea': |
|
| 1020 | + case 'html': |
|
| 1021 | + case 'url': |
|
| 1022 | + case 'file': |
|
| 1023 | + |
|
| 1024 | + $data_type = 'TEXT'; |
|
| 1025 | + |
|
| 1026 | + $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL "; |
|
| 1027 | + |
|
| 1028 | + $meta_field_add = $data_type . " NULL "; |
|
| 1029 | + /*if($default_value != '') |
|
| 1030 | 1030 | { $meta_field_add .= " DEFAULT '".$default_value."'"; }*/
|
| 1031 | 1031 | |
| 1032 | - $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
|
| 1033 | - if ($add_result === false) {
|
|
| 1034 | - return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
|
|
| 1035 | - } |
|
| 1032 | + $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
|
| 1033 | + if ($add_result === false) {
|
|
| 1034 | + return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
|
|
| 1035 | + } |
|
| 1036 | 1036 | |
| 1037 | - break; |
|
| 1037 | + break; |
|
| 1038 | 1038 | |
| 1039 | - case 'datepicker': |
|
| 1039 | + case 'datepicker': |
|
| 1040 | 1040 | |
| 1041 | - $data_type = 'DATE'; |
|
| 1041 | + $data_type = 'DATE'; |
|
| 1042 | 1042 | |
| 1043 | - $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL "; |
|
| 1043 | + $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL "; |
|
| 1044 | 1044 | |
| 1045 | - $meta_field_add = $data_type . " NULL "; |
|
| 1045 | + $meta_field_add = $data_type . " NULL "; |
|
| 1046 | 1046 | |
| 1047 | - $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
|
| 1048 | - if ($add_result === false) {
|
|
| 1049 | - return __('Column creation failed, you may have too many columns or the default value must have in valid date format.', 'geodirectory');
|
|
| 1050 | - } |
|
| 1047 | + $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
|
| 1048 | + if ($add_result === false) {
|
|
| 1049 | + return __('Column creation failed, you may have too many columns or the default value must have in valid date format.', 'geodirectory');
|
|
| 1050 | + } |
|
| 1051 | 1051 | |
| 1052 | - break; |
|
| 1052 | + break; |
|
| 1053 | 1053 | |
| 1054 | - case 'time': |
|
| 1054 | + case 'time': |
|
| 1055 | 1055 | |
| 1056 | - $data_type = 'TIME'; |
|
| 1056 | + $data_type = 'TIME'; |
|
| 1057 | 1057 | |
| 1058 | - $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL "; |
|
| 1058 | + $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL "; |
|
| 1059 | 1059 | |
| 1060 | - $meta_field_add = $data_type . " NULL "; |
|
| 1060 | + $meta_field_add = $data_type . " NULL "; |
|
| 1061 | 1061 | |
| 1062 | - $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
|
| 1063 | - if ($add_result === false) {
|
|
| 1064 | - return __('Column creation failed, you may have too many columns or the default value must have in valid time format.', 'geodirectory');
|
|
| 1065 | - } |
|
| 1062 | + $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
|
| 1063 | + if ($add_result === false) {
|
|
| 1064 | + return __('Column creation failed, you may have too many columns or the default value must have in valid time format.', 'geodirectory');
|
|
| 1065 | + } |
|
| 1066 | 1066 | |
| 1067 | - break; |
|
| 1067 | + break; |
|
| 1068 | 1068 | |
| 1069 | - default: |
|
| 1069 | + default: |
|
| 1070 | 1070 | |
| 1071 | - if ($data_type != 'VARCHAR' && $data_type != '') {
|
|
| 1072 | - $meta_field_add = $data_type . " NULL "; |
|
| 1071 | + if ($data_type != 'VARCHAR' && $data_type != '') {
|
|
| 1072 | + $meta_field_add = $data_type . " NULL "; |
|
| 1073 | 1073 | |
| 1074 | - if ($data_type == 'FLOAT' && $decimal_point > 0) {
|
|
| 1075 | - $meta_field_add = "DECIMAL(11, " . (int)$decimal_point . ") NULL "; |
|
| 1076 | - } |
|
| 1074 | + if ($data_type == 'FLOAT' && $decimal_point > 0) {
|
|
| 1075 | + $meta_field_add = "DECIMAL(11, " . (int)$decimal_point . ") NULL "; |
|
| 1076 | + } |
|
| 1077 | 1077 | |
| 1078 | - if (is_numeric($default_value) && $default_value != '') {
|
|
| 1079 | - $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1080 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1081 | - } |
|
| 1082 | - } else {
|
|
| 1083 | - $meta_field_add = " VARCHAR( 254 ) NULL "; |
|
| 1078 | + if (is_numeric($default_value) && $default_value != '') {
|
|
| 1079 | + $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1080 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1081 | + } |
|
| 1082 | + } else {
|
|
| 1083 | + $meta_field_add = " VARCHAR( 254 ) NULL "; |
|
| 1084 | 1084 | |
| 1085 | - if ($default_value != '') {
|
|
| 1086 | - $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1087 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1088 | - } |
|
| 1089 | - } |
|
| 1085 | + if ($default_value != '') {
|
|
| 1086 | + $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1087 | + $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
| 1088 | + } |
|
| 1089 | + } |
|
| 1090 | 1090 | |
| 1091 | - $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
|
| 1092 | - if ($add_result === false) {
|
|
| 1093 | - return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
|
|
| 1094 | - } |
|
| 1095 | - break; |
|
| 1096 | - endswitch; |
|
| 1091 | + $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
|
| 1092 | + if ($add_result === false) {
|
|
| 1093 | + return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
|
|
| 1094 | + } |
|
| 1095 | + break; |
|
| 1096 | + endswitch; |
|
| 1097 | 1097 | |
| 1098 | - $extra_field_query = ''; |
|
| 1099 | - if (!empty($extra_fields)) {
|
|
| 1100 | - $extra_field_query = serialize($extra_fields); |
|
| 1101 | - } |
|
| 1098 | + $extra_field_query = ''; |
|
| 1099 | + if (!empty($extra_fields)) {
|
|
| 1100 | + $extra_field_query = serialize($extra_fields); |
|
| 1101 | + } |
|
| 1102 | 1102 | |
| 1103 | - $decimal_point = $field_type == 'text' && $data_type == 'FLOAT' ? $decimal_point : ''; |
|
| 1103 | + $decimal_point = $field_type == 'text' && $data_type == 'FLOAT' ? $decimal_point : ''; |
|
| 1104 | 1104 | |
| 1105 | - $wpdb->query( |
|
| 1105 | + $wpdb->query( |
|
| 1106 | 1106 | |
| 1107 | - $wpdb->prepare( |
|
| 1107 | + $wpdb->prepare( |
|
| 1108 | 1108 | |
| 1109 | - "insert into " . GEODIR_CUSTOM_FIELDS_TABLE . " set |
|
| 1109 | + "insert into " . GEODIR_CUSTOM_FIELDS_TABLE . " set |
|
| 1110 | 1110 | post_type = %s, |
| 1111 | 1111 | admin_title = %s, |
| 1112 | 1112 | site_title = %s, |
@@ -1139,26 +1139,26 @@ discard block |
||
| 1139 | 1139 | validation_msg = %s, |
| 1140 | 1140 | for_admin_use = %s ", |
| 1141 | 1141 | |
| 1142 | - array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing,$show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use) |
|
| 1142 | + array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing,$show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use) |
|
| 1143 | 1143 | |
| 1144 | - ) |
|
| 1144 | + ) |
|
| 1145 | 1145 | |
| 1146 | - ); |
|
| 1146 | + ); |
|
| 1147 | 1147 | |
| 1148 | - $lastid = $wpdb->insert_id; |
|
| 1148 | + $lastid = $wpdb->insert_id; |
|
| 1149 | 1149 | |
| 1150 | - $lastid = trim($lastid); |
|
| 1150 | + $lastid = trim($lastid); |
|
| 1151 | 1151 | |
| 1152 | - } |
|
| 1152 | + } |
|
| 1153 | 1153 | |
| 1154 | - return (int)$lastid; |
|
| 1154 | + return (int)$lastid; |
|
| 1155 | 1155 | |
| 1156 | 1156 | |
| 1157 | - } else {
|
|
| 1158 | - return 'HTML Variable Name should be a unique name'; |
|
| 1159 | - } |
|
| 1157 | + } else {
|
|
| 1158 | + return 'HTML Variable Name should be a unique name'; |
|
| 1159 | + } |
|
| 1160 | 1160 | |
| 1161 | - } |
|
| 1161 | + } |
|
| 1162 | 1162 | } |
| 1163 | 1163 | |
| 1164 | 1164 | /** |
@@ -1173,54 +1173,54 @@ discard block |
||
| 1173 | 1173 | function godir_set_field_order($field_ids = array()) |
| 1174 | 1174 | {
|
| 1175 | 1175 | |
| 1176 | - global $wpdb; |
|
| 1176 | + global $wpdb; |
|
| 1177 | 1177 | |
| 1178 | - $count = 0; |
|
| 1179 | - if (!empty($field_ids)): |
|
| 1180 | - $post_meta_info = false; |
|
| 1181 | - foreach ($field_ids as $id) {
|
|
| 1178 | + $count = 0; |
|
| 1179 | + if (!empty($field_ids)): |
|
| 1180 | + $post_meta_info = false; |
|
| 1181 | + foreach ($field_ids as $id) {
|
|
| 1182 | 1182 | |
| 1183 | - $cf = trim($id, '_'); |
|
| 1183 | + $cf = trim($id, '_'); |
|
| 1184 | 1184 | |
| 1185 | - $post_meta_info = $wpdb->query( |
|
| 1186 | - $wpdb->prepare( |
|
| 1187 | - "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set |
|
| 1185 | + $post_meta_info = $wpdb->query( |
|
| 1186 | + $wpdb->prepare( |
|
| 1187 | + "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set |
|
| 1188 | 1188 | sort_order=%d |
| 1189 | 1189 | where id= %d", |
| 1190 | - array($count, $cf) |
|
| 1191 | - ) |
|
| 1192 | - ); |
|
| 1193 | - $count++; |
|
| 1194 | - } |
|
| 1195 | - |
|
| 1196 | - return $post_meta_info; |
|
| 1197 | - else: |
|
| 1198 | - return false; |
|
| 1199 | - endif; |
|
| 1190 | + array($count, $cf) |
|
| 1191 | + ) |
|
| 1192 | + ); |
|
| 1193 | + $count++; |
|
| 1194 | + } |
|
| 1195 | + |
|
| 1196 | + return $post_meta_info; |
|
| 1197 | + else: |
|
| 1198 | + return false; |
|
| 1199 | + endif; |
|
| 1200 | 1200 | } |
| 1201 | 1201 | |
| 1202 | 1202 | |
| 1203 | 1203 | function geodir_get_cf_value($cf){
|
| 1204 | - global $gd_session; |
|
| 1205 | - $value = ''; |
|
| 1206 | - if (is_admin()) {
|
|
| 1207 | - global $post,$gd_session; |
|
| 1208 | - |
|
| 1209 | - if (isset($_REQUEST['post'])) |
|
| 1210 | - $_REQUEST['pid'] = $_REQUEST['post']; |
|
| 1211 | - } |
|
| 1212 | - |
|
| 1213 | - if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
|
|
| 1214 | - $post = $gd_ses_listing; |
|
| 1215 | - $value = isset($post[$cf['name']]) ? $post[$cf['name']] : ''; |
|
| 1216 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 1217 | - $value = geodir_get_post_meta($_REQUEST['pid'], $cf['name'], true); |
|
| 1218 | - } else {
|
|
| 1219 | - if ($value == '') {
|
|
| 1220 | - $value = $cf['default']; |
|
| 1221 | - } |
|
| 1222 | - } |
|
| 1223 | - return $value; |
|
| 1204 | + global $gd_session; |
|
| 1205 | + $value = ''; |
|
| 1206 | + if (is_admin()) {
|
|
| 1207 | + global $post,$gd_session; |
|
| 1208 | + |
|
| 1209 | + if (isset($_REQUEST['post'])) |
|
| 1210 | + $_REQUEST['pid'] = $_REQUEST['post']; |
|
| 1211 | + } |
|
| 1212 | + |
|
| 1213 | + if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
|
|
| 1214 | + $post = $gd_ses_listing; |
|
| 1215 | + $value = isset($post[$cf['name']]) ? $post[$cf['name']] : ''; |
|
| 1216 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 1217 | + $value = geodir_get_post_meta($_REQUEST['pid'], $cf['name'], true); |
|
| 1218 | + } else {
|
|
| 1219 | + if ($value == '') {
|
|
| 1220 | + $value = $cf['default']; |
|
| 1221 | + } |
|
| 1222 | + } |
|
| 1223 | + return $value; |
|
| 1224 | 1224 | } |
| 1225 | 1225 | |
| 1226 | 1226 | /** |
@@ -1239,422 +1239,422 @@ discard block |
||
| 1239 | 1239 | * @param string $post_type Optional. The wordpress post type. |
| 1240 | 1240 | */ |
| 1241 | 1241 | function geodir_get_custom_fields_html($package_id = '', $default = 'custom', $post_type = 'gd_place') {
|
| 1242 | - global $is_default, $mapzoom, $gd_session; |
|
| 1242 | + global $is_default, $mapzoom, $gd_session; |
|
| 1243 | 1243 | |
| 1244 | - $listing_type = $post_type; |
|
| 1244 | + $listing_type = $post_type; |
|
| 1245 | 1245 | |
| 1246 | - $custom_fields = geodir_post_custom_fields($package_id, $default, $post_type); |
|
| 1246 | + $custom_fields = geodir_post_custom_fields($package_id, $default, $post_type); |
|
| 1247 | 1247 | |
| 1248 | - foreach ($custom_fields as $key => $val) {
|
|
| 1249 | - if(isset($val['extra_fields'])){$extra_fields = $val['extra_fields'];}
|
|
| 1250 | - $val = stripslashes_deep($val); // strip slashes from labels |
|
| 1251 | - if(isset($val['extra_fields'])){$val['extra_fields'] = $extra_fields;}
|
|
| 1248 | + foreach ($custom_fields as $key => $val) {
|
|
| 1249 | + if(isset($val['extra_fields'])){$extra_fields = $val['extra_fields'];}
|
|
| 1250 | + $val = stripslashes_deep($val); // strip slashes from labels |
|
| 1251 | + if(isset($val['extra_fields'])){$val['extra_fields'] = $extra_fields;}
|
|
| 1252 | 1252 | |
| 1253 | - $name = $val['name']; |
|
| 1254 | - $type = $val['type']; |
|
| 1255 | - $is_default = $val['is_default']; |
|
| 1253 | + $name = $val['name']; |
|
| 1254 | + $type = $val['type']; |
|
| 1255 | + $is_default = $val['is_default']; |
|
| 1256 | 1256 | |
| 1257 | - /* field available to site admin only for edit */ |
|
| 1258 | - $for_admin_use = isset($val['for_admin_use']) && (int)$val['for_admin_use'] == 1 ? true : false; |
|
| 1259 | - if ($for_admin_use && !is_super_admin()) {
|
|
| 1260 | - continue; |
|
| 1261 | - } |
|
| 1257 | + /* field available to site admin only for edit */ |
|
| 1258 | + $for_admin_use = isset($val['for_admin_use']) && (int)$val['for_admin_use'] == 1 ? true : false; |
|
| 1259 | + if ($for_admin_use && !is_super_admin()) {
|
|
| 1260 | + continue; |
|
| 1261 | + } |
|
| 1262 | 1262 | |
| 1263 | - if (is_admin()) {
|
|
| 1264 | - global $post; |
|
| 1263 | + if (is_admin()) {
|
|
| 1264 | + global $post; |
|
| 1265 | 1265 | |
| 1266 | - if (isset($_REQUEST['post'])) |
|
| 1267 | - $_REQUEST['pid'] = $_REQUEST['post']; |
|
| 1268 | - } |
|
| 1266 | + if (isset($_REQUEST['post'])) |
|
| 1267 | + $_REQUEST['pid'] = $_REQUEST['post']; |
|
| 1268 | + } |
|
| 1269 | 1269 | |
| 1270 | 1270 | |
| 1271 | 1271 | |
| 1272 | - /** |
|
| 1273 | - * Called before the custom fields info is output for submitting a post. |
|
| 1274 | - * |
|
| 1275 | - * Used dynamic hook type geodir_before_custom_form_field_$name. |
|
| 1276 | - * |
|
| 1277 | - * @since 1.0.0 |
|
| 1278 | - * @param string $listing_type The post post type. |
|
| 1279 | - * @param int $package_id The price package ID for the post. |
|
| 1280 | - * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
|
|
| 1281 | - * @see 'geodir_after_custom_form_field_$name' |
|
| 1282 | - */ |
|
| 1283 | - do_action('geodir_before_custom_form_field_' . $name, $listing_type, $package_id, $val);
|
|
| 1284 | - |
|
| 1285 | - |
|
| 1286 | - $custom_field = $val; |
|
| 1287 | - $html =''; |
|
| 1288 | - /** |
|
| 1289 | - * Filter the output for custom fields. |
|
| 1290 | - * |
|
| 1291 | - * Here we can remove or add new functions depending on the field type. |
|
| 1292 | - * |
|
| 1293 | - * @param string $html The html to be filtered (blank). |
|
| 1294 | - * @param array $custom_field The custom field array values. |
|
| 1295 | - */ |
|
| 1296 | - echo apply_filters("geodir_custom_field_input_{$type}",$html,$custom_field);
|
|
| 1297 | - |
|
| 1298 | - |
|
| 1299 | - |
|
| 1300 | - /** |
|
| 1301 | - * Called after the custom fields info is output for submitting a post. |
|
| 1302 | - * |
|
| 1303 | - * Used dynamic hook type geodir_after_custom_form_field_$name. |
|
| 1304 | - * |
|
| 1305 | - * @since 1.0.0 |
|
| 1306 | - * @param string $listing_type The post post type. |
|
| 1307 | - * @param int $package_id The price package ID for the post. |
|
| 1308 | - * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
|
|
| 1309 | - * @see 'geodir_before_custom_form_field_$name' |
|
| 1310 | - */ |
|
| 1311 | - do_action('geodir_after_custom_form_field_' . $name, $listing_type, $package_id, $val);
|
|
| 1312 | - |
|
| 1313 | - } |
|
| 1272 | + /** |
|
| 1273 | + * Called before the custom fields info is output for submitting a post. |
|
| 1274 | + * |
|
| 1275 | + * Used dynamic hook type geodir_before_custom_form_field_$name. |
|
| 1276 | + * |
|
| 1277 | + * @since 1.0.0 |
|
| 1278 | + * @param string $listing_type The post post type. |
|
| 1279 | + * @param int $package_id The price package ID for the post. |
|
| 1280 | + * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
|
|
| 1281 | + * @see 'geodir_after_custom_form_field_$name' |
|
| 1282 | + */ |
|
| 1283 | + do_action('geodir_before_custom_form_field_' . $name, $listing_type, $package_id, $val);
|
|
| 1284 | + |
|
| 1285 | + |
|
| 1286 | + $custom_field = $val; |
|
| 1287 | + $html =''; |
|
| 1288 | + /** |
|
| 1289 | + * Filter the output for custom fields. |
|
| 1290 | + * |
|
| 1291 | + * Here we can remove or add new functions depending on the field type. |
|
| 1292 | + * |
|
| 1293 | + * @param string $html The html to be filtered (blank). |
|
| 1294 | + * @param array $custom_field The custom field array values. |
|
| 1295 | + */ |
|
| 1296 | + echo apply_filters("geodir_custom_field_input_{$type}",$html,$custom_field);
|
|
| 1297 | + |
|
| 1298 | + |
|
| 1299 | + |
|
| 1300 | + /** |
|
| 1301 | + * Called after the custom fields info is output for submitting a post. |
|
| 1302 | + * |
|
| 1303 | + * Used dynamic hook type geodir_after_custom_form_field_$name. |
|
| 1304 | + * |
|
| 1305 | + * @since 1.0.0 |
|
| 1306 | + * @param string $listing_type The post post type. |
|
| 1307 | + * @param int $package_id The price package ID for the post. |
|
| 1308 | + * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
|
|
| 1309 | + * @see 'geodir_before_custom_form_field_$name' |
|
| 1310 | + */ |
|
| 1311 | + do_action('geodir_after_custom_form_field_' . $name, $listing_type, $package_id, $val);
|
|
| 1312 | + |
|
| 1313 | + } |
|
| 1314 | 1314 | |
| 1315 | 1315 | } |
| 1316 | 1316 | |
| 1317 | 1317 | |
| 1318 | 1318 | if (!function_exists('geodir_get_field_infoby')) {
|
| 1319 | - /** |
|
| 1320 | - * Get custom field using key and value. |
|
| 1321 | - * |
|
| 1322 | - * @since 1.0.0 |
|
| 1323 | - * @package GeoDirectory |
|
| 1324 | - * @global object $wpdb WordPress Database object. |
|
| 1325 | - * @param string $key The key you want to look for. |
|
| 1326 | - * @param string $value The value of the key you want to look for. |
|
| 1327 | - * @param string $geodir_post_type The post type. |
|
| 1328 | - * @return bool|mixed Returns field info when available. otherwise returns false. |
|
| 1329 | - */ |
|
| 1330 | - function geodir_get_field_infoby($key = '', $value = '', $geodir_post_type = '') |
|
| 1331 | - {
|
|
| 1332 | - |
|
| 1333 | - global $wpdb; |
|
| 1334 | - |
|
| 1335 | - $filter = $wpdb->get_row( |
|
| 1336 | - $wpdb->prepare( |
|
| 1337 | - "SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND " . $key . "='" . $value . "'", |
|
| 1338 | - array($geodir_post_type) |
|
| 1339 | - ) |
|
| 1340 | - ); |
|
| 1341 | - |
|
| 1342 | - if ($filter) {
|
|
| 1343 | - return $filter; |
|
| 1344 | - } else {
|
|
| 1345 | - return false; |
|
| 1346 | - } |
|
| 1347 | - |
|
| 1348 | - } |
|
| 1319 | + /** |
|
| 1320 | + * Get custom field using key and value. |
|
| 1321 | + * |
|
| 1322 | + * @since 1.0.0 |
|
| 1323 | + * @package GeoDirectory |
|
| 1324 | + * @global object $wpdb WordPress Database object. |
|
| 1325 | + * @param string $key The key you want to look for. |
|
| 1326 | + * @param string $value The value of the key you want to look for. |
|
| 1327 | + * @param string $geodir_post_type The post type. |
|
| 1328 | + * @return bool|mixed Returns field info when available. otherwise returns false. |
|
| 1329 | + */ |
|
| 1330 | + function geodir_get_field_infoby($key = '', $value = '', $geodir_post_type = '') |
|
| 1331 | + {
|
|
| 1332 | + |
|
| 1333 | + global $wpdb; |
|
| 1334 | + |
|
| 1335 | + $filter = $wpdb->get_row( |
|
| 1336 | + $wpdb->prepare( |
|
| 1337 | + "SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND " . $key . "='" . $value . "'", |
|
| 1338 | + array($geodir_post_type) |
|
| 1339 | + ) |
|
| 1340 | + ); |
|
| 1341 | + |
|
| 1342 | + if ($filter) {
|
|
| 1343 | + return $filter; |
|
| 1344 | + } else {
|
|
| 1345 | + return false; |
|
| 1346 | + } |
|
| 1347 | + |
|
| 1348 | + } |
|
| 1349 | 1349 | } |
| 1350 | 1350 | |
| 1351 | 1351 | |
| 1352 | 1352 | function geodir_field_icon_proccess($cf){
|
| 1353 | 1353 | |
| 1354 | 1354 | |
| 1355 | - if (strpos($cf['field_icon'], 'http') !== false) {
|
|
| 1356 | - $field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
|
|
| 1357 | - } elseif (strpos($cf['field_icon'], 'fa fa-') !== false) {
|
|
| 1358 | - $field_icon = '<i class="' . $cf['field_icon'] . '"></i>'; |
|
| 1359 | - }else{
|
|
| 1360 | - $field_icon = $cf['field_icon']; |
|
| 1361 | - } |
|
| 1355 | + if (strpos($cf['field_icon'], 'http') !== false) {
|
|
| 1356 | + $field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
|
|
| 1357 | + } elseif (strpos($cf['field_icon'], 'fa fa-') !== false) {
|
|
| 1358 | + $field_icon = '<i class="' . $cf['field_icon'] . '"></i>'; |
|
| 1359 | + }else{
|
|
| 1360 | + $field_icon = $cf['field_icon']; |
|
| 1361 | + } |
|
| 1362 | 1362 | |
| 1363 | - return $field_icon; |
|
| 1363 | + return $field_icon; |
|
| 1364 | 1364 | } |
| 1365 | 1365 | |
| 1366 | 1366 | if (!function_exists('geodir_show_listing_info')) {
|
| 1367 | - /** |
|
| 1368 | - * Show listing info depending on field location. |
|
| 1369 | - * |
|
| 1370 | - * @since 1.0.0 |
|
| 1371 | - * @since 1.5.7 Custom fields option values added to db translation. |
|
| 1372 | - * Changes to display url fields title. |
|
| 1373 | - * @package GeoDirectory |
|
| 1374 | - * @global object $wpdb WordPress Database object. |
|
| 1375 | - * @global object $post The current post object. |
|
| 1376 | - * @global bool $send_to_friend True if send to friend link already rendered. Otherwise false. |
|
| 1377 | - * |
|
| 1378 | - * @param string $fields_location In which page you are going to place this custom fields?. Ex: listing, detail etc. |
|
| 1379 | - * @return string Returns listing info html. |
|
| 1380 | - */ |
|
| 1381 | - function geodir_show_listing_info($fields_location = '') {
|
|
| 1382 | - global $post, $preview, $wpdb, $send_to_friend; |
|
| 1383 | - |
|
| 1384 | - $package_info = array(); |
|
| 1385 | - |
|
| 1386 | - $package_info = geodir_post_package_info($package_info, $post); |
|
| 1387 | - $post_package_id = !empty($package_info->pid) ? $package_info->pid : ''; |
|
| 1388 | - $p_type = !empty($post->post_type) ? $post->post_type : geodir_get_current_posttype(); |
|
| 1389 | - $send_to_friend = false; |
|
| 1390 | - |
|
| 1391 | - ob_start(); |
|
| 1392 | - $fields_info = geodir_post_custom_fields($post_package_id, 'all', $p_type, $fields_location); |
|
| 1393 | - |
|
| 1394 | - if (!empty($fields_info)) {
|
|
| 1395 | - $post = stripslashes_deep($post); // strip slashes |
|
| 1367 | + /** |
|
| 1368 | + * Show listing info depending on field location. |
|
| 1369 | + * |
|
| 1370 | + * @since 1.0.0 |
|
| 1371 | + * @since 1.5.7 Custom fields option values added to db translation. |
|
| 1372 | + * Changes to display url fields title. |
|
| 1373 | + * @package GeoDirectory |
|
| 1374 | + * @global object $wpdb WordPress Database object. |
|
| 1375 | + * @global object $post The current post object. |
|
| 1376 | + * @global bool $send_to_friend True if send to friend link already rendered. Otherwise false. |
|
| 1377 | + * |
|
| 1378 | + * @param string $fields_location In which page you are going to place this custom fields?. Ex: listing, detail etc. |
|
| 1379 | + * @return string Returns listing info html. |
|
| 1380 | + */ |
|
| 1381 | + function geodir_show_listing_info($fields_location = '') {
|
|
| 1382 | + global $post, $preview, $wpdb, $send_to_friend; |
|
| 1383 | + |
|
| 1384 | + $package_info = array(); |
|
| 1385 | + |
|
| 1386 | + $package_info = geodir_post_package_info($package_info, $post); |
|
| 1387 | + $post_package_id = !empty($package_info->pid) ? $package_info->pid : ''; |
|
| 1388 | + $p_type = !empty($post->post_type) ? $post->post_type : geodir_get_current_posttype(); |
|
| 1389 | + $send_to_friend = false; |
|
| 1390 | + |
|
| 1391 | + ob_start(); |
|
| 1392 | + $fields_info = geodir_post_custom_fields($post_package_id, 'all', $p_type, $fields_location); |
|
| 1393 | + |
|
| 1394 | + if (!empty($fields_info)) {
|
|
| 1395 | + $post = stripslashes_deep($post); // strip slashes |
|
| 1396 | 1396 | |
| 1397 | - //echo '<div class="geodir-company_info field-group">'; |
|
| 1398 | - global $field_set_start; |
|
| 1399 | - $field_set_start = 0; |
|
| 1400 | - |
|
| 1401 | - |
|
| 1402 | - |
|
| 1403 | - foreach ($fields_info as $type) {
|
|
| 1404 | - if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
|
|
| 1405 | - $type = stripslashes_deep($type); // strip slashes |
|
| 1406 | - if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
|
|
| 1407 | - $html = ''; |
|
| 1408 | - $field_icon = geodir_field_icon_proccess($type); |
|
| 1409 | - $filed_type = $type['type']; |
|
| 1410 | - $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : ''; |
|
| 1411 | - if($html_var=='post'){$html_var='post_address';}
|
|
| 1412 | - |
|
| 1413 | - /** |
|
| 1414 | - * Filter the output for custom fields. |
|
| 1415 | - * |
|
| 1416 | - * Here we can remove or add new functions depending on the field type. |
|
| 1417 | - * |
|
| 1418 | - * @param string $html The html to be filtered (blank). |
|
| 1419 | - * @param string $fields_location The location the field is to be show. |
|
| 1420 | - * @param array $type The array of field values. |
|
| 1421 | - */ |
|
| 1422 | - $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
|
|
| 1423 | - |
|
| 1424 | - $variables_array = array(); |
|
| 1425 | - |
|
| 1426 | - |
|
| 1427 | - if ($type['type'] != 'fieldset'): |
|
| 1428 | - $variables_array['post_id'] = $post->ID; |
|
| 1429 | - $variables_array['label'] = __($type['site_title'], 'geodirectory'); |
|
| 1430 | - $variables_array['value'] = ''; |
|
| 1431 | - if (isset($post->{$type['htmlvar_name']}))
|
|
| 1432 | - $variables_array['value'] = $post->{$type['htmlvar_name']};
|
|
| 1433 | - endif; |
|
| 1434 | - |
|
| 1435 | - |
|
| 1436 | - if ($html): |
|
| 1437 | - |
|
| 1438 | - /** |
|
| 1439 | - * Called before a custom fields is output on the frontend. |
|
| 1440 | - * |
|
| 1441 | - * @since 1.0.0 |
|
| 1442 | - * @param string $html_var The HTML variable name for the field. |
|
| 1443 | - */ |
|
| 1444 | - do_action("geodir_before_show_{$html_var}");
|
|
| 1445 | - /** |
|
| 1446 | - * Filter custom field output. |
|
| 1447 | - * |
|
| 1448 | - * @since 1.0.0 |
|
| 1449 | - * |
|
| 1450 | - * @param string $html_var The HTML variable name for the field. |
|
| 1451 | - * @param string $html Custom field unfiltered HTML. |
|
| 1452 | - * @param array $variables_array Custom field variables array. |
|
| 1453 | - */ |
|
| 1454 | - if ($html) echo apply_filters("geodir_show_{$html_var}", $html, $variables_array);
|
|
| 1455 | - |
|
| 1456 | - /** |
|
| 1457 | - * Called after a custom fields is output on the frontend. |
|
| 1458 | - * |
|
| 1459 | - * @since 1.0.0 |
|
| 1460 | - * @param string $html_var The HTML variable name for the field. |
|
| 1461 | - */ |
|
| 1462 | - do_action("geodir_after_show_{$html_var}");
|
|
| 1463 | - |
|
| 1464 | - endif; |
|
| 1465 | - |
|
| 1466 | - } |
|
| 1467 | - |
|
| 1468 | - //echo '</div>'; |
|
| 1469 | - |
|
| 1470 | - } |
|
| 1471 | - |
|
| 1472 | - |
|
| 1473 | - $html = ob_get_clean(); |
|
| 1474 | - |
|
| 1475 | - /** |
|
| 1476 | - * Filter the custom fields over all output. |
|
| 1477 | - * |
|
| 1478 | - * @param string $html The html of the custom fields. |
|
| 1479 | - * @param string $fields_location The location the fields are being output. |
|
| 1480 | - * @since 1.6.9 |
|
| 1481 | - */ |
|
| 1482 | - return apply_filters('geodir_show_listing_info',$html,$fields_location);
|
|
| 1483 | - |
|
| 1484 | - } |
|
| 1397 | + //echo '<div class="geodir-company_info field-group">'; |
|
| 1398 | + global $field_set_start; |
|
| 1399 | + $field_set_start = 0; |
|
| 1400 | + |
|
| 1401 | + |
|
| 1402 | + |
|
| 1403 | + foreach ($fields_info as $type) {
|
|
| 1404 | + if(isset($type['extra_fields'])){$extra_fields= $type['extra_fields'];}
|
|
| 1405 | + $type = stripslashes_deep($type); // strip slashes |
|
| 1406 | + if(isset($type['extra_fields'])){$type['extra_fields'] = $extra_fields;}
|
|
| 1407 | + $html = ''; |
|
| 1408 | + $field_icon = geodir_field_icon_proccess($type); |
|
| 1409 | + $filed_type = $type['type']; |
|
| 1410 | + $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : ''; |
|
| 1411 | + if($html_var=='post'){$html_var='post_address';}
|
|
| 1412 | + |
|
| 1413 | + /** |
|
| 1414 | + * Filter the output for custom fields. |
|
| 1415 | + * |
|
| 1416 | + * Here we can remove or add new functions depending on the field type. |
|
| 1417 | + * |
|
| 1418 | + * @param string $html The html to be filtered (blank). |
|
| 1419 | + * @param string $fields_location The location the field is to be show. |
|
| 1420 | + * @param array $type The array of field values. |
|
| 1421 | + */ |
|
| 1422 | + $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
|
|
| 1423 | + |
|
| 1424 | + $variables_array = array(); |
|
| 1425 | + |
|
| 1426 | + |
|
| 1427 | + if ($type['type'] != 'fieldset'): |
|
| 1428 | + $variables_array['post_id'] = $post->ID; |
|
| 1429 | + $variables_array['label'] = __($type['site_title'], 'geodirectory'); |
|
| 1430 | + $variables_array['value'] = ''; |
|
| 1431 | + if (isset($post->{$type['htmlvar_name']}))
|
|
| 1432 | + $variables_array['value'] = $post->{$type['htmlvar_name']};
|
|
| 1433 | + endif; |
|
| 1434 | + |
|
| 1435 | + |
|
| 1436 | + if ($html): |
|
| 1437 | + |
|
| 1438 | + /** |
|
| 1439 | + * Called before a custom fields is output on the frontend. |
|
| 1440 | + * |
|
| 1441 | + * @since 1.0.0 |
|
| 1442 | + * @param string $html_var The HTML variable name for the field. |
|
| 1443 | + */ |
|
| 1444 | + do_action("geodir_before_show_{$html_var}");
|
|
| 1445 | + /** |
|
| 1446 | + * Filter custom field output. |
|
| 1447 | + * |
|
| 1448 | + * @since 1.0.0 |
|
| 1449 | + * |
|
| 1450 | + * @param string $html_var The HTML variable name for the field. |
|
| 1451 | + * @param string $html Custom field unfiltered HTML. |
|
| 1452 | + * @param array $variables_array Custom field variables array. |
|
| 1453 | + */ |
|
| 1454 | + if ($html) echo apply_filters("geodir_show_{$html_var}", $html, $variables_array);
|
|
| 1455 | + |
|
| 1456 | + /** |
|
| 1457 | + * Called after a custom fields is output on the frontend. |
|
| 1458 | + * |
|
| 1459 | + * @since 1.0.0 |
|
| 1460 | + * @param string $html_var The HTML variable name for the field. |
|
| 1461 | + */ |
|
| 1462 | + do_action("geodir_after_show_{$html_var}");
|
|
| 1463 | + |
|
| 1464 | + endif; |
|
| 1465 | + |
|
| 1466 | + } |
|
| 1467 | + |
|
| 1468 | + //echo '</div>'; |
|
| 1469 | + |
|
| 1470 | + } |
|
| 1471 | + |
|
| 1472 | + |
|
| 1473 | + $html = ob_get_clean(); |
|
| 1474 | + |
|
| 1475 | + /** |
|
| 1476 | + * Filter the custom fields over all output. |
|
| 1477 | + * |
|
| 1478 | + * @param string $html The html of the custom fields. |
|
| 1479 | + * @param string $fields_location The location the fields are being output. |
|
| 1480 | + * @since 1.6.9 |
|
| 1481 | + */ |
|
| 1482 | + return apply_filters('geodir_show_listing_info',$html,$fields_location);
|
|
| 1483 | + |
|
| 1484 | + } |
|
| 1485 | 1485 | } |
| 1486 | 1486 | |
| 1487 | 1487 | if (!function_exists('geodir_default_date_format')) {
|
| 1488 | - /** |
|
| 1489 | - * Returns default date format. |
|
| 1490 | - * |
|
| 1491 | - * @since 1.0.0 |
|
| 1492 | - * @package GeoDirectory |
|
| 1493 | - * @return mixed|string|void Returns default date format. |
|
| 1494 | - */ |
|
| 1495 | - function geodir_default_date_format() |
|
| 1496 | - {
|
|
| 1497 | - if ($format = get_option('date_format'))
|
|
| 1498 | - return $format; |
|
| 1499 | - else |
|
| 1500 | - return 'dd-mm-yy'; |
|
| 1501 | - } |
|
| 1488 | + /** |
|
| 1489 | + * Returns default date format. |
|
| 1490 | + * |
|
| 1491 | + * @since 1.0.0 |
|
| 1492 | + * @package GeoDirectory |
|
| 1493 | + * @return mixed|string|void Returns default date format. |
|
| 1494 | + */ |
|
| 1495 | + function geodir_default_date_format() |
|
| 1496 | + {
|
|
| 1497 | + if ($format = get_option('date_format'))
|
|
| 1498 | + return $format; |
|
| 1499 | + else |
|
| 1500 | + return 'dd-mm-yy'; |
|
| 1501 | + } |
|
| 1502 | 1502 | } |
| 1503 | 1503 | |
| 1504 | 1504 | if (!function_exists('geodir_get_formated_date')) {
|
| 1505 | - /** |
|
| 1506 | - * Returns formatted date. |
|
| 1507 | - * |
|
| 1508 | - * @since 1.0.0 |
|
| 1509 | - * @package GeoDirectory |
|
| 1510 | - * @param string $date Date string to convert. |
|
| 1511 | - * @return bool|int|string Returns formatted date. |
|
| 1512 | - */ |
|
| 1513 | - function geodir_get_formated_date($date) |
|
| 1514 | - {
|
|
| 1515 | - return mysql2date(get_option('date_format'), $date);
|
|
| 1516 | - } |
|
| 1505 | + /** |
|
| 1506 | + * Returns formatted date. |
|
| 1507 | + * |
|
| 1508 | + * @since 1.0.0 |
|
| 1509 | + * @package GeoDirectory |
|
| 1510 | + * @param string $date Date string to convert. |
|
| 1511 | + * @return bool|int|string Returns formatted date. |
|
| 1512 | + */ |
|
| 1513 | + function geodir_get_formated_date($date) |
|
| 1514 | + {
|
|
| 1515 | + return mysql2date(get_option('date_format'), $date);
|
|
| 1516 | + } |
|
| 1517 | 1517 | } |
| 1518 | 1518 | |
| 1519 | 1519 | if (!function_exists('geodir_get_formated_time')) {
|
| 1520 | - /** |
|
| 1521 | - * Returns formatted time. |
|
| 1522 | - * |
|
| 1523 | - * @since 1.0.0 |
|
| 1524 | - * @package GeoDirectory |
|
| 1525 | - * @param string $time Time string to convert. |
|
| 1526 | - * @return bool|int|string Returns formatted time. |
|
| 1527 | - */ |
|
| 1528 | - function geodir_get_formated_time($time) |
|
| 1529 | - {
|
|
| 1530 | - return mysql2date(get_option('time_format'), $time, $translate = true);
|
|
| 1531 | - } |
|
| 1520 | + /** |
|
| 1521 | + * Returns formatted time. |
|
| 1522 | + * |
|
| 1523 | + * @since 1.0.0 |
|
| 1524 | + * @package GeoDirectory |
|
| 1525 | + * @param string $time Time string to convert. |
|
| 1526 | + * @return bool|int|string Returns formatted time. |
|
| 1527 | + */ |
|
| 1528 | + function geodir_get_formated_time($time) |
|
| 1529 | + {
|
|
| 1530 | + return mysql2date(get_option('time_format'), $time, $translate = true);
|
|
| 1531 | + } |
|
| 1532 | 1532 | } |
| 1533 | 1533 | |
| 1534 | 1534 | |
| 1535 | 1535 | if (!function_exists('geodir_save_post_file_fields')) {
|
| 1536 | - /** |
|
| 1537 | - * Save post file fields |
|
| 1538 | - * |
|
| 1539 | - * @since 1.0.0 |
|
| 1540 | - * @since 1.4.7 Added `$extra_fields` parameter. |
|
| 1541 | - * @package GeoDirectory |
|
| 1542 | - * @global object $wpdb WordPress Database object. |
|
| 1543 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 1544 | - * @global object $current_user Current user object. |
|
| 1545 | - * @param int $post_id |
|
| 1546 | - * @param string $field_id |
|
| 1547 | - * @param array $post_image |
|
| 1548 | - * @param array $extra_fields Array of extra fields. |
|
| 1549 | - */ |
|
| 1550 | - function geodir_save_post_file_fields($post_id = 0, $field_id = '', $post_image = array(), $extra_fields = array()) |
|
| 1551 | - {
|
|
| 1536 | + /** |
|
| 1537 | + * Save post file fields |
|
| 1538 | + * |
|
| 1539 | + * @since 1.0.0 |
|
| 1540 | + * @since 1.4.7 Added `$extra_fields` parameter. |
|
| 1541 | + * @package GeoDirectory |
|
| 1542 | + * @global object $wpdb WordPress Database object. |
|
| 1543 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 1544 | + * @global object $current_user Current user object. |
|
| 1545 | + * @param int $post_id |
|
| 1546 | + * @param string $field_id |
|
| 1547 | + * @param array $post_image |
|
| 1548 | + * @param array $extra_fields Array of extra fields. |
|
| 1549 | + */ |
|
| 1550 | + function geodir_save_post_file_fields($post_id = 0, $field_id = '', $post_image = array(), $extra_fields = array()) |
|
| 1551 | + {
|
|
| 1552 | 1552 | |
| 1553 | - global $wpdb, $plugin_prefix, $current_user; |
|
| 1553 | + global $wpdb, $plugin_prefix, $current_user; |
|
| 1554 | 1554 | |
| 1555 | - $post_type = get_post_type($post_id); |
|
| 1556 | - //echo $field_id; exit; |
|
| 1557 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1555 | + $post_type = get_post_type($post_id); |
|
| 1556 | + //echo $field_id; exit; |
|
| 1557 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1558 | 1558 | |
| 1559 | - $postcurr_images = array(); |
|
| 1560 | - $postcurr_images = geodir_get_post_meta($post_id, $field_id, true); |
|
| 1561 | - $file_urls = ''; |
|
| 1559 | + $postcurr_images = array(); |
|
| 1560 | + $postcurr_images = geodir_get_post_meta($post_id, $field_id, true); |
|
| 1561 | + $file_urls = ''; |
|
| 1562 | 1562 | |
| 1563 | - if (!empty($post_image)) {
|
|
| 1563 | + if (!empty($post_image)) {
|
|
| 1564 | 1564 | |
| 1565 | - $invalid_files = array(); |
|
| 1565 | + $invalid_files = array(); |
|
| 1566 | 1566 | |
| 1567 | - //Get and remove all old images of post from database to set by new order |
|
| 1568 | - $geodir_uploaddir = ''; |
|
| 1569 | - $uploads = wp_upload_dir(); |
|
| 1570 | - $uploads_dir = $uploads['path']; |
|
| 1567 | + //Get and remove all old images of post from database to set by new order |
|
| 1568 | + $geodir_uploaddir = ''; |
|
| 1569 | + $uploads = wp_upload_dir(); |
|
| 1570 | + $uploads_dir = $uploads['path']; |
|
| 1571 | 1571 | |
| 1572 | - $geodir_uploadpath = $uploads['path']; |
|
| 1573 | - $geodir_uploadurl = $uploads['url']; |
|
| 1574 | - $sub_dir = $uploads['subdir']; |
|
| 1572 | + $geodir_uploadpath = $uploads['path']; |
|
| 1573 | + $geodir_uploadurl = $uploads['url']; |
|
| 1574 | + $sub_dir = $uploads['subdir']; |
|
| 1575 | 1575 | |
| 1576 | - $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
|
|
| 1576 | + $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
|
|
| 1577 | 1577 | |
| 1578 | - for ($m = 0; $m < count($post_image); $m++) {
|
|
| 1578 | + for ($m = 0; $m < count($post_image); $m++) {
|
|
| 1579 | 1579 | |
| 1580 | - /* --------- start ------- */ |
|
| 1580 | + /* --------- start ------- */ |
|
| 1581 | 1581 | |
| 1582 | - if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM " . $table . " WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) {
|
|
| 1582 | + if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM " . $table . " WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) {
|
|
| 1583 | 1583 | |
| 1584 | 1584 | |
| 1585 | - $curr_img_url = $post_image[$m]; |
|
| 1586 | - $image_name_arr = explode('/', $curr_img_url);
|
|
| 1587 | - $curr_img_dir = $image_name_arr[count($image_name_arr) - 2]; |
|
| 1588 | - $filename = end($image_name_arr); |
|
| 1589 | - $img_name_arr = explode('.', $filename);
|
|
| 1585 | + $curr_img_url = $post_image[$m]; |
|
| 1586 | + $image_name_arr = explode('/', $curr_img_url);
|
|
| 1587 | + $curr_img_dir = $image_name_arr[count($image_name_arr) - 2]; |
|
| 1588 | + $filename = end($image_name_arr); |
|
| 1589 | + $img_name_arr = explode('.', $filename);
|
|
| 1590 | 1590 | |
| 1591 | - $arr_file_type = wp_check_filetype($filename); |
|
| 1591 | + $arr_file_type = wp_check_filetype($filename); |
|
| 1592 | 1592 | |
| 1593 | - if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
|
|
| 1594 | - continue; |
|
| 1595 | - } |
|
| 1593 | + if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
|
|
| 1594 | + continue; |
|
| 1595 | + } |
|
| 1596 | 1596 | |
| 1597 | - $uploaded_file_type = $arr_file_type['type']; |
|
| 1598 | - $uploaded_file_ext = $arr_file_type['ext']; |
|
| 1597 | + $uploaded_file_type = $arr_file_type['type']; |
|
| 1598 | + $uploaded_file_ext = $arr_file_type['ext']; |
|
| 1599 | 1599 | |
| 1600 | - if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
|
|
| 1601 | - continue; // Invalid file type. |
|
| 1602 | - } |
|
| 1600 | + if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
|
|
| 1601 | + continue; // Invalid file type. |
|
| 1602 | + } |
|
| 1603 | 1603 | |
| 1604 | - // Set an array containing a list of acceptable formats |
|
| 1605 | - //$allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/octet-stream', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
|
|
| 1604 | + // Set an array containing a list of acceptable formats |
|
| 1605 | + //$allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/octet-stream', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
|
|
| 1606 | 1606 | |
| 1607 | - if (!function_exists('wp_handle_upload'))
|
|
| 1608 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
| 1607 | + if (!function_exists('wp_handle_upload'))
|
|
| 1608 | + require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
| 1609 | 1609 | |
| 1610 | - if (!is_dir($geodir_uploadpath)) |
|
| 1611 | - mkdir($geodir_uploadpath); |
|
| 1610 | + if (!is_dir($geodir_uploadpath)) |
|
| 1611 | + mkdir($geodir_uploadpath); |
|
| 1612 | 1612 | |
| 1613 | - $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1]; |
|
| 1614 | - $explode_sub_dir = explode("/", $sub_dir);
|
|
| 1615 | - if ($curr_img_dir == end($explode_sub_dir)) {
|
|
| 1616 | - $img_path = $geodir_uploadpath . '/' . $filename; |
|
| 1617 | - $img_url = $geodir_uploadurl . '/' . $filename; |
|
| 1618 | - } else {
|
|
| 1619 | - $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1620 | - $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1621 | - } |
|
| 1613 | + $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1]; |
|
| 1614 | + $explode_sub_dir = explode("/", $sub_dir);
|
|
| 1615 | + if ($curr_img_dir == end($explode_sub_dir)) {
|
|
| 1616 | + $img_path = $geodir_uploadpath . '/' . $filename; |
|
| 1617 | + $img_url = $geodir_uploadurl . '/' . $filename; |
|
| 1618 | + } else {
|
|
| 1619 | + $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1620 | + $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
| 1621 | + } |
|
| 1622 | 1622 | |
| 1623 | - $uploaded_file = ''; |
|
| 1624 | - if (file_exists($img_path)) |
|
| 1625 | - $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name); |
|
| 1623 | + $uploaded_file = ''; |
|
| 1624 | + if (file_exists($img_path)) |
|
| 1625 | + $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name); |
|
| 1626 | 1626 | |
| 1627 | - if ($curr_img_dir != $geodir_uploaddir) {
|
|
| 1628 | - if (file_exists($img_path)) |
|
| 1629 | - unlink($img_path); |
|
| 1630 | - } |
|
| 1627 | + if ($curr_img_dir != $geodir_uploaddir) {
|
|
| 1628 | + if (file_exists($img_path)) |
|
| 1629 | + unlink($img_path); |
|
| 1630 | + } |
|
| 1631 | 1631 | |
| 1632 | - if (!empty($uploaded_file)) |
|
| 1633 | - $file_urls = $geodir_uploadurl . '/' . $new_name; |
|
| 1632 | + if (!empty($uploaded_file)) |
|
| 1633 | + $file_urls = $geodir_uploadurl . '/' . $new_name; |
|
| 1634 | 1634 | |
| 1635 | - } else {
|
|
| 1636 | - $file_urls = $post_image[$m]; |
|
| 1637 | - } |
|
| 1638 | - } |
|
| 1635 | + } else {
|
|
| 1636 | + $file_urls = $post_image[$m]; |
|
| 1637 | + } |
|
| 1638 | + } |
|
| 1639 | 1639 | |
| 1640 | 1640 | |
| 1641 | - } |
|
| 1641 | + } |
|
| 1642 | 1642 | |
| 1643 | - //Remove all old attachments and temp images |
|
| 1644 | - if (!empty($postcurr_images)) {
|
|
| 1643 | + //Remove all old attachments and temp images |
|
| 1644 | + if (!empty($postcurr_images)) {
|
|
| 1645 | 1645 | |
| 1646 | - if ($file_urls != $postcurr_images) {
|
|
| 1647 | - $invalid_files[] = (object)array('src' => $postcurr_images);
|
|
| 1648 | - $invalid_files = (object)$invalid_files; |
|
| 1649 | - } |
|
| 1650 | - } |
|
| 1646 | + if ($file_urls != $postcurr_images) {
|
|
| 1647 | + $invalid_files[] = (object)array('src' => $postcurr_images);
|
|
| 1648 | + $invalid_files = (object)$invalid_files; |
|
| 1649 | + } |
|
| 1650 | + } |
|
| 1651 | 1651 | |
| 1652 | - geodir_save_post_meta($post_id, $field_id, $file_urls); |
|
| 1652 | + geodir_save_post_meta($post_id, $field_id, $file_urls); |
|
| 1653 | 1653 | |
| 1654 | - if (!empty($invalid_files)) |
|
| 1655 | - geodir_remove_attachments($invalid_files); |
|
| 1654 | + if (!empty($invalid_files)) |
|
| 1655 | + geodir_remove_attachments($invalid_files); |
|
| 1656 | 1656 | |
| 1657 | - } |
|
| 1657 | + } |
|
| 1658 | 1658 | } |
| 1659 | 1659 | |
| 1660 | 1660 | |
@@ -1669,76 +1669,76 @@ discard block |
||
| 1669 | 1669 | */ |
| 1670 | 1670 | function geodir_custom_upload_mimes($existing_mimes = array()) |
| 1671 | 1671 | {
|
| 1672 | - $existing_mimes['wif'] = 'text/plain'; |
|
| 1673 | - $existing_mimes['jpg|jpeg'] = 'image/jpeg'; |
|
| 1674 | - $existing_mimes['gif'] = 'image/gif'; |
|
| 1675 | - $existing_mimes['png'] = 'image/png'; |
|
| 1676 | - $existing_mimes['pdf'] = 'application/pdf'; |
|
| 1677 | - $existing_mimes['txt'] = 'text/text'; |
|
| 1678 | - $existing_mimes['csv'] = 'application/octet-stream'; |
|
| 1679 | - $existing_mimes['doc'] = 'application/msword'; |
|
| 1680 | - $existing_mimes['xla|xls|xlt|xlw'] = 'application/vnd.ms-excel'; |
|
| 1681 | - $existing_mimes['docx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; |
|
| 1682 | - $existing_mimes['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; |
|
| 1683 | - return $existing_mimes; |
|
| 1672 | + $existing_mimes['wif'] = 'text/plain'; |
|
| 1673 | + $existing_mimes['jpg|jpeg'] = 'image/jpeg'; |
|
| 1674 | + $existing_mimes['gif'] = 'image/gif'; |
|
| 1675 | + $existing_mimes['png'] = 'image/png'; |
|
| 1676 | + $existing_mimes['pdf'] = 'application/pdf'; |
|
| 1677 | + $existing_mimes['txt'] = 'text/text'; |
|
| 1678 | + $existing_mimes['csv'] = 'application/octet-stream'; |
|
| 1679 | + $existing_mimes['doc'] = 'application/msword'; |
|
| 1680 | + $existing_mimes['xla|xls|xlt|xlw'] = 'application/vnd.ms-excel'; |
|
| 1681 | + $existing_mimes['docx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'; |
|
| 1682 | + $existing_mimes['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'; |
|
| 1683 | + return $existing_mimes; |
|
| 1684 | 1684 | } |
| 1685 | 1685 | |
| 1686 | 1686 | if (!function_exists('geodir_plupload_action')) {
|
| 1687 | 1687 | |
| 1688 | - /** |
|
| 1689 | - * Get upload directory path details |
|
| 1690 | - * |
|
| 1691 | - * @since 1.0.0 |
|
| 1692 | - * @package GeoDirectory |
|
| 1693 | - * @global object $current_user Current user object. |
|
| 1694 | - * @param array $upload Array of upload directory data with keys of 'path','url', 'subdir, 'basedir', and 'error'. |
|
| 1695 | - * @return mixed Returns upload directory details as an array. |
|
| 1696 | - */ |
|
| 1697 | - function geodir_upload_dir($upload) |
|
| 1698 | - {
|
|
| 1699 | - global $current_user; |
|
| 1700 | - $upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID; |
|
| 1701 | - $upload['path'] = $upload['basedir'] . $upload['subdir']; |
|
| 1702 | - $upload['url'] = $upload['baseurl'] . $upload['subdir']; |
|
| 1703 | - return $upload; |
|
| 1704 | - } |
|
| 1705 | - |
|
| 1706 | - /** |
|
| 1707 | - * Handles place file and image upload. |
|
| 1708 | - * |
|
| 1709 | - * @since 1.0.0 |
|
| 1710 | - * @package GeoDirectory |
|
| 1711 | - */ |
|
| 1712 | - function geodir_plupload_action() |
|
| 1713 | - {
|
|
| 1714 | - // check ajax nonce |
|
| 1715 | - $imgid = $_POST["imgid"]; |
|
| 1716 | - |
|
| 1717 | - check_ajax_referer($imgid . 'pluploadan'); |
|
| 1718 | - |
|
| 1719 | - // handle custom file uploaddir |
|
| 1720 | - add_filter('upload_dir', 'geodir_upload_dir');
|
|
| 1721 | - |
|
| 1722 | - // change file orientation if needed |
|
| 1723 | - $fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']); |
|
| 1724 | - |
|
| 1725 | - // handle file upload |
|
| 1726 | - $status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action'));
|
|
| 1727 | - // remove handle custom file uploaddir |
|
| 1728 | - remove_filter('upload_dir', 'geodir_upload_dir');
|
|
| 1729 | - |
|
| 1730 | - if(!isset($status['url']) && isset($status['error'])){
|
|
| 1731 | - print_r($status); |
|
| 1732 | - } |
|
| 1733 | - |
|
| 1734 | - // send the uploaded file url in response |
|
| 1735 | - if (isset($status['url'])) {
|
|
| 1736 | - echo $status['url']; |
|
| 1737 | - } else {
|
|
| 1738 | - echo 'x'; |
|
| 1739 | - } |
|
| 1740 | - exit; |
|
| 1741 | - } |
|
| 1688 | + /** |
|
| 1689 | + * Get upload directory path details |
|
| 1690 | + * |
|
| 1691 | + * @since 1.0.0 |
|
| 1692 | + * @package GeoDirectory |
|
| 1693 | + * @global object $current_user Current user object. |
|
| 1694 | + * @param array $upload Array of upload directory data with keys of 'path','url', 'subdir, 'basedir', and 'error'. |
|
| 1695 | + * @return mixed Returns upload directory details as an array. |
|
| 1696 | + */ |
|
| 1697 | + function geodir_upload_dir($upload) |
|
| 1698 | + {
|
|
| 1699 | + global $current_user; |
|
| 1700 | + $upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID; |
|
| 1701 | + $upload['path'] = $upload['basedir'] . $upload['subdir']; |
|
| 1702 | + $upload['url'] = $upload['baseurl'] . $upload['subdir']; |
|
| 1703 | + return $upload; |
|
| 1704 | + } |
|
| 1705 | + |
|
| 1706 | + /** |
|
| 1707 | + * Handles place file and image upload. |
|
| 1708 | + * |
|
| 1709 | + * @since 1.0.0 |
|
| 1710 | + * @package GeoDirectory |
|
| 1711 | + */ |
|
| 1712 | + function geodir_plupload_action() |
|
| 1713 | + {
|
|
| 1714 | + // check ajax nonce |
|
| 1715 | + $imgid = $_POST["imgid"]; |
|
| 1716 | + |
|
| 1717 | + check_ajax_referer($imgid . 'pluploadan'); |
|
| 1718 | + |
|
| 1719 | + // handle custom file uploaddir |
|
| 1720 | + add_filter('upload_dir', 'geodir_upload_dir');
|
|
| 1721 | + |
|
| 1722 | + // change file orientation if needed |
|
| 1723 | + $fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']); |
|
| 1724 | + |
|
| 1725 | + // handle file upload |
|
| 1726 | + $status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action'));
|
|
| 1727 | + // remove handle custom file uploaddir |
|
| 1728 | + remove_filter('upload_dir', 'geodir_upload_dir');
|
|
| 1729 | + |
|
| 1730 | + if(!isset($status['url']) && isset($status['error'])){
|
|
| 1731 | + print_r($status); |
|
| 1732 | + } |
|
| 1733 | + |
|
| 1734 | + // send the uploaded file url in response |
|
| 1735 | + if (isset($status['url'])) {
|
|
| 1736 | + echo $status['url']; |
|
| 1737 | + } else {
|
|
| 1738 | + echo 'x'; |
|
| 1739 | + } |
|
| 1740 | + exit; |
|
| 1741 | + } |
|
| 1742 | 1742 | } |
| 1743 | 1743 | |
| 1744 | 1744 | /** |
@@ -1753,17 +1753,17 @@ discard block |
||
| 1753 | 1753 | */ |
| 1754 | 1754 | function geodir_get_video($post_id) |
| 1755 | 1755 | {
|
| 1756 | - global $wpdb, $plugin_prefix; |
|
| 1756 | + global $wpdb, $plugin_prefix; |
|
| 1757 | 1757 | |
| 1758 | - $post_type = get_post_type($post_id); |
|
| 1758 | + $post_type = get_post_type($post_id); |
|
| 1759 | 1759 | |
| 1760 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1760 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1761 | 1761 | |
| 1762 | - $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id)));
|
|
| 1762 | + $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id)));
|
|
| 1763 | 1763 | |
| 1764 | - if ($results) {
|
|
| 1765 | - return $results[0]->geodir_video; |
|
| 1766 | - } |
|
| 1764 | + if ($results) {
|
|
| 1765 | + return $results[0]->geodir_video; |
|
| 1766 | + } |
|
| 1767 | 1767 | |
| 1768 | 1768 | } |
| 1769 | 1769 | |
@@ -1779,40 +1779,40 @@ discard block |
||
| 1779 | 1779 | */ |
| 1780 | 1780 | function geodir_get_special_offers($post_id) |
| 1781 | 1781 | {
|
| 1782 | - global $wpdb, $plugin_prefix; |
|
| 1782 | + global $wpdb, $plugin_prefix; |
|
| 1783 | 1783 | |
| 1784 | - $post_type = get_post_type($post_id); |
|
| 1784 | + $post_type = get_post_type($post_id); |
|
| 1785 | 1785 | |
| 1786 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1786 | + $table = $plugin_prefix . $post_type . '_detail'; |
|
| 1787 | 1787 | |
| 1788 | - $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id)));
|
|
| 1788 | + $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id)));
|
|
| 1789 | 1789 | |
| 1790 | - if ($results) {
|
|
| 1791 | - return $results[0]->geodir_special_offers; |
|
| 1792 | - } |
|
| 1790 | + if ($results) {
|
|
| 1791 | + return $results[0]->geodir_special_offers; |
|
| 1792 | + } |
|
| 1793 | 1793 | |
| 1794 | 1794 | } |
| 1795 | 1795 | |
| 1796 | 1796 | if (!function_exists('geodir_max_upload_size')) {
|
| 1797 | - /** |
|
| 1798 | - * Get max upload file size |
|
| 1799 | - * |
|
| 1800 | - * @since 1.0.0 |
|
| 1801 | - * @package GeoDirectory |
|
| 1802 | - * @return mixed|void Returns max upload file size. |
|
| 1803 | - */ |
|
| 1804 | - function geodir_max_upload_size() |
|
| 1805 | - {
|
|
| 1806 | - $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
|
|
| 1807 | - |
|
| 1808 | - if ($max_filesize > 0 && $max_filesize < 1) {
|
|
| 1809 | - $max_filesize = (int)($max_filesize * 1024) . 'kb'; |
|
| 1810 | - } else {
|
|
| 1811 | - $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb'; |
|
| 1812 | - } |
|
| 1813 | - /** Filter documented in geodirectory-functions/general_functions.php **/ |
|
| 1814 | - return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
|
|
| 1815 | - } |
|
| 1797 | + /** |
|
| 1798 | + * Get max upload file size |
|
| 1799 | + * |
|
| 1800 | + * @since 1.0.0 |
|
| 1801 | + * @package GeoDirectory |
|
| 1802 | + * @return mixed|void Returns max upload file size. |
|
| 1803 | + */ |
|
| 1804 | + function geodir_max_upload_size() |
|
| 1805 | + {
|
|
| 1806 | + $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
|
|
| 1807 | + |
|
| 1808 | + if ($max_filesize > 0 && $max_filesize < 1) {
|
|
| 1809 | + $max_filesize = (int)($max_filesize * 1024) . 'kb'; |
|
| 1810 | + } else {
|
|
| 1811 | + $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb'; |
|
| 1812 | + } |
|
| 1813 | + /** Filter documented in geodirectory-functions/general_functions.php **/ |
|
| 1814 | + return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
|
|
| 1815 | + } |
|
| 1816 | 1816 | } |
| 1817 | 1817 | |
| 1818 | 1818 | |
@@ -1830,33 +1830,33 @@ discard block |
||
| 1830 | 1830 | */ |
| 1831 | 1831 | function geodir_add_custom_sort_options($fields, $post_type) |
| 1832 | 1832 | {
|
| 1833 | - global $wpdb; |
|
| 1833 | + global $wpdb; |
|
| 1834 | 1834 | |
| 1835 | - if ($post_type != '') {
|
|
| 1835 | + if ($post_type != '') {
|
|
| 1836 | 1836 | |
| 1837 | - $all_postypes = geodir_get_posttypes(); |
|
| 1837 | + $all_postypes = geodir_get_posttypes(); |
|
| 1838 | 1838 | |
| 1839 | - if (in_array($post_type, $all_postypes)) {
|
|
| 1839 | + if (in_array($post_type, $all_postypes)) {
|
|
| 1840 | 1840 | |
| 1841 | - $custom_fields = $wpdb->get_results( |
|
| 1842 | - $wpdb->prepare( |
|
| 1843 | - "select post_type,data_type,field_type,site_title,htmlvar_name,field_icon from " . GEODIR_CUSTOM_FIELDS_TABLE . " where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc", |
|
| 1844 | - array($post_type) |
|
| 1845 | - ), 'ARRAY_A' |
|
| 1846 | - ); |
|
| 1841 | + $custom_fields = $wpdb->get_results( |
|
| 1842 | + $wpdb->prepare( |
|
| 1843 | + "select post_type,data_type,field_type,site_title,htmlvar_name,field_icon from " . GEODIR_CUSTOM_FIELDS_TABLE . " where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc", |
|
| 1844 | + array($post_type) |
|
| 1845 | + ), 'ARRAY_A' |
|
| 1846 | + ); |
|
| 1847 | 1847 | |
| 1848 | - if (!empty($custom_fields)) {
|
|
| 1848 | + if (!empty($custom_fields)) {
|
|
| 1849 | 1849 | |
| 1850 | - foreach ($custom_fields as $val) {
|
|
| 1851 | - $fields[] = $val; |
|
| 1852 | - } |
|
| 1853 | - } |
|
| 1850 | + foreach ($custom_fields as $val) {
|
|
| 1851 | + $fields[] = $val; |
|
| 1852 | + } |
|
| 1853 | + } |
|
| 1854 | 1854 | |
| 1855 | - } |
|
| 1855 | + } |
|
| 1856 | 1856 | |
| 1857 | - } |
|
| 1857 | + } |
|
| 1858 | 1858 | |
| 1859 | - return $fields; |
|
| 1859 | + return $fields; |
|
| 1860 | 1860 | } |
| 1861 | 1861 | |
| 1862 | 1862 | |
@@ -1872,76 +1872,76 @@ discard block |
||
| 1872 | 1872 | function geodir_get_custom_sort_options($post_type = '') |
| 1873 | 1873 | {
|
| 1874 | 1874 | |
| 1875 | - global $wpdb; |
|
| 1876 | - |
|
| 1877 | - if ($post_type != '') {
|
|
| 1878 | - |
|
| 1879 | - $all_postypes = geodir_get_posttypes(); |
|
| 1880 | - |
|
| 1881 | - if (!in_array($post_type, $all_postypes)) |
|
| 1882 | - return false; |
|
| 1883 | - |
|
| 1884 | - $fields = array(); |
|
| 1885 | - |
|
| 1886 | - $fields[] = array( |
|
| 1887 | - 'post_type' => $post_type, |
|
| 1888 | - 'data_type' => '', |
|
| 1889 | - 'field_type' => 'random', |
|
| 1890 | - 'site_title' => 'Random', |
|
| 1891 | - 'htmlvar_name' => 'post_title', |
|
| 1892 | - 'field_icon' => 'fa fa-random', |
|
| 1893 | - 'description' => __('Random sort (not recommended for large sites)', 'geodirectory')
|
|
| 1894 | - ); |
|
| 1895 | - |
|
| 1896 | - $fields[] = array( |
|
| 1897 | - 'post_type' => $post_type, |
|
| 1898 | - 'data_type' => '', |
|
| 1899 | - 'field_type' => 'datetime', |
|
| 1900 | - 'site_title' => __('Add date', 'geodirectory'),
|
|
| 1901 | - 'htmlvar_name' => 'post_date', |
|
| 1902 | - 'field_icon' => 'fa fa-calendar', |
|
| 1903 | - 'description' => __('Sort by date added', 'geodirectory')
|
|
| 1904 | - ); |
|
| 1905 | - $fields[] = array( |
|
| 1906 | - 'post_type' => $post_type, |
|
| 1907 | - 'data_type' => '', |
|
| 1908 | - 'field_type' => 'bigint', |
|
| 1909 | - 'site_title' => __('Review', 'geodirectory'),
|
|
| 1910 | - 'htmlvar_name' => 'comment_count', |
|
| 1911 | - 'field_icon' => 'fa fa-commenting-o', |
|
| 1912 | - 'description' => __('Sort by the number of reviews', 'geodirectory')
|
|
| 1913 | - ); |
|
| 1914 | - $fields[] = array( |
|
| 1915 | - 'post_type' => $post_type, |
|
| 1916 | - 'data_type' => '', |
|
| 1917 | - 'field_type' => 'float', |
|
| 1918 | - 'site_title' => __('Rating', 'geodirectory'),
|
|
| 1919 | - 'htmlvar_name' => 'overall_rating', |
|
| 1920 | - 'field_icon' => 'fa fa-star-o', |
|
| 1921 | - 'description' => __('Sort by the overall rating value', 'geodirectory')
|
|
| 1922 | - ); |
|
| 1923 | - $fields[] = array( |
|
| 1924 | - 'post_type' => $post_type, |
|
| 1925 | - 'data_type' => '', |
|
| 1926 | - 'field_type' => 'text', |
|
| 1927 | - 'site_title' => __('Title', 'geodirectory'),
|
|
| 1928 | - 'htmlvar_name' => 'post_title', |
|
| 1929 | - 'field_icon' => 'fa fa-sort-alpha-desc', |
|
| 1930 | - 'description' => __('Sort alphabetically by title', 'geodirectory')
|
|
| 1931 | - ); |
|
| 1932 | - |
|
| 1933 | - /** |
|
| 1934 | - * Hook to add custom sort options. |
|
| 1935 | - * |
|
| 1936 | - * @since 1.0.0 |
|
| 1937 | - * @param array $fields Unmodified sort options array. |
|
| 1938 | - * @param string $post_type Post type. |
|
| 1939 | - */ |
|
| 1940 | - return $fields = apply_filters('geodir_add_custom_sort_options', $fields, $post_type);
|
|
| 1941 | - |
|
| 1942 | - } |
|
| 1943 | - |
|
| 1944 | - return false; |
|
| 1875 | + global $wpdb; |
|
| 1876 | + |
|
| 1877 | + if ($post_type != '') {
|
|
| 1878 | + |
|
| 1879 | + $all_postypes = geodir_get_posttypes(); |
|
| 1880 | + |
|
| 1881 | + if (!in_array($post_type, $all_postypes)) |
|
| 1882 | + return false; |
|
| 1883 | + |
|
| 1884 | + $fields = array(); |
|
| 1885 | + |
|
| 1886 | + $fields[] = array( |
|
| 1887 | + 'post_type' => $post_type, |
|
| 1888 | + 'data_type' => '', |
|
| 1889 | + 'field_type' => 'random', |
|
| 1890 | + 'site_title' => 'Random', |
|
| 1891 | + 'htmlvar_name' => 'post_title', |
|
| 1892 | + 'field_icon' => 'fa fa-random', |
|
| 1893 | + 'description' => __('Random sort (not recommended for large sites)', 'geodirectory')
|
|
| 1894 | + ); |
|
| 1895 | + |
|
| 1896 | + $fields[] = array( |
|
| 1897 | + 'post_type' => $post_type, |
|
| 1898 | + 'data_type' => '', |
|
| 1899 | + 'field_type' => 'datetime', |
|
| 1900 | + 'site_title' => __('Add date', 'geodirectory'),
|
|
| 1901 | + 'htmlvar_name' => 'post_date', |
|
| 1902 | + 'field_icon' => 'fa fa-calendar', |
|
| 1903 | + 'description' => __('Sort by date added', 'geodirectory')
|
|
| 1904 | + ); |
|
| 1905 | + $fields[] = array( |
|
| 1906 | + 'post_type' => $post_type, |
|
| 1907 | + 'data_type' => '', |
|
| 1908 | + 'field_type' => 'bigint', |
|
| 1909 | + 'site_title' => __('Review', 'geodirectory'),
|
|
| 1910 | + 'htmlvar_name' => 'comment_count', |
|
| 1911 | + 'field_icon' => 'fa fa-commenting-o', |
|
| 1912 | + 'description' => __('Sort by the number of reviews', 'geodirectory')
|
|
| 1913 | + ); |
|
| 1914 | + $fields[] = array( |
|
| 1915 | + 'post_type' => $post_type, |
|
| 1916 | + 'data_type' => '', |
|
| 1917 | + 'field_type' => 'float', |
|
| 1918 | + 'site_title' => __('Rating', 'geodirectory'),
|
|
| 1919 | + 'htmlvar_name' => 'overall_rating', |
|
| 1920 | + 'field_icon' => 'fa fa-star-o', |
|
| 1921 | + 'description' => __('Sort by the overall rating value', 'geodirectory')
|
|
| 1922 | + ); |
|
| 1923 | + $fields[] = array( |
|
| 1924 | + 'post_type' => $post_type, |
|
| 1925 | + 'data_type' => '', |
|
| 1926 | + 'field_type' => 'text', |
|
| 1927 | + 'site_title' => __('Title', 'geodirectory'),
|
|
| 1928 | + 'htmlvar_name' => 'post_title', |
|
| 1929 | + 'field_icon' => 'fa fa-sort-alpha-desc', |
|
| 1930 | + 'description' => __('Sort alphabetically by title', 'geodirectory')
|
|
| 1931 | + ); |
|
| 1932 | + |
|
| 1933 | + /** |
|
| 1934 | + * Hook to add custom sort options. |
|
| 1935 | + * |
|
| 1936 | + * @since 1.0.0 |
|
| 1937 | + * @param array $fields Unmodified sort options array. |
|
| 1938 | + * @param string $post_type Post type. |
|
| 1939 | + */ |
|
| 1940 | + return $fields = apply_filters('geodir_add_custom_sort_options', $fields, $post_type);
|
|
| 1941 | + |
|
| 1942 | + } |
|
| 1943 | + |
|
| 1944 | + return false; |
|
| 1945 | 1945 | } |
| 1946 | 1946 | |
| 1947 | 1947 | |
@@ -1957,117 +1957,117 @@ discard block |
||
| 1957 | 1957 | function godir_set_sort_field_order($field_ids = array()) |
| 1958 | 1958 | {
|
| 1959 | 1959 | |
| 1960 | - global $wpdb; |
|
| 1960 | + global $wpdb; |
|
| 1961 | 1961 | |
| 1962 | - $count = 0; |
|
| 1963 | - if (!empty($field_ids)): |
|
| 1964 | - foreach ($field_ids as $id) {
|
|
| 1962 | + $count = 0; |
|
| 1963 | + if (!empty($field_ids)): |
|
| 1964 | + foreach ($field_ids as $id) {
|
|
| 1965 | 1965 | |
| 1966 | - $cf = trim($id, '_'); |
|
| 1966 | + $cf = trim($id, '_'); |
|
| 1967 | 1967 | |
| 1968 | - $post_meta_info = $wpdb->query( |
|
| 1969 | - $wpdb->prepare( |
|
| 1970 | - "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
| 1968 | + $post_meta_info = $wpdb->query( |
|
| 1969 | + $wpdb->prepare( |
|
| 1970 | + "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
| 1971 | 1971 | sort_order=%d |
| 1972 | 1972 | where id= %d", |
| 1973 | - array($count, $cf) |
|
| 1974 | - ) |
|
| 1975 | - ); |
|
| 1976 | - $count++; |
|
| 1977 | - } |
|
| 1978 | - |
|
| 1979 | - return $field_ids; |
|
| 1980 | - else: |
|
| 1981 | - return false; |
|
| 1982 | - endif; |
|
| 1973 | + array($count, $cf) |
|
| 1974 | + ) |
|
| 1975 | + ); |
|
| 1976 | + $count++; |
|
| 1977 | + } |
|
| 1978 | + |
|
| 1979 | + return $field_ids; |
|
| 1980 | + else: |
|
| 1981 | + return false; |
|
| 1982 | + endif; |
|
| 1983 | 1983 | } |
| 1984 | 1984 | |
| 1985 | 1985 | |
| 1986 | 1986 | if (!function_exists('geodir_custom_sort_field_save')) {
|
| 1987 | - /** |
|
| 1988 | - * Save or Update custom sort fields into the database. |
|
| 1989 | - * |
|
| 1990 | - * @since 1.0.0 |
|
| 1991 | - * @package GeoDirectory |
|
| 1992 | - * @global object $wpdb WordPress Database object. |
|
| 1993 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 1994 | - * @param array $request_field {
|
|
| 1995 | - * Attributes of the Request field. |
|
| 1996 | - * |
|
| 1997 | - * @type string $action Ajax action name. |
|
| 1998 | - * @type string $manage_field_type Manage field type Default "sorting_options". |
|
| 1999 | - * @type string $create_field Do you want to create this field?. |
|
| 2000 | - * @type string $field_ins_upd Field created or updated?. |
|
| 2001 | - * @type string $_wpnonce Nonce value. |
|
| 2002 | - * @type string $listing_type The Post type. |
|
| 2003 | - * @type string $field_type Field Type. |
|
| 2004 | - * @type string $field_id Field ID. |
|
| 2005 | - * @type string $data_type Data Type. |
|
| 2006 | - * @type string $htmlvar_name HTML variable name. |
|
| 2007 | - * @type string $site_title Section title which you wish to display in frontend. |
|
| 2008 | - * @type string $is_default Is this default sorting?. |
|
| 2009 | - * @type string $is_active If not active then the field will not be displayed anywhere. |
|
| 2010 | - * @type string $sort_order Sort Order. |
|
| 2011 | - * |
|
| 2012 | - * } |
|
| 2013 | - * @param bool $default Not yet implemented. |
|
| 2014 | - * @return int Returns the last affected db table row id. |
|
| 2015 | - */ |
|
| 2016 | - function geodir_custom_sort_field_save($request_field = array(), $default = false) |
|
| 2017 | - {
|
|
| 2018 | - |
|
| 2019 | - global $wpdb, $plugin_prefix; |
|
| 2020 | - |
|
| 2021 | - $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : ''; |
|
| 2022 | - |
|
| 2023 | - $cf = trim($result_str, '_'); |
|
| 2024 | - |
|
| 2025 | - /*-------- check duplicate validation --------*/ |
|
| 2026 | - |
|
| 2027 | - $field_type = isset($request_field['field_type']) ? $request_field['field_type'] : ''; |
|
| 2028 | - $cehhtmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : ''; |
|
| 2029 | - |
|
| 2030 | - $post_type = $request_field['listing_type']; |
|
| 2031 | - $data_type = isset($request_field['data_type']) ? $request_field['data_type'] : ''; |
|
| 2032 | - $field_type = isset($request_field['field_type']) ? $request_field['field_type'] : ''; |
|
| 2033 | - $site_title = isset($request_field['site_title']) ? $request_field['site_title'] : ''; |
|
| 2034 | - $htmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : ''; |
|
| 2035 | - $sort_order = isset($request_field['sort_order']) ? $request_field['sort_order'] : 0; |
|
| 2036 | - $is_active = isset($request_field['is_active']) ? $request_field['is_active'] : 0; |
|
| 2037 | - $is_default = isset($request_field['is_default']) ? $request_field['is_default'] : ''; |
|
| 2038 | - $asc = isset($request_field['asc']) ? $request_field['asc'] : 0; |
|
| 2039 | - $desc = isset($request_field['desc']) ? $request_field['desc'] : 0; |
|
| 2040 | - $asc_title = isset($request_field['asc_title']) ? $request_field['asc_title'] : ''; |
|
| 2041 | - $desc_title = isset($request_field['desc_title']) ? $request_field['desc_title'] : ''; |
|
| 2042 | - |
|
| 2043 | - $default_order = ''; |
|
| 2044 | - if ($is_default != '') {
|
|
| 2045 | - $default_order = $is_default; |
|
| 2046 | - $is_default = '1'; |
|
| 2047 | - } |
|
| 2048 | - |
|
| 2049 | - |
|
| 2050 | - $check_html_variable = $wpdb->get_var( |
|
| 2051 | - $wpdb->prepare( |
|
| 2052 | - "select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ", |
|
| 2053 | - array($cehhtmlvar_name, $post_type, $field_type) |
|
| 2054 | - ) |
|
| 2055 | - ); |
|
| 2056 | - |
|
| 2057 | - if ($is_default == 1) {
|
|
| 2058 | - |
|
| 2059 | - $wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type)));
|
|
| 2060 | - |
|
| 2061 | - } |
|
| 2062 | - |
|
| 2063 | - |
|
| 2064 | - if (!$check_html_variable) {
|
|
| 2065 | - |
|
| 2066 | - $wpdb->query( |
|
| 2067 | - |
|
| 2068 | - $wpdb->prepare( |
|
| 2069 | - |
|
| 2070 | - "insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
| 1987 | + /** |
|
| 1988 | + * Save or Update custom sort fields into the database. |
|
| 1989 | + * |
|
| 1990 | + * @since 1.0.0 |
|
| 1991 | + * @package GeoDirectory |
|
| 1992 | + * @global object $wpdb WordPress Database object. |
|
| 1993 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 1994 | + * @param array $request_field {
|
|
| 1995 | + * Attributes of the Request field. |
|
| 1996 | + * |
|
| 1997 | + * @type string $action Ajax action name. |
|
| 1998 | + * @type string $manage_field_type Manage field type Default "sorting_options". |
|
| 1999 | + * @type string $create_field Do you want to create this field?. |
|
| 2000 | + * @type string $field_ins_upd Field created or updated?. |
|
| 2001 | + * @type string $_wpnonce Nonce value. |
|
| 2002 | + * @type string $listing_type The Post type. |
|
| 2003 | + * @type string $field_type Field Type. |
|
| 2004 | + * @type string $field_id Field ID. |
|
| 2005 | + * @type string $data_type Data Type. |
|
| 2006 | + * @type string $htmlvar_name HTML variable name. |
|
| 2007 | + * @type string $site_title Section title which you wish to display in frontend. |
|
| 2008 | + * @type string $is_default Is this default sorting?. |
|
| 2009 | + * @type string $is_active If not active then the field will not be displayed anywhere. |
|
| 2010 | + * @type string $sort_order Sort Order. |
|
| 2011 | + * |
|
| 2012 | + * } |
|
| 2013 | + * @param bool $default Not yet implemented. |
|
| 2014 | + * @return int Returns the last affected db table row id. |
|
| 2015 | + */ |
|
| 2016 | + function geodir_custom_sort_field_save($request_field = array(), $default = false) |
|
| 2017 | + {
|
|
| 2018 | + |
|
| 2019 | + global $wpdb, $plugin_prefix; |
|
| 2020 | + |
|
| 2021 | + $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : ''; |
|
| 2022 | + |
|
| 2023 | + $cf = trim($result_str, '_'); |
|
| 2024 | + |
|
| 2025 | + /*-------- check duplicate validation --------*/ |
|
| 2026 | + |
|
| 2027 | + $field_type = isset($request_field['field_type']) ? $request_field['field_type'] : ''; |
|
| 2028 | + $cehhtmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : ''; |
|
| 2029 | + |
|
| 2030 | + $post_type = $request_field['listing_type']; |
|
| 2031 | + $data_type = isset($request_field['data_type']) ? $request_field['data_type'] : ''; |
|
| 2032 | + $field_type = isset($request_field['field_type']) ? $request_field['field_type'] : ''; |
|
| 2033 | + $site_title = isset($request_field['site_title']) ? $request_field['site_title'] : ''; |
|
| 2034 | + $htmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : ''; |
|
| 2035 | + $sort_order = isset($request_field['sort_order']) ? $request_field['sort_order'] : 0; |
|
| 2036 | + $is_active = isset($request_field['is_active']) ? $request_field['is_active'] : 0; |
|
| 2037 | + $is_default = isset($request_field['is_default']) ? $request_field['is_default'] : ''; |
|
| 2038 | + $asc = isset($request_field['asc']) ? $request_field['asc'] : 0; |
|
| 2039 | + $desc = isset($request_field['desc']) ? $request_field['desc'] : 0; |
|
| 2040 | + $asc_title = isset($request_field['asc_title']) ? $request_field['asc_title'] : ''; |
|
| 2041 | + $desc_title = isset($request_field['desc_title']) ? $request_field['desc_title'] : ''; |
|
| 2042 | + |
|
| 2043 | + $default_order = ''; |
|
| 2044 | + if ($is_default != '') {
|
|
| 2045 | + $default_order = $is_default; |
|
| 2046 | + $is_default = '1'; |
|
| 2047 | + } |
|
| 2048 | + |
|
| 2049 | + |
|
| 2050 | + $check_html_variable = $wpdb->get_var( |
|
| 2051 | + $wpdb->prepare( |
|
| 2052 | + "select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ", |
|
| 2053 | + array($cehhtmlvar_name, $post_type, $field_type) |
|
| 2054 | + ) |
|
| 2055 | + ); |
|
| 2056 | + |
|
| 2057 | + if ($is_default == 1) {
|
|
| 2058 | + |
|
| 2059 | + $wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type)));
|
|
| 2060 | + |
|
| 2061 | + } |
|
| 2062 | + |
|
| 2063 | + |
|
| 2064 | + if (!$check_html_variable) {
|
|
| 2065 | + |
|
| 2066 | + $wpdb->query( |
|
| 2067 | + |
|
| 2068 | + $wpdb->prepare( |
|
| 2069 | + |
|
| 2070 | + "insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
| 2071 | 2071 | post_type = %s, |
| 2072 | 2072 | data_type = %s, |
| 2073 | 2073 | field_type = %s, |
@@ -2082,23 +2082,23 @@ discard block |
||
| 2082 | 2082 | asc_title = %s, |
| 2083 | 2083 | desc_title = %s", |
| 2084 | 2084 | |
| 2085 | - array($post_type, $data_type, $field_type, $site_title, $htmlvar_name, $sort_order, $is_active, $is_default, $default_order, $asc, $desc, $asc_title, $desc_title) |
|
| 2086 | - ) |
|
| 2085 | + array($post_type, $data_type, $field_type, $site_title, $htmlvar_name, $sort_order, $is_active, $is_default, $default_order, $asc, $desc, $asc_title, $desc_title) |
|
| 2086 | + ) |
|
| 2087 | 2087 | |
| 2088 | - ); |
|
| 2088 | + ); |
|
| 2089 | 2089 | |
| 2090 | 2090 | |
| 2091 | - $lastid = $wpdb->insert_id; |
|
| 2091 | + $lastid = $wpdb->insert_id; |
|
| 2092 | 2092 | |
| 2093 | - $lastid = trim($lastid); |
|
| 2093 | + $lastid = trim($lastid); |
|
| 2094 | 2094 | |
| 2095 | - } else {
|
|
| 2095 | + } else {
|
|
| 2096 | 2096 | |
| 2097 | - $wpdb->query( |
|
| 2097 | + $wpdb->query( |
|
| 2098 | 2098 | |
| 2099 | - $wpdb->prepare( |
|
| 2099 | + $wpdb->prepare( |
|
| 2100 | 2100 | |
| 2101 | - "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
| 2101 | + "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
| 2102 | 2102 | post_type = %s, |
| 2103 | 2103 | data_type = %s, |
| 2104 | 2104 | field_type = %s, |
@@ -2114,123 +2114,123 @@ discard block |
||
| 2114 | 2114 | desc_title = %s |
| 2115 | 2115 | where id = %d", |
| 2116 | 2116 | |
| 2117 | - array($post_type, $data_type, $field_type, $site_title, $htmlvar_name, $sort_order, $is_active, $is_default, $default_order, $asc, $desc, $asc_title, $desc_title, $cf) |
|
| 2118 | - ) |
|
| 2117 | + array($post_type, $data_type, $field_type, $site_title, $htmlvar_name, $sort_order, $is_active, $is_default, $default_order, $asc, $desc, $asc_title, $desc_title, $cf) |
|
| 2118 | + ) |
|
| 2119 | 2119 | |
| 2120 | - ); |
|
| 2120 | + ); |
|
| 2121 | 2121 | |
| 2122 | - $lastid = trim($cf); |
|
| 2122 | + $lastid = trim($cf); |
|
| 2123 | 2123 | |
| 2124 | - } |
|
| 2124 | + } |
|
| 2125 | 2125 | |
| 2126 | 2126 | |
| 2127 | - return (int)$lastid; |
|
| 2127 | + return (int)$lastid; |
|
| 2128 | 2128 | |
| 2129 | - } |
|
| 2129 | + } |
|
| 2130 | 2130 | } |
| 2131 | 2131 | |
| 2132 | 2132 | |
| 2133 | 2133 | if (!function_exists('geodir_custom_sort_field_delete')) {
|
| 2134 | - /** |
|
| 2135 | - * Delete a custom sort field using field id. |
|
| 2136 | - * @since 1.0.0 |
|
| 2137 | - * @package GeoDirectory |
|
| 2138 | - * @global object $wpdb WordPress Database object. |
|
| 2139 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 2140 | - * @param string $field_id The field ID. |
|
| 2141 | - * @return int|string Returns field id when successful deletion, else returns 0. |
|
| 2142 | - */ |
|
| 2143 | - function geodir_custom_sort_field_delete($field_id = '') |
|
| 2144 | - {
|
|
| 2145 | - |
|
| 2146 | - global $wpdb, $plugin_prefix; |
|
| 2147 | - if ($field_id != '') {
|
|
| 2148 | - $cf = trim($field_id, '_'); |
|
| 2149 | - |
|
| 2150 | - $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf)));
|
|
| 2151 | - |
|
| 2152 | - return $field_id; |
|
| 2153 | - |
|
| 2154 | - } else |
|
| 2155 | - return 0; |
|
| 2156 | - |
|
| 2157 | - } |
|
| 2134 | + /** |
|
| 2135 | + * Delete a custom sort field using field id. |
|
| 2136 | + * @since 1.0.0 |
|
| 2137 | + * @package GeoDirectory |
|
| 2138 | + * @global object $wpdb WordPress Database object. |
|
| 2139 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 2140 | + * @param string $field_id The field ID. |
|
| 2141 | + * @return int|string Returns field id when successful deletion, else returns 0. |
|
| 2142 | + */ |
|
| 2143 | + function geodir_custom_sort_field_delete($field_id = '') |
|
| 2144 | + {
|
|
| 2145 | + |
|
| 2146 | + global $wpdb, $plugin_prefix; |
|
| 2147 | + if ($field_id != '') {
|
|
| 2148 | + $cf = trim($field_id, '_'); |
|
| 2149 | + |
|
| 2150 | + $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf)));
|
|
| 2151 | + |
|
| 2152 | + return $field_id; |
|
| 2153 | + |
|
| 2154 | + } else |
|
| 2155 | + return 0; |
|
| 2156 | + |
|
| 2157 | + } |
|
| 2158 | 2158 | } |
| 2159 | 2159 | |
| 2160 | 2160 | |
| 2161 | 2161 | if (!function_exists('geodir_custom_sort_field_adminhtml')) {
|
| 2162 | - /** |
|
| 2163 | - * Custom sort field admin html. |
|
| 2164 | - * |
|
| 2165 | - * @since 1.0.0 |
|
| 2166 | - * @package GeoDirectory |
|
| 2167 | - * @global object $wpdb WordPress Database object. |
|
| 2168 | - * @param string $field_type The form field type. |
|
| 2169 | - * @param object|int $result_str The custom field results object or row id. |
|
| 2170 | - * @param string $field_ins_upd When set to "submit" displays form. |
|
| 2171 | - * @param bool $default when set to true field will be for admin use only. |
|
| 2172 | - */ |
|
| 2173 | - function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key='') |
|
| 2174 | - {
|
|
| 2175 | - global $wpdb; |
|
| 2176 | - $cf = $result_str; |
|
| 2177 | - if (!is_object($cf)) {
|
|
| 2178 | - $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf)));
|
|
| 2179 | - } else {
|
|
| 2180 | - $field_info = $cf; |
|
| 2181 | - $result_str = $cf->id; |
|
| 2182 | - } |
|
| 2183 | - |
|
| 2184 | - $field_info = stripslashes_deep($field_info); // strip slashes |
|
| 2185 | - |
|
| 2186 | - if (!isset($field_info->post_type)) {
|
|
| 2187 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2188 | - } else {
|
|
| 2189 | - $post_type = $field_info->post_type; |
|
| 2190 | - } |
|
| 2191 | - |
|
| 2192 | - |
|
| 2193 | - $htmlvar_name = isset($field_type_key) ? $field_type_key : ''; |
|
| 2194 | - |
|
| 2195 | - $site_title = ''; |
|
| 2196 | - if ($site_title == '') |
|
| 2197 | - $site_title = isset($field_info->site_title) ? $field_info->site_title : ''; |
|
| 2198 | - |
|
| 2199 | - if ($site_title == '') {
|
|
| 2200 | - $fields = geodir_get_custom_sort_options($post_type); |
|
| 2201 | - |
|
| 2202 | - foreach ($fields as $val) {
|
|
| 2203 | - $val = stripslashes_deep($val); // strip slashes |
|
| 2204 | - |
|
| 2205 | - if ($val['field_type'] == $field_type && $val['htmlvar_name'] == $htmlvar_name) {
|
|
| 2206 | - $site_title = isset($val['site_title']) ? $val['site_title'] : ''; |
|
| 2207 | - } |
|
| 2208 | - } |
|
| 2209 | - } |
|
| 2210 | - |
|
| 2211 | - if ($htmlvar_name == '') |
|
| 2212 | - $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : ''; |
|
| 2213 | - |
|
| 2214 | - $nonce = wp_create_nonce('custom_fields_' . $result_str);
|
|
| 2215 | - |
|
| 2216 | - $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
|
| 2217 | - $cso_arr = geodir_get_custom_sort_options($post_type); |
|
| 2218 | - |
|
| 2219 | - $cur_field_type = (isset($cf->field_type)) ? $cf->field_type : esc_html($_REQUEST['field_type']); |
|
| 2220 | - foreach($cso_arr as $cso){
|
|
| 2221 | - if($cur_field_type==$cso['field_type']){
|
|
| 2222 | - |
|
| 2223 | - if (isset($cso['field_icon']) && strpos($cso['field_icon'], 'fa fa-') !== false) {
|
|
| 2224 | - $field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>'; |
|
| 2225 | - }elseif(isset($cso['field_icon']) && $cso['field_icon']){
|
|
| 2226 | - $field_icon = '<b style="background-image: url("'.$cso['field_icon'].'")"></b>';
|
|
| 2227 | - } |
|
| 2228 | - |
|
| 2229 | - } |
|
| 2230 | - } |
|
| 2231 | - |
|
| 2232 | - $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name.$field_type : rand(5, 500); |
|
| 2233 | - ?> |
|
| 2162 | + /** |
|
| 2163 | + * Custom sort field admin html. |
|
| 2164 | + * |
|
| 2165 | + * @since 1.0.0 |
|
| 2166 | + * @package GeoDirectory |
|
| 2167 | + * @global object $wpdb WordPress Database object. |
|
| 2168 | + * @param string $field_type The form field type. |
|
| 2169 | + * @param object|int $result_str The custom field results object or row id. |
|
| 2170 | + * @param string $field_ins_upd When set to "submit" displays form. |
|
| 2171 | + * @param bool $default when set to true field will be for admin use only. |
|
| 2172 | + */ |
|
| 2173 | + function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key='') |
|
| 2174 | + {
|
|
| 2175 | + global $wpdb; |
|
| 2176 | + $cf = $result_str; |
|
| 2177 | + if (!is_object($cf)) {
|
|
| 2178 | + $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf)));
|
|
| 2179 | + } else {
|
|
| 2180 | + $field_info = $cf; |
|
| 2181 | + $result_str = $cf->id; |
|
| 2182 | + } |
|
| 2183 | + |
|
| 2184 | + $field_info = stripslashes_deep($field_info); // strip slashes |
|
| 2185 | + |
|
| 2186 | + if (!isset($field_info->post_type)) {
|
|
| 2187 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2188 | + } else {
|
|
| 2189 | + $post_type = $field_info->post_type; |
|
| 2190 | + } |
|
| 2191 | + |
|
| 2192 | + |
|
| 2193 | + $htmlvar_name = isset($field_type_key) ? $field_type_key : ''; |
|
| 2194 | + |
|
| 2195 | + $site_title = ''; |
|
| 2196 | + if ($site_title == '') |
|
| 2197 | + $site_title = isset($field_info->site_title) ? $field_info->site_title : ''; |
|
| 2198 | + |
|
| 2199 | + if ($site_title == '') {
|
|
| 2200 | + $fields = geodir_get_custom_sort_options($post_type); |
|
| 2201 | + |
|
| 2202 | + foreach ($fields as $val) {
|
|
| 2203 | + $val = stripslashes_deep($val); // strip slashes |
|
| 2204 | + |
|
| 2205 | + if ($val['field_type'] == $field_type && $val['htmlvar_name'] == $htmlvar_name) {
|
|
| 2206 | + $site_title = isset($val['site_title']) ? $val['site_title'] : ''; |
|
| 2207 | + } |
|
| 2208 | + } |
|
| 2209 | + } |
|
| 2210 | + |
|
| 2211 | + if ($htmlvar_name == '') |
|
| 2212 | + $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : ''; |
|
| 2213 | + |
|
| 2214 | + $nonce = wp_create_nonce('custom_fields_' . $result_str);
|
|
| 2215 | + |
|
| 2216 | + $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
|
| 2217 | + $cso_arr = geodir_get_custom_sort_options($post_type); |
|
| 2218 | + |
|
| 2219 | + $cur_field_type = (isset($cf->field_type)) ? $cf->field_type : esc_html($_REQUEST['field_type']); |
|
| 2220 | + foreach($cso_arr as $cso){
|
|
| 2221 | + if($cur_field_type==$cso['field_type']){
|
|
| 2222 | + |
|
| 2223 | + if (isset($cso['field_icon']) && strpos($cso['field_icon'], 'fa fa-') !== false) {
|
|
| 2224 | + $field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>'; |
|
| 2225 | + }elseif(isset($cso['field_icon']) && $cso['field_icon']){
|
|
| 2226 | + $field_icon = '<b style="background-image: url("'.$cso['field_icon'].'")"></b>';
|
|
| 2227 | + } |
|
| 2228 | + |
|
| 2229 | + } |
|
| 2230 | + } |
|
| 2231 | + |
|
| 2232 | + $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name.$field_type : rand(5, 500); |
|
| 2233 | + ?> |
|
| 2234 | 2234 | |
| 2235 | 2235 | <li class="text" id="licontainer_<?php echo $result_str;?>"> |
| 2236 | 2236 | <form><!-- we need to wrap in a form so we can use radio buttons with same name --> |
@@ -2239,7 +2239,7 @@ discard block |
||
| 2239 | 2239 | ondblclick="show_hide('field_frm<?php echo $result_str;?>')">
|
| 2240 | 2240 | <?php |
| 2241 | 2241 | |
| 2242 | - ?> |
|
| 2242 | + ?> |
|
| 2243 | 2243 | |
| 2244 | 2244 | <div title="<?php _e('Click to remove field', 'geodirectory');?>"
|
| 2245 | 2245 | onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
|
@@ -2254,17 +2254,17 @@ discard block |
||
| 2254 | 2254 | |
| 2255 | 2255 | <div id="field_frm<?php echo $result_str;?>" class="field_frm" |
| 2256 | 2256 | style="display:<?php if ($field_ins_upd == 'submit') {
|
| 2257 | - echo 'block;'; |
|
| 2258 | - } else {
|
|
| 2259 | - echo 'none;'; |
|
| 2260 | - } ?>"> |
|
| 2257 | + echo 'block;'; |
|
| 2258 | + } else {
|
|
| 2259 | + echo 'none;'; |
|
| 2260 | + } ?>"> |
|
| 2261 | 2261 | <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>"/> |
| 2262 | 2262 | <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type;?>"/> |
| 2263 | 2263 | <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type;?>"/> |
| 2264 | 2264 | <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str;?>"/> |
| 2265 | 2265 | <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
|
| 2266 | - echo $field_info->data_type; |
|
| 2267 | - }?>"/> |
|
| 2266 | + echo $field_info->data_type; |
|
| 2267 | + }?>"/> |
|
| 2268 | 2268 | <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name;?>"/> |
| 2269 | 2269 | |
| 2270 | 2270 | |
@@ -2287,14 +2287,14 @@ discard block |
||
| 2287 | 2287 | |
| 2288 | 2288 | <input type="radio" id="asc_yes<?php echo $radio_id;?>" name="asc" class="gdri-enabled" value="1" |
| 2289 | 2289 | <?php if ($value == '1') {
|
| 2290 | - echo 'checked'; |
|
| 2291 | - } ?>/> |
|
| 2290 | + echo 'checked'; |
|
| 2291 | + } ?>/> |
|
| 2292 | 2292 | <label onclick="show_hide_radio(this,'show','cfs-asc-title');" for="asc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
| 2293 | 2293 | |
| 2294 | 2294 | <input type="radio" id="asc_no<?php echo $radio_id;?>" name="asc" class="gdri-disabled" value="0" |
| 2295 | 2295 | <?php if ($value == '0' || !$value) {
|
| 2296 | - echo 'checked'; |
|
| 2297 | - } ?>/> |
|
| 2296 | + echo 'checked'; |
|
| 2297 | + } ?>/> |
|
| 2298 | 2298 | <label onclick="show_hide_radio(this,'hide','cfs-asc-title');" for="asc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
| 2299 | 2299 | |
| 2300 | 2300 | </div> |
@@ -2331,8 +2331,8 @@ discard block |
||
| 2331 | 2331 | |
| 2332 | 2332 | <input type="radio" name="is_default" |
| 2333 | 2333 | value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_asc') {
|
| 2334 | - echo 'checked="checked"'; |
|
| 2335 | - } ?>/> |
|
| 2334 | + echo 'checked="checked"'; |
|
| 2335 | + } ?>/> |
|
| 2336 | 2336 | </div> |
| 2337 | 2337 | |
| 2338 | 2338 | </li> |
@@ -2352,14 +2352,14 @@ discard block |
||
| 2352 | 2352 | |
| 2353 | 2353 | <input type="radio" id="desc_yes<?php echo $radio_id;?>" name="desc" class="gdri-enabled" value="1" |
| 2354 | 2354 | <?php if ($value == '1') {
|
| 2355 | - echo 'checked'; |
|
| 2356 | - } ?>/> |
|
| 2355 | + echo 'checked'; |
|
| 2356 | + } ?>/> |
|
| 2357 | 2357 | <label onclick="show_hide_radio(this,'show','cfs-desc-title');" for="desc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
| 2358 | 2358 | |
| 2359 | 2359 | <input type="radio" id="desc_no<?php echo $radio_id;?>" name="desc" class="gdri-disabled" value="0" |
| 2360 | 2360 | <?php if ($value == '0' || !$value) {
|
| 2361 | - echo 'checked'; |
|
| 2362 | - } ?>/> |
|
| 2361 | + echo 'checked'; |
|
| 2362 | + } ?>/> |
|
| 2363 | 2363 | <label onclick="show_hide_radio(this,'hide','cfs-desc-title');" for="desc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
| 2364 | 2364 | |
| 2365 | 2365 | </div> |
@@ -2395,8 +2395,8 @@ discard block |
||
| 2395 | 2395 | |
| 2396 | 2396 | <input type="radio" name="is_default" |
| 2397 | 2397 | value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_desc') {
|
| 2398 | - echo 'checked="checked"'; |
|
| 2399 | - } ?>/> |
|
| 2398 | + echo 'checked="checked"'; |
|
| 2399 | + } ?>/> |
|
| 2400 | 2400 | </div> |
| 2401 | 2401 | |
| 2402 | 2402 | </li> |
@@ -2438,8 +2438,8 @@ discard block |
||
| 2438 | 2438 | |
| 2439 | 2439 | <input type="checkbox" name="is_default" |
| 2440 | 2440 | value="<?php echo $field_type; ?>" <?php if (isset($value) && $value == '1') {
|
| 2441 | - echo 'checked="checked"'; |
|
| 2442 | - } ?>/> |
|
| 2441 | + echo 'checked="checked"'; |
|
| 2442 | + } ?>/> |
|
| 2443 | 2443 | </div> |
| 2444 | 2444 | |
| 2445 | 2445 | |
@@ -2462,14 +2462,14 @@ discard block |
||
| 2462 | 2462 | |
| 2463 | 2463 | <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled" value="1" |
| 2464 | 2464 | <?php if ($value == '1') {
|
| 2465 | - echo 'checked'; |
|
| 2466 | - } ?>/> |
|
| 2465 | + echo 'checked'; |
|
| 2466 | + } ?>/> |
|
| 2467 | 2467 | <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
| 2468 | 2468 | |
| 2469 | 2469 | <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0" |
| 2470 | 2470 | <?php if ($value == '0' || !$value) {
|
| 2471 | - echo 'checked'; |
|
| 2472 | - } ?>/> |
|
| 2471 | + echo 'checked'; |
|
| 2472 | + } ?>/> |
|
| 2473 | 2473 | <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
| 2474 | 2474 | |
| 2475 | 2475 | </div> |
@@ -2479,8 +2479,8 @@ discard block |
||
| 2479 | 2479 | |
| 2480 | 2480 | <input type="hidden" readonly="readonly" name="sort_order" id="sort_order" |
| 2481 | 2481 | value="<?php if (isset($field_info->sort_order)) {
|
| 2482 | - echo esc_attr($field_info->sort_order); |
|
| 2483 | - }?>" size="50"/> |
|
| 2482 | + echo esc_attr($field_info->sort_order); |
|
| 2483 | + }?>" size="50"/> |
|
| 2484 | 2484 | |
| 2485 | 2485 | |
| 2486 | 2486 | |
@@ -2504,38 +2504,38 @@ discard block |
||
| 2504 | 2504 | </form> |
| 2505 | 2505 | </li> <?php |
| 2506 | 2506 | |
| 2507 | - } |
|
| 2507 | + } |
|
| 2508 | 2508 | } |
| 2509 | 2509 | |
| 2510 | 2510 | if (!function_exists('check_field_visibility')) {
|
| 2511 | - /** |
|
| 2512 | - * Check field visibility as per price package. |
|
| 2513 | - * |
|
| 2514 | - * @since 1.0.0 |
|
| 2515 | - * @package GeoDirectory |
|
| 2516 | - * @global object $wpdb WordPress Database object. |
|
| 2517 | - * @global array $geodir_addon_list List of active GeoDirectory extensions. |
|
| 2518 | - * @param int|string $package_id The package ID. |
|
| 2519 | - * @param string $field_name The field name. |
|
| 2520 | - * @param string $post_type Optional. The wordpress post type. |
|
| 2521 | - * @return bool Returns true when field visible, otherwise false. |
|
| 2522 | - */ |
|
| 2523 | - function check_field_visibility($package_id, $field_name, $post_type) |
|
| 2524 | - {
|
|
| 2525 | - global $wpdb, $geodir_addon_list; |
|
| 2526 | - if (!(isset($geodir_addon_list['geodir_payment_manager']) && $geodir_addon_list['geodir_payment_manager'] == 'yes')) {
|
|
| 2527 | - return true; |
|
| 2528 | - } |
|
| 2529 | - if (!$package_id || !$field_name || !$post_type) {
|
|
| 2530 | - return true; |
|
| 2531 | - } |
|
| 2532 | - $sql = $wpdb->prepare("SELECT id FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int)$package_id));
|
|
| 2533 | - |
|
| 2534 | - if ($wpdb->get_var($sql)) {
|
|
| 2535 | - return true; |
|
| 2536 | - } |
|
| 2537 | - return false; |
|
| 2538 | - } |
|
| 2511 | + /** |
|
| 2512 | + * Check field visibility as per price package. |
|
| 2513 | + * |
|
| 2514 | + * @since 1.0.0 |
|
| 2515 | + * @package GeoDirectory |
|
| 2516 | + * @global object $wpdb WordPress Database object. |
|
| 2517 | + * @global array $geodir_addon_list List of active GeoDirectory extensions. |
|
| 2518 | + * @param int|string $package_id The package ID. |
|
| 2519 | + * @param string $field_name The field name. |
|
| 2520 | + * @param string $post_type Optional. The wordpress post type. |
|
| 2521 | + * @return bool Returns true when field visible, otherwise false. |
|
| 2522 | + */ |
|
| 2523 | + function check_field_visibility($package_id, $field_name, $post_type) |
|
| 2524 | + {
|
|
| 2525 | + global $wpdb, $geodir_addon_list; |
|
| 2526 | + if (!(isset($geodir_addon_list['geodir_payment_manager']) && $geodir_addon_list['geodir_payment_manager'] == 'yes')) {
|
|
| 2527 | + return true; |
|
| 2528 | + } |
|
| 2529 | + if (!$package_id || !$field_name || !$post_type) {
|
|
| 2530 | + return true; |
|
| 2531 | + } |
|
| 2532 | + $sql = $wpdb->prepare("SELECT id FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int)$package_id));
|
|
| 2533 | + |
|
| 2534 | + if ($wpdb->get_var($sql)) {
|
|
| 2535 | + return true; |
|
| 2536 | + } |
|
| 2537 | + return false; |
|
| 2538 | + } |
|
| 2539 | 2539 | } |
| 2540 | 2540 | |
| 2541 | 2541 | /** |
@@ -2551,43 +2551,43 @@ discard block |
||
| 2551 | 2551 | */ |
| 2552 | 2552 | function geodir_string_to_options($input = '', $translated = false) |
| 2553 | 2553 | {
|
| 2554 | - $return = array(); |
|
| 2555 | - if ($input != '') {
|
|
| 2556 | - $input = trim($input); |
|
| 2557 | - $input = rtrim($input, ","); |
|
| 2558 | - $input = ltrim($input, ","); |
|
| 2559 | - $input = trim($input); |
|
| 2560 | - } |
|
| 2561 | - |
|
| 2562 | - $input_arr = explode(',', $input);
|
|
| 2563 | - |
|
| 2564 | - if (!empty($input_arr)) {
|
|
| 2565 | - foreach ($input_arr as $input_str) {
|
|
| 2566 | - $input_str = trim($input_str); |
|
| 2567 | - |
|
| 2568 | - if (strpos($input_str, "/") !== false) {
|
|
| 2569 | - $input_str = explode("/", $input_str, 2);
|
|
| 2570 | - $label = trim($input_str[0]); |
|
| 2571 | - if ($translated && $label != '') {
|
|
| 2572 | - $label = __($label, 'geodirectory'); |
|
| 2573 | - } |
|
| 2574 | - $label = ucfirst($label); |
|
| 2575 | - $value = trim($input_str[1]); |
|
| 2576 | - } else {
|
|
| 2577 | - $value = $input_str; |
|
| 2578 | - if ($translated && $input_str != '') {
|
|
| 2579 | - $input_str = __($input_str, 'geodirectory'); |
|
| 2580 | - } |
|
| 2581 | - $label = ucfirst($input_str); |
|
| 2582 | - } |
|
| 2583 | - |
|
| 2584 | - if ($label != '') {
|
|
| 2585 | - $return[] = array('label' => $label, 'value' => $value, 'optgroup' => NULL);
|
|
| 2586 | - } |
|
| 2587 | - } |
|
| 2588 | - } |
|
| 2589 | - |
|
| 2590 | - return $return; |
|
| 2554 | + $return = array(); |
|
| 2555 | + if ($input != '') {
|
|
| 2556 | + $input = trim($input); |
|
| 2557 | + $input = rtrim($input, ","); |
|
| 2558 | + $input = ltrim($input, ","); |
|
| 2559 | + $input = trim($input); |
|
| 2560 | + } |
|
| 2561 | + |
|
| 2562 | + $input_arr = explode(',', $input);
|
|
| 2563 | + |
|
| 2564 | + if (!empty($input_arr)) {
|
|
| 2565 | + foreach ($input_arr as $input_str) {
|
|
| 2566 | + $input_str = trim($input_str); |
|
| 2567 | + |
|
| 2568 | + if (strpos($input_str, "/") !== false) {
|
|
| 2569 | + $input_str = explode("/", $input_str, 2);
|
|
| 2570 | + $label = trim($input_str[0]); |
|
| 2571 | + if ($translated && $label != '') {
|
|
| 2572 | + $label = __($label, 'geodirectory'); |
|
| 2573 | + } |
|
| 2574 | + $label = ucfirst($label); |
|
| 2575 | + $value = trim($input_str[1]); |
|
| 2576 | + } else {
|
|
| 2577 | + $value = $input_str; |
|
| 2578 | + if ($translated && $input_str != '') {
|
|
| 2579 | + $input_str = __($input_str, 'geodirectory'); |
|
| 2580 | + } |
|
| 2581 | + $label = ucfirst($input_str); |
|
| 2582 | + } |
|
| 2583 | + |
|
| 2584 | + if ($label != '') {
|
|
| 2585 | + $return[] = array('label' => $label, 'value' => $value, 'optgroup' => NULL);
|
|
| 2586 | + } |
|
| 2587 | + } |
|
| 2588 | + } |
|
| 2589 | + |
|
| 2590 | + return $return; |
|
| 2591 | 2591 | } |
| 2592 | 2592 | |
| 2593 | 2593 | /** |
@@ -2602,66 +2602,66 @@ discard block |
||
| 2602 | 2602 | */ |
| 2603 | 2603 | function geodir_string_values_to_options($option_values = '', $translated = false) |
| 2604 | 2604 | {
|
| 2605 | - $options = array(); |
|
| 2606 | - if ($option_values == '') {
|
|
| 2607 | - return NULL; |
|
| 2608 | - } |
|
| 2609 | - |
|
| 2610 | - if (strpos($option_values, "{/optgroup}") !== false) {
|
|
| 2611 | - $option_values_arr = explode("{/optgroup}", $option_values);
|
|
| 2612 | - |
|
| 2613 | - foreach ($option_values_arr as $optgroup) {
|
|
| 2614 | - if (strpos($optgroup, "{optgroup}") !== false) {
|
|
| 2615 | - $optgroup_arr = explode("{optgroup}", $optgroup);
|
|
| 2616 | - |
|
| 2617 | - $count = 0; |
|
| 2618 | - foreach ($optgroup_arr as $optgroup_str) {
|
|
| 2619 | - $count++; |
|
| 2620 | - $optgroup_str = trim($optgroup_str); |
|
| 2621 | - |
|
| 2622 | - $optgroup_label = ''; |
|
| 2623 | - if (strpos($optgroup_str, "|") !== false) {
|
|
| 2624 | - $optgroup_str_arr = explode("|", $optgroup_str, 2);
|
|
| 2625 | - $optgroup_label = trim($optgroup_str_arr[0]); |
|
| 2626 | - if ($translated && $optgroup_label != '') {
|
|
| 2627 | - $optgroup_label = __($optgroup_label, 'geodirectory'); |
|
| 2628 | - } |
|
| 2629 | - $optgroup_label = ucfirst($optgroup_label); |
|
| 2630 | - $optgroup_str = $optgroup_str_arr[1]; |
|
| 2631 | - } |
|
| 2632 | - |
|
| 2633 | - $optgroup3 = geodir_string_to_options($optgroup_str, $translated); |
|
| 2634 | - |
|
| 2635 | - if ($count > 1 && $optgroup_label != '' && !empty($optgroup3)) {
|
|
| 2636 | - $optgroup_start = array(array('label' => $optgroup_label, 'value' => NULL, 'optgroup' => 'start'));
|
|
| 2637 | - $optgroup_end = array(array('label' => $optgroup_label, 'value' => NULL, 'optgroup' => 'end'));
|
|
| 2638 | - $optgroup3 = array_merge($optgroup_start, $optgroup3, $optgroup_end); |
|
| 2639 | - } |
|
| 2640 | - $options = array_merge($options, $optgroup3); |
|
| 2641 | - } |
|
| 2642 | - } else {
|
|
| 2643 | - $optgroup1 = geodir_string_to_options($optgroup, $translated); |
|
| 2644 | - $options = array_merge($options, $optgroup1); |
|
| 2645 | - } |
|
| 2646 | - } |
|
| 2647 | - } else {
|
|
| 2648 | - $options = geodir_string_to_options($option_values, $translated); |
|
| 2649 | - } |
|
| 2650 | - |
|
| 2651 | - return $options; |
|
| 2605 | + $options = array(); |
|
| 2606 | + if ($option_values == '') {
|
|
| 2607 | + return NULL; |
|
| 2608 | + } |
|
| 2609 | + |
|
| 2610 | + if (strpos($option_values, "{/optgroup}") !== false) {
|
|
| 2611 | + $option_values_arr = explode("{/optgroup}", $option_values);
|
|
| 2612 | + |
|
| 2613 | + foreach ($option_values_arr as $optgroup) {
|
|
| 2614 | + if (strpos($optgroup, "{optgroup}") !== false) {
|
|
| 2615 | + $optgroup_arr = explode("{optgroup}", $optgroup);
|
|
| 2616 | + |
|
| 2617 | + $count = 0; |
|
| 2618 | + foreach ($optgroup_arr as $optgroup_str) {
|
|
| 2619 | + $count++; |
|
| 2620 | + $optgroup_str = trim($optgroup_str); |
|
| 2621 | + |
|
| 2622 | + $optgroup_label = ''; |
|
| 2623 | + if (strpos($optgroup_str, "|") !== false) {
|
|
| 2624 | + $optgroup_str_arr = explode("|", $optgroup_str, 2);
|
|
| 2625 | + $optgroup_label = trim($optgroup_str_arr[0]); |
|
| 2626 | + if ($translated && $optgroup_label != '') {
|
|
| 2627 | + $optgroup_label = __($optgroup_label, 'geodirectory'); |
|
| 2628 | + } |
|
| 2629 | + $optgroup_label = ucfirst($optgroup_label); |
|
| 2630 | + $optgroup_str = $optgroup_str_arr[1]; |
|
| 2631 | + } |
|
| 2632 | + |
|
| 2633 | + $optgroup3 = geodir_string_to_options($optgroup_str, $translated); |
|
| 2634 | + |
|
| 2635 | + if ($count > 1 && $optgroup_label != '' && !empty($optgroup3)) {
|
|
| 2636 | + $optgroup_start = array(array('label' => $optgroup_label, 'value' => NULL, 'optgroup' => 'start'));
|
|
| 2637 | + $optgroup_end = array(array('label' => $optgroup_label, 'value' => NULL, 'optgroup' => 'end'));
|
|
| 2638 | + $optgroup3 = array_merge($optgroup_start, $optgroup3, $optgroup_end); |
|
| 2639 | + } |
|
| 2640 | + $options = array_merge($options, $optgroup3); |
|
| 2641 | + } |
|
| 2642 | + } else {
|
|
| 2643 | + $optgroup1 = geodir_string_to_options($optgroup, $translated); |
|
| 2644 | + $options = array_merge($options, $optgroup1); |
|
| 2645 | + } |
|
| 2646 | + } |
|
| 2647 | + } else {
|
|
| 2648 | + $options = geodir_string_to_options($option_values, $translated); |
|
| 2649 | + } |
|
| 2650 | + |
|
| 2651 | + return $options; |
|
| 2652 | 2652 | } |
| 2653 | 2653 | |
| 2654 | 2654 | |
| 2655 | 2655 | function geodir_cfa_data_type_text($output,$result_str,$cf,$field_info){
|
| 2656 | - ob_start(); |
|
| 2657 | - |
|
| 2658 | - $dt_value = ''; |
|
| 2659 | - if (isset($field_info->data_type)) {
|
|
| 2660 | - $dt_value = esc_attr($field_info->data_type); |
|
| 2661 | - }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
|
|
| 2662 | - $dt_value = $cf['defaults']['data_type']; |
|
| 2663 | - } |
|
| 2664 | - ?> |
|
| 2656 | + ob_start(); |
|
| 2657 | + |
|
| 2658 | + $dt_value = ''; |
|
| 2659 | + if (isset($field_info->data_type)) {
|
|
| 2660 | + $dt_value = esc_attr($field_info->data_type); |
|
| 2661 | + }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
|
|
| 2662 | + $dt_value = $cf['defaults']['data_type']; |
|
| 2663 | + } |
|
| 2664 | + ?> |
|
| 2665 | 2665 | <li> |
| 2666 | 2666 | <label for="data_type"><?php _e('Field Data Type ? :', 'geodirectory'); ?></label>
|
| 2667 | 2667 | <div class="gd-cf-input-wrap"> |
@@ -2670,16 +2670,16 @@ discard block |
||
| 2670 | 2670 | onchange="javascript:gd_data_type_changed(this, '<?php echo $result_str; ?>');"> |
| 2671 | 2671 | <option |
| 2672 | 2672 | value="XVARCHAR" <?php if ($dt_value == 'VARCHAR') {
|
| 2673 | - echo 'selected="selected"'; |
|
| 2674 | - } ?>><?php _e('CHARACTER', 'geodirectory'); ?></option>
|
|
| 2673 | + echo 'selected="selected"'; |
|
| 2674 | + } ?>><?php _e('CHARACTER', 'geodirectory'); ?></option>
|
|
| 2675 | 2675 | <option |
| 2676 | 2676 | value="INT" <?php if ($dt_value == 'INT') {
|
| 2677 | - echo 'selected="selected"'; |
|
| 2678 | - } ?>><?php _e('NUMBER', 'geodirectory'); ?></option>
|
|
| 2677 | + echo 'selected="selected"'; |
|
| 2678 | + } ?>><?php _e('NUMBER', 'geodirectory'); ?></option>
|
|
| 2679 | 2679 | <option |
| 2680 | 2680 | value="FLOAT" <?php if ($dt_value == 'FLOAT') {
|
| 2681 | - echo 'selected="selected"'; |
|
| 2682 | - } ?>><?php _e('DECIMAL', 'geodirectory'); ?></option>
|
|
| 2681 | + echo 'selected="selected"'; |
|
| 2682 | + } ?>><?php _e('DECIMAL', 'geodirectory'); ?></option>
|
|
| 2683 | 2683 | </select> |
| 2684 | 2684 | <br/> <span><?php _e('Select Custom Field type', 'geodirectory'); ?></span>
|
| 2685 | 2685 | |
@@ -2687,13 +2687,13 @@ discard block |
||
| 2687 | 2687 | </li> |
| 2688 | 2688 | |
| 2689 | 2689 | <?php |
| 2690 | - $value = ''; |
|
| 2691 | - if (isset($field_info->decimal_point)) {
|
|
| 2692 | - $value = esc_attr($field_info->decimal_point); |
|
| 2693 | - }elseif(isset($cf['defaults']['decimal_point']) && $cf['defaults']['decimal_point']){
|
|
| 2694 | - $value = $cf['defaults']['decimal_point']; |
|
| 2695 | - } |
|
| 2696 | - ?> |
|
| 2690 | + $value = ''; |
|
| 2691 | + if (isset($field_info->decimal_point)) {
|
|
| 2692 | + $value = esc_attr($field_info->decimal_point); |
|
| 2693 | + }elseif(isset($cf['defaults']['decimal_point']) && $cf['defaults']['decimal_point']){
|
|
| 2694 | + $value = $cf['defaults']['decimal_point']; |
|
| 2695 | + } |
|
| 2696 | + ?> |
|
| 2697 | 2697 | |
| 2698 | 2698 | <li class="decimal-point-wrapper" |
| 2699 | 2699 | style="<?php echo ($dt_value == 'FLOAT') ? '' : 'display:none' ?>"> |
@@ -2702,7 +2702,7 @@ discard block |
||
| 2702 | 2702 | <select name="decimal_point" id="decimal_point"> |
| 2703 | 2703 | <option value=""><?php echo _e('Select', 'geodirectory'); ?></option>
|
| 2704 | 2704 | <?php for ($i = 1; $i <= 10; $i++) {
|
| 2705 | - $selected = $i == $value ? 'selected="selected"' : ''; ?> |
|
| 2705 | + $selected = $i == $value ? 'selected="selected"' : ''; ?> |
|
| 2706 | 2706 | <option value="<?php echo $i; ?>" <?php echo $selected; ?>><?php echo $i; ?></option> |
| 2707 | 2707 | <?php } ?> |
| 2708 | 2708 | </select> |
@@ -2711,8 +2711,8 @@ discard block |
||
| 2711 | 2711 | </li> |
| 2712 | 2712 | <?php |
| 2713 | 2713 | |
| 2714 | - $output = ob_get_clean(); |
|
| 2715 | - return $output; |
|
| 2714 | + $output = ob_get_clean(); |
|
| 2715 | + return $output; |
|
| 2716 | 2716 | } |
| 2717 | 2717 | add_filter('geodir_cfa_data_type_text','geodir_cfa_data_type_text',10,4);
|
| 2718 | 2718 | |
@@ -2750,9 +2750,9 @@ discard block |
||
| 2750 | 2750 | |
| 2751 | 2751 | |
| 2752 | 2752 | function geodir_cfa_advanced_editor_geodir_special_offers($output,$result_str,$cf,$field_info){
|
| 2753 | - if($field_info->htmlvar_name != 'geodir_special_offers'){return '';}
|
|
| 2754 | - ob_start(); |
|
| 2755 | - ?> |
|
| 2753 | + if($field_info->htmlvar_name != 'geodir_special_offers'){return '';}
|
|
| 2754 | + ob_start(); |
|
| 2755 | + ?> |
|
| 2756 | 2756 | <li> |
| 2757 | 2757 | <label for="advanced_editor" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show advanced editor :', 'geodirectory'); ?>
|
| 2758 | 2758 | <div class="gdcf-tooltip"> |
@@ -2763,13 +2763,13 @@ discard block |
||
| 2763 | 2763 | <div class="gd-cf-input-wrap"> |
| 2764 | 2764 | |
| 2765 | 2765 | <?php |
| 2766 | - $selected = ''; |
|
| 2767 | - if (isset($field_info->extra_fields)) |
|
| 2768 | - $advanced_editor = unserialize($field_info->extra_fields); |
|
| 2766 | + $selected = ''; |
|
| 2767 | + if (isset($field_info->extra_fields)) |
|
| 2768 | + $advanced_editor = unserialize($field_info->extra_fields); |
|
| 2769 | 2769 | |
| 2770 | - if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor))
|
|
| 2771 | - $selected = 'checked="checked"'; |
|
| 2772 | - ?> |
|
| 2770 | + if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor))
|
|
| 2771 | + $selected = 'checked="checked"'; |
|
| 2772 | + ?> |
|
| 2773 | 2773 | |
| 2774 | 2774 | <input type="checkbox" name="advanced_editor[]" id="advanced_editor" |
| 2775 | 2775 | value="1" <?php echo $selected; ?>/> |
@@ -2778,22 +2778,22 @@ discard block |
||
| 2778 | 2778 | </li> |
| 2779 | 2779 | <?php |
| 2780 | 2780 | |
| 2781 | - $output = ob_get_clean(); |
|
| 2782 | - return $output; |
|
| 2781 | + $output = ob_get_clean(); |
|
| 2782 | + return $output; |
|
| 2783 | 2783 | } |
| 2784 | 2784 | add_filter('geodir_cfa_advanced_editor_textarea','geodir_cfa_advanced_editor_geodir_special_offers',10,4);
|
| 2785 | 2785 | |
| 2786 | 2786 | |
| 2787 | 2787 | function geodir_cfa_validation_pattern_text($output,$result_str,$cf,$field_info){
|
| 2788 | - ob_start(); |
|
| 2789 | - |
|
| 2790 | - $value = ''; |
|
| 2791 | - if (isset($field_info->validation_pattern)) {
|
|
| 2792 | - $value = esc_attr($field_info->validation_pattern); |
|
| 2793 | - }elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
|
|
| 2794 | - $value = esc_attr($cf['defaults']['validation_pattern']); |
|
| 2795 | - } |
|
| 2796 | - ?> |
|
| 2788 | + ob_start(); |
|
| 2789 | + |
|
| 2790 | + $value = ''; |
|
| 2791 | + if (isset($field_info->validation_pattern)) {
|
|
| 2792 | + $value = esc_attr($field_info->validation_pattern); |
|
| 2793 | + }elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
|
|
| 2794 | + $value = esc_attr($cf['defaults']['validation_pattern']); |
|
| 2795 | + } |
|
| 2796 | + ?> |
|
| 2797 | 2797 | <li> |
| 2798 | 2798 | <label for="validation_pattern" class="gd-cf-tooltip-wrap"> |
| 2799 | 2799 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Validation Pattern:', 'geodirectory'); ?>
|
@@ -2807,13 +2807,13 @@ discard block |
||
| 2807 | 2807 | </div> |
| 2808 | 2808 | </li> |
| 2809 | 2809 | <?php |
| 2810 | - $value = ''; |
|
| 2811 | - if (isset($field_info->validation_msg)) {
|
|
| 2812 | - $value = esc_attr($field_info->validation_msg); |
|
| 2813 | - }elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
|
|
| 2814 | - $value = esc_attr($cf['defaults']['validation_msg']); |
|
| 2815 | - } |
|
| 2816 | - ?> |
|
| 2810 | + $value = ''; |
|
| 2811 | + if (isset($field_info->validation_msg)) {
|
|
| 2812 | + $value = esc_attr($field_info->validation_msg); |
|
| 2813 | + }elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
|
|
| 2814 | + $value = esc_attr($cf['defaults']['validation_msg']); |
|
| 2815 | + } |
|
| 2816 | + ?> |
|
| 2817 | 2817 | <li> |
| 2818 | 2818 | <label for="validation_msg" class="gd-cf-tooltip-wrap"> |
| 2819 | 2819 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Validation Message:', 'geodirectory'); ?>
|
@@ -2828,21 +2828,21 @@ discard block |
||
| 2828 | 2828 | </li> |
| 2829 | 2829 | <?php |
| 2830 | 2830 | |
| 2831 | - $output = ob_get_clean(); |
|
| 2832 | - return $output; |
|
| 2831 | + $output = ob_get_clean(); |
|
| 2832 | + return $output; |
|
| 2833 | 2833 | } |
| 2834 | 2834 | add_filter('geodir_cfa_validation_pattern_text','geodir_cfa_validation_pattern_text',10,4);
|
| 2835 | 2835 | |
| 2836 | 2836 | |
| 2837 | 2837 | function geodir_cfa_htmlvar_name_taxonomy($output,$result_str,$cf,$field_info){
|
| 2838 | - ob_start(); |
|
| 2839 | - global $post_type; |
|
| 2840 | - |
|
| 2841 | - if (!isset($field_info->post_type)) {
|
|
| 2842 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2843 | - } else |
|
| 2844 | - $post_type = $field_info->post_type; |
|
| 2845 | - ?> |
|
| 2838 | + ob_start(); |
|
| 2839 | + global $post_type; |
|
| 2840 | + |
|
| 2841 | + if (!isset($field_info->post_type)) {
|
|
| 2842 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2843 | + } else |
|
| 2844 | + $post_type = $field_info->post_type; |
|
| 2845 | + ?> |
|
| 2846 | 2846 | <li style="display: none;"> |
| 2847 | 2847 | <label for="htmlvar_name" class="gd-cf-tooltip-wrap"> |
| 2848 | 2848 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Select taxonomy:', 'geodirectory'); ?>
|
@@ -2853,15 +2853,15 @@ discard block |
||
| 2853 | 2853 | <div class="gd-cf-input-wrap"> |
| 2854 | 2854 | <select name="htmlvar_name" id="htmlvar_name"> |
| 2855 | 2855 | <?php |
| 2856 | - $gd_taxonomy = geodir_get_taxonomies($post_type); |
|
| 2856 | + $gd_taxonomy = geodir_get_taxonomies($post_type); |
|
| 2857 | 2857 | |
| 2858 | - foreach ($gd_taxonomy as $gd_tax) {
|
|
| 2859 | - ?> |
|
| 2858 | + foreach ($gd_taxonomy as $gd_tax) {
|
|
| 2859 | + ?> |
|
| 2860 | 2860 | <option <?php if (isset($field_info->htmlvar_name) && $field_info->htmlvar_name == $gd_tax) {
|
| 2861 | - echo 'selected="selected"'; |
|
| 2862 | - }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php |
|
| 2863 | - } |
|
| 2864 | - ?> |
|
| 2861 | + echo 'selected="selected"'; |
|
| 2862 | + }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php |
|
| 2863 | + } |
|
| 2864 | + ?> |
|
| 2865 | 2865 | </select> |
| 2866 | 2866 | </div> |
| 2867 | 2867 | </li> |
@@ -2877,49 +2877,49 @@ discard block |
||
| 2877 | 2877 | |
| 2878 | 2878 | <select name="cat_display_type" id="cat_display_type"> |
| 2879 | 2879 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'ajax_chained') {
|
| 2880 | - echo 'selected="selected"'; |
|
| 2881 | - }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
|
|
| 2880 | + echo 'selected="selected"'; |
|
| 2881 | + }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
|
|
| 2882 | 2882 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
|
| 2883 | - echo 'selected="selected"'; |
|
| 2884 | - }?> value="select"><?php _e('Select', 'geodirectory');?></option>
|
|
| 2883 | + echo 'selected="selected"'; |
|
| 2884 | + }?> value="select"><?php _e('Select', 'geodirectory');?></option>
|
|
| 2885 | 2885 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'multiselect') {
|
| 2886 | - echo 'selected="selected"'; |
|
| 2887 | - }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
|
|
| 2886 | + echo 'selected="selected"'; |
|
| 2887 | + }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
|
|
| 2888 | 2888 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
|
| 2889 | - echo 'selected="selected"'; |
|
| 2890 | - }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
|
|
| 2889 | + echo 'selected="selected"'; |
|
| 2890 | + }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
|
|
| 2891 | 2891 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
|
| 2892 | - echo 'selected="selected"'; |
|
| 2893 | - }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
|
|
| 2892 | + echo 'selected="selected"'; |
|
| 2893 | + }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
|
|
| 2894 | 2894 | </select> |
| 2895 | 2895 | </div> |
| 2896 | 2896 | </li> |
| 2897 | 2897 | <?php |
| 2898 | 2898 | |
| 2899 | - $output = ob_get_clean(); |
|
| 2900 | - return $output; |
|
| 2899 | + $output = ob_get_clean(); |
|
| 2900 | + return $output; |
|
| 2901 | 2901 | } |
| 2902 | 2902 | add_filter('geodir_cfa_htmlvar_name_taxonomy','geodir_cfa_htmlvar_name_taxonomy',10,4);
|
| 2903 | 2903 | |
| 2904 | 2904 | |
| 2905 | 2905 | function geodir_cfa_extra_fields_address($output,$result_str,$cf,$field_info){
|
| 2906 | 2906 | |
| 2907 | - ob_start(); |
|
| 2908 | - if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
|
|
| 2909 | - $address = stripslashes_deep(unserialize($field_info->extra_fields)); |
|
| 2910 | - } |
|
| 2907 | + ob_start(); |
|
| 2908 | + if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
|
|
| 2909 | + $address = stripslashes_deep(unserialize($field_info->extra_fields)); |
|
| 2910 | + } |
|
| 2911 | 2911 | |
| 2912 | - $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name : rand(5, 500); |
|
| 2913 | - ?> |
|
| 2912 | + $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name : rand(5, 500); |
|
| 2913 | + ?> |
|
| 2914 | 2914 | <?php |
| 2915 | - /** |
|
| 2916 | - * Called on the add custom fields settings page before the address field is output. |
|
| 2917 | - * |
|
| 2918 | - * @since 1.0.0 |
|
| 2919 | - * @param array $address The address settings array. |
|
| 2920 | - * @param object $field_info Extra fields info. |
|
| 2921 | - */ |
|
| 2922 | - do_action('geodir_address_extra_admin_fields', $address, $field_info); ?>
|
|
| 2915 | + /** |
|
| 2916 | + * Called on the add custom fields settings page before the address field is output. |
|
| 2917 | + * |
|
| 2918 | + * @since 1.0.0 |
|
| 2919 | + * @param array $address The address settings array. |
|
| 2920 | + * @param object $field_info Extra fields info. |
|
| 2921 | + */ |
|
| 2922 | + do_action('geodir_address_extra_admin_fields', $address, $field_info); ?>
|
|
| 2923 | 2923 | |
| 2924 | 2924 | <li> |
| 2925 | 2925 | <label for="show_zip" class="gd-cf-tooltip-wrap"> |
@@ -2932,14 +2932,14 @@ discard block |
||
| 2932 | 2932 | |
| 2933 | 2933 | <input type="radio" id="show_zip_yes<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-enabled" value="1" |
| 2934 | 2934 | <?php if (isset($address['show_zip']) && $address['show_zip'] == '1') {
|
| 2935 | - echo 'checked'; |
|
| 2936 | - } ?>/> |
|
| 2935 | + echo 'checked'; |
|
| 2936 | + } ?>/> |
|
| 2937 | 2937 | <label onclick="show_hide_radio(this,'show','cf-zip-lable');" for="show_zip_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
| 2938 | 2938 | |
| 2939 | 2939 | <input type="radio" id="show_zip_no<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-disabled" value="0" |
| 2940 | 2940 | <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {
|
| 2941 | - echo 'checked'; |
|
| 2942 | - } ?>/> |
|
| 2941 | + echo 'checked'; |
|
| 2942 | + } ?>/> |
|
| 2943 | 2943 | <label onclick="show_hide_radio(this,'hide','cf-zip-lable');" for="show_zip_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
| 2944 | 2944 | |
| 2945 | 2945 | |
@@ -2956,8 +2956,8 @@ discard block |
||
| 2956 | 2956 | <div class="gd-cf-input-wrap"> |
| 2957 | 2957 | <input type="text" name="extra[zip_lable]" id="zip_lable" |
| 2958 | 2958 | value="<?php if (isset($address['zip_lable'])) {
|
| 2959 | - echo esc_attr($address['zip_lable']); |
|
| 2960 | - }?>"/> |
|
| 2959 | + echo esc_attr($address['zip_lable']); |
|
| 2960 | + }?>"/> |
|
| 2961 | 2961 | </div> |
| 2962 | 2962 | </li> |
| 2963 | 2963 | |
@@ -2974,8 +2974,8 @@ discard block |
||
| 2974 | 2974 | <div class="gd-cf-input-wrap"> |
| 2975 | 2975 | <input type="text" name="extra[map_lable]" id="map_lable" |
| 2976 | 2976 | value="<?php if (isset($address['map_lable'])) {
|
| 2977 | - echo esc_attr($address['map_lable']); |
|
| 2978 | - }?>"/> |
|
| 2977 | + echo esc_attr($address['map_lable']); |
|
| 2978 | + }?>"/> |
|
| 2979 | 2979 | </div> |
| 2980 | 2980 | </li> |
| 2981 | 2981 | |
@@ -2990,14 +2990,14 @@ discard block |
||
| 2990 | 2990 | |
| 2991 | 2991 | <input type="radio" id="show_mapzoom_yes<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-enabled" value="1" |
| 2992 | 2992 | <?php if (isset($address['show_mapzoom']) && $address['show_mapzoom'] == '1') {
|
| 2993 | - echo 'checked'; |
|
| 2994 | - } ?>/> |
|
| 2993 | + echo 'checked'; |
|
| 2994 | + } ?>/> |
|
| 2995 | 2995 | <label for="show_mapzoom_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
| 2996 | 2996 | |
| 2997 | 2997 | <input type="radio" id="show_mapzoom_no<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0" |
| 2998 | 2998 | <?php if ((isset($address['show_mapzoom']) && !$address['show_mapzoom']) || !isset($address['show_mapzoom'])) {
|
| 2999 | - echo 'checked'; |
|
| 3000 | - } ?>/> |
|
| 2999 | + echo 'checked'; |
|
| 3000 | + } ?>/> |
|
| 3001 | 3001 | <label for="show_mapzoom_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
| 3002 | 3002 | |
| 3003 | 3003 | </div> |
@@ -3014,14 +3014,14 @@ discard block |
||
| 3014 | 3014 | |
| 3015 | 3015 | <input type="radio" id="show_mapview_yes<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-enabled" value="1" |
| 3016 | 3016 | <?php if (isset($address['show_mapview']) && $address['show_mapview'] == '1') {
|
| 3017 | - echo 'checked'; |
|
| 3018 | - } ?>/> |
|
| 3017 | + echo 'checked'; |
|
| 3018 | + } ?>/> |
|
| 3019 | 3019 | <label for="show_mapview_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
| 3020 | 3020 | |
| 3021 | 3021 | <input type="radio" id="show_mapview_no<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-disabled" value="0" |
| 3022 | 3022 | <?php if ((isset($address['show_mapview']) && !$address['show_mapview']) || !isset($address['show_mapview'])) {
|
| 3023 | - echo 'checked'; |
|
| 3024 | - } ?>/> |
|
| 3023 | + echo 'checked'; |
|
| 3024 | + } ?>/> |
|
| 3025 | 3025 | <label for="show_mapview_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
| 3026 | 3026 | |
| 3027 | 3027 | </div> |
@@ -3038,8 +3038,8 @@ discard block |
||
| 3038 | 3038 | <div class="gd-cf-input-wrap"> |
| 3039 | 3039 | <input type="text" name="extra[mapview_lable]" id="mapview_lable" |
| 3040 | 3040 | value="<?php if (isset($address['mapview_lable'])) {
|
| 3041 | - echo esc_attr($address['mapview_lable']); |
|
| 3042 | - }?>"/> |
|
| 3041 | + echo esc_attr($address['mapview_lable']); |
|
| 3042 | + }?>"/> |
|
| 3043 | 3043 | </div> |
| 3044 | 3044 | </li> |
| 3045 | 3045 | <li> |
@@ -3053,29 +3053,29 @@ discard block |
||
| 3053 | 3053 | |
| 3054 | 3054 | <input type="radio" id="show_latlng_yes<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-enabled" value="1" |
| 3055 | 3055 | <?php if (isset($address['show_latlng']) && $address['show_latlng'] == '1') {
|
| 3056 | - echo 'checked'; |
|
| 3057 | - } ?>/> |
|
| 3056 | + echo 'checked'; |
|
| 3057 | + } ?>/> |
|
| 3058 | 3058 | <label for="show_latlng_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
| 3059 | 3059 | |
| 3060 | 3060 | <input type="radio" id="show_latlng_no<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-disabled" value="0" |
| 3061 | 3061 | <?php if ((isset($address['show_latlng']) && !$address['show_latlng']) || !isset($address['show_latlng'])) {
|
| 3062 | - echo 'checked'; |
|
| 3063 | - } ?>/> |
|
| 3062 | + echo 'checked'; |
|
| 3063 | + } ?>/> |
|
| 3064 | 3064 | <label for="show_latlng_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
| 3065 | 3065 | |
| 3066 | 3066 | </div> |
| 3067 | 3067 | </li> |
| 3068 | 3068 | <?php |
| 3069 | 3069 | |
| 3070 | - $html = ob_get_clean(); |
|
| 3071 | - return $output.$html; |
|
| 3070 | + $html = ob_get_clean(); |
|
| 3071 | + return $output.$html; |
|
| 3072 | 3072 | } |
| 3073 | 3073 | add_filter('geodir_cfa_extra_fields_address','geodir_cfa_extra_fields_address',10,4);
|
| 3074 | 3074 | |
| 3075 | 3075 | |
| 3076 | 3076 | function geodir_cfa_extra_fields_multiselect($output,$result_str,$cf,$field_info){
|
| 3077 | - ob_start(); |
|
| 3078 | - ?> |
|
| 3077 | + ob_start(); |
|
| 3078 | + ?> |
|
| 3079 | 3079 | <li> |
| 3080 | 3080 | <label for="multi_display_type" class="gd-cf-tooltip-wrap"> |
| 3081 | 3081 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Multiselect display type :', 'geodirectory'); ?>
|
@@ -3087,14 +3087,14 @@ discard block |
||
| 3087 | 3087 | |
| 3088 | 3088 | <select name="multi_display_type" id="multi_display_type"> |
| 3089 | 3089 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
|
| 3090 | - echo 'selected="selected"'; |
|
| 3091 | - }?> value="select"><?php _e('Select', 'geodirectory');?></option>
|
|
| 3090 | + echo 'selected="selected"'; |
|
| 3091 | + }?> value="select"><?php _e('Select', 'geodirectory');?></option>
|
|
| 3092 | 3092 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
|
| 3093 | - echo 'selected="selected"'; |
|
| 3094 | - }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
|
|
| 3093 | + echo 'selected="selected"'; |
|
| 3094 | + }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
|
|
| 3095 | 3095 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
|
| 3096 | - echo 'selected="selected"'; |
|
| 3097 | - }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
|
|
| 3096 | + echo 'selected="selected"'; |
|
| 3097 | + }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
|
|
| 3098 | 3098 | </select> |
| 3099 | 3099 | |
| 3100 | 3100 | <br/> |
@@ -3102,25 +3102,25 @@ discard block |
||
| 3102 | 3102 | </li> |
| 3103 | 3103 | <?php |
| 3104 | 3104 | |
| 3105 | - $html = ob_get_clean(); |
|
| 3106 | - return $output.$html; |
|
| 3105 | + $html = ob_get_clean(); |
|
| 3106 | + return $output.$html; |
|
| 3107 | 3107 | } |
| 3108 | 3108 | add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_multiselect',10,4);
|
| 3109 | 3109 | |
| 3110 | 3110 | |
| 3111 | 3111 | function geodir_cfa_extra_fields_smr($output,$result_str,$cf,$field_info){
|
| 3112 | 3112 | |
| 3113 | - ob_start(); |
|
| 3113 | + ob_start(); |
|
| 3114 | 3114 | |
| 3115 | - $value = ''; |
|
| 3116 | - if (isset($field_info->option_values)) {
|
|
| 3117 | - $value = esc_attr($field_info->option_values); |
|
| 3118 | - }elseif(isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']){
|
|
| 3119 | - $value = esc_attr($cf['defaults']['option_values']); |
|
| 3120 | - } |
|
| 3115 | + $value = ''; |
|
| 3116 | + if (isset($field_info->option_values)) {
|
|
| 3117 | + $value = esc_attr($field_info->option_values); |
|
| 3118 | + }elseif(isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']){
|
|
| 3119 | + $value = esc_attr($cf['defaults']['option_values']); |
|
| 3120 | + } |
|
| 3121 | 3121 | |
| 3122 | - $field_type = isset($field_info->field_type) ? $field_info->field_type : ''; |
|
| 3123 | - ?> |
|
| 3122 | + $field_type = isset($field_info->field_type) ? $field_info->field_type : ''; |
|
| 3123 | + ?> |
|
| 3124 | 3124 | <li> |
| 3125 | 3125 | <label for="option_values" class="gd-cf-tooltip-wrap"> |
| 3126 | 3126 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Option Values :', 'geodirectory'); ?>
|
@@ -3147,8 +3147,8 @@ discard block |
||
| 3147 | 3147 | </li> |
| 3148 | 3148 | <?php |
| 3149 | 3149 | |
| 3150 | - $html = ob_get_clean(); |
|
| 3151 | - return $output.$html; |
|
| 3150 | + $html = ob_get_clean(); |
|
| 3151 | + return $output.$html; |
|
| 3152 | 3152 | } |
| 3153 | 3153 | add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_smr',10,4);
|
| 3154 | 3154 | add_filter('geodir_cfa_extra_fields_select','geodir_cfa_extra_fields_smr',10,4);
|
@@ -3156,12 +3156,12 @@ discard block |
||
| 3156 | 3156 | |
| 3157 | 3157 | |
| 3158 | 3158 | function geodir_cfa_extra_fields_datepicker($output,$result_str,$cf,$field_info){
|
| 3159 | - ob_start(); |
|
| 3160 | - $extra = array(); |
|
| 3161 | - if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
|
|
| 3162 | - $extra = unserialize($field_info->extra_fields); |
|
| 3163 | - } |
|
| 3164 | - ?> |
|
| 3159 | + ob_start(); |
|
| 3160 | + $extra = array(); |
|
| 3161 | + if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
|
|
| 3162 | + $extra = unserialize($field_info->extra_fields); |
|
| 3163 | + } |
|
| 3164 | + ?> |
|
| 3165 | 3165 | <li> |
| 3166 | 3166 | <label for="date_format" class="gd-cf-tooltip-wrap"> |
| 3167 | 3167 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Date Format :', 'geodirectory'); ?>
|
@@ -3171,52 +3171,52 @@ discard block |
||
| 3171 | 3171 | </label> |
| 3172 | 3172 | <div class="gd-cf-input-wrap" style="overflow:inherit;"> |
| 3173 | 3173 | <?php |
| 3174 | - $date_formats = array( |
|
| 3175 | - 'm/d/Y', |
|
| 3176 | - 'd/m/Y', |
|
| 3177 | - 'Y/m/d', |
|
| 3178 | - 'm-d-Y', |
|
| 3179 | - 'd-m-Y', |
|
| 3180 | - 'Y-m-d', |
|
| 3181 | - 'F j, Y', |
|
| 3182 | - ); |
|
| 3183 | - /** |
|
| 3184 | - * Filter the custom field date format options. |
|
| 3185 | - * |
|
| 3186 | - * @since 1.6.5 |
|
| 3187 | - * @param array $date_formats The PHP date format array. |
|
| 3188 | - */ |
|
| 3189 | - $date_formats = apply_filters('geodir_date_formats',$date_formats);
|
|
| 3190 | - ?> |
|
| 3174 | + $date_formats = array( |
|
| 3175 | + 'm/d/Y', |
|
| 3176 | + 'd/m/Y', |
|
| 3177 | + 'Y/m/d', |
|
| 3178 | + 'm-d-Y', |
|
| 3179 | + 'd-m-Y', |
|
| 3180 | + 'Y-m-d', |
|
| 3181 | + 'F j, Y', |
|
| 3182 | + ); |
|
| 3183 | + /** |
|
| 3184 | + * Filter the custom field date format options. |
|
| 3185 | + * |
|
| 3186 | + * @since 1.6.5 |
|
| 3187 | + * @param array $date_formats The PHP date format array. |
|
| 3188 | + */ |
|
| 3189 | + $date_formats = apply_filters('geodir_date_formats',$date_formats);
|
|
| 3190 | + ?> |
|
| 3191 | 3191 | <select name="extra[date_format]" id="date_format"> |
| 3192 | 3192 | <?php |
| 3193 | - foreach($date_formats as $format){
|
|
| 3194 | - $selected = ''; |
|
| 3195 | - if(!empty($extra) && esc_attr($extra['date_format'])==$format){
|
|
| 3196 | - $selected = "selected='selected'"; |
|
| 3197 | - } |
|
| 3198 | - echo "<option $selected value='$format'>$format (".date_i18n( $format, time()).")</option>";
|
|
| 3199 | - } |
|
| 3200 | - ?> |
|
| 3193 | + foreach($date_formats as $format){
|
|
| 3194 | + $selected = ''; |
|
| 3195 | + if(!empty($extra) && esc_attr($extra['date_format'])==$format){
|
|
| 3196 | + $selected = "selected='selected'"; |
|
| 3197 | + } |
|
| 3198 | + echo "<option $selected value='$format'>$format (".date_i18n( $format, time()).")</option>";
|
|
| 3199 | + } |
|
| 3200 | + ?> |
|
| 3201 | 3201 | </select> |
| 3202 | 3202 | |
| 3203 | 3203 | </div> |
| 3204 | 3204 | </li> |
| 3205 | 3205 | <?php |
| 3206 | 3206 | |
| 3207 | - $html = ob_get_clean(); |
|
| 3208 | - return $output.$html; |
|
| 3207 | + $html = ob_get_clean(); |
|
| 3208 | + return $output.$html; |
|
| 3209 | 3209 | } |
| 3210 | 3210 | add_filter('geodir_cfa_extra_fields_datepicker','geodir_cfa_extra_fields_datepicker',10,4);
|
| 3211 | 3211 | |
| 3212 | 3212 | |
| 3213 | 3213 | function geodir_cfa_extra_fields_file($output,$result_str,$cf,$field_info){
|
| 3214 | - ob_start(); |
|
| 3215 | - $allowed_file_types = geodir_allowed_mime_types(); |
|
| 3214 | + ob_start(); |
|
| 3215 | + $allowed_file_types = geodir_allowed_mime_types(); |
|
| 3216 | 3216 | |
| 3217 | - $extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : ''; |
|
| 3218 | - $gd_file_types = !empty($extra_fields) && !empty($extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : array('*');
|
|
| 3219 | - ?> |
|
| 3217 | + $extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : ''; |
|
| 3218 | + $gd_file_types = !empty($extra_fields) && !empty($extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : array('*');
|
|
| 3219 | + ?> |
|
| 3220 | 3220 | <li> |
| 3221 | 3221 | <label for="gd_file_types" class="gd-cf-tooltip-wrap"> |
| 3222 | 3222 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Allowed file types :', 'geodirectory'); ?>
|
@@ -3239,33 +3239,33 @@ discard block |
||
| 3239 | 3239 | </li> |
| 3240 | 3240 | <?php |
| 3241 | 3241 | |
| 3242 | - $html = ob_get_clean(); |
|
| 3243 | - return $output.$html; |
|
| 3242 | + $html = ob_get_clean(); |
|
| 3243 | + return $output.$html; |
|
| 3244 | 3244 | } |
| 3245 | 3245 | add_filter('geodir_cfa_extra_fields_file','geodir_cfa_extra_fields_file',10,4);
|
| 3246 | 3246 | |
| 3247 | 3247 | function geodir_cfa_extra_fields_text($output,$result_str,$cf,$field_info){
|
| 3248 | - ob_start(); |
|
| 3248 | + ob_start(); |
|
| 3249 | 3249 | |
| 3250 | - $extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : ''; |
|
| 3250 | + $extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : ''; |
|
| 3251 | 3251 | // print_r($cf);echo '###'; |
| 3252 | 3252 | |
| 3253 | 3253 | |
| 3254 | 3254 | |
| 3255 | - $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name : rand(5, 500); |
|
| 3255 | + $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name : rand(5, 500); |
|
| 3256 | 3256 | |
| 3257 | 3257 | |
| 3258 | - $value = ''; |
|
| 3259 | - if ($extra_fields && isset($extra_fields['is_price'])) {
|
|
| 3260 | - $value = esc_attr($extra_fields['is_price']); |
|
| 3261 | - }elseif(isset($cf['defaults']['extra_fields']['is_price']) && $cf['defaults']['extra_fields']['is_price']){
|
|
| 3262 | - $value = esc_attr($cf['defaults']['extra_fields']['is_price']); |
|
| 3263 | - } |
|
| 3258 | + $value = ''; |
|
| 3259 | + if ($extra_fields && isset($extra_fields['is_price'])) {
|
|
| 3260 | + $value = esc_attr($extra_fields['is_price']); |
|
| 3261 | + }elseif(isset($cf['defaults']['extra_fields']['is_price']) && $cf['defaults']['extra_fields']['is_price']){
|
|
| 3262 | + $value = esc_attr($cf['defaults']['extra_fields']['is_price']); |
|
| 3263 | + } |
|
| 3264 | 3264 | |
| 3265 | - $show_price_extra = ($value==1) ? 1 : 0; |
|
| 3265 | + $show_price_extra = ($value==1) ? 1 : 0; |
|
| 3266 | 3266 | |
| 3267 | - $show_price = (isset($field_info->data_type) && ($field_info->data_type=='INT' && $field_info->data_type=='FLOAT')) ? 1 : 0; |
|
| 3268 | - ?> |
|
| 3267 | + $show_price = (isset($field_info->data_type) && ($field_info->data_type=='INT' && $field_info->data_type=='FLOAT')) ? 1 : 0; |
|
| 3268 | + ?> |
|
| 3269 | 3269 | <li class="gdcf-price-extra-set" <?php if(!$show_price){ echo "style='display:none;'";}?>>
|
| 3270 | 3270 | <label for="is_price" class="gd-cf-tooltip-wrap"> |
| 3271 | 3271 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display as price? :', 'geodirectory'); ?>
|
@@ -3277,14 +3277,14 @@ discard block |
||
| 3277 | 3277 | |
| 3278 | 3278 | <input type="radio" id="is_price_yes<?php echo $radio_id;?>" name="extra[is_price]" class="gdri-enabled" value="1" |
| 3279 | 3279 | <?php if ($value == '1') {
|
| 3280 | - echo 'checked'; |
|
| 3281 | - } ?>/> |
|
| 3280 | + echo 'checked'; |
|
| 3281 | + } ?>/> |
|
| 3282 | 3282 | <label onclick="show_hide_radio(this,'show','gdcf-price-extra');" for="is_price_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
|
| 3283 | 3283 | |
| 3284 | 3284 | <input type="radio" id="is_price_no<?php echo $radio_id;?>" name="extra[is_price]" class="gdri-disabled" value="0" |
| 3285 | 3285 | <?php if ($value == '0' || !$value) {
|
| 3286 | - echo 'checked'; |
|
| 3287 | - } ?>/> |
|
| 3286 | + echo 'checked'; |
|
| 3287 | + } ?>/> |
|
| 3288 | 3288 | <label onclick="show_hide_radio(this,'hide','gdcf-price-extra');" for="is_price_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
|
| 3289 | 3289 | |
| 3290 | 3290 | </div> |
@@ -3292,13 +3292,13 @@ discard block |
||
| 3292 | 3292 | |
| 3293 | 3293 | <?php |
| 3294 | 3294 | |
| 3295 | - $value = ''; |
|
| 3296 | - if ($extra_fields && isset($extra_fields['thousand_separator'])) {
|
|
| 3297 | - $value = esc_attr($extra_fields['thousand_separator']); |
|
| 3298 | - }elseif(isset($cf['defaults']['extra_fields']['thousand_separator']) && $cf['defaults']['extra_fields']['thousand_separator']){
|
|
| 3299 | - $value = esc_attr($cf['defaults']['extra_fields']['thousand_separator']); |
|
| 3300 | - } |
|
| 3301 | - ?> |
|
| 3295 | + $value = ''; |
|
| 3296 | + if ($extra_fields && isset($extra_fields['thousand_separator'])) {
|
|
| 3297 | + $value = esc_attr($extra_fields['thousand_separator']); |
|
| 3298 | + }elseif(isset($cf['defaults']['extra_fields']['thousand_separator']) && $cf['defaults']['extra_fields']['thousand_separator']){
|
|
| 3299 | + $value = esc_attr($cf['defaults']['extra_fields']['thousand_separator']); |
|
| 3300 | + } |
|
| 3301 | + ?> |
|
| 3302 | 3302 | <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
|
| 3303 | 3303 | <label for="thousand_separator" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Thousand separator :', 'geodirectory');?>
|
| 3304 | 3304 | <div class="gdcf-tooltip"> |
@@ -3319,13 +3319,13 @@ discard block |
||
| 3319 | 3319 | |
| 3320 | 3320 | <?php |
| 3321 | 3321 | |
| 3322 | - $value = ''; |
|
| 3323 | - if ($extra_fields && isset($extra_fields['decimal_separator'])) {
|
|
| 3324 | - $value = esc_attr($extra_fields['decimal_separator']); |
|
| 3325 | - }elseif(isset($cf['defaults']['extra_fields']['decimal_separator']) && $cf['defaults']['extra_fields']['decimal_separator']){
|
|
| 3326 | - $value = esc_attr($cf['defaults']['extra_fields']['decimal_separator']); |
|
| 3327 | - } |
|
| 3328 | - ?> |
|
| 3322 | + $value = ''; |
|
| 3323 | + if ($extra_fields && isset($extra_fields['decimal_separator'])) {
|
|
| 3324 | + $value = esc_attr($extra_fields['decimal_separator']); |
|
| 3325 | + }elseif(isset($cf['defaults']['extra_fields']['decimal_separator']) && $cf['defaults']['extra_fields']['decimal_separator']){
|
|
| 3326 | + $value = esc_attr($cf['defaults']['extra_fields']['decimal_separator']); |
|
| 3327 | + } |
|
| 3328 | + ?> |
|
| 3329 | 3329 | <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
|
| 3330 | 3330 | <label for="decimal_separator" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal separator :', 'geodirectory');?>
|
| 3331 | 3331 | <div class="gdcf-tooltip"> |
@@ -3342,13 +3342,13 @@ discard block |
||
| 3342 | 3342 | |
| 3343 | 3343 | <?php |
| 3344 | 3344 | |
| 3345 | - $value = ''; |
|
| 3346 | - if ($extra_fields && isset($extra_fields['decimal_display'])) {
|
|
| 3347 | - $value = esc_attr($extra_fields['decimal_display']); |
|
| 3348 | - }elseif(isset($cf['defaults']['extra_fields']['decimal_display']) && $cf['defaults']['extra_fields']['decimal_display']){
|
|
| 3349 | - $value = esc_attr($cf['defaults']['extra_fields']['decimal_display']); |
|
| 3350 | - } |
|
| 3351 | - ?> |
|
| 3345 | + $value = ''; |
|
| 3346 | + if ($extra_fields && isset($extra_fields['decimal_display'])) {
|
|
| 3347 | + $value = esc_attr($extra_fields['decimal_display']); |
|
| 3348 | + }elseif(isset($cf['defaults']['extra_fields']['decimal_display']) && $cf['defaults']['extra_fields']['decimal_display']){
|
|
| 3349 | + $value = esc_attr($cf['defaults']['extra_fields']['decimal_display']); |
|
| 3350 | + } |
|
| 3351 | + ?> |
|
| 3352 | 3352 | <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
|
| 3353 | 3353 | <label for="decimal_display" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal display :', 'geodirectory');?>
|
| 3354 | 3354 | <div class="gdcf-tooltip"> |
@@ -3365,13 +3365,13 @@ discard block |
||
| 3365 | 3365 | |
| 3366 | 3366 | <?php |
| 3367 | 3367 | |
| 3368 | - $value = ''; |
|
| 3369 | - if ($extra_fields && isset($extra_fields['currency_symbol'])) {
|
|
| 3370 | - $value = esc_attr($extra_fields['currency_symbol']); |
|
| 3371 | - }elseif(isset($cf['defaults']['extra_fields']['currency_symbol']) && $cf['defaults']['extra_fields']['currency_symbol']){
|
|
| 3372 | - $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol']); |
|
| 3373 | - } |
|
| 3374 | - ?> |
|
| 3368 | + $value = ''; |
|
| 3369 | + if ($extra_fields && isset($extra_fields['currency_symbol'])) {
|
|
| 3370 | + $value = esc_attr($extra_fields['currency_symbol']); |
|
| 3371 | + }elseif(isset($cf['defaults']['extra_fields']['currency_symbol']) && $cf['defaults']['extra_fields']['currency_symbol']){
|
|
| 3372 | + $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol']); |
|
| 3373 | + } |
|
| 3374 | + ?> |
|
| 3375 | 3375 | <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
|
| 3376 | 3376 | <label for="currency_symbol" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol :', 'geodirectory');?>
|
| 3377 | 3377 | <div class="gdcf-tooltip"> |
@@ -3386,13 +3386,13 @@ discard block |
||
| 3386 | 3386 | |
| 3387 | 3387 | <?php |
| 3388 | 3388 | |
| 3389 | - $value = ''; |
|
| 3390 | - if ($extra_fields && isset($extra_fields['currency_symbol_placement'])) {
|
|
| 3391 | - $value = esc_attr($extra_fields['currency_symbol_placement']); |
|
| 3392 | - }elseif(isset($cf['defaults']['extra_fields']['currency_symbol_placement']) && $cf['defaults']['extra_fields']['currency_symbol_placement']){
|
|
| 3393 | - $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol_placement']); |
|
| 3394 | - } |
|
| 3395 | - ?> |
|
| 3389 | + $value = ''; |
|
| 3390 | + if ($extra_fields && isset($extra_fields['currency_symbol_placement'])) {
|
|
| 3391 | + $value = esc_attr($extra_fields['currency_symbol_placement']); |
|
| 3392 | + }elseif(isset($cf['defaults']['extra_fields']['currency_symbol_placement']) && $cf['defaults']['extra_fields']['currency_symbol_placement']){
|
|
| 3393 | + $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol_placement']); |
|
| 3394 | + } |
|
| 3395 | + ?> |
|
| 3396 | 3396 | <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
|
| 3397 | 3397 | <label for="currency_symbol_placement" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol placement :', 'geodirectory');?>
|
| 3398 | 3398 | <div class="gdcf-tooltip"> |
@@ -3410,225 +3410,225 @@ discard block |
||
| 3410 | 3410 | |
| 3411 | 3411 | <?php |
| 3412 | 3412 | |
| 3413 | - $html = ob_get_clean(); |
|
| 3414 | - return $output.$html; |
|
| 3413 | + $html = ob_get_clean(); |
|
| 3414 | + return $output.$html; |
|
| 3415 | 3415 | } |
| 3416 | 3416 | add_filter('geodir_cfa_extra_fields_text','geodir_cfa_extra_fields_text',10,4);
|
| 3417 | 3417 | |
| 3418 | 3418 | function geodir_default_custom_fields($post_type='gd_place',$package_id=''){
|
| 3419 | - $fields = array(); |
|
| 3420 | - $package = ($package_id=='') ? '' : array($package_id); |
|
| 3421 | - |
|
| 3422 | - $fields[] = array('listing_type' => $post_type,
|
|
| 3423 | - 'data_type' => 'VARCHAR', |
|
| 3424 | - 'field_type' => 'taxonomy', |
|
| 3425 | - 'admin_title' => __('Category', 'geodirectory'),
|
|
| 3426 | - 'admin_desc' => __('SELECT listing category FROM here. SELECT at least one CATEGORY', 'geodirectory'),
|
|
| 3427 | - 'site_title' => __('Category', 'geodirectory'),
|
|
| 3428 | - 'htmlvar_name' => $post_type.'category', |
|
| 3429 | - 'default_value' => '', |
|
| 3430 | - 'is_default' => '1', |
|
| 3431 | - 'is_admin' => '1', |
|
| 3432 | - 'is_required' => '1', |
|
| 3433 | - 'show_in' => '[detail]', |
|
| 3434 | - 'show_on_pkg' => $package, |
|
| 3435 | - 'clabels' => __('Category', 'geodirectory'));
|
|
| 3436 | - |
|
| 3437 | - $fields[] = array('listing_type' => $post_type,
|
|
| 3438 | - 'data_type' => 'VARCHAR', |
|
| 3439 | - 'field_type' => 'address', |
|
| 3440 | - 'admin_title' => __('Address', 'geodirectory'),
|
|
| 3441 | - 'admin_desc' => ADDRESS_MSG, |
|
| 3442 | - 'site_title' => __('Address', 'geodirectory'),
|
|
| 3443 | - 'htmlvar_name' => 'post', |
|
| 3444 | - 'default_value' => '', |
|
| 3445 | - 'option_values' => '', |
|
| 3446 | - 'is_default' => '1', |
|
| 3447 | - 'is_admin' => '1', |
|
| 3448 | - 'is_required' => '1', |
|
| 3449 | - 'show_in' => '[detail],[mapbubble]', |
|
| 3450 | - 'show_on_pkg' => $package, |
|
| 3451 | - 'required_msg' => __('Address fields are required', 'geodirectory'),
|
|
| 3452 | - 'clabels' => __('Address', 'geodirectory'),
|
|
| 3453 | - 'extra' => array('show_city' => 1, 'city_lable' => __('City', 'geodirectory'),
|
|
| 3454 | - 'show_region' => 1, 'region_lable' => __('Region', 'geodirectory'),
|
|
| 3455 | - 'show_country' => 1, 'country_lable' => __('Country', 'geodirectory'),
|
|
| 3456 | - 'show_zip' => 1, 'zip_lable' => __('Zip/Post Code', 'geodirectory'),
|
|
| 3457 | - 'show_map' => 1, 'map_lable' => __('Set Address On Map', 'geodirectory'),
|
|
| 3458 | - 'show_mapview' => 1, 'mapview_lable' => __('Select Map View', 'geodirectory'),
|
|
| 3459 | - 'show_mapzoom' => 1, 'mapzoom_lable' => 'hidden', |
|
| 3460 | - 'show_latlng' => 1)); |
|
| 3461 | - |
|
| 3462 | - $fields[] = array('listing_type' => $post_type,
|
|
| 3463 | - 'data_type' => 'VARCHAR', |
|
| 3464 | - 'field_type' => 'text', |
|
| 3465 | - 'admin_title' => __('Time', 'geodirectory'),
|
|
| 3466 | - 'admin_desc' => __('Enter Business or Listing Timing Information.<br/>eg. : 10.00 am to 6 pm every day', 'geodirectory'),
|
|
| 3467 | - 'site_title' => __('Time', 'geodirectory'),
|
|
| 3468 | - 'htmlvar_name' => 'timing', |
|
| 3469 | - 'default_value' => '', |
|
| 3470 | - 'option_values' => '', |
|
| 3471 | - 'is_default' => '1', |
|
| 3472 | - 'is_admin' => '1', |
|
| 3473 | - 'show_in' => '[detail],[mapbubble]', |
|
| 3474 | - 'show_on_pkg' => $package, |
|
| 3475 | - 'clabels' => __('Time', 'geodirectory'));
|
|
| 3476 | - |
|
| 3477 | - $fields[] = array('listing_type' => $post_type,
|
|
| 3478 | - 'data_type' => 'VARCHAR', |
|
| 3479 | - 'field_type' => 'phone', |
|
| 3480 | - 'admin_title' => __('Phone', 'geodirectory'),
|
|
| 3481 | - 'admin_desc' => __('You can enter phone number,cell phone number etc.', 'geodirectory'),
|
|
| 3482 | - 'site_title' => __('Phone', 'geodirectory'),
|
|
| 3483 | - 'htmlvar_name' => 'contact', |
|
| 3484 | - 'default_value' => '', |
|
| 3485 | - 'option_values' => '', |
|
| 3486 | - 'is_default' => '1', |
|
| 3487 | - 'is_admin' => '1', |
|
| 3488 | - 'show_in' => '[detail],[mapbubble]', |
|
| 3489 | - 'show_on_pkg' => $package, |
|
| 3490 | - 'clabels' => __('Phone', 'geodirectory'));
|
|
| 3491 | - |
|
| 3492 | - $fields[] = array('listing_type' => $post_type,
|
|
| 3493 | - 'data_type' => 'VARCHAR', |
|
| 3494 | - 'field_type' => 'email', |
|
| 3495 | - 'admin_title' => __('Email', 'geodirectory'),
|
|
| 3496 | - 'admin_desc' => __('You can enter your business or listing email.', 'geodirectory'),
|
|
| 3497 | - 'site_title' => __('Email', 'geodirectory'),
|
|
| 3498 | - 'htmlvar_name' => 'email', |
|
| 3499 | - 'default_value' => '', |
|
| 3500 | - 'option_values' => '', |
|
| 3501 | - 'is_default' => '1', |
|
| 3502 | - 'is_admin' => '1', |
|
| 3503 | - 'show_in' => '[detail]', |
|
| 3504 | - 'show_on_pkg' => $package, |
|
| 3505 | - 'clabels' => __('Email', 'geodirectory'));
|
|
| 3506 | - |
|
| 3507 | - $fields[] = array('listing_type' => $post_type,
|
|
| 3508 | - 'data_type' => 'VARCHAR', |
|
| 3509 | - 'field_type' => 'url', |
|
| 3510 | - 'admin_title' => __('Website', 'geodirectory'),
|
|
| 3511 | - 'admin_desc' => __('You can enter your business or listing website.', 'geodirectory'),
|
|
| 3512 | - 'site_title' => __('Website', 'geodirectory'),
|
|
| 3513 | - 'htmlvar_name' => 'website', |
|
| 3514 | - 'default_value' => '', |
|
| 3515 | - 'option_values' => '', |
|
| 3516 | - 'is_default' => '1', |
|
| 3517 | - 'is_admin' => '1', |
|
| 3518 | - 'show_in' => '[detail]', |
|
| 3519 | - 'show_on_pkg' => $package, |
|
| 3520 | - 'clabels' => __('Website', 'geodirectory'));
|
|
| 3521 | - |
|
| 3522 | - $fields[] = array('listing_type' => $post_type,
|
|
| 3523 | - 'data_type' => 'VARCHAR', |
|
| 3524 | - 'field_type' => 'url', |
|
| 3525 | - 'admin_title' => __('Twitter', 'geodirectory'),
|
|
| 3526 | - 'admin_desc' => __('You can enter your business or listing twitter url.', 'geodirectory'),
|
|
| 3527 | - 'site_title' => __('Twitter', 'geodirectory'),
|
|
| 3528 | - 'htmlvar_name' => 'twitter', |
|
| 3529 | - 'default_value' => '', |
|
| 3530 | - 'option_values' => '', |
|
| 3531 | - 'is_default' => '1', |
|
| 3532 | - 'is_admin' => '1', |
|
| 3533 | - 'show_in' => '[detail]', |
|
| 3534 | - 'show_on_pkg' => $package, |
|
| 3535 | - 'clabels' => __('Twitter', 'geodirectory'));
|
|
| 3536 | - |
|
| 3537 | - $fields[] = array('listing_type' => $post_type,
|
|
| 3538 | - 'data_type' => 'VARCHAR', |
|
| 3539 | - 'field_type' => 'url', |
|
| 3540 | - 'admin_title' => __('Facebook', 'geodirectory'),
|
|
| 3541 | - 'admin_desc' => __('You can enter your business or listing facebook url.', 'geodirectory'),
|
|
| 3542 | - 'site_title' => __('Facebook', 'geodirectory'),
|
|
| 3543 | - 'htmlvar_name' => 'facebook', |
|
| 3544 | - 'default_value' => '', |
|
| 3545 | - 'option_values' => '', |
|
| 3546 | - 'is_default' => '1', |
|
| 3547 | - 'is_admin' => '1', |
|
| 3548 | - 'show_in' => '[detail]', |
|
| 3549 | - 'show_on_pkg' => $package, |
|
| 3550 | - 'clabels' => __('Facebook', 'geodirectory'));
|
|
| 3551 | - |
|
| 3552 | - $fields[] = array('listing_type' => $post_type,
|
|
| 3553 | - 'data_type' => 'TEXT', |
|
| 3554 | - 'field_type' => 'textarea', |
|
| 3555 | - 'admin_title' => __('Video', 'geodirectory'),
|
|
| 3556 | - 'admin_desc' => __('Add video code here, YouTube etc.', 'geodirectory'),
|
|
| 3557 | - 'site_title' => __('Video', 'geodirectory'),
|
|
| 3558 | - 'htmlvar_name' => 'video', |
|
| 3559 | - 'default_value' => '', |
|
| 3560 | - 'option_values' => '', |
|
| 3561 | - 'is_default' => '0', |
|
| 3562 | - 'is_admin' => '1', |
|
| 3563 | - 'show_in' => '[owntab]', |
|
| 3564 | - 'show_on_pkg' => $package, |
|
| 3565 | - 'clabels' => __('Video', 'geodirectory'));
|
|
| 3566 | - |
|
| 3567 | - $fields[] = array('listing_type' => $post_type,
|
|
| 3568 | - 'data_type' => 'TEXT', |
|
| 3569 | - 'field_type' => 'textarea', |
|
| 3570 | - 'admin_title' => __('Special Offers', 'geodirectory'),
|
|
| 3571 | - 'admin_desc' => __('Note: List out any special offers (optional)', 'geodirectory'),
|
|
| 3572 | - 'site_title' => __('Special Offers', 'geodirectory'),
|
|
| 3573 | - 'htmlvar_name' => 'special_offers', |
|
| 3574 | - 'default_value' => '', |
|
| 3575 | - 'option_values' => '', |
|
| 3576 | - 'is_default' => '0', |
|
| 3577 | - 'is_admin' => '1', |
|
| 3578 | - 'show_in' => '[owntab]', |
|
| 3579 | - 'show_on_pkg' => $package, |
|
| 3580 | - 'clabels' => __('Special Offers', 'geodirectory'));
|
|
| 3581 | - |
|
| 3582 | - /** |
|
| 3583 | - * Filter the array of default custom fields DB table data. |
|
| 3584 | - * |
|
| 3585 | - * @since 1.6.6 |
|
| 3586 | - * @param string $fields The default custom fields as an array. |
|
| 3587 | - */ |
|
| 3588 | - $fields = apply_filters('geodir_default_custom_fields', $fields);
|
|
| 3589 | - |
|
| 3590 | - return $fields; |
|
| 3419 | + $fields = array(); |
|
| 3420 | + $package = ($package_id=='') ? '' : array($package_id); |
|
| 3421 | + |
|
| 3422 | + $fields[] = array('listing_type' => $post_type,
|
|
| 3423 | + 'data_type' => 'VARCHAR', |
|
| 3424 | + 'field_type' => 'taxonomy', |
|
| 3425 | + 'admin_title' => __('Category', 'geodirectory'),
|
|
| 3426 | + 'admin_desc' => __('SELECT listing category FROM here. SELECT at least one CATEGORY', 'geodirectory'),
|
|
| 3427 | + 'site_title' => __('Category', 'geodirectory'),
|
|
| 3428 | + 'htmlvar_name' => $post_type.'category', |
|
| 3429 | + 'default_value' => '', |
|
| 3430 | + 'is_default' => '1', |
|
| 3431 | + 'is_admin' => '1', |
|
| 3432 | + 'is_required' => '1', |
|
| 3433 | + 'show_in' => '[detail]', |
|
| 3434 | + 'show_on_pkg' => $package, |
|
| 3435 | + 'clabels' => __('Category', 'geodirectory'));
|
|
| 3436 | + |
|
| 3437 | + $fields[] = array('listing_type' => $post_type,
|
|
| 3438 | + 'data_type' => 'VARCHAR', |
|
| 3439 | + 'field_type' => 'address', |
|
| 3440 | + 'admin_title' => __('Address', 'geodirectory'),
|
|
| 3441 | + 'admin_desc' => ADDRESS_MSG, |
|
| 3442 | + 'site_title' => __('Address', 'geodirectory'),
|
|
| 3443 | + 'htmlvar_name' => 'post', |
|
| 3444 | + 'default_value' => '', |
|
| 3445 | + 'option_values' => '', |
|
| 3446 | + 'is_default' => '1', |
|
| 3447 | + 'is_admin' => '1', |
|
| 3448 | + 'is_required' => '1', |
|
| 3449 | + 'show_in' => '[detail],[mapbubble]', |
|
| 3450 | + 'show_on_pkg' => $package, |
|
| 3451 | + 'required_msg' => __('Address fields are required', 'geodirectory'),
|
|
| 3452 | + 'clabels' => __('Address', 'geodirectory'),
|
|
| 3453 | + 'extra' => array('show_city' => 1, 'city_lable' => __('City', 'geodirectory'),
|
|
| 3454 | + 'show_region' => 1, 'region_lable' => __('Region', 'geodirectory'),
|
|
| 3455 | + 'show_country' => 1, 'country_lable' => __('Country', 'geodirectory'),
|
|
| 3456 | + 'show_zip' => 1, 'zip_lable' => __('Zip/Post Code', 'geodirectory'),
|
|
| 3457 | + 'show_map' => 1, 'map_lable' => __('Set Address On Map', 'geodirectory'),
|
|
| 3458 | + 'show_mapview' => 1, 'mapview_lable' => __('Select Map View', 'geodirectory'),
|
|
| 3459 | + 'show_mapzoom' => 1, 'mapzoom_lable' => 'hidden', |
|
| 3460 | + 'show_latlng' => 1)); |
|
| 3461 | + |
|
| 3462 | + $fields[] = array('listing_type' => $post_type,
|
|
| 3463 | + 'data_type' => 'VARCHAR', |
|
| 3464 | + 'field_type' => 'text', |
|
| 3465 | + 'admin_title' => __('Time', 'geodirectory'),
|
|
| 3466 | + 'admin_desc' => __('Enter Business or Listing Timing Information.<br/>eg. : 10.00 am to 6 pm every day', 'geodirectory'),
|
|
| 3467 | + 'site_title' => __('Time', 'geodirectory'),
|
|
| 3468 | + 'htmlvar_name' => 'timing', |
|
| 3469 | + 'default_value' => '', |
|
| 3470 | + 'option_values' => '', |
|
| 3471 | + 'is_default' => '1', |
|
| 3472 | + 'is_admin' => '1', |
|
| 3473 | + 'show_in' => '[detail],[mapbubble]', |
|
| 3474 | + 'show_on_pkg' => $package, |
|
| 3475 | + 'clabels' => __('Time', 'geodirectory'));
|
|
| 3476 | + |
|
| 3477 | + $fields[] = array('listing_type' => $post_type,
|
|
| 3478 | + 'data_type' => 'VARCHAR', |
|
| 3479 | + 'field_type' => 'phone', |
|
| 3480 | + 'admin_title' => __('Phone', 'geodirectory'),
|
|
| 3481 | + 'admin_desc' => __('You can enter phone number,cell phone number etc.', 'geodirectory'),
|
|
| 3482 | + 'site_title' => __('Phone', 'geodirectory'),
|
|
| 3483 | + 'htmlvar_name' => 'contact', |
|
| 3484 | + 'default_value' => '', |
|
| 3485 | + 'option_values' => '', |
|
| 3486 | + 'is_default' => '1', |
|
| 3487 | + 'is_admin' => '1', |
|
| 3488 | + 'show_in' => '[detail],[mapbubble]', |
|
| 3489 | + 'show_on_pkg' => $package, |
|
| 3490 | + 'clabels' => __('Phone', 'geodirectory'));
|
|
| 3491 | + |
|
| 3492 | + $fields[] = array('listing_type' => $post_type,
|
|
| 3493 | + 'data_type' => 'VARCHAR', |
|
| 3494 | + 'field_type' => 'email', |
|
| 3495 | + 'admin_title' => __('Email', 'geodirectory'),
|
|
| 3496 | + 'admin_desc' => __('You can enter your business or listing email.', 'geodirectory'),
|
|
| 3497 | + 'site_title' => __('Email', 'geodirectory'),
|
|
| 3498 | + 'htmlvar_name' => 'email', |
|
| 3499 | + 'default_value' => '', |
|
| 3500 | + 'option_values' => '', |
|
| 3501 | + 'is_default' => '1', |
|
| 3502 | + 'is_admin' => '1', |
|
| 3503 | + 'show_in' => '[detail]', |
|
| 3504 | + 'show_on_pkg' => $package, |
|
| 3505 | + 'clabels' => __('Email', 'geodirectory'));
|
|
| 3506 | + |
|
| 3507 | + $fields[] = array('listing_type' => $post_type,
|
|
| 3508 | + 'data_type' => 'VARCHAR', |
|
| 3509 | + 'field_type' => 'url', |
|
| 3510 | + 'admin_title' => __('Website', 'geodirectory'),
|
|
| 3511 | + 'admin_desc' => __('You can enter your business or listing website.', 'geodirectory'),
|
|
| 3512 | + 'site_title' => __('Website', 'geodirectory'),
|
|
| 3513 | + 'htmlvar_name' => 'website', |
|
| 3514 | + 'default_value' => '', |
|
| 3515 | + 'option_values' => '', |
|
| 3516 | + 'is_default' => '1', |
|
| 3517 | + 'is_admin' => '1', |
|
| 3518 | + 'show_in' => '[detail]', |
|
| 3519 | + 'show_on_pkg' => $package, |
|
| 3520 | + 'clabels' => __('Website', 'geodirectory'));
|
|
| 3521 | + |
|
| 3522 | + $fields[] = array('listing_type' => $post_type,
|
|
| 3523 | + 'data_type' => 'VARCHAR', |
|
| 3524 | + 'field_type' => 'url', |
|
| 3525 | + 'admin_title' => __('Twitter', 'geodirectory'),
|
|
| 3526 | + 'admin_desc' => __('You can enter your business or listing twitter url.', 'geodirectory'),
|
|
| 3527 | + 'site_title' => __('Twitter', 'geodirectory'),
|
|
| 3528 | + 'htmlvar_name' => 'twitter', |
|
| 3529 | + 'default_value' => '', |
|
| 3530 | + 'option_values' => '', |
|
| 3531 | + 'is_default' => '1', |
|
| 3532 | + 'is_admin' => '1', |
|
| 3533 | + 'show_in' => '[detail]', |
|
| 3534 | + 'show_on_pkg' => $package, |
|
| 3535 | + 'clabels' => __('Twitter', 'geodirectory'));
|
|
| 3536 | + |
|
| 3537 | + $fields[] = array('listing_type' => $post_type,
|
|
| 3538 | + 'data_type' => 'VARCHAR', |
|
| 3539 | + 'field_type' => 'url', |
|
| 3540 | + 'admin_title' => __('Facebook', 'geodirectory'),
|
|
| 3541 | + 'admin_desc' => __('You can enter your business or listing facebook url.', 'geodirectory'),
|
|
| 3542 | + 'site_title' => __('Facebook', 'geodirectory'),
|
|
| 3543 | + 'htmlvar_name' => 'facebook', |
|
| 3544 | + 'default_value' => '', |
|
| 3545 | + 'option_values' => '', |
|
| 3546 | + 'is_default' => '1', |
|
| 3547 | + 'is_admin' => '1', |
|
| 3548 | + 'show_in' => '[detail]', |
|
| 3549 | + 'show_on_pkg' => $package, |
|
| 3550 | + 'clabels' => __('Facebook', 'geodirectory'));
|
|
| 3551 | + |
|
| 3552 | + $fields[] = array('listing_type' => $post_type,
|
|
| 3553 | + 'data_type' => 'TEXT', |
|
| 3554 | + 'field_type' => 'textarea', |
|
| 3555 | + 'admin_title' => __('Video', 'geodirectory'),
|
|
| 3556 | + 'admin_desc' => __('Add video code here, YouTube etc.', 'geodirectory'),
|
|
| 3557 | + 'site_title' => __('Video', 'geodirectory'),
|
|
| 3558 | + 'htmlvar_name' => 'video', |
|
| 3559 | + 'default_value' => '', |
|
| 3560 | + 'option_values' => '', |
|
| 3561 | + 'is_default' => '0', |
|
| 3562 | + 'is_admin' => '1', |
|
| 3563 | + 'show_in' => '[owntab]', |
|
| 3564 | + 'show_on_pkg' => $package, |
|
| 3565 | + 'clabels' => __('Video', 'geodirectory'));
|
|
| 3566 | + |
|
| 3567 | + $fields[] = array('listing_type' => $post_type,
|
|
| 3568 | + 'data_type' => 'TEXT', |
|
| 3569 | + 'field_type' => 'textarea', |
|
| 3570 | + 'admin_title' => __('Special Offers', 'geodirectory'),
|
|
| 3571 | + 'admin_desc' => __('Note: List out any special offers (optional)', 'geodirectory'),
|
|
| 3572 | + 'site_title' => __('Special Offers', 'geodirectory'),
|
|
| 3573 | + 'htmlvar_name' => 'special_offers', |
|
| 3574 | + 'default_value' => '', |
|
| 3575 | + 'option_values' => '', |
|
| 3576 | + 'is_default' => '0', |
|
| 3577 | + 'is_admin' => '1', |
|
| 3578 | + 'show_in' => '[owntab]', |
|
| 3579 | + 'show_on_pkg' => $package, |
|
| 3580 | + 'clabels' => __('Special Offers', 'geodirectory'));
|
|
| 3581 | + |
|
| 3582 | + /** |
|
| 3583 | + * Filter the array of default custom fields DB table data. |
|
| 3584 | + * |
|
| 3585 | + * @since 1.6.6 |
|
| 3586 | + * @param string $fields The default custom fields as an array. |
|
| 3587 | + */ |
|
| 3588 | + $fields = apply_filters('geodir_default_custom_fields', $fields);
|
|
| 3589 | + |
|
| 3590 | + return $fields; |
|
| 3591 | 3591 | } |
| 3592 | 3592 | |
| 3593 | 3593 | function geodir_currency_format_number($number='',$cf=''){
|
| 3594 | 3594 | |
| 3595 | - $cs = isset($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : ''; |
|
| 3595 | + $cs = isset($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : ''; |
|
| 3596 | 3596 | |
| 3597 | - $symbol = isset($cs['currency_symbol']) ? $cs['currency_symbol'] : '$'; |
|
| 3598 | - $decimals = isset($cf['decimal_point']) && $cf['decimal_point'] ? $cf['decimal_point'] : 2; |
|
| 3599 | - $decimal_display = isset($cf['decimal_display']) && $cf['decimal_display'] ? $cf['decimal_display'] : 'if'; |
|
| 3600 | - $decimalpoint = '.'; |
|
| 3597 | + $symbol = isset($cs['currency_symbol']) ? $cs['currency_symbol'] : '$'; |
|
| 3598 | + $decimals = isset($cf['decimal_point']) && $cf['decimal_point'] ? $cf['decimal_point'] : 2; |
|
| 3599 | + $decimal_display = isset($cf['decimal_display']) && $cf['decimal_display'] ? $cf['decimal_display'] : 'if'; |
|
| 3600 | + $decimalpoint = '.'; |
|
| 3601 | 3601 | |
| 3602 | - if(isset($cs['decimal_separator']) && $cs['decimal_separator']=='comma'){
|
|
| 3603 | - $decimalpoint = ','; |
|
| 3604 | - } |
|
| 3602 | + if(isset($cs['decimal_separator']) && $cs['decimal_separator']=='comma'){
|
|
| 3603 | + $decimalpoint = ','; |
|
| 3604 | + } |
|
| 3605 | 3605 | |
| 3606 | - $separator = ','; |
|
| 3606 | + $separator = ','; |
|
| 3607 | 3607 | |
| 3608 | - if(isset($cs['thousand_separator'])){
|
|
| 3609 | - if($cs['thousand_separator']=='comma'){$separator = ',';}
|
|
| 3610 | - if($cs['thousand_separator']=='slash'){$separator = '\\';}
|
|
| 3611 | - if($cs['thousand_separator']=='period'){$separator = '.';}
|
|
| 3612 | - if($cs['thousand_separator']=='space'){$separator = ' ';}
|
|
| 3613 | - if($cs['thousand_separator']=='none'){$separator = '';}
|
|
| 3614 | - } |
|
| 3608 | + if(isset($cs['thousand_separator'])){
|
|
| 3609 | + if($cs['thousand_separator']=='comma'){$separator = ',';}
|
|
| 3610 | + if($cs['thousand_separator']=='slash'){$separator = '\\';}
|
|
| 3611 | + if($cs['thousand_separator']=='period'){$separator = '.';}
|
|
| 3612 | + if($cs['thousand_separator']=='space'){$separator = ' ';}
|
|
| 3613 | + if($cs['thousand_separator']=='none'){$separator = '';}
|
|
| 3614 | + } |
|
| 3615 | 3615 | |
| 3616 | - $currency_symbol_placement = isset($cs['currency_symbol_placement']) ? $cs['currency_symbol_placement'] : 'left'; |
|
| 3616 | + $currency_symbol_placement = isset($cs['currency_symbol_placement']) ? $cs['currency_symbol_placement'] : 'left'; |
|
| 3617 | 3617 | |
| 3618 | - if($decimals>0 && $decimal_display=='if'){
|
|
| 3619 | - if(is_int($number) || floor( $number ) == $number) |
|
| 3620 | - $decimals = 0; |
|
| 3621 | - } |
|
| 3618 | + if($decimals>0 && $decimal_display=='if'){
|
|
| 3619 | + if(is_int($number) || floor( $number ) == $number) |
|
| 3620 | + $decimals = 0; |
|
| 3621 | + } |
|
| 3622 | 3622 | |
| 3623 | - $number = number_format($number,$decimals,$decimalpoint,$separator); |
|
| 3623 | + $number = number_format($number,$decimals,$decimalpoint,$separator); |
|
| 3624 | 3624 | |
| 3625 | 3625 | |
| 3626 | 3626 | |
| 3627 | - if($currency_symbol_placement=='left'){
|
|
| 3628 | - $number = $symbol . $number; |
|
| 3629 | - }else{
|
|
| 3630 | - $number = $number . $symbol; |
|
| 3631 | - } |
|
| 3627 | + if($currency_symbol_placement=='left'){
|
|
| 3628 | + $number = $symbol . $number; |
|
| 3629 | + }else{
|
|
| 3630 | + $number = $number . $symbol; |
|
| 3631 | + } |
|
| 3632 | 3632 | |
| 3633 | 3633 | |
| 3634 | 3634 | return $number; |
@@ -16,22 +16,22 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | function geodir_on_wp_loaded() |
| 18 | 18 | {
|
| 19 | - /** |
|
| 20 | - * Called on the wp_loaded WP hook and used to send the send inquiry and send to friend forms. |
|
| 21 | - * |
|
| 22 | - * @since 1.0.0 |
|
| 23 | - */ |
|
| 24 | - do_action('giodir_handle_request_plugins_loaded');
|
|
| 25 | - global $wpdb; |
|
| 19 | + /** |
|
| 20 | + * Called on the wp_loaded WP hook and used to send the send inquiry and send to friend forms. |
|
| 21 | + * |
|
| 22 | + * @since 1.0.0 |
|
| 23 | + */ |
|
| 24 | + do_action('giodir_handle_request_plugins_loaded');
|
|
| 25 | + global $wpdb; |
|
| 26 | 26 | |
| 27 | 27 | |
| 28 | - if (isset($_POST['sendact']) && $_POST['sendact'] == 'send_inqury') {
|
|
| 29 | - geodir_send_inquiry($_REQUEST); // function in custom_functions.php |
|
| 28 | + if (isset($_POST['sendact']) && $_POST['sendact'] == 'send_inqury') {
|
|
| 29 | + geodir_send_inquiry($_REQUEST); // function in custom_functions.php |
|
| 30 | 30 | |
| 31 | - } elseif (isset($_POST['sendact']) && $_POST['sendact'] == 'email_frnd') {
|
|
| 32 | - geodir_send_friend($_REQUEST); // function in custom_functions.php |
|
| 31 | + } elseif (isset($_POST['sendact']) && $_POST['sendact'] == 'email_frnd') {
|
|
| 32 | + geodir_send_friend($_REQUEST); // function in custom_functions.php |
|
| 33 | 33 | |
| 34 | - } |
|
| 34 | + } |
|
| 35 | 35 | |
| 36 | 36 | } |
| 37 | 37 | |
@@ -44,9 +44,9 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | function geodir_on_wp() |
| 46 | 46 | {
|
| 47 | - if(geodir_is_page('login')) {
|
|
| 48 | - geodir_user_signup(); |
|
| 49 | - } |
|
| 47 | + if(geodir_is_page('login')) {
|
|
| 48 | + geodir_user_signup(); |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | 51 | } |
| 52 | 52 | |
@@ -59,32 +59,32 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | function geodir_on_init() |
| 61 | 61 | {
|
| 62 | - /** |
|
| 63 | - * Called on the wp_init WP hook at the start of the geodir_on_init() function. |
|
| 64 | - * |
|
| 65 | - * @since 1.0.0 |
|
| 66 | - */ |
|
| 67 | - do_action('giodir_handle_request');
|
|
| 68 | - global $wpdb; |
|
| 62 | + /** |
|
| 63 | + * Called on the wp_init WP hook at the start of the geodir_on_init() function. |
|
| 64 | + * |
|
| 65 | + * @since 1.0.0 |
|
| 66 | + */ |
|
| 67 | + do_action('giodir_handle_request');
|
|
| 68 | + global $wpdb; |
|
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | |
| 72 | 72 | |
| 73 | - if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && !current_user_can('manage_options') && !class_exists('BuddyPress')) {
|
|
| 74 | - show_admin_bar(false); |
|
| 75 | - } |
|
| 73 | + if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && !current_user_can('manage_options') && !class_exists('BuddyPress')) {
|
|
| 74 | + show_admin_bar(false); |
|
| 75 | + } |
|
| 76 | 76 | |
| 77 | 77 | |
| 78 | - if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'get_markers') {
|
|
| 79 | - /** |
|
| 80 | - * Contains map marker functions. |
|
| 81 | - * |
|
| 82 | - * @since 1.0.0 |
|
| 83 | - * @package GeoDirectory |
|
| 84 | - */ |
|
| 85 | - include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php'); |
|
| 86 | - die; |
|
| 87 | - } |
|
| 78 | + if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'get_markers') {
|
|
| 79 | + /** |
|
| 80 | + * Contains map marker functions. |
|
| 81 | + * |
|
| 82 | + * @since 1.0.0 |
|
| 83 | + * @package GeoDirectory |
|
| 84 | + */ |
|
| 85 | + include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php'); |
|
| 86 | + die; |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | |
@@ -104,290 +104,290 @@ discard block |
||
| 104 | 104 | * @todo check if nonce is required here and if so add one. |
| 105 | 105 | */ |
| 106 | 106 | function geodir_ajax_handler() {
|
| 107 | - global $wpdb, $gd_session,$post; |
|
| 107 | + global $wpdb, $gd_session,$post; |
|
| 108 | 108 | |
| 109 | - if (isset($_REQUEST['gd_listing_view']) && $_REQUEST['gd_listing_view'] != '') {
|
|
| 109 | + if (isset($_REQUEST['gd_listing_view']) && $_REQUEST['gd_listing_view'] != '') {
|
|
| 110 | 110 | $gd_session->set('gd_listing_view', $_REQUEST['gd_listing_view']);
|
| 111 | - echo '1'; |
|
| 112 | - } |
|
| 113 | - |
|
| 114 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') {
|
|
| 115 | - if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude'])) |
|
| 116 | - geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']); |
|
| 117 | - else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax'])) |
|
| 118 | - geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']); |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) {
|
|
| 122 | - if (current_user_can('manage_options')) {
|
|
| 123 | - /** |
|
| 124 | - * Contains admin ajax handling functions. |
|
| 125 | - * |
|
| 126 | - * @since 1.0.0 |
|
| 127 | - * @package GeoDirectory |
|
| 128 | - */ |
|
| 129 | - include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php'); |
|
| 130 | - } else {
|
|
| 131 | - wp_redirect(geodir_login_url()); |
|
| 132 | - gd_die(); |
|
| 133 | - } |
|
| 134 | - } |
|
| 135 | - |
|
| 136 | - if (isset($_REQUEST['geodir_autofill']) && $_REQUEST['geodir_autofill'] != '' && isset($_REQUEST['_wpnonce'])) {
|
|
| 137 | - if (current_user_can('manage_options')) {
|
|
| 138 | - switch ($_REQUEST['geodir_autofill']): |
|
| 139 | - case "geodir_dummy_delete" : |
|
| 140 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
|
| 141 | - return; |
|
| 142 | - |
|
| 143 | - $datatype = isset($_REQUEST['datatype']) ? sanitize_key($_REQUEST['datatype']) : ''; |
|
| 144 | - if (isset($_REQUEST['posttype'])) |
|
| 145 | - /** |
|
| 146 | - * Used to delete the dummy post data per post type. |
|
| 147 | - * |
|
| 148 | - * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype']. |
|
| 149 | - * |
|
| 150 | - * @since 1.6.11 |
|
| 151 | - * @param string $posttype The post type to insert. |
|
| 152 | - * @param string $datatype The type of dummy data to insert. |
|
| 153 | - */ |
|
| 154 | - do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),$datatype);
|
|
| 155 | - break; |
|
| 156 | - case "geodir_dummy_insert" : |
|
| 157 | - if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
|
| 158 | - return; |
|
| 159 | - |
|
| 160 | - global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2; |
|
| 161 | - $city_bound_lat1 = $_REQUEST['city_bound_lat1']; |
|
| 162 | - $city_bound_lng1 = $_REQUEST['city_bound_lng1']; |
|
| 163 | - $city_bound_lat2 = $_REQUEST['city_bound_lat2']; |
|
| 164 | - $city_bound_lng2 = $_REQUEST['city_bound_lng2']; |
|
| 165 | - |
|
| 166 | - if (isset($_REQUEST['posttype'])){
|
|
| 167 | - /** |
|
| 168 | - * Used to insert the dummy post data per post type. |
|
| 169 | - * |
|
| 170 | - * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype']. |
|
| 171 | - * |
|
| 172 | - * @since 1.6.11 |
|
| 173 | - * @param string $posttype The post type to insert. |
|
| 174 | - * @param string $datatype The type of dummy data to insert. |
|
| 175 | - * @param int $post_index The item number to insert. |
|
| 176 | - */ |
|
| 177 | - do_action('geodir_insert_dummy_posts',sanitize_key($_REQUEST['posttype']),sanitize_key($_REQUEST['datatype']),absint($_REQUEST['insert_dummy_post_index']));
|
|
| 178 | - } |
|
| 179 | - |
|
| 180 | - |
|
| 181 | - break; |
|
| 182 | - endswitch; |
|
| 183 | - } else {
|
|
| 184 | - wp_redirect(geodir_login_url()); |
|
| 185 | - exit(); |
|
| 186 | - } |
|
| 187 | - } |
|
| 188 | - |
|
| 189 | - if (isset($_REQUEST['popuptype']) && $_REQUEST['popuptype'] != '' && isset($_REQUEST['post_id']) && $_REQUEST['post_id'] != '') {
|
|
| 190 | - |
|
| 191 | - if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
|
|
| 192 | - $template = locate_template(array("geodirectory/popup-forms.php"));
|
|
| 193 | - if (!$template) {
|
|
| 194 | - $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php'; |
|
| 195 | - } |
|
| 196 | - require_once($template); |
|
| 197 | - } |
|
| 198 | - |
|
| 199 | - gd_die(); |
|
| 200 | - } |
|
| 201 | - |
|
| 202 | - /*if(isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'filter_ajax'){
|
|
| 111 | + echo '1'; |
|
| 112 | + } |
|
| 113 | + |
|
| 114 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') {
|
|
| 115 | + if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude'])) |
|
| 116 | + geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']); |
|
| 117 | + else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax'])) |
|
| 118 | + geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']); |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) {
|
|
| 122 | + if (current_user_can('manage_options')) {
|
|
| 123 | + /** |
|
| 124 | + * Contains admin ajax handling functions. |
|
| 125 | + * |
|
| 126 | + * @since 1.0.0 |
|
| 127 | + * @package GeoDirectory |
|
| 128 | + */ |
|
| 129 | + include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php'); |
|
| 130 | + } else {
|
|
| 131 | + wp_redirect(geodir_login_url()); |
|
| 132 | + gd_die(); |
|
| 133 | + } |
|
| 134 | + } |
|
| 135 | + |
|
| 136 | + if (isset($_REQUEST['geodir_autofill']) && $_REQUEST['geodir_autofill'] != '' && isset($_REQUEST['_wpnonce'])) {
|
|
| 137 | + if (current_user_can('manage_options')) {
|
|
| 138 | + switch ($_REQUEST['geodir_autofill']): |
|
| 139 | + case "geodir_dummy_delete" : |
|
| 140 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
|
| 141 | + return; |
|
| 142 | + |
|
| 143 | + $datatype = isset($_REQUEST['datatype']) ? sanitize_key($_REQUEST['datatype']) : ''; |
|
| 144 | + if (isset($_REQUEST['posttype'])) |
|
| 145 | + /** |
|
| 146 | + * Used to delete the dummy post data per post type. |
|
| 147 | + * |
|
| 148 | + * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype']. |
|
| 149 | + * |
|
| 150 | + * @since 1.6.11 |
|
| 151 | + * @param string $posttype The post type to insert. |
|
| 152 | + * @param string $datatype The type of dummy data to insert. |
|
| 153 | + */ |
|
| 154 | + do_action('geodir_delete_dummy_posts' ,sanitize_key($_REQUEST['posttype']),$datatype);
|
|
| 155 | + break; |
|
| 156 | + case "geodir_dummy_insert" : |
|
| 157 | + if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) |
|
| 158 | + return; |
|
| 159 | + |
|
| 160 | + global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2; |
|
| 161 | + $city_bound_lat1 = $_REQUEST['city_bound_lat1']; |
|
| 162 | + $city_bound_lng1 = $_REQUEST['city_bound_lng1']; |
|
| 163 | + $city_bound_lat2 = $_REQUEST['city_bound_lat2']; |
|
| 164 | + $city_bound_lng2 = $_REQUEST['city_bound_lng2']; |
|
| 165 | + |
|
| 166 | + if (isset($_REQUEST['posttype'])){
|
|
| 167 | + /** |
|
| 168 | + * Used to insert the dummy post data per post type. |
|
| 169 | + * |
|
| 170 | + * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype']. |
|
| 171 | + * |
|
| 172 | + * @since 1.6.11 |
|
| 173 | + * @param string $posttype The post type to insert. |
|
| 174 | + * @param string $datatype The type of dummy data to insert. |
|
| 175 | + * @param int $post_index The item number to insert. |
|
| 176 | + */ |
|
| 177 | + do_action('geodir_insert_dummy_posts',sanitize_key($_REQUEST['posttype']),sanitize_key($_REQUEST['datatype']),absint($_REQUEST['insert_dummy_post_index']));
|
|
| 178 | + } |
|
| 179 | + |
|
| 180 | + |
|
| 181 | + break; |
|
| 182 | + endswitch; |
|
| 183 | + } else {
|
|
| 184 | + wp_redirect(geodir_login_url()); |
|
| 185 | + exit(); |
|
| 186 | + } |
|
| 187 | + } |
|
| 188 | + |
|
| 189 | + if (isset($_REQUEST['popuptype']) && $_REQUEST['popuptype'] != '' && isset($_REQUEST['post_id']) && $_REQUEST['post_id'] != '') {
|
|
| 190 | + |
|
| 191 | + if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
|
|
| 192 | + $template = locate_template(array("geodirectory/popup-forms.php"));
|
|
| 193 | + if (!$template) {
|
|
| 194 | + $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php'; |
|
| 195 | + } |
|
| 196 | + require_once($template); |
|
| 197 | + } |
|
| 198 | + |
|
| 199 | + gd_die(); |
|
| 200 | + } |
|
| 201 | + |
|
| 202 | + /*if(isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'filter_ajax'){
|
|
| 203 | 203 | include_once ( geodir_plugin_path() . '/geodirectory-templates/advance-search-form.php'); |
| 204 | 204 | }*/ |
| 205 | 205 | |
| 206 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'map_ajax') {
|
|
| 207 | - /** |
|
| 208 | - * Contains map marker functions. |
|
| 209 | - * |
|
| 210 | - * @since 1.0.0 |
|
| 211 | - * @package GeoDirectory |
|
| 212 | - */ |
|
| 213 | - include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php'); |
|
| 214 | - } |
|
| 215 | - |
|
| 216 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
|
|
| 217 | - if (is_user_logged_in()) {
|
|
| 218 | - switch ($_REQUEST['ajax_action']): |
|
| 219 | - case "add" : |
|
| 220 | - geodir_add_to_favorite((int)$_REQUEST['pid']); |
|
| 221 | - break; |
|
| 222 | - case "remove" : |
|
| 223 | - geodir_remove_from_favorite((int)$_REQUEST['pid']); |
|
| 224 | - break; |
|
| 225 | - endswitch; |
|
| 226 | - } else {
|
|
| 227 | - wp_redirect(geodir_login_url()); |
|
| 228 | - exit(); |
|
| 229 | - } |
|
| 230 | - } |
|
| 231 | - |
|
| 232 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'add_listing') {
|
|
| 233 | - |
|
| 234 | - $is_current_user_owner = true; |
|
| 235 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 236 | - $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']); |
|
| 237 | - } |
|
| 238 | - |
|
| 239 | - $request = $gd_session->get('listing');
|
|
| 240 | - |
|
| 241 | - if (is_user_logged_in() && $is_current_user_owner) {
|
|
| 242 | - |
|
| 243 | - switch ($_REQUEST['ajax_action']): |
|
| 244 | - case "add": |
|
| 245 | - case "update": |
|
| 246 | - |
|
| 247 | - if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
|
|
| 248 | - $last_id = geodir_save_listing(); |
|
| 249 | - |
|
| 250 | - if ($last_id) {
|
|
| 251 | - //$redirect_to = get_permalink( $last_id ); |
|
| 252 | - $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
|
|
| 253 | - |
|
| 254 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 255 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 256 | - $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
|
|
| 257 | - } else |
|
| 258 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 259 | - |
|
| 260 | - wp_redirect($redirect_to); |
|
| 261 | - } else {
|
|
| 262 | - $gd_session->un_set('listing');
|
|
| 263 | - wp_redirect(home_url()); |
|
| 264 | - } |
|
| 265 | - |
|
| 266 | - break; |
|
| 267 | - case "cancel" : |
|
| 268 | - |
|
| 269 | - $gd_session->un_set('listing');
|
|
| 270 | - |
|
| 271 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid'])) |
|
| 272 | - wp_redirect(get_permalink($_REQUEST['pid'])); |
|
| 273 | - else {
|
|
| 274 | - geodir_remove_temp_images(); |
|
| 275 | - wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
|
|
| 276 | - } |
|
| 277 | - |
|
| 278 | - break; |
|
| 279 | - |
|
| 280 | - case "publish" : |
|
| 281 | - |
|
| 282 | - if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
|
|
| 283 | - |
|
| 284 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 285 | - $new_post = array(); |
|
| 286 | - $new_post['ID'] = $_REQUEST['pid']; |
|
| 287 | - |
|
| 288 | - $lastid = wp_update_post($new_post); |
|
| 289 | - |
|
| 290 | - $gd_session->un_set('listing');
|
|
| 291 | - wp_redirect(get_permalink($lastid)); |
|
| 292 | - } else {
|
|
| 293 | - $last_id = geodir_save_listing(); |
|
| 294 | - |
|
| 295 | - if ($last_id) {
|
|
| 296 | - //$redirect_to = get_permalink( $last_id ); |
|
| 297 | - $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
|
|
| 298 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 299 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 300 | - $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
|
|
| 301 | - } else |
|
| 302 | - $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 303 | - |
|
| 304 | - $gd_session->un_set('listing');
|
|
| 305 | - wp_redirect($redirect_to); |
|
| 306 | - } |
|
| 307 | - } else {
|
|
| 308 | - $gd_session->un_set('listing');
|
|
| 309 | - wp_redirect(home_url()); |
|
| 310 | - } |
|
| 311 | - |
|
| 312 | - break; |
|
| 313 | - case "delete" : |
|
| 314 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 315 | - global $current_user; |
|
| 316 | - |
|
| 317 | - if (get_option('geodir_disable_perm_delete')) {
|
|
| 318 | - $lastid = wp_trash_post($_REQUEST['pid']); |
|
| 319 | - } else {
|
|
| 320 | - $lastid = wp_delete_post($_REQUEST['pid']); |
|
| 321 | - } |
|
| 322 | - |
|
| 323 | - if ($lastid && !is_wp_error($lastid)) |
|
| 324 | - wp_redirect($_SERVER['HTTP_REFERER']); |
|
| 325 | - |
|
| 326 | - //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
|
|
| 327 | - } |
|
| 328 | - break; |
|
| 329 | - endswitch; |
|
| 330 | - |
|
| 331 | - $gd_session->un_set('listing');
|
|
| 332 | - } else {
|
|
| 333 | - $gd_session->un_set('listing');
|
|
| 334 | - wp_redirect(geodir_login_url()); |
|
| 335 | - exit(); |
|
| 336 | - } |
|
| 337 | - } |
|
| 338 | - |
|
| 339 | - if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'user_login') {
|
|
| 340 | - /** |
|
| 341 | - * Contains registration and login functions. |
|
| 342 | - * @todo Fix the file path. |
|
| 343 | - * |
|
| 344 | - * @since 1.0.0 |
|
| 345 | - * @package GeoDirectory |
|
| 346 | - */ |
|
| 347 | - include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php'); |
|
| 348 | - } |
|
| 349 | - |
|
| 350 | - if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') {
|
|
| 351 | - $args = array('taxonomy' => sanitize_text_field($_REQUEST['term']));
|
|
| 352 | - if (!empty($_REQUEST['parent_only'])) {
|
|
| 353 | - $args['parent'] = 0; |
|
| 354 | - } |
|
| 355 | - $terms_o = get_terms($args); |
|
| 206 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'map_ajax') {
|
|
| 207 | + /** |
|
| 208 | + * Contains map marker functions. |
|
| 209 | + * |
|
| 210 | + * @since 1.0.0 |
|
| 211 | + * @package GeoDirectory |
|
| 212 | + */ |
|
| 213 | + include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php'); |
|
| 214 | + } |
|
| 215 | + |
|
| 216 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
|
|
| 217 | + if (is_user_logged_in()) {
|
|
| 218 | + switch ($_REQUEST['ajax_action']): |
|
| 219 | + case "add" : |
|
| 220 | + geodir_add_to_favorite((int)$_REQUEST['pid']); |
|
| 221 | + break; |
|
| 222 | + case "remove" : |
|
| 223 | + geodir_remove_from_favorite((int)$_REQUEST['pid']); |
|
| 224 | + break; |
|
| 225 | + endswitch; |
|
| 226 | + } else {
|
|
| 227 | + wp_redirect(geodir_login_url()); |
|
| 228 | + exit(); |
|
| 229 | + } |
|
| 230 | + } |
|
| 231 | + |
|
| 232 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'add_listing') {
|
|
| 233 | + |
|
| 234 | + $is_current_user_owner = true; |
|
| 235 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 236 | + $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']); |
|
| 237 | + } |
|
| 238 | + |
|
| 239 | + $request = $gd_session->get('listing');
|
|
| 240 | + |
|
| 241 | + if (is_user_logged_in() && $is_current_user_owner) {
|
|
| 242 | + |
|
| 243 | + switch ($_REQUEST['ajax_action']): |
|
| 244 | + case "add": |
|
| 245 | + case "update": |
|
| 246 | + |
|
| 247 | + if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
|
|
| 248 | + $last_id = geodir_save_listing(); |
|
| 249 | + |
|
| 250 | + if ($last_id) {
|
|
| 251 | + //$redirect_to = get_permalink( $last_id ); |
|
| 252 | + $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
|
|
| 253 | + |
|
| 254 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 255 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 256 | + $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
|
|
| 257 | + } else |
|
| 258 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 259 | + |
|
| 260 | + wp_redirect($redirect_to); |
|
| 261 | + } else {
|
|
| 262 | + $gd_session->un_set('listing');
|
|
| 263 | + wp_redirect(home_url()); |
|
| 264 | + } |
|
| 265 | + |
|
| 266 | + break; |
|
| 267 | + case "cancel" : |
|
| 268 | + |
|
| 269 | + $gd_session->un_set('listing');
|
|
| 270 | + |
|
| 271 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid'])) |
|
| 272 | + wp_redirect(get_permalink($_REQUEST['pid'])); |
|
| 273 | + else {
|
|
| 274 | + geodir_remove_temp_images(); |
|
| 275 | + wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
|
|
| 276 | + } |
|
| 277 | + |
|
| 278 | + break; |
|
| 279 | + |
|
| 280 | + case "publish" : |
|
| 281 | + |
|
| 282 | + if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
|
|
| 283 | + |
|
| 284 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 285 | + $new_post = array(); |
|
| 286 | + $new_post['ID'] = $_REQUEST['pid']; |
|
| 287 | + |
|
| 288 | + $lastid = wp_update_post($new_post); |
|
| 289 | + |
|
| 290 | + $gd_session->un_set('listing');
|
|
| 291 | + wp_redirect(get_permalink($lastid)); |
|
| 292 | + } else {
|
|
| 293 | + $last_id = geodir_save_listing(); |
|
| 294 | + |
|
| 295 | + if ($last_id) {
|
|
| 296 | + //$redirect_to = get_permalink( $last_id ); |
|
| 297 | + $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
|
|
| 298 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 299 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 300 | + $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
|
|
| 301 | + } else |
|
| 302 | + $redirect_to = get_permalink(geodir_add_listing_page_id()); |
|
| 303 | + |
|
| 304 | + $gd_session->un_set('listing');
|
|
| 305 | + wp_redirect($redirect_to); |
|
| 306 | + } |
|
| 307 | + } else {
|
|
| 308 | + $gd_session->un_set('listing');
|
|
| 309 | + wp_redirect(home_url()); |
|
| 310 | + } |
|
| 311 | + |
|
| 312 | + break; |
|
| 313 | + case "delete" : |
|
| 314 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 315 | + global $current_user; |
|
| 316 | + |
|
| 317 | + if (get_option('geodir_disable_perm_delete')) {
|
|
| 318 | + $lastid = wp_trash_post($_REQUEST['pid']); |
|
| 319 | + } else {
|
|
| 320 | + $lastid = wp_delete_post($_REQUEST['pid']); |
|
| 321 | + } |
|
| 322 | + |
|
| 323 | + if ($lastid && !is_wp_error($lastid)) |
|
| 324 | + wp_redirect($_SERVER['HTTP_REFERER']); |
|
| 325 | + |
|
| 326 | + //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
|
|
| 327 | + } |
|
| 328 | + break; |
|
| 329 | + endswitch; |
|
| 330 | + |
|
| 331 | + $gd_session->un_set('listing');
|
|
| 332 | + } else {
|
|
| 333 | + $gd_session->un_set('listing');
|
|
| 334 | + wp_redirect(geodir_login_url()); |
|
| 335 | + exit(); |
|
| 336 | + } |
|
| 337 | + } |
|
| 338 | + |
|
| 339 | + if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'user_login') {
|
|
| 340 | + /** |
|
| 341 | + * Contains registration and login functions. |
|
| 342 | + * @todo Fix the file path. |
|
| 343 | + * |
|
| 344 | + * @since 1.0.0 |
|
| 345 | + * @package GeoDirectory |
|
| 346 | + */ |
|
| 347 | + include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php'); |
|
| 348 | + } |
|
| 349 | + |
|
| 350 | + if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') {
|
|
| 351 | + $args = array('taxonomy' => sanitize_text_field($_REQUEST['term']));
|
|
| 352 | + if (!empty($_REQUEST['parent_only'])) {
|
|
| 353 | + $args['parent'] = 0; |
|
| 354 | + } |
|
| 355 | + $terms_o = get_terms($args); |
|
| 356 | 356 | |
| 357 | - // Skip terms which has no listing |
|
| 358 | - if (!empty($terms_o)) {
|
|
| 359 | - $filter_terms = array(); |
|
| 357 | + // Skip terms which has no listing |
|
| 358 | + if (!empty($terms_o)) {
|
|
| 359 | + $filter_terms = array(); |
|
| 360 | 360 | |
| 361 | - foreach ($terms_o as $term) {
|
|
| 362 | - if (isset($term->count) && $term->count > 0) {
|
|
| 363 | - $filter_terms[] = $term; |
|
| 364 | - } |
|
| 365 | - } |
|
| 366 | - $terms_o = $filter_terms; |
|
| 367 | - } |
|
| 361 | + foreach ($terms_o as $term) {
|
|
| 362 | + if (isset($term->count) && $term->count > 0) {
|
|
| 363 | + $filter_terms[] = $term; |
|
| 364 | + } |
|
| 365 | + } |
|
| 366 | + $terms_o = $filter_terms; |
|
| 367 | + } |
|
| 368 | 368 | |
| 369 | - $terms = geodir_sort_terms($terms_o, 'count'); |
|
| 370 | - geodir_helper_cat_list_output($terms, intval($_REQUEST['limit'])); |
|
| 371 | - exit(); |
|
| 372 | - } |
|
| 369 | + $terms = geodir_sort_terms($terms_o, 'count'); |
|
| 370 | + geodir_helper_cat_list_output($terms, intval($_REQUEST['limit'])); |
|
| 371 | + exit(); |
|
| 372 | + } |
|
| 373 | 373 | |
| 374 | - gd_die(); |
|
| 374 | + gd_die(); |
|
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | |
| 378 | 378 | function geodir_show_ga_stats(){
|
| 379 | - if (isset($_REQUEST['ga_start'])) {
|
|
| 380 | - $ga_start = $_REQUEST['ga_start']; |
|
| 381 | - } else {
|
|
| 382 | - $ga_start = ''; |
|
| 383 | - } |
|
| 384 | - if (isset($_REQUEST['ga_end'])) {
|
|
| 385 | - $ga_end = $_REQUEST['ga_end']; |
|
| 386 | - } else {
|
|
| 387 | - $ga_end = ''; |
|
| 388 | - } |
|
| 389 | - geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end); |
|
| 390 | - die; |
|
| 379 | + if (isset($_REQUEST['ga_start'])) {
|
|
| 380 | + $ga_start = $_REQUEST['ga_start']; |
|
| 381 | + } else {
|
|
| 382 | + $ga_start = ''; |
|
| 383 | + } |
|
| 384 | + if (isset($_REQUEST['ga_end'])) {
|
|
| 385 | + $ga_end = $_REQUEST['ga_end']; |
|
| 386 | + } else {
|
|
| 387 | + $ga_end = ''; |
|
| 388 | + } |
|
| 389 | + geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end); |
|
| 390 | + die; |
|
| 391 | 391 | } |
| 392 | 392 | add_action( 'wp_ajax_gdga', 'geodir_show_ga_stats' ); |
| 393 | 393 | add_action( 'wp_ajax_nopriv_gdga', 'geodir_show_ga_stats' ); |
| 394 | 394 | \ No newline at end of file |
@@ -17,14 +17,14 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | function geodir_post_type_setting_fun() |
| 19 | 19 | {
|
| 20 | - $post_type_arr = array(); |
|
| 20 | + $post_type_arr = array(); |
|
| 21 | 21 | |
| 22 | - $post_types = geodir_get_posttypes('object');
|
|
| 22 | + $post_types = geodir_get_posttypes('object');
|
|
| 23 | 23 | |
| 24 | - foreach ($post_types as $key => $post_types_obj) {
|
|
| 25 | - $post_type_arr[$key] = $post_types_obj->labels->singular_name; |
|
| 26 | - } |
|
| 27 | - return $post_type_arr; |
|
| 24 | + foreach ($post_types as $key => $post_types_obj) {
|
|
| 25 | + $post_type_arr[$key] = $post_types_obj->labels->singular_name; |
|
| 26 | + } |
|
| 27 | + return $post_type_arr; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -35,17 +35,17 @@ discard block |
||
| 35 | 35 | */ |
| 36 | 36 | function geodir_theme_location_setting_fun() |
| 37 | 37 | {
|
| 38 | - $post_type_arr = array(); |
|
| 39 | - $geodir_all_nav_locations = get_registered_nav_menus(); |
|
| 40 | - $geodir_active_nav_locations = get_nav_menu_locations(); |
|
| 41 | - if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) {
|
|
| 42 | - foreach ($geodir_active_nav_locations as $key => $theme_location) {
|
|
| 43 | - if (!empty($geodir_all_nav_locations) && is_array($geodir_all_nav_locations) && array_key_exists($key, $geodir_all_nav_locations)) |
|
| 44 | - $post_type_arr[$key] = $geodir_all_nav_locations[$key]; |
|
| 45 | - } |
|
| 46 | - } |
|
| 47 | - |
|
| 48 | - return $post_type_arr; |
|
| 38 | + $post_type_arr = array(); |
|
| 39 | + $geodir_all_nav_locations = get_registered_nav_menus(); |
|
| 40 | + $geodir_active_nav_locations = get_nav_menu_locations(); |
|
| 41 | + if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) {
|
|
| 42 | + foreach ($geodir_active_nav_locations as $key => $theme_location) {
|
|
| 43 | + if (!empty($geodir_all_nav_locations) && is_array($geodir_all_nav_locations) && array_key_exists($key, $geodir_all_nav_locations)) |
|
| 44 | + $post_type_arr[$key] = $geodir_all_nav_locations[$key]; |
|
| 45 | + } |
|
| 46 | + } |
|
| 47 | + |
|
| 48 | + return $post_type_arr; |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -56,536 +56,536 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | $geodir_settings['design_settings'] = apply_filters('geodir_design_settings', array(
|
| 58 | 58 | |
| 59 | - /* Home Layout Settings start */ |
|
| 60 | - array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '),
|
|
| 59 | + /* Home Layout Settings start */ |
|
| 60 | + array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '),
|
|
| 61 | 61 | |
| 62 | 62 | |
| 63 | - array('name' => __('Home Top Section Settings', 'geodirectory'),
|
|
| 64 | - 'type' => 'sectionstart', |
|
| 65 | - 'desc' => '', |
|
| 66 | - 'id' => 'geodir_home_top_section'), |
|
| 63 | + array('name' => __('Home Top Section Settings', 'geodirectory'),
|
|
| 64 | + 'type' => 'sectionstart', |
|
| 65 | + 'desc' => '', |
|
| 66 | + 'id' => 'geodir_home_top_section'), |
|
| 67 | 67 | |
| 68 | - array( |
|
| 69 | - 'name' => __('Home top section', 'geodirectory'),
|
|
| 70 | - 'desc' => __('Show the top section of home page', 'geodirectory'),
|
|
| 71 | - 'id' => 'geodir_show_home_top_section', |
|
| 72 | - 'type' => 'checkbox', |
|
| 73 | - 'std' => '1' // Default value to show home top section |
|
| 74 | - ), |
|
| 68 | + array( |
|
| 69 | + 'name' => __('Home top section', 'geodirectory'),
|
|
| 70 | + 'desc' => __('Show the top section of home page', 'geodirectory'),
|
|
| 71 | + 'id' => 'geodir_show_home_top_section', |
|
| 72 | + 'type' => 'checkbox', |
|
| 73 | + 'std' => '1' // Default value to show home top section |
|
| 74 | + ), |
|
| 75 | 75 | |
| 76 | 76 | |
| 77 | - array('type' => 'sectionend', 'id' => 'geodir_home_top_section'),
|
|
| 77 | + array('type' => 'sectionend', 'id' => 'geodir_home_top_section'),
|
|
| 78 | 78 | |
| 79 | 79 | |
| 80 | - array('name' => __('Home Page Layout Settings', 'geodirectory'),
|
|
| 81 | - 'type' => 'sectionstart', |
|
| 82 | - 'desc' => '', |
|
| 83 | - 'id' => 'geodir_home_layout'), |
|
| 80 | + array('name' => __('Home Page Layout Settings', 'geodirectory'),
|
|
| 81 | + 'type' => 'sectionstart', |
|
| 82 | + 'desc' => '', |
|
| 83 | + 'id' => 'geodir_home_layout'), |
|
| 84 | 84 | |
| 85 | - array( |
|
| 86 | - 'name' => __('Home right section', 'geodirectory'),
|
|
| 87 | - 'desc' => __('Show the right section of home page', 'geodirectory'),
|
|
| 88 | - 'id' => 'geodir_show_home_right_section', |
|
| 89 | - 'type' => 'checkbox', |
|
| 90 | - 'std' => '1' // Default value to show home top section |
|
| 91 | - ), |
|
| 85 | + array( |
|
| 86 | + 'name' => __('Home right section', 'geodirectory'),
|
|
| 87 | + 'desc' => __('Show the right section of home page', 'geodirectory'),
|
|
| 88 | + 'id' => 'geodir_show_home_right_section', |
|
| 89 | + 'type' => 'checkbox', |
|
| 90 | + 'std' => '1' // Default value to show home top section |
|
| 91 | + ), |
|
| 92 | 92 | |
| 93 | - array( |
|
| 94 | - 'name' => __('Width of home right section', 'geodirectory'),
|
|
| 95 | - 'desc' => __('Enter the width of right section of home page in %', 'geodirectory'),
|
|
| 96 | - 'id' => 'geodir_width_home_right_section', |
|
| 97 | - 'type' => 'text', |
|
| 98 | - 'css' => 'min-width:300px;', |
|
| 99 | - 'std' => '30' // Default value to show home top section |
|
| 100 | - ), |
|
| 93 | + array( |
|
| 94 | + 'name' => __('Width of home right section', 'geodirectory'),
|
|
| 95 | + 'desc' => __('Enter the width of right section of home page in %', 'geodirectory'),
|
|
| 96 | + 'id' => 'geodir_width_home_right_section', |
|
| 97 | + 'type' => 'text', |
|
| 98 | + 'css' => 'min-width:300px;', |
|
| 99 | + 'std' => '30' // Default value to show home top section |
|
| 100 | + ), |
|
| 101 | 101 | |
| 102 | - array( |
|
| 103 | - 'name' => __('Home content section', 'geodirectory'),
|
|
| 104 | - 'desc' => __('Show the content section of home page', 'geodirectory'),
|
|
| 105 | - 'id' => 'geodir_show_home_contant_section', |
|
| 106 | - 'type' => 'checkbox', |
|
| 107 | - 'std' => '1' // Default value to show home top section |
|
| 108 | - ), |
|
| 102 | + array( |
|
| 103 | + 'name' => __('Home content section', 'geodirectory'),
|
|
| 104 | + 'desc' => __('Show the content section of home page', 'geodirectory'),
|
|
| 105 | + 'id' => 'geodir_show_home_contant_section', |
|
| 106 | + 'type' => 'checkbox', |
|
| 107 | + 'std' => '1' // Default value to show home top section |
|
| 108 | + ), |
|
| 109 | 109 | |
| 110 | - array( |
|
| 111 | - 'name' => __('Width of home content section', 'geodirectory'),
|
|
| 112 | - 'desc' => __('Enter the width of content section of home page in %', 'geodirectory'),
|
|
| 113 | - 'id' => 'geodir_width_home_contant_section', |
|
| 114 | - 'type' => 'text', |
|
| 115 | - 'css' => 'min-width:300px;', |
|
| 116 | - 'std' => '63' // Default value to show home top section |
|
| 117 | - ), |
|
| 110 | + array( |
|
| 111 | + 'name' => __('Width of home content section', 'geodirectory'),
|
|
| 112 | + 'desc' => __('Enter the width of content section of home page in %', 'geodirectory'),
|
|
| 113 | + 'id' => 'geodir_width_home_contant_section', |
|
| 114 | + 'type' => 'text', |
|
| 115 | + 'css' => 'min-width:300px;', |
|
| 116 | + 'std' => '63' // Default value to show home top section |
|
| 117 | + ), |
|
| 118 | 118 | |
| 119 | - array( |
|
| 120 | - 'name' => __('Home left section', 'geodirectory'),
|
|
| 121 | - 'desc' => __('Show the left section of home page', 'geodirectory'),
|
|
| 122 | - 'id' => 'geodir_show_home_left_section', |
|
| 123 | - 'type' => 'checkbox', |
|
| 124 | - 'std' => '0' // Default value to show home top section |
|
| 125 | - ), |
|
| 119 | + array( |
|
| 120 | + 'name' => __('Home left section', 'geodirectory'),
|
|
| 121 | + 'desc' => __('Show the left section of home page', 'geodirectory'),
|
|
| 122 | + 'id' => 'geodir_show_home_left_section', |
|
| 123 | + 'type' => 'checkbox', |
|
| 124 | + 'std' => '0' // Default value to show home top section |
|
| 125 | + ), |
|
| 126 | 126 | |
| 127 | - array( |
|
| 128 | - 'name' => __('Width of home left section', 'geodirectory'),
|
|
| 129 | - 'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
|
|
| 130 | - 'id' => 'geodir_width_home_left_section', |
|
| 131 | - 'type' => 'text', |
|
| 132 | - 'css' => 'min-width:300px;', |
|
| 133 | - 'std' => '30' // Default value to show home top section |
|
| 134 | - ), |
|
| 127 | + array( |
|
| 128 | + 'name' => __('Width of home left section', 'geodirectory'),
|
|
| 129 | + 'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
|
|
| 130 | + 'id' => 'geodir_width_home_left_section', |
|
| 131 | + 'type' => 'text', |
|
| 132 | + 'css' => 'min-width:300px;', |
|
| 133 | + 'std' => '30' // Default value to show home top section |
|
| 134 | + ), |
|
| 135 | 135 | |
| 136 | - array( |
|
| 137 | - 'name' => __('Home bottom section', 'geodirectory'),
|
|
| 138 | - 'desc' => __('Show the bottom section of home page', 'geodirectory'),
|
|
| 139 | - 'id' => 'geodir_show_home_bottom_section', |
|
| 140 | - 'type' => 'checkbox', |
|
| 141 | - 'std' => '0' // Default value to show home top section |
|
| 142 | - ), |
|
| 143 | - array( |
|
| 144 | - 'name' => __('Resize image large size', 'geodirectory'),
|
|
| 145 | - 'desc' => sprintf(__('Use default wordpress media image large size ( %s ) for featured image upload. If unchecked then default geodirectory image large size ( 800x800 ) will be used.', 'geodirectory'), get_option('large_size_w') . 'x' . get_option('large_size_h')),
|
|
| 146 | - 'id' => 'geodir_use_wp_media_large_size', |
|
| 147 | - 'type' => 'checkbox', |
|
| 148 | - 'std' => '0' |
|
| 149 | - ), |
|
| 136 | + array( |
|
| 137 | + 'name' => __('Home bottom section', 'geodirectory'),
|
|
| 138 | + 'desc' => __('Show the bottom section of home page', 'geodirectory'),
|
|
| 139 | + 'id' => 'geodir_show_home_bottom_section', |
|
| 140 | + 'type' => 'checkbox', |
|
| 141 | + 'std' => '0' // Default value to show home top section |
|
| 142 | + ), |
|
| 143 | + array( |
|
| 144 | + 'name' => __('Resize image large size', 'geodirectory'),
|
|
| 145 | + 'desc' => sprintf(__('Use default wordpress media image large size ( %s ) for featured image upload. If unchecked then default geodirectory image large size ( 800x800 ) will be used.', 'geodirectory'), get_option('large_size_w') . 'x' . get_option('large_size_h')),
|
|
| 146 | + 'id' => 'geodir_use_wp_media_large_size', |
|
| 147 | + 'type' => 'checkbox', |
|
| 148 | + 'std' => '0' |
|
| 149 | + ), |
|
| 150 | 150 | |
| 151 | - array('type' => 'sectionend', 'id' => 'geodir_home_layout'),
|
|
| 151 | + array('type' => 'sectionend', 'id' => 'geodir_home_layout'),
|
|
| 152 | 152 | |
| 153 | 153 | |
| 154 | - /* Home Layout Settings end */ |
|
| 154 | + /* Home Layout Settings end */ |
|
| 155 | 155 | |
| 156 | 156 | |
| 157 | - /* Listing Layout Settings end */ |
|
| 157 | + /* Listing Layout Settings end */ |
|
| 158 | 158 | |
| 159 | - array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '),
|
|
| 159 | + array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '),
|
|
| 160 | 160 | |
| 161 | 161 | |
| 162 | - array('name' => __('Listing Page Layout Settings', 'geodirectory'),
|
|
| 163 | - 'type' => 'sectionstart', |
|
| 164 | - 'desc' => '', |
|
| 165 | - 'id' => 'geodir_listing_layout'), |
|
| 162 | + array('name' => __('Listing Page Layout Settings', 'geodirectory'),
|
|
| 163 | + 'type' => 'sectionstart', |
|
| 164 | + 'desc' => '', |
|
| 165 | + 'id' => 'geodir_listing_layout'), |
|
| 166 | 166 | |
| 167 | - array( |
|
| 168 | - 'name' => __('Listing top section', 'geodirectory'),
|
|
| 169 | - 'desc' => __('Show the top section of listing page', 'geodirectory'),
|
|
| 170 | - 'id' => 'geodir_show_listing_top_section', |
|
| 171 | - 'type' => 'checkbox', |
|
| 172 | - 'std' => '1' // Default value to show home top section |
|
| 173 | - ), |
|
| 167 | + array( |
|
| 168 | + 'name' => __('Listing top section', 'geodirectory'),
|
|
| 169 | + 'desc' => __('Show the top section of listing page', 'geodirectory'),
|
|
| 170 | + 'id' => 'geodir_show_listing_top_section', |
|
| 171 | + 'type' => 'checkbox', |
|
| 172 | + 'std' => '1' // Default value to show home top section |
|
| 173 | + ), |
|
| 174 | 174 | |
| 175 | - array( |
|
| 176 | - 'name' => __('Listing right section', 'geodirectory'),
|
|
| 177 | - 'desc' => __('Show the right section of listing page', 'geodirectory'),
|
|
| 178 | - 'id' => 'geodir_show_listing_right_section', |
|
| 179 | - 'type' => 'checkbox', |
|
| 180 | - 'std' => '1' // Default value to show home top section |
|
| 181 | - ), |
|
| 175 | + array( |
|
| 176 | + 'name' => __('Listing right section', 'geodirectory'),
|
|
| 177 | + 'desc' => __('Show the right section of listing page', 'geodirectory'),
|
|
| 178 | + 'id' => 'geodir_show_listing_right_section', |
|
| 179 | + 'type' => 'checkbox', |
|
| 180 | + 'std' => '1' // Default value to show home top section |
|
| 181 | + ), |
|
| 182 | 182 | |
| 183 | - array( |
|
| 184 | - 'name' => __('Width of listing right section', 'geodirectory'),
|
|
| 185 | - 'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'),
|
|
| 186 | - 'id' => 'geodir_width_listing_right_section', |
|
| 187 | - 'type' => 'text', |
|
| 188 | - 'css' => 'min-width:300px;', |
|
| 189 | - 'std' => '30' // Default value to show home top section |
|
| 190 | - ), |
|
| 183 | + array( |
|
| 184 | + 'name' => __('Width of listing right section', 'geodirectory'),
|
|
| 185 | + 'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'),
|
|
| 186 | + 'id' => 'geodir_width_listing_right_section', |
|
| 187 | + 'type' => 'text', |
|
| 188 | + 'css' => 'min-width:300px;', |
|
| 189 | + 'std' => '30' // Default value to show home top section |
|
| 190 | + ), |
|
| 191 | 191 | |
| 192 | 192 | |
| 193 | - array( |
|
| 194 | - 'name' => __('Listing content section view', 'geodirectory'),
|
|
| 195 | - 'desc' => __('Set the listing view of listing page', 'geodirectory'),
|
|
| 196 | - 'id' => 'geodir_listing_view', |
|
| 197 | - 'css' => 'min-width:300px;', |
|
| 198 | - 'std' => 'gridview_onehalf', |
|
| 199 | - 'type' => 'select', |
|
| 200 | - 'class' => 'chosen_select', |
|
| 201 | - 'options' => array_unique(array( |
|
| 202 | - 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
|
|
| 203 | - 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
|
|
| 204 | - 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
|
|
| 205 | - 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
|
|
| 206 | - 'listview' => __('List view', 'geodirectory'),
|
|
| 207 | - )) |
|
| 208 | - ), |
|
| 193 | + array( |
|
| 194 | + 'name' => __('Listing content section view', 'geodirectory'),
|
|
| 195 | + 'desc' => __('Set the listing view of listing page', 'geodirectory'),
|
|
| 196 | + 'id' => 'geodir_listing_view', |
|
| 197 | + 'css' => 'min-width:300px;', |
|
| 198 | + 'std' => 'gridview_onehalf', |
|
| 199 | + 'type' => 'select', |
|
| 200 | + 'class' => 'chosen_select', |
|
| 201 | + 'options' => array_unique(array( |
|
| 202 | + 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
|
|
| 203 | + 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
|
|
| 204 | + 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
|
|
| 205 | + 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
|
|
| 206 | + 'listview' => __('List view', 'geodirectory'),
|
|
| 207 | + )) |
|
| 208 | + ), |
|
| 209 | 209 | |
| 210 | - array( |
|
| 211 | - 'name' => __('Width of listing content section', 'geodirectory'),
|
|
| 212 | - 'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'),
|
|
| 213 | - 'id' => 'geodir_width_listing_contant_section', |
|
| 214 | - 'type' => 'text', |
|
| 215 | - 'css' => 'min-width:300px;', |
|
| 216 | - 'std' => '63' // Default value to show home top section |
|
| 217 | - ), |
|
| 210 | + array( |
|
| 211 | + 'name' => __('Width of listing content section', 'geodirectory'),
|
|
| 212 | + 'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'),
|
|
| 213 | + 'id' => 'geodir_width_listing_contant_section', |
|
| 214 | + 'type' => 'text', |
|
| 215 | + 'css' => 'min-width:300px;', |
|
| 216 | + 'std' => '63' // Default value to show home top section |
|
| 217 | + ), |
|
| 218 | 218 | |
| 219 | - array( |
|
| 220 | - 'name' => __('Listing left section', 'geodirectory'),
|
|
| 221 | - 'desc' => __('Show the left section of listing page', 'geodirectory'),
|
|
| 222 | - 'id' => 'geodir_show_listing_left_section', |
|
| 223 | - 'type' => 'checkbox', |
|
| 224 | - 'std' => '0' // Default value to show home top section |
|
| 225 | - ), |
|
| 219 | + array( |
|
| 220 | + 'name' => __('Listing left section', 'geodirectory'),
|
|
| 221 | + 'desc' => __('Show the left section of listing page', 'geodirectory'),
|
|
| 222 | + 'id' => 'geodir_show_listing_left_section', |
|
| 223 | + 'type' => 'checkbox', |
|
| 224 | + 'std' => '0' // Default value to show home top section |
|
| 225 | + ), |
|
| 226 | 226 | |
| 227 | - array( |
|
| 228 | - 'name' => __('Width of listing left section', 'geodirectory'),
|
|
| 229 | - 'desc' => __('Enter the width of left section of listing in %', 'geodirectory'),
|
|
| 230 | - 'id' => 'geodir_width_listing_left_section', |
|
| 231 | - 'type' => 'text', |
|
| 232 | - 'css' => 'min-width:300px;', |
|
| 233 | - 'std' => '30' // Default value to show home top section |
|
| 234 | - ), |
|
| 227 | + array( |
|
| 228 | + 'name' => __('Width of listing left section', 'geodirectory'),
|
|
| 229 | + 'desc' => __('Enter the width of left section of listing in %', 'geodirectory'),
|
|
| 230 | + 'id' => 'geodir_width_listing_left_section', |
|
| 231 | + 'type' => 'text', |
|
| 232 | + 'css' => 'min-width:300px;', |
|
| 233 | + 'std' => '30' // Default value to show home top section |
|
| 234 | + ), |
|
| 235 | 235 | |
| 236 | - array( |
|
| 237 | - 'name' => __('Listing bottom section', 'geodirectory'),
|
|
| 238 | - 'desc' => __('Show the bottom section of listing page', 'geodirectory'),
|
|
| 239 | - 'id' => 'geodir_show_listing_bottom_section', |
|
| 240 | - 'type' => 'checkbox', |
|
| 241 | - 'std' => '0' // Default value to show home top section |
|
| 242 | - ), |
|
| 236 | + array( |
|
| 237 | + 'name' => __('Listing bottom section', 'geodirectory'),
|
|
| 238 | + 'desc' => __('Show the bottom section of listing page', 'geodirectory'),
|
|
| 239 | + 'id' => 'geodir_show_listing_bottom_section', |
|
| 240 | + 'type' => 'checkbox', |
|
| 241 | + 'std' => '0' // Default value to show home top section |
|
| 242 | + ), |
|
| 243 | 243 | |
| 244 | - array( |
|
| 245 | - 'name' => __('Upload listing no image', 'geodirectory'),
|
|
| 246 | - 'desc' => '', |
|
| 247 | - 'id' => 'geodir_listing_no_img', |
|
| 248 | - 'type' => 'file', |
|
| 249 | - 'std' => '0' // Default value to show home top section |
|
| 250 | - ), |
|
| 244 | + array( |
|
| 245 | + 'name' => __('Upload listing no image', 'geodirectory'),
|
|
| 246 | + 'desc' => '', |
|
| 247 | + 'id' => 'geodir_listing_no_img', |
|
| 248 | + 'type' => 'file', |
|
| 249 | + 'std' => '0' // Default value to show home top section |
|
| 250 | + ), |
|
| 251 | 251 | |
| 252 | - array( |
|
| 253 | - 'name' => __('Description word limit', 'geodirectory'),
|
|
| 254 | - 'desc' => '', |
|
| 255 | - 'id' => 'geodir_desc_word_limit', |
|
| 256 | - 'type' => 'text', |
|
| 257 | - 'css' => 'min-width:300px;', |
|
| 258 | - 'std' => '50' // Default value to show home top section |
|
| 259 | - ), |
|
| 252 | + array( |
|
| 253 | + 'name' => __('Description word limit', 'geodirectory'),
|
|
| 254 | + 'desc' => '', |
|
| 255 | + 'id' => 'geodir_desc_word_limit', |
|
| 256 | + 'type' => 'text', |
|
| 257 | + 'css' => 'min-width:300px;', |
|
| 258 | + 'std' => '50' // Default value to show home top section |
|
| 259 | + ), |
|
| 260 | 260 | |
| 261 | - array( |
|
| 262 | - 'name' => __('Hover listing map animation', 'geodirectory'),
|
|
| 263 | - 'desc' => __('Bounce map pin if listing hovered', 'geodirectory'),
|
|
| 264 | - 'id' => 'geodir_listing_hover_bounce_map_pin', |
|
| 265 | - 'type' => 'checkbox', |
|
| 266 | - 'std' => '1' // Default value to show home top section |
|
| 267 | - ), |
|
| 261 | + array( |
|
| 262 | + 'name' => __('Hover listing map animation', 'geodirectory'),
|
|
| 263 | + 'desc' => __('Bounce map pin if listing hovered', 'geodirectory'),
|
|
| 264 | + 'id' => 'geodir_listing_hover_bounce_map_pin', |
|
| 265 | + 'type' => 'checkbox', |
|
| 266 | + 'std' => '1' // Default value to show home top section |
|
| 267 | + ), |
|
| 268 | 268 | |
| 269 | - array('type' => 'sectionend', 'id' => 'geodir_listing_layout'),
|
|
| 269 | + array('type' => 'sectionend', 'id' => 'geodir_listing_layout'),
|
|
| 270 | 270 | |
| 271 | 271 | |
| 272 | - array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '),
|
|
| 272 | + array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '),
|
|
| 273 | 273 | |
| 274 | - array( |
|
| 275 | - 'name' => __('New listing default status', 'geodirectory'),
|
|
| 276 | - 'desc' => __('Select new listing default status.', 'geodirectory'),
|
|
| 277 | - 'tip' => '', |
|
| 278 | - 'id' => 'geodir_new_post_default_status', |
|
| 279 | - 'css' => 'min-width:300px;', |
|
| 280 | - 'std' => 'publish', |
|
| 281 | - 'type' => 'select', |
|
| 282 | - 'class' => 'chosen_select', |
|
| 283 | - 'options' => array_unique(array( |
|
| 284 | - 'publish' => __('publish', 'geodirectory'),
|
|
| 285 | - 'draft' => __('draft', 'geodirectory'),
|
|
| 286 | - )) |
|
| 287 | - ), |
|
| 274 | + array( |
|
| 275 | + 'name' => __('New listing default status', 'geodirectory'),
|
|
| 276 | + 'desc' => __('Select new listing default status.', 'geodirectory'),
|
|
| 277 | + 'tip' => '', |
|
| 278 | + 'id' => 'geodir_new_post_default_status', |
|
| 279 | + 'css' => 'min-width:300px;', |
|
| 280 | + 'std' => 'publish', |
|
| 281 | + 'type' => 'select', |
|
| 282 | + 'class' => 'chosen_select', |
|
| 283 | + 'options' => array_unique(array( |
|
| 284 | + 'publish' => __('publish', 'geodirectory'),
|
|
| 285 | + 'draft' => __('draft', 'geodirectory'),
|
|
| 286 | + )) |
|
| 287 | + ), |
|
| 288 | 288 | |
| 289 | - array( |
|
| 290 | - 'name' => __('New listings settings', 'geodirectory'),
|
|
| 291 | - 'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'),
|
|
| 292 | - 'id' => 'geodir_listing_new_days', |
|
| 293 | - 'type' => 'text', |
|
| 294 | - 'css' => 'min-width:300px;', |
|
| 295 | - 'std' => '30' // Default value for the page title - changed in settings |
|
| 296 | - ), |
|
| 289 | + array( |
|
| 290 | + 'name' => __('New listings settings', 'geodirectory'),
|
|
| 291 | + 'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'),
|
|
| 292 | + 'id' => 'geodir_listing_new_days', |
|
| 293 | + 'type' => 'text', |
|
| 294 | + 'css' => 'min-width:300px;', |
|
| 295 | + 'std' => '30' // Default value for the page title - changed in settings |
|
| 296 | + ), |
|
| 297 | 297 | |
| 298 | - array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'),
|
|
| 298 | + array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'),
|
|
| 299 | 299 | |
| 300 | 300 | |
| 301 | - array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'),
|
|
| 301 | + array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'),
|
|
| 302 | 302 | |
| 303 | - array( |
|
| 304 | - 'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'),
|
|
| 305 | - 'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'),
|
|
| 306 | - 'id' => 'geodir_accept_term_condition', |
|
| 307 | - 'type' => 'checkbox', |
|
| 308 | - 'std' => '1' // Default value to show home top section |
|
| 309 | - ), |
|
| 303 | + array( |
|
| 304 | + 'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'),
|
|
| 305 | + 'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'),
|
|
| 306 | + 'id' => 'geodir_accept_term_condition', |
|
| 307 | + 'type' => 'checkbox', |
|
| 308 | + 'std' => '1' // Default value to show home top section |
|
| 309 | + ), |
|
| 310 | 310 | |
| 311 | 311 | |
| 312 | - array( |
|
| 313 | - 'name' => __('Show description field as editor', 'geodirectory'),
|
|
| 314 | - 'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'),
|
|
| 315 | - 'tip' => '', |
|
| 316 | - 'id' => 'geodir_tiny_editor_on_add_listing', |
|
| 317 | - 'css' => 'min-width:300px;', |
|
| 318 | - 'std' => array(), |
|
| 319 | - 'type' => 'multiselect', |
|
| 320 | - 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 321 | - 'class' => 'chosen_select', |
|
| 322 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 323 | - ), |
|
| 312 | + array( |
|
| 313 | + 'name' => __('Show description field as editor', 'geodirectory'),
|
|
| 314 | + 'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'),
|
|
| 315 | + 'tip' => '', |
|
| 316 | + 'id' => 'geodir_tiny_editor_on_add_listing', |
|
| 317 | + 'css' => 'min-width:300px;', |
|
| 318 | + 'std' => array(), |
|
| 319 | + 'type' => 'multiselect', |
|
| 320 | + 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 321 | + 'class' => 'chosen_select', |
|
| 322 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 323 | + ), |
|
| 324 | 324 | |
| 325 | - array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'),
|
|
| 326 | - /* Listing Layout Settings end */ |
|
| 325 | + array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'),
|
|
| 326 | + /* Listing Layout Settings end */ |
|
| 327 | 327 | |
| 328 | 328 | |
| 329 | - /* Search Layout Settings end */ |
|
| 329 | + /* Search Layout Settings end */ |
|
| 330 | 330 | |
| 331 | - array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '),
|
|
| 331 | + array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '),
|
|
| 332 | 332 | |
| 333 | 333 | |
| 334 | - array('name' => __('Search Page Layout Settings', 'geodirectory'),
|
|
| 335 | - 'type' => 'sectionstart', |
|
| 336 | - 'desc' => '', |
|
| 337 | - 'id' => 'geodir_search_layout'), |
|
| 334 | + array('name' => __('Search Page Layout Settings', 'geodirectory'),
|
|
| 335 | + 'type' => 'sectionstart', |
|
| 336 | + 'desc' => '', |
|
| 337 | + 'id' => 'geodir_search_layout'), |
|
| 338 | 338 | |
| 339 | - array( |
|
| 340 | - 'name' => __('Search top section', 'geodirectory'),
|
|
| 341 | - 'desc' => __('Show the top section of search page', 'geodirectory'),
|
|
| 342 | - 'id' => 'geodir_show_search_top_section', |
|
| 343 | - 'type' => 'checkbox', |
|
| 344 | - 'std' => '1' // Default value to show home top section |
|
| 345 | - ), |
|
| 339 | + array( |
|
| 340 | + 'name' => __('Search top section', 'geodirectory'),
|
|
| 341 | + 'desc' => __('Show the top section of search page', 'geodirectory'),
|
|
| 342 | + 'id' => 'geodir_show_search_top_section', |
|
| 343 | + 'type' => 'checkbox', |
|
| 344 | + 'std' => '1' // Default value to show home top section |
|
| 345 | + ), |
|
| 346 | 346 | |
| 347 | - array( |
|
| 348 | - 'name' => __('Search right section', 'geodirectory'),
|
|
| 349 | - 'desc' => __('Show the right section of search page', 'geodirectory'),
|
|
| 350 | - 'id' => 'geodir_show_search_right_section', |
|
| 351 | - 'type' => 'checkbox', |
|
| 352 | - 'std' => '1' // Default value to show home top section |
|
| 353 | - ), |
|
| 347 | + array( |
|
| 348 | + 'name' => __('Search right section', 'geodirectory'),
|
|
| 349 | + 'desc' => __('Show the right section of search page', 'geodirectory'),
|
|
| 350 | + 'id' => 'geodir_show_search_right_section', |
|
| 351 | + 'type' => 'checkbox', |
|
| 352 | + 'std' => '1' // Default value to show home top section |
|
| 353 | + ), |
|
| 354 | 354 | |
| 355 | - array( |
|
| 356 | - 'name' => __('Width of search right section', 'geodirectory'),
|
|
| 357 | - 'desc' => __('Enter the width of right section of search page in %', 'geodirectory'),
|
|
| 358 | - 'id' => 'geodir_width_search_right_section', |
|
| 359 | - 'type' => 'text', |
|
| 360 | - 'css' => 'min-width:300px;', |
|
| 361 | - 'std' => '30' // Default value to show home top section |
|
| 362 | - ), |
|
| 355 | + array( |
|
| 356 | + 'name' => __('Width of search right section', 'geodirectory'),
|
|
| 357 | + 'desc' => __('Enter the width of right section of search page in %', 'geodirectory'),
|
|
| 358 | + 'id' => 'geodir_width_search_right_section', |
|
| 359 | + 'type' => 'text', |
|
| 360 | + 'css' => 'min-width:300px;', |
|
| 361 | + 'std' => '30' // Default value to show home top section |
|
| 362 | + ), |
|
| 363 | 363 | |
| 364 | 364 | |
| 365 | - array( |
|
| 366 | - 'name' => __('Search content section view', 'geodirectory'),
|
|
| 367 | - 'desc' => __('Set the listing view of search page', 'geodirectory'),
|
|
| 368 | - 'id' => 'geodir_search_view', |
|
| 369 | - 'css' => 'min-width:300px;', |
|
| 370 | - 'std' => 'gridview_onehalf', |
|
| 371 | - 'type' => 'select', |
|
| 372 | - 'class' => 'chosen_select', |
|
| 373 | - 'options' => array_unique(array( |
|
| 374 | - 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
|
|
| 375 | - 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
|
|
| 376 | - 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
|
|
| 377 | - 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
|
|
| 378 | - 'listview' => __('List view', 'geodirectory'),
|
|
| 379 | - )) |
|
| 380 | - ), |
|
| 365 | + array( |
|
| 366 | + 'name' => __('Search content section view', 'geodirectory'),
|
|
| 367 | + 'desc' => __('Set the listing view of search page', 'geodirectory'),
|
|
| 368 | + 'id' => 'geodir_search_view', |
|
| 369 | + 'css' => 'min-width:300px;', |
|
| 370 | + 'std' => 'gridview_onehalf', |
|
| 371 | + 'type' => 'select', |
|
| 372 | + 'class' => 'chosen_select', |
|
| 373 | + 'options' => array_unique(array( |
|
| 374 | + 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
|
|
| 375 | + 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
|
|
| 376 | + 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
|
|
| 377 | + 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
|
|
| 378 | + 'listview' => __('List view', 'geodirectory'),
|
|
| 379 | + )) |
|
| 380 | + ), |
|
| 381 | 381 | |
| 382 | - array( |
|
| 383 | - 'name' => __('Width of search content section', 'geodirectory'),
|
|
| 384 | - 'desc' => __('Enter the width of content section of search page in %', 'geodirectory'),
|
|
| 385 | - 'id' => 'geodir_width_search_contant_section', |
|
| 386 | - 'type' => 'text', |
|
| 387 | - 'css' => 'min-width:300px;', |
|
| 388 | - 'std' => '63' // Default value to show home top section |
|
| 389 | - ), |
|
| 382 | + array( |
|
| 383 | + 'name' => __('Width of search content section', 'geodirectory'),
|
|
| 384 | + 'desc' => __('Enter the width of content section of search page in %', 'geodirectory'),
|
|
| 385 | + 'id' => 'geodir_width_search_contant_section', |
|
| 386 | + 'type' => 'text', |
|
| 387 | + 'css' => 'min-width:300px;', |
|
| 388 | + 'std' => '63' // Default value to show home top section |
|
| 389 | + ), |
|
| 390 | 390 | |
| 391 | - array( |
|
| 392 | - 'name' => __('Search left section', 'geodirectory'),
|
|
| 393 | - 'desc' => __('Show the left section of search page', 'geodirectory'),
|
|
| 394 | - 'id' => 'geodir_show_search_left_section', |
|
| 395 | - 'type' => 'checkbox', |
|
| 396 | - 'std' => '0' // Default value to show home top section |
|
| 397 | - ), |
|
| 391 | + array( |
|
| 392 | + 'name' => __('Search left section', 'geodirectory'),
|
|
| 393 | + 'desc' => __('Show the left section of search page', 'geodirectory'),
|
|
| 394 | + 'id' => 'geodir_show_search_left_section', |
|
| 395 | + 'type' => 'checkbox', |
|
| 396 | + 'std' => '0' // Default value to show home top section |
|
| 397 | + ), |
|
| 398 | 398 | |
| 399 | - array( |
|
| 400 | - 'name' => __('Width of search left section', 'geodirectory'),
|
|
| 401 | - 'desc' => __('Enter the width of left section of search in %', 'geodirectory'),
|
|
| 402 | - 'id' => 'geodir_width_search_left_section', |
|
| 403 | - 'type' => 'text', |
|
| 404 | - 'css' => 'min-width:300px;', |
|
| 405 | - 'std' => '30' // Default value to show home top section |
|
| 406 | - ), |
|
| 399 | + array( |
|
| 400 | + 'name' => __('Width of search left section', 'geodirectory'),
|
|
| 401 | + 'desc' => __('Enter the width of left section of search in %', 'geodirectory'),
|
|
| 402 | + 'id' => 'geodir_width_search_left_section', |
|
| 403 | + 'type' => 'text', |
|
| 404 | + 'css' => 'min-width:300px;', |
|
| 405 | + 'std' => '30' // Default value to show home top section |
|
| 406 | + ), |
|
| 407 | 407 | |
| 408 | - array( |
|
| 409 | - 'name' => __('Search bottom section', 'geodirectory'),
|
|
| 410 | - 'desc' => __('Show the bottom section of search page', 'geodirectory'),
|
|
| 411 | - 'id' => 'geodir_show_search_bottom_section', |
|
| 412 | - 'type' => 'checkbox', |
|
| 413 | - 'std' => '0' // Default value to show home top section |
|
| 414 | - ), |
|
| 408 | + array( |
|
| 409 | + 'name' => __('Search bottom section', 'geodirectory'),
|
|
| 410 | + 'desc' => __('Show the bottom section of search page', 'geodirectory'),
|
|
| 411 | + 'id' => 'geodir_show_search_bottom_section', |
|
| 412 | + 'type' => 'checkbox', |
|
| 413 | + 'std' => '0' // Default value to show home top section |
|
| 414 | + ), |
|
| 415 | 415 | |
| 416 | 416 | array( |
| 417 | - 'name' => __('Show advanced pagination details', 'geodirectory'),
|
|
| 418 | - 'desc' => __('This will add extra pagination info like "Showing listings x-y of z" after/before pagination.', 'geodirectory'),
|
|
| 419 | - 'id' => 'geodir_pagination_advance_info', |
|
| 420 | - 'css' => 'min-width:300px;', |
|
| 421 | - 'std' => '', |
|
| 422 | - 'type' => 'select', |
|
| 423 | - 'class' => 'chosen_select', |
|
| 424 | - 'options' => array( |
|
| 417 | + 'name' => __('Show advanced pagination details', 'geodirectory'),
|
|
| 418 | + 'desc' => __('This will add extra pagination info like "Showing listings x-y of z" after/before pagination.', 'geodirectory'),
|
|
| 419 | + 'id' => 'geodir_pagination_advance_info', |
|
| 420 | + 'css' => 'min-width:300px;', |
|
| 421 | + 'std' => '', |
|
| 422 | + 'type' => 'select', |
|
| 423 | + 'class' => 'chosen_select', |
|
| 424 | + 'options' => array( |
|
| 425 | 425 | '' => __('Never Display', 'geodirectory'),
|
| 426 | 426 | 'after' => __('After Pagination', 'geodirectory'),
|
| 427 | 427 | 'before' => __('Before Pagination', 'geodirectory')
|
| 428 | 428 | ) |
| 429 | - ), |
|
| 429 | + ), |
|
| 430 | 430 | |
| 431 | - array('type' => 'sectionend', 'id' => 'geodir_search_layout'),
|
|
| 431 | + array('type' => 'sectionend', 'id' => 'geodir_search_layout'),
|
|
| 432 | 432 | |
| 433 | 433 | |
| 434 | - array('name' => __('Search form settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'),
|
|
| 434 | + array('name' => __('Search form settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'),
|
|
| 435 | 435 | |
| 436 | - array( |
|
| 437 | - 'name' => __('Use old non-styled form', 'geodirectory'),
|
|
| 438 | - 'desc' => __('Will show the old type form (not recommended unless you had added your own styles)', 'geodirectory'),
|
|
| 439 | - 'id' => 'geodir_show_search_old_search_from', |
|
| 440 | - 'type' => 'checkbox', |
|
| 441 | - 'std' => '0' // Default value to show |
|
| 442 | - ), |
|
| 436 | + array( |
|
| 437 | + 'name' => __('Use old non-styled form', 'geodirectory'),
|
|
| 438 | + 'desc' => __('Will show the old type form (not recommended unless you had added your own styles)', 'geodirectory'),
|
|
| 439 | + 'id' => 'geodir_show_search_old_search_from', |
|
| 440 | + 'type' => 'checkbox', |
|
| 441 | + 'std' => '0' // Default value to show |
|
| 442 | + ), |
|
| 443 | 443 | |
| 444 | - array( |
|
| 445 | - 'name' => __('Search field default value', 'geodirectory'),
|
|
| 446 | - 'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'),
|
|
| 447 | - 'id' => 'geodir_search_field_default_text', |
|
| 448 | - 'type' => 'text', |
|
| 449 | - 'css' => 'min-width:300px;', |
|
| 450 | - 'std' => 'Search for' // show on the listing page. |
|
| 451 | - ), |
|
| 444 | + array( |
|
| 445 | + 'name' => __('Search field default value', 'geodirectory'),
|
|
| 446 | + 'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'),
|
|
| 447 | + 'id' => 'geodir_search_field_default_text', |
|
| 448 | + 'type' => 'text', |
|
| 449 | + 'css' => 'min-width:300px;', |
|
| 450 | + 'std' => 'Search for' // show on the listing page. |
|
| 451 | + ), |
|
| 452 | 452 | |
| 453 | - array( |
|
| 454 | - 'name' => __('Near field default value', 'geodirectory'),
|
|
| 455 | - 'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'),
|
|
| 456 | - 'id' => 'geodir_near_field_default_text', |
|
| 457 | - 'type' => 'text', |
|
| 458 | - 'css' => 'min-width:300px;', |
|
| 459 | - 'std' => 'Near' // show on the listing page. |
|
| 460 | - ), |
|
| 453 | + array( |
|
| 454 | + 'name' => __('Near field default value', 'geodirectory'),
|
|
| 455 | + 'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'),
|
|
| 456 | + 'id' => 'geodir_near_field_default_text', |
|
| 457 | + 'type' => 'text', |
|
| 458 | + 'css' => 'min-width:300px;', |
|
| 459 | + 'std' => 'Near' // show on the listing page. |
|
| 460 | + ), |
|
| 461 | 461 | |
| 462 | - array( |
|
| 463 | - 'name' => __('Search button label', 'geodirectory'),
|
|
| 464 | - 'desc' => __('Show the search button label on search form.', 'geodirectory'),
|
|
| 465 | - 'id' => 'geodir_search_button_label', |
|
| 466 | - 'type' => 'text', |
|
| 467 | - 'css' => 'min-width:300px;', |
|
| 468 | - 'std' => 'Search' // show on the listing page. |
|
| 469 | - ), |
|
| 462 | + array( |
|
| 463 | + 'name' => __('Search button label', 'geodirectory'),
|
|
| 464 | + 'desc' => __('Show the search button label on search form.', 'geodirectory'),
|
|
| 465 | + 'id' => 'geodir_search_button_label', |
|
| 466 | + 'type' => 'text', |
|
| 467 | + 'css' => 'min-width:300px;', |
|
| 468 | + 'std' => 'Search' // show on the listing page. |
|
| 469 | + ), |
|
| 470 | 470 | |
| 471 | - array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'),
|
|
| 471 | + array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'),
|
|
| 472 | 472 | |
| 473 | - /* Listing Layout Settings end */ |
|
| 473 | + /* Listing Layout Settings end */ |
|
| 474 | 474 | |
| 475 | 475 | |
| 476 | - /* Detail Layout Settings end */ |
|
| 476 | + /* Detail Layout Settings end */ |
|
| 477 | 477 | |
| 478 | - array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '),
|
|
| 478 | + array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '),
|
|
| 479 | 479 | |
| 480 | - array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '),
|
|
| 480 | + array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '),
|
|
| 481 | 481 | |
| 482 | - array( |
|
| 483 | - 'name' => __('Detail top section', 'geodirectory'),
|
|
| 484 | - 'desc' => __('Show the top section of listing page', 'geodirectory'),
|
|
| 485 | - 'id' => 'geodir_show_detail_top_section', |
|
| 486 | - 'type' => 'checkbox', |
|
| 487 | - 'std' => '1' // Default value to show home top section |
|
| 488 | - ), |
|
| 482 | + array( |
|
| 483 | + 'name' => __('Detail top section', 'geodirectory'),
|
|
| 484 | + 'desc' => __('Show the top section of listing page', 'geodirectory'),
|
|
| 485 | + 'id' => 'geodir_show_detail_top_section', |
|
| 486 | + 'type' => 'checkbox', |
|
| 487 | + 'std' => '1' // Default value to show home top section |
|
| 488 | + ), |
|
| 489 | 489 | |
| 490 | - array( |
|
| 491 | - 'name' => __('Detail bottom section', 'geodirectory'),
|
|
| 492 | - 'desc' => __('Show the bottom section of listing page', 'geodirectory'),
|
|
| 493 | - 'id' => 'geodir_show_detail_bottom_section', |
|
| 494 | - 'type' => 'checkbox', |
|
| 495 | - 'std' => '1' // Default value to show home top section |
|
| 496 | - ), |
|
| 497 | - array( |
|
| 498 | - 'name' => __('Detail sidebar section on left side', 'geodirectory'),
|
|
| 499 | - 'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'),
|
|
| 500 | - 'id' => 'geodir_detail_sidebar_left_section', |
|
| 501 | - 'type' => 'checkbox', |
|
| 502 | - 'std' => '0' |
|
| 503 | - ), |
|
| 504 | - array( |
|
| 505 | - 'name' => __('Disable GD modal', 'geodirectory'),
|
|
| 506 | - 'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'),
|
|
| 507 | - 'id' => 'geodir_disable_gb_modal', |
|
| 508 | - 'type' => 'checkbox', |
|
| 509 | - 'std' => '0' |
|
| 510 | - ), |
|
| 511 | - array( |
|
| 512 | - 'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'),
|
|
| 513 | - 'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'),
|
|
| 514 | - 'id' => 'geodir_disable_tfg_buttons_section', |
|
| 515 | - 'type' => 'checkbox', |
|
| 516 | - 'std' => '0' |
|
| 517 | - ), |
|
| 518 | - array( |
|
| 519 | - 'name' => __('Disable Google Analytics section', 'geodirectory'),
|
|
| 520 | - 'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'),
|
|
| 521 | - 'id' => 'geodir_disable_google_analytics_section', |
|
| 522 | - 'type' => 'checkbox', |
|
| 523 | - 'std' => '0' |
|
| 524 | - ), |
|
| 525 | - array( |
|
| 526 | - 'name' => __('Disable User Links section', 'geodirectory'),
|
|
| 527 | - 'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'),
|
|
| 528 | - 'id' => 'geodir_disable_user_links_section', |
|
| 529 | - 'type' => 'checkbox', |
|
| 530 | - 'std' => '0' |
|
| 531 | - ), |
|
| 532 | - array( |
|
| 533 | - 'name' => __('Disable Rating Info section', 'geodirectory'),
|
|
| 534 | - 'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'),
|
|
| 535 | - 'id' => 'geodir_disable_rating_info_section', |
|
| 536 | - 'type' => 'checkbox', |
|
| 537 | - 'std' => '0' |
|
| 538 | - ), |
|
| 539 | - array( |
|
| 540 | - 'name' => __('Disable Listing Info section', 'geodirectory'),
|
|
| 541 | - 'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'),
|
|
| 542 | - 'id' => 'geodir_disable_listing_info_section', |
|
| 543 | - 'type' => 'checkbox', |
|
| 544 | - 'std' => '0' |
|
| 545 | - ), |
|
| 490 | + array( |
|
| 491 | + 'name' => __('Detail bottom section', 'geodirectory'),
|
|
| 492 | + 'desc' => __('Show the bottom section of listing page', 'geodirectory'),
|
|
| 493 | + 'id' => 'geodir_show_detail_bottom_section', |
|
| 494 | + 'type' => 'checkbox', |
|
| 495 | + 'std' => '1' // Default value to show home top section |
|
| 496 | + ), |
|
| 497 | + array( |
|
| 498 | + 'name' => __('Detail sidebar section on left side', 'geodirectory'),
|
|
| 499 | + 'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'),
|
|
| 500 | + 'id' => 'geodir_detail_sidebar_left_section', |
|
| 501 | + 'type' => 'checkbox', |
|
| 502 | + 'std' => '0' |
|
| 503 | + ), |
|
| 504 | + array( |
|
| 505 | + 'name' => __('Disable GD modal', 'geodirectory'),
|
|
| 506 | + 'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'),
|
|
| 507 | + 'id' => 'geodir_disable_gb_modal', |
|
| 508 | + 'type' => 'checkbox', |
|
| 509 | + 'std' => '0' |
|
| 510 | + ), |
|
| 511 | + array( |
|
| 512 | + 'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'),
|
|
| 513 | + 'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'),
|
|
| 514 | + 'id' => 'geodir_disable_tfg_buttons_section', |
|
| 515 | + 'type' => 'checkbox', |
|
| 516 | + 'std' => '0' |
|
| 517 | + ), |
|
| 518 | + array( |
|
| 519 | + 'name' => __('Disable Google Analytics section', 'geodirectory'),
|
|
| 520 | + 'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'),
|
|
| 521 | + 'id' => 'geodir_disable_google_analytics_section', |
|
| 522 | + 'type' => 'checkbox', |
|
| 523 | + 'std' => '0' |
|
| 524 | + ), |
|
| 525 | + array( |
|
| 526 | + 'name' => __('Disable User Links section', 'geodirectory'),
|
|
| 527 | + 'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'),
|
|
| 528 | + 'id' => 'geodir_disable_user_links_section', |
|
| 529 | + 'type' => 'checkbox', |
|
| 530 | + 'std' => '0' |
|
| 531 | + ), |
|
| 532 | + array( |
|
| 533 | + 'name' => __('Disable Rating Info section', 'geodirectory'),
|
|
| 534 | + 'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'),
|
|
| 535 | + 'id' => 'geodir_disable_rating_info_section', |
|
| 536 | + 'type' => 'checkbox', |
|
| 537 | + 'std' => '0' |
|
| 538 | + ), |
|
| 539 | + array( |
|
| 540 | + 'name' => __('Disable Listing Info section', 'geodirectory'),
|
|
| 541 | + 'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'),
|
|
| 542 | + 'id' => 'geodir_disable_listing_info_section', |
|
| 543 | + 'type' => 'checkbox', |
|
| 544 | + 'std' => '0' |
|
| 545 | + ), |
|
| 546 | 546 | |
| 547 | - array('type' => 'sectionend', 'id' => 'detail_page_settings'),
|
|
| 547 | + array('type' => 'sectionend', 'id' => 'detail_page_settings'),
|
|
| 548 | 548 | |
| 549 | 549 | |
| 550 | - /* ---------- DETAIL PAGE TAB SETTING START*/ |
|
| 550 | + /* ---------- DETAIL PAGE TAB SETTING START*/ |
|
| 551 | 551 | |
| 552 | - array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '),
|
|
| 552 | + array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '),
|
|
| 553 | 553 | |
| 554 | - array( |
|
| 555 | - 'name' => __('Exclude selected tabs from detail page', 'geodirectory'),
|
|
| 556 | - 'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'),
|
|
| 557 | - 'tip' => '', |
|
| 558 | - 'id' => 'geodir_detail_page_tabs_excluded', |
|
| 559 | - 'css' => 'min-width:300px;', |
|
| 560 | - 'std' => geodir_get_posttypes(), |
|
| 561 | - 'type' => 'multiselect', |
|
| 562 | - 'placeholder_text' => __('Select tabs', 'geodirectory'),
|
|
| 563 | - 'class' => 'chosen_select', |
|
| 564 | - 'options' => array_unique(geodir_detail_page_tabs_key_value_array()) |
|
| 565 | - ), |
|
| 554 | + array( |
|
| 555 | + 'name' => __('Exclude selected tabs from detail page', 'geodirectory'),
|
|
| 556 | + 'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'),
|
|
| 557 | + 'tip' => '', |
|
| 558 | + 'id' => 'geodir_detail_page_tabs_excluded', |
|
| 559 | + 'css' => 'min-width:300px;', |
|
| 560 | + 'std' => geodir_get_posttypes(), |
|
| 561 | + 'type' => 'multiselect', |
|
| 562 | + 'placeholder_text' => __('Select tabs', 'geodirectory'),
|
|
| 563 | + 'class' => 'chosen_select', |
|
| 564 | + 'options' => array_unique(geodir_detail_page_tabs_key_value_array()) |
|
| 565 | + ), |
|
| 566 | 566 | |
| 567 | - array( |
|
| 568 | - 'name' => __('Show as list', 'geodirectory'),
|
|
| 569 | - 'desc' => __('Show as list instead of tabs', 'geodirectory'),
|
|
| 570 | - 'id' => 'geodir_disable_tabs', |
|
| 571 | - 'type' => 'checkbox', |
|
| 572 | - 'std' => '0' |
|
| 573 | - ), |
|
| 567 | + array( |
|
| 568 | + 'name' => __('Show as list', 'geodirectory'),
|
|
| 569 | + 'desc' => __('Show as list instead of tabs', 'geodirectory'),
|
|
| 570 | + 'id' => 'geodir_disable_tabs', |
|
| 571 | + 'type' => 'checkbox', |
|
| 572 | + 'std' => '0' |
|
| 573 | + ), |
|
| 574 | 574 | |
| 575 | - array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
|
|
| 576 | - /* ---------- DETAIL PAGE TAB SETTING END*/ |
|
| 575 | + array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
|
|
| 576 | + /* ---------- DETAIL PAGE TAB SETTING END*/ |
|
| 577 | 577 | |
| 578 | - /* START DEFAULT STAR IMAGE*/ |
|
| 579 | - array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '),
|
|
| 578 | + /* START DEFAULT STAR IMAGE*/ |
|
| 579 | + array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '),
|
|
| 580 | 580 | |
| 581 | - array( |
|
| 582 | - 'name' => __('Upload default rating star icon', 'geodirectory'),
|
|
| 583 | - 'desc' => '', |
|
| 584 | - 'id' => 'geodir_default_rating_star_icon', |
|
| 585 | - 'type' => 'file', |
|
| 586 | - 'std' => '0', |
|
| 587 | - 'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section |
|
| 588 | - ), |
|
| 581 | + array( |
|
| 582 | + 'name' => __('Upload default rating star icon', 'geodirectory'),
|
|
| 583 | + 'desc' => '', |
|
| 584 | + 'id' => 'geodir_default_rating_star_icon', |
|
| 585 | + 'type' => 'file', |
|
| 586 | + 'std' => '0', |
|
| 587 | + 'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section |
|
| 588 | + ), |
|
| 589 | 589 | array( |
| 590 | 590 | 'name' => __('Enable Font Awesome', 'geodirectory'),
|
| 591 | 591 | 'desc' => __('When enabled all rating images will be using font awesome rating icons as images.', 'geodirectory' ),
|
@@ -601,369 +601,369 @@ discard block |
||
| 601 | 601 | 'std' => '#757575' |
| 602 | 602 | ), |
| 603 | 603 | |
| 604 | - array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
|
|
| 604 | + array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
|
|
| 605 | 605 | |
| 606 | - /* END DEFAULT STAR IMAGE*/ |
|
| 606 | + /* END DEFAULT STAR IMAGE*/ |
|
| 607 | 607 | |
| 608 | - /* Detail related post settings start */ |
|
| 608 | + /* Detail related post settings start */ |
|
| 609 | 609 | |
| 610 | - array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '),
|
|
| 610 | + array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '),
|
|
| 611 | 611 | |
| 612 | - array( |
|
| 613 | - 'name' => __('Show related post listing on', 'geodirectory'),
|
|
| 614 | - 'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'),
|
|
| 615 | - 'tip' => '', |
|
| 616 | - 'id' => 'geodir_add_related_listing_posttypes', |
|
| 617 | - 'css' => 'min-width:300px;', |
|
| 618 | - 'std' => geodir_get_posttypes(), |
|
| 619 | - 'type' => 'multiselect', |
|
| 620 | - 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 621 | - 'class' => 'chosen_select', |
|
| 622 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 623 | - ), |
|
| 612 | + array( |
|
| 613 | + 'name' => __('Show related post listing on', 'geodirectory'),
|
|
| 614 | + 'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'),
|
|
| 615 | + 'tip' => '', |
|
| 616 | + 'id' => 'geodir_add_related_listing_posttypes', |
|
| 617 | + 'css' => 'min-width:300px;', |
|
| 618 | + 'std' => geodir_get_posttypes(), |
|
| 619 | + 'type' => 'multiselect', |
|
| 620 | + 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 621 | + 'class' => 'chosen_select', |
|
| 622 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 623 | + ), |
|
| 624 | 624 | |
| 625 | - array( |
|
| 626 | - 'name' => __('Relate to', 'geodirectory'),
|
|
| 627 | - 'desc' => __('Set the relation between current post to related posts.', 'geodirectory'),
|
|
| 628 | - 'id' => 'geodir_related_post_relate_to', |
|
| 629 | - 'css' => 'min-width:300px;', |
|
| 630 | - 'std' => 'category', |
|
| 631 | - 'type' => 'select', |
|
| 632 | - 'class' => 'chosen_select', |
|
| 633 | - 'options' => array_unique(array( |
|
| 634 | - 'category' => __('Categories', 'geodirectory'),
|
|
| 635 | - 'tags' => __('Tags', 'geodirectory'),
|
|
| 636 | - )) |
|
| 637 | - ), |
|
| 625 | + array( |
|
| 626 | + 'name' => __('Relate to', 'geodirectory'),
|
|
| 627 | + 'desc' => __('Set the relation between current post to related posts.', 'geodirectory'),
|
|
| 628 | + 'id' => 'geodir_related_post_relate_to', |
|
| 629 | + 'css' => 'min-width:300px;', |
|
| 630 | + 'std' => 'category', |
|
| 631 | + 'type' => 'select', |
|
| 632 | + 'class' => 'chosen_select', |
|
| 633 | + 'options' => array_unique(array( |
|
| 634 | + 'category' => __('Categories', 'geodirectory'),
|
|
| 635 | + 'tags' => __('Tags', 'geodirectory'),
|
|
| 636 | + )) |
|
| 637 | + ), |
|
| 638 | 638 | |
| 639 | - array( |
|
| 640 | - 'name' => __('Layout', 'geodirectory'),
|
|
| 641 | - 'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'),
|
|
| 642 | - 'id' => 'geodir_related_post_listing_view', |
|
| 643 | - 'css' => 'min-width:300px;', |
|
| 644 | - 'std' => 'gridview_onehalf', |
|
| 645 | - 'type' => 'select', |
|
| 646 | - 'class' => 'chosen_select', |
|
| 647 | - 'options' => array_unique(array( |
|
| 648 | - 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
|
|
| 649 | - 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
|
|
| 650 | - 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
|
|
| 651 | - 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
|
|
| 652 | - 'listview' => __('List view', 'geodirectory'),
|
|
| 653 | - )) |
|
| 654 | - ), |
|
| 639 | + array( |
|
| 640 | + 'name' => __('Layout', 'geodirectory'),
|
|
| 641 | + 'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'),
|
|
| 642 | + 'id' => 'geodir_related_post_listing_view', |
|
| 643 | + 'css' => 'min-width:300px;', |
|
| 644 | + 'std' => 'gridview_onehalf', |
|
| 645 | + 'type' => 'select', |
|
| 646 | + 'class' => 'chosen_select', |
|
| 647 | + 'options' => array_unique(array( |
|
| 648 | + 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
|
|
| 649 | + 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
|
|
| 650 | + 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
|
|
| 651 | + 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
|
|
| 652 | + 'listview' => __('List view', 'geodirectory'),
|
|
| 653 | + )) |
|
| 654 | + ), |
|
| 655 | 655 | |
| 656 | - array( |
|
| 657 | - 'name' => __('Sort by', 'geodirectory'),
|
|
| 658 | - 'desc' => __('Set the related post listing sort by view', 'geodirectory'),
|
|
| 659 | - 'id' => 'geodir_related_post_sortby', |
|
| 660 | - 'css' => 'min-width:300px;', |
|
| 661 | - 'std' => 'latest', |
|
| 662 | - 'type' => 'select', |
|
| 663 | - 'class' => 'chosen_select', |
|
| 664 | - 'options' => array_unique(array( |
|
| 665 | - 'latest' => __('Latest', 'geodirectory'),
|
|
| 666 | - 'featured' => __('Featured', 'geodirectory'),
|
|
| 667 | - 'high_review' => __('Review', 'geodirectory'),
|
|
| 668 | - 'high_rating' => __('Rating', 'geodirectory'),
|
|
| 669 | - 'random' => __('Random', 'geodirectory'),
|
|
| 670 | - 'nearest' => __('Nearest', 'geodirectory'),
|
|
| 671 | - )) |
|
| 672 | - ), |
|
| 656 | + array( |
|
| 657 | + 'name' => __('Sort by', 'geodirectory'),
|
|
| 658 | + 'desc' => __('Set the related post listing sort by view', 'geodirectory'),
|
|
| 659 | + 'id' => 'geodir_related_post_sortby', |
|
| 660 | + 'css' => 'min-width:300px;', |
|
| 661 | + 'std' => 'latest', |
|
| 662 | + 'type' => 'select', |
|
| 663 | + 'class' => 'chosen_select', |
|
| 664 | + 'options' => array_unique(array( |
|
| 665 | + 'latest' => __('Latest', 'geodirectory'),
|
|
| 666 | + 'featured' => __('Featured', 'geodirectory'),
|
|
| 667 | + 'high_review' => __('Review', 'geodirectory'),
|
|
| 668 | + 'high_rating' => __('Rating', 'geodirectory'),
|
|
| 669 | + 'random' => __('Random', 'geodirectory'),
|
|
| 670 | + 'nearest' => __('Nearest', 'geodirectory'),
|
|
| 671 | + )) |
|
| 672 | + ), |
|
| 673 | 673 | |
| 674 | - array( |
|
| 675 | - 'name' => __('Number of posts:', 'geodirectory'),
|
|
| 676 | - 'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'),
|
|
| 677 | - 'id' => 'geodir_related_post_count', |
|
| 678 | - 'type' => 'text', |
|
| 679 | - 'css' => 'min-width:300px;', |
|
| 680 | - 'std' => '5' // Default value to show home top section |
|
| 681 | - ), |
|
| 674 | + array( |
|
| 675 | + 'name' => __('Number of posts:', 'geodirectory'),
|
|
| 676 | + 'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'),
|
|
| 677 | + 'id' => 'geodir_related_post_count', |
|
| 678 | + 'type' => 'text', |
|
| 679 | + 'css' => 'min-width:300px;', |
|
| 680 | + 'std' => '5' // Default value to show home top section |
|
| 681 | + ), |
|
| 682 | 682 | |
| 683 | - array( |
|
| 684 | - 'name' => __('Post excerpt', 'geodirectory'),
|
|
| 685 | - 'desc' => __('Post content excerpt character count', 'geodirectory'),
|
|
| 686 | - 'id' => 'geodir_related_post_excerpt', |
|
| 687 | - 'type' => 'text', |
|
| 688 | - 'css' => 'min-width:300px;', |
|
| 689 | - 'std' => '20' // Default value to show home top section |
|
| 690 | - ), |
|
| 683 | + array( |
|
| 684 | + 'name' => __('Post excerpt', 'geodirectory'),
|
|
| 685 | + 'desc' => __('Post content excerpt character count', 'geodirectory'),
|
|
| 686 | + 'id' => 'geodir_related_post_excerpt', |
|
| 687 | + 'type' => 'text', |
|
| 688 | + 'css' => 'min-width:300px;', |
|
| 689 | + 'std' => '20' // Default value to show home top section |
|
| 690 | + ), |
|
| 691 | 691 | |
| 692 | 692 | |
| 693 | - array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'),
|
|
| 694 | - /* Detail Layout Settings end */ |
|
| 693 | + array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'),
|
|
| 694 | + /* Detail Layout Settings end */ |
|
| 695 | 695 | |
| 696 | - /* Author Layout Settings Start */ |
|
| 696 | + /* Author Layout Settings Start */ |
|
| 697 | 697 | |
| 698 | - array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '),
|
|
| 698 | + array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '),
|
|
| 699 | 699 | |
| 700 | 700 | |
| 701 | - array('name' => __('Author Page Layout Settings', 'geodirectory'),
|
|
| 702 | - 'type' => 'sectionstart', |
|
| 703 | - 'desc' => '', |
|
| 704 | - 'id' => 'geodir_author_layout'), |
|
| 701 | + array('name' => __('Author Page Layout Settings', 'geodirectory'),
|
|
| 702 | + 'type' => 'sectionstart', |
|
| 703 | + 'desc' => '', |
|
| 704 | + 'id' => 'geodir_author_layout'), |
|
| 705 | 705 | |
| 706 | - array( |
|
| 707 | - 'name' => __('Author top section', 'geodirectory'),
|
|
| 708 | - 'desc' => __('Show the top section of author page', 'geodirectory'),
|
|
| 709 | - 'id' => 'geodir_show_author_top_section', |
|
| 710 | - 'type' => 'checkbox', |
|
| 711 | - 'std' => '1' // Default value to show home top section |
|
| 712 | - ), |
|
| 706 | + array( |
|
| 707 | + 'name' => __('Author top section', 'geodirectory'),
|
|
| 708 | + 'desc' => __('Show the top section of author page', 'geodirectory'),
|
|
| 709 | + 'id' => 'geodir_show_author_top_section', |
|
| 710 | + 'type' => 'checkbox', |
|
| 711 | + 'std' => '1' // Default value to show home top section |
|
| 712 | + ), |
|
| 713 | 713 | |
| 714 | - array( |
|
| 715 | - 'name' => __('Author right section', 'geodirectory'),
|
|
| 716 | - 'desc' => __('Show the right section of author page', 'geodirectory'),
|
|
| 717 | - 'id' => 'geodir_show_author_right_section', |
|
| 718 | - 'type' => 'checkbox', |
|
| 719 | - 'std' => '1' // Default value to show home top section |
|
| 720 | - ), |
|
| 714 | + array( |
|
| 715 | + 'name' => __('Author right section', 'geodirectory'),
|
|
| 716 | + 'desc' => __('Show the right section of author page', 'geodirectory'),
|
|
| 717 | + 'id' => 'geodir_show_author_right_section', |
|
| 718 | + 'type' => 'checkbox', |
|
| 719 | + 'std' => '1' // Default value to show home top section |
|
| 720 | + ), |
|
| 721 | 721 | |
| 722 | - array( |
|
| 723 | - 'name' => __('Width of author right section', 'geodirectory'),
|
|
| 724 | - 'desc' => __('Enter the width of right section of author page in %', 'geodirectory'),
|
|
| 725 | - 'id' => 'geodir_width_author_right_section', |
|
| 726 | - 'type' => 'text', |
|
| 727 | - 'css' => 'min-width:300px;', |
|
| 728 | - 'std' => '30' // Default value to show home top section |
|
| 729 | - ), |
|
| 722 | + array( |
|
| 723 | + 'name' => __('Width of author right section', 'geodirectory'),
|
|
| 724 | + 'desc' => __('Enter the width of right section of author page in %', 'geodirectory'),
|
|
| 725 | + 'id' => 'geodir_width_author_right_section', |
|
| 726 | + 'type' => 'text', |
|
| 727 | + 'css' => 'min-width:300px;', |
|
| 728 | + 'std' => '30' // Default value to show home top section |
|
| 729 | + ), |
|
| 730 | 730 | |
| 731 | - array( |
|
| 732 | - 'name' => __('Author content section view', 'geodirectory'),
|
|
| 733 | - 'desc' => __('Set the listing view of author page', 'geodirectory'),
|
|
| 734 | - 'id' => 'geodir_author_view', |
|
| 735 | - 'css' => 'min-width:300px;', |
|
| 736 | - 'std' => 'gridview_onehalf', |
|
| 737 | - 'type' => 'select', |
|
| 738 | - 'class' => 'chosen_select', |
|
| 739 | - 'options' => array_unique(array( |
|
| 740 | - 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
|
|
| 741 | - 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
|
|
| 742 | - 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
|
|
| 743 | - 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
|
|
| 744 | - 'listview' => __('List view', 'geodirectory'),
|
|
| 745 | - )) |
|
| 746 | - ), |
|
| 731 | + array( |
|
| 732 | + 'name' => __('Author content section view', 'geodirectory'),
|
|
| 733 | + 'desc' => __('Set the listing view of author page', 'geodirectory'),
|
|
| 734 | + 'id' => 'geodir_author_view', |
|
| 735 | + 'css' => 'min-width:300px;', |
|
| 736 | + 'std' => 'gridview_onehalf', |
|
| 737 | + 'type' => 'select', |
|
| 738 | + 'class' => 'chosen_select', |
|
| 739 | + 'options' => array_unique(array( |
|
| 740 | + 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
|
|
| 741 | + 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
|
|
| 742 | + 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
|
|
| 743 | + 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
|
|
| 744 | + 'listview' => __('List view', 'geodirectory'),
|
|
| 745 | + )) |
|
| 746 | + ), |
|
| 747 | 747 | |
| 748 | - array( |
|
| 749 | - 'name' => __('Width of author content section', 'geodirectory'),
|
|
| 750 | - 'desc' => __('Enter the width of content section of author page in %', 'geodirectory'),
|
|
| 751 | - 'id' => 'geodir_width_author_contant_section', |
|
| 752 | - 'type' => 'text', |
|
| 753 | - 'css' => 'min-width:300px;', |
|
| 754 | - 'std' => '63' // Default value to show home top section |
|
| 755 | - ), |
|
| 748 | + array( |
|
| 749 | + 'name' => __('Width of author content section', 'geodirectory'),
|
|
| 750 | + 'desc' => __('Enter the width of content section of author page in %', 'geodirectory'),
|
|
| 751 | + 'id' => 'geodir_width_author_contant_section', |
|
| 752 | + 'type' => 'text', |
|
| 753 | + 'css' => 'min-width:300px;', |
|
| 754 | + 'std' => '63' // Default value to show home top section |
|
| 755 | + ), |
|
| 756 | 756 | |
| 757 | - array( |
|
| 758 | - 'name' => __('Author left section', 'geodirectory'),
|
|
| 759 | - 'desc' => __('Show the left section of author page', 'geodirectory'),
|
|
| 760 | - 'id' => 'geodir_show_author_left_section', |
|
| 761 | - 'type' => 'checkbox', |
|
| 762 | - 'std' => '0' // Default value to show home top section |
|
| 763 | - ), |
|
| 757 | + array( |
|
| 758 | + 'name' => __('Author left section', 'geodirectory'),
|
|
| 759 | + 'desc' => __('Show the left section of author page', 'geodirectory'),
|
|
| 760 | + 'id' => 'geodir_show_author_left_section', |
|
| 761 | + 'type' => 'checkbox', |
|
| 762 | + 'std' => '0' // Default value to show home top section |
|
| 763 | + ), |
|
| 764 | 764 | |
| 765 | - array( |
|
| 766 | - 'name' => __('Width of author left section', 'geodirectory'),
|
|
| 767 | - 'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
|
|
| 768 | - 'id' => 'geodir_width_author_left_section', |
|
| 769 | - 'type' => 'text', |
|
| 770 | - 'css' => 'min-width:300px;', |
|
| 771 | - 'std' => '30' // Default value to show home top section |
|
| 772 | - ), |
|
| 765 | + array( |
|
| 766 | + 'name' => __('Width of author left section', 'geodirectory'),
|
|
| 767 | + 'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
|
|
| 768 | + 'id' => 'geodir_width_author_left_section', |
|
| 769 | + 'type' => 'text', |
|
| 770 | + 'css' => 'min-width:300px;', |
|
| 771 | + 'std' => '30' // Default value to show home top section |
|
| 772 | + ), |
|
| 773 | 773 | |
| 774 | - array( |
|
| 775 | - 'name' => __('Author bottom section', 'geodirectory'),
|
|
| 776 | - 'desc' => __('Show the bottom section of author page', 'geodirectory'),
|
|
| 777 | - 'id' => 'geodir_show_author_bottom_section', |
|
| 778 | - 'type' => 'checkbox', |
|
| 779 | - 'std' => '0' // Default value to show home top section |
|
| 780 | - ), |
|
| 774 | + array( |
|
| 775 | + 'name' => __('Author bottom section', 'geodirectory'),
|
|
| 776 | + 'desc' => __('Show the bottom section of author page', 'geodirectory'),
|
|
| 777 | + 'id' => 'geodir_show_author_bottom_section', |
|
| 778 | + 'type' => 'checkbox', |
|
| 779 | + 'std' => '0' // Default value to show home top section |
|
| 780 | + ), |
|
| 781 | 781 | |
| 782 | 782 | |
| 783 | - array( |
|
| 784 | - 'name' => __('Description word limit', 'geodirectory'),
|
|
| 785 | - 'desc' => '', |
|
| 786 | - 'id' => 'geodir_author_desc_word_limit', |
|
| 787 | - 'type' => 'text', |
|
| 788 | - 'css' => 'min-width:300px;', |
|
| 789 | - 'std' => '50' // Default value to show home top section |
|
| 790 | - ), |
|
| 783 | + array( |
|
| 784 | + 'name' => __('Description word limit', 'geodirectory'),
|
|
| 785 | + 'desc' => '', |
|
| 786 | + 'id' => 'geodir_author_desc_word_limit', |
|
| 787 | + 'type' => 'text', |
|
| 788 | + 'css' => 'min-width:300px;', |
|
| 789 | + 'std' => '50' // Default value to show home top section |
|
| 790 | + ), |
|
| 791 | 791 | |
| 792 | - array('type' => 'sectionend', 'id' => 'geodir_author_layout'),
|
|
| 793 | - /* Author Layout Settings end */ |
|
| 792 | + array('type' => 'sectionend', 'id' => 'geodir_author_layout'),
|
|
| 793 | + /* Author Layout Settings end */ |
|
| 794 | 794 | |
| 795 | 795 | |
| 796 | - /* Post Type Navigation Settings Start */ |
|
| 797 | - array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'),
|
|
| 796 | + /* Post Type Navigation Settings Start */ |
|
| 797 | + array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'),
|
|
| 798 | 798 | |
| 799 | 799 | |
| 800 | - /* Post Type Navigation Settings Start */ |
|
| 800 | + /* Post Type Navigation Settings Start */ |
|
| 801 | 801 | |
| 802 | - array('name' => __('Navigation Locations', 'geodirectory'),
|
|
| 803 | - 'type' => 'sectionstart', |
|
| 804 | - 'desc' => '', |
|
| 805 | - 'id' => 'geodir_navigation_locations'), |
|
| 802 | + array('name' => __('Navigation Locations', 'geodirectory'),
|
|
| 803 | + 'type' => 'sectionstart', |
|
| 804 | + 'desc' => '', |
|
| 805 | + 'id' => 'geodir_navigation_locations'), |
|
| 806 | 806 | |
| 807 | - array( |
|
| 808 | - 'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'),
|
|
| 809 | - 'desc' => '', |
|
| 810 | - 'tip' => '', |
|
| 811 | - 'id' => 'geodir_theme_location_nav', |
|
| 812 | - 'css' => 'min-width:300px;', |
|
| 813 | - 'std' => array(), |
|
| 814 | - 'type' => 'multiselect', |
|
| 815 | - 'placeholder_text' => __('Select menu locations', 'geodirectory'),
|
|
| 816 | - 'class' => 'chosen_select', |
|
| 817 | - 'options' => array_unique(geodir_theme_location_setting_fun()) |
|
| 818 | - ), |
|
| 819 | - array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
|
|
| 820 | - |
|
| 821 | - |
|
| 822 | - array('name' => __('Navigation Settings', 'geodirectory'),
|
|
| 823 | - 'type' => 'sectionstart', |
|
| 824 | - 'desc' => '', |
|
| 825 | - 'id' => 'geodir_navigation_options'), |
|
| 807 | + array( |
|
| 808 | + 'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'),
|
|
| 809 | + 'desc' => '', |
|
| 810 | + 'tip' => '', |
|
| 811 | + 'id' => 'geodir_theme_location_nav', |
|
| 812 | + 'css' => 'min-width:300px;', |
|
| 813 | + 'std' => array(), |
|
| 814 | + 'type' => 'multiselect', |
|
| 815 | + 'placeholder_text' => __('Select menu locations', 'geodirectory'),
|
|
| 816 | + 'class' => 'chosen_select', |
|
| 817 | + 'options' => array_unique(geodir_theme_location_setting_fun()) |
|
| 818 | + ), |
|
| 819 | + array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
|
|
| 826 | 820 | |
| 827 | 821 | |
| 828 | - array( |
|
| 829 | - 'name' => __('Show add listing navigation in menu', 'geodirectory'),
|
|
| 830 | - 'desc' => sprintf(__('Show add listing navigation in main menu? (untick to disable) If you disable this option, none of the add listing link will appear in main navigation.', 'geodirectory')),
|
|
| 831 | - 'id' => 'geodir_show_addlisting_nav', |
|
| 832 | - 'std' => '1', |
|
| 833 | - 'type' => 'checkbox' |
|
| 834 | - ), |
|
| 822 | + array('name' => __('Navigation Settings', 'geodirectory'),
|
|
| 823 | + 'type' => 'sectionstart', |
|
| 824 | + 'desc' => '', |
|
| 825 | + 'id' => 'geodir_navigation_options'), |
|
| 835 | 826 | |
| 836 | - array( |
|
| 837 | - 'name' => __('Show listings navigation in menu', 'geodirectory'),
|
|
| 838 | - 'desc' => sprintf(__('Show listing navigation in main menu? (untick to disable) If you disable this option, none of the listing link will appear in main navigation.', 'geodirectory')),
|
|
| 839 | - 'id' => 'geodir_show_listing_nav', |
|
| 840 | - 'std' => '1', |
|
| 841 | - 'type' => 'checkbox' |
|
| 842 | - ), |
|
| 843 | 827 | |
| 844 | - array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
|
|
| 828 | + array( |
|
| 829 | + 'name' => __('Show add listing navigation in menu', 'geodirectory'),
|
|
| 830 | + 'desc' => sprintf(__('Show add listing navigation in main menu? (untick to disable) If you disable this option, none of the add listing link will appear in main navigation.', 'geodirectory')),
|
|
| 831 | + 'id' => 'geodir_show_addlisting_nav', |
|
| 832 | + 'std' => '1', |
|
| 833 | + 'type' => 'checkbox' |
|
| 834 | + ), |
|
| 845 | 835 | |
| 836 | + array( |
|
| 837 | + 'name' => __('Show listings navigation in menu', 'geodirectory'),
|
|
| 838 | + 'desc' => sprintf(__('Show listing navigation in main menu? (untick to disable) If you disable this option, none of the listing link will appear in main navigation.', 'geodirectory')),
|
|
| 839 | + 'id' => 'geodir_show_listing_nav', |
|
| 840 | + 'std' => '1', |
|
| 841 | + 'type' => 'checkbox' |
|
| 842 | + ), |
|
| 846 | 843 | |
| 847 | - array('name' => __('Post Type Navigation Settings', 'geodirectory'),
|
|
| 848 | - 'type' => 'sectionstart', |
|
| 849 | - 'desc' => '', |
|
| 850 | - 'id' => 'geodir_post_type_navigation_layout'), |
|
| 851 | - array( |
|
| 852 | - 'name' => __('Show listing link in main navigation', 'geodirectory'),
|
|
| 853 | - 'desc' => '', |
|
| 854 | - 'tip' => '', |
|
| 855 | - 'id' => 'geodir_add_posttype_in_main_nav', |
|
| 856 | - 'css' => 'min-width:300px;', |
|
| 857 | - 'std' => array(), |
|
| 858 | - 'type' => 'multiselect', |
|
| 859 | - 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 860 | - 'class' => 'chosen_select', |
|
| 861 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 862 | - ), |
|
| 844 | + array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
|
|
| 863 | 845 | |
| 864 | - array( |
|
| 865 | - 'name' => __('Show listing link in listing navigation', 'geodirectory'),
|
|
| 866 | - 'desc' => '', |
|
| 867 | - 'tip' => '', |
|
| 868 | - 'id' => 'geodir_add_posttype_in_listing_nav', |
|
| 869 | - 'css' => 'min-width:300px;', |
|
| 870 | - 'std' => geodir_get_posttypes(), |
|
| 871 | - 'type' => 'multiselect', |
|
| 872 | - 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 873 | - 'class' => 'chosen_select', |
|
| 874 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 875 | - ), |
|
| 876 | 846 | |
| 877 | - array( |
|
| 878 | - 'name' => __('Allow post type to add from frontend', 'geodirectory'),
|
|
| 879 | - 'desc' => '', |
|
| 880 | - 'tip' => '', |
|
| 881 | - 'id' => 'geodir_allow_posttype_frontend', |
|
| 882 | - 'css' => 'min-width:300px;', |
|
| 883 | - 'std' => geodir_get_posttypes(), |
|
| 884 | - 'type' => 'multiselect', |
|
| 885 | - 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 886 | - 'class' => 'chosen_select', |
|
| 887 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 888 | - ), |
|
| 847 | + array('name' => __('Post Type Navigation Settings', 'geodirectory'),
|
|
| 848 | + 'type' => 'sectionstart', |
|
| 849 | + 'desc' => '', |
|
| 850 | + 'id' => 'geodir_post_type_navigation_layout'), |
|
| 851 | + array( |
|
| 852 | + 'name' => __('Show listing link in main navigation', 'geodirectory'),
|
|
| 853 | + 'desc' => '', |
|
| 854 | + 'tip' => '', |
|
| 855 | + 'id' => 'geodir_add_posttype_in_main_nav', |
|
| 856 | + 'css' => 'min-width:300px;', |
|
| 857 | + 'std' => array(), |
|
| 858 | + 'type' => 'multiselect', |
|
| 859 | + 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 860 | + 'class' => 'chosen_select', |
|
| 861 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 862 | + ), |
|
| 889 | 863 | |
| 890 | - array( |
|
| 891 | - 'name' => __('Show add listing link in main navigation', 'geodirectory'),
|
|
| 892 | - 'desc' => '', |
|
| 893 | - 'tip' => '', |
|
| 894 | - 'id' => 'geodir_add_listing_link_main_nav', |
|
| 895 | - 'css' => 'min-width:300px;', |
|
| 896 | - 'std' => array(), |
|
| 897 | - 'type' => 'multiselect', |
|
| 898 | - 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 899 | - 'class' => 'chosen_select', |
|
| 900 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 901 | - ), |
|
| 864 | + array( |
|
| 865 | + 'name' => __('Show listing link in listing navigation', 'geodirectory'),
|
|
| 866 | + 'desc' => '', |
|
| 867 | + 'tip' => '', |
|
| 868 | + 'id' => 'geodir_add_posttype_in_listing_nav', |
|
| 869 | + 'css' => 'min-width:300px;', |
|
| 870 | + 'std' => geodir_get_posttypes(), |
|
| 871 | + 'type' => 'multiselect', |
|
| 872 | + 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 873 | + 'class' => 'chosen_select', |
|
| 874 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 875 | + ), |
|
| 902 | 876 | |
| 903 | - array( |
|
| 904 | - 'name' => __('Show add listing link in add listing navigation', 'geodirectory'),
|
|
| 905 | - 'desc' => '', |
|
| 906 | - 'tip' => '', |
|
| 907 | - 'id' => 'geodir_add_listing_link_add_listing_nav', |
|
| 908 | - 'css' => 'min-width:300px;', |
|
| 909 | - 'std' => geodir_get_posttypes(), |
|
| 910 | - 'type' => 'multiselect', |
|
| 911 | - 'class' => 'chosen_select', |
|
| 912 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 913 | - ), |
|
| 877 | + array( |
|
| 878 | + 'name' => __('Allow post type to add from frontend', 'geodirectory'),
|
|
| 879 | + 'desc' => '', |
|
| 880 | + 'tip' => '', |
|
| 881 | + 'id' => 'geodir_allow_posttype_frontend', |
|
| 882 | + 'css' => 'min-width:300px;', |
|
| 883 | + 'std' => geodir_get_posttypes(), |
|
| 884 | + 'type' => 'multiselect', |
|
| 885 | + 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 886 | + 'class' => 'chosen_select', |
|
| 887 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 888 | + ), |
|
| 914 | 889 | |
| 915 | - array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'),
|
|
| 890 | + array( |
|
| 891 | + 'name' => __('Show add listing link in main navigation', 'geodirectory'),
|
|
| 892 | + 'desc' => '', |
|
| 893 | + 'tip' => '', |
|
| 894 | + 'id' => 'geodir_add_listing_link_main_nav', |
|
| 895 | + 'css' => 'min-width:300px;', |
|
| 896 | + 'std' => array(), |
|
| 897 | + 'type' => 'multiselect', |
|
| 898 | + 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 899 | + 'class' => 'chosen_select', |
|
| 900 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 901 | + ), |
|
| 916 | 902 | |
| 903 | + array( |
|
| 904 | + 'name' => __('Show add listing link in add listing navigation', 'geodirectory'),
|
|
| 905 | + 'desc' => '', |
|
| 906 | + 'tip' => '', |
|
| 907 | + 'id' => 'geodir_add_listing_link_add_listing_nav', |
|
| 908 | + 'css' => 'min-width:300px;', |
|
| 909 | + 'std' => geodir_get_posttypes(), |
|
| 910 | + 'type' => 'multiselect', |
|
| 911 | + 'class' => 'chosen_select', |
|
| 912 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 913 | + ), |
|
| 917 | 914 | |
| 918 | - array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '),
|
|
| 915 | + array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'),
|
|
| 919 | 916 | |
| 920 | 917 | |
| 921 | - array( |
|
| 922 | - 'name' => __('Show add listing link in user dashboard', 'geodirectory'),
|
|
| 923 | - 'desc' => '', |
|
| 924 | - 'tip' => '', |
|
| 925 | - 'id' => 'geodir_add_listing_link_user_dashboard', |
|
| 926 | - 'css' => 'min-width:300px;', |
|
| 927 | - 'std' => geodir_get_posttypes(), |
|
| 928 | - 'type' => 'multiselect', |
|
| 929 | - 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 930 | - 'class' => 'chosen_select', |
|
| 931 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 932 | - ), |
|
| 918 | + array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '),
|
|
| 933 | 919 | |
| 934 | - array( |
|
| 935 | - 'name' => __('Show favorite link in user dashboard', 'geodirectory'),
|
|
| 936 | - 'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'),
|
|
| 937 | - 'tip' => '', |
|
| 938 | - 'id' => 'geodir_favorite_link_user_dashboard', |
|
| 939 | - 'css' => 'min-width:300px;', |
|
| 940 | - 'std' => geodir_get_posttypes(), |
|
| 941 | - 'type' => 'multiselect', |
|
| 942 | - 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 943 | - 'class' => 'chosen_select', |
|
| 944 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 945 | - ), |
|
| 946 | 920 | |
| 947 | - array( |
|
| 948 | - 'name' => __('Show listing link in user dashboard', 'geodirectory'),
|
|
| 949 | - 'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'),
|
|
| 950 | - 'tip' => '', |
|
| 951 | - 'id' => 'geodir_listing_link_user_dashboard', |
|
| 952 | - 'css' => 'min-width:300px;', |
|
| 953 | - 'std' => geodir_get_posttypes(), |
|
| 954 | - 'type' => 'multiselect', |
|
| 955 | - 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 956 | - 'class' => 'chosen_select', |
|
| 957 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 958 | - ), |
|
| 959 | - |
|
| 960 | - array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'),
|
|
| 961 | - /* Post Type Navigation Settings End */ |
|
| 962 | - |
|
| 963 | - /* Script Settings Start */ |
|
| 964 | - array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '),
|
|
| 965 | - |
|
| 966 | - /* |
|
| 921 | + array( |
|
| 922 | + 'name' => __('Show add listing link in user dashboard', 'geodirectory'),
|
|
| 923 | + 'desc' => '', |
|
| 924 | + 'tip' => '', |
|
| 925 | + 'id' => 'geodir_add_listing_link_user_dashboard', |
|
| 926 | + 'css' => 'min-width:300px;', |
|
| 927 | + 'std' => geodir_get_posttypes(), |
|
| 928 | + 'type' => 'multiselect', |
|
| 929 | + 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 930 | + 'class' => 'chosen_select', |
|
| 931 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 932 | + ), |
|
| 933 | + |
|
| 934 | + array( |
|
| 935 | + 'name' => __('Show favorite link in user dashboard', 'geodirectory'),
|
|
| 936 | + 'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'),
|
|
| 937 | + 'tip' => '', |
|
| 938 | + 'id' => 'geodir_favorite_link_user_dashboard', |
|
| 939 | + 'css' => 'min-width:300px;', |
|
| 940 | + 'std' => geodir_get_posttypes(), |
|
| 941 | + 'type' => 'multiselect', |
|
| 942 | + 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 943 | + 'class' => 'chosen_select', |
|
| 944 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 945 | + ), |
|
| 946 | + |
|
| 947 | + array( |
|
| 948 | + 'name' => __('Show listing link in user dashboard', 'geodirectory'),
|
|
| 949 | + 'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'),
|
|
| 950 | + 'tip' => '', |
|
| 951 | + 'id' => 'geodir_listing_link_user_dashboard', |
|
| 952 | + 'css' => 'min-width:300px;', |
|
| 953 | + 'std' => geodir_get_posttypes(), |
|
| 954 | + 'type' => 'multiselect', |
|
| 955 | + 'placeholder_text' => __('Select post types', 'geodirectory'),
|
|
| 956 | + 'class' => 'chosen_select', |
|
| 957 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
| 958 | + ), |
|
| 959 | + |
|
| 960 | + array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'),
|
|
| 961 | + /* Post Type Navigation Settings End */ |
|
| 962 | + |
|
| 963 | + /* Script Settings Start */ |
|
| 964 | + array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '),
|
|
| 965 | + |
|
| 966 | + /* |
|
| 967 | 967 | array( 'name' => __( 'Add/Remove Scripts', 'geodirectory' ), |
| 968 | 968 | 'type' => 'sectionstart', |
| 969 | 969 | 'desc' => '', |
@@ -989,190 +989,190 @@ discard block |
||
| 989 | 989 | |
| 990 | 990 | */ |
| 991 | 991 | |
| 992 | - array('name' => __('GD Lazy Load Images', 'geodirectory'),
|
|
| 993 | - 'type' => 'sectionstart', |
|
| 994 | - 'desc' => '', |
|
| 995 | - 'id' => 'geodir_gdll_settings'), |
|
| 992 | + array('name' => __('GD Lazy Load Images', 'geodirectory'),
|
|
| 993 | + 'type' => 'sectionstart', |
|
| 994 | + 'desc' => '', |
|
| 995 | + 'id' => 'geodir_gdll_settings'), |
|
| 996 | 996 | |
| 997 | - array( |
|
| 998 | - 'name' => __('Enable lazy load images?', 'geodirectory'),
|
|
| 999 | - 'desc' => __('GD images will be loaded only when visible on the page', 'geodirectory'),
|
|
| 1000 | - 'id' => 'geodir_lazy_load', |
|
| 1001 | - 'type' => 'checkbox', |
|
| 1002 | - 'std' => '1' // Default value to show home top section |
|
| 1003 | - ), |
|
| 1004 | - array('type' => 'sectionend', 'id' => 'geodir_gdll_settings'),
|
|
| 997 | + array( |
|
| 998 | + 'name' => __('Enable lazy load images?', 'geodirectory'),
|
|
| 999 | + 'desc' => __('GD images will be loaded only when visible on the page', 'geodirectory'),
|
|
| 1000 | + 'id' => 'geodir_lazy_load', |
|
| 1001 | + 'type' => 'checkbox', |
|
| 1002 | + 'std' => '1' // Default value to show home top section |
|
| 1003 | + ), |
|
| 1004 | + array('type' => 'sectionend', 'id' => 'geodir_gdll_settings'),
|
|
| 1005 | 1005 | |
| 1006 | 1006 | |
| 1007 | - array('name' => __('Script Settings', 'geodirectory'),
|
|
| 1008 | - 'type' => 'sectionstart', |
|
| 1009 | - 'desc' => '', |
|
| 1010 | - 'id' => 'geodir_script_settings'), |
|
| 1007 | + array('name' => __('Script Settings', 'geodirectory'),
|
|
| 1008 | + 'type' => 'sectionstart', |
|
| 1009 | + 'desc' => '', |
|
| 1010 | + 'id' => 'geodir_script_settings'), |
|
| 1011 | 1011 | |
| 1012 | - array( |
|
| 1013 | - 'name' => __('Custom style css code', 'geodirectory'),
|
|
| 1014 | - 'desc' => '', |
|
| 1015 | - 'id' => 'geodir_coustem_css', |
|
| 1016 | - 'type' => 'textarea', |
|
| 1017 | - 'css' => 'min-width:300px;', |
|
| 1018 | - 'std' => '' // Default value for the page title - changed in settings |
|
| 1019 | - ), |
|
| 1012 | + array( |
|
| 1013 | + 'name' => __('Custom style css code', 'geodirectory'),
|
|
| 1014 | + 'desc' => '', |
|
| 1015 | + 'id' => 'geodir_coustem_css', |
|
| 1016 | + 'type' => 'textarea', |
|
| 1017 | + 'css' => 'min-width:300px;', |
|
| 1018 | + 'std' => '' // Default value for the page title - changed in settings |
|
| 1019 | + ), |
|
| 1020 | 1020 | |
| 1021 | - array( |
|
| 1022 | - 'name' => __('Header script code', 'geodirectory'),
|
|
| 1023 | - 'desc' => '', |
|
| 1024 | - 'id' => 'geodir_header_scripts', |
|
| 1025 | - 'type' => 'textarea', |
|
| 1026 | - 'css' => 'min-width:300px;', |
|
| 1027 | - 'std' => '' // Default value for the page title - changed in settings |
|
| 1028 | - ), |
|
| 1021 | + array( |
|
| 1022 | + 'name' => __('Header script code', 'geodirectory'),
|
|
| 1023 | + 'desc' => '', |
|
| 1024 | + 'id' => 'geodir_header_scripts', |
|
| 1025 | + 'type' => 'textarea', |
|
| 1026 | + 'css' => 'min-width:300px;', |
|
| 1027 | + 'std' => '' // Default value for the page title - changed in settings |
|
| 1028 | + ), |
|
| 1029 | 1029 | |
| 1030 | - array( |
|
| 1031 | - 'name' => __('Footer script code', 'geodirectory'),
|
|
| 1032 | - 'desc' => '', |
|
| 1033 | - 'id' => 'geodir_footer_scripts', |
|
| 1034 | - 'type' => 'textarea', |
|
| 1035 | - 'css' => 'min-width:300px;', |
|
| 1036 | - 'std' => '' // Default value for the page title - changed in settings |
|
| 1037 | - ), |
|
| 1030 | + array( |
|
| 1031 | + 'name' => __('Footer script code', 'geodirectory'),
|
|
| 1032 | + 'desc' => '', |
|
| 1033 | + 'id' => 'geodir_footer_scripts', |
|
| 1034 | + 'type' => 'textarea', |
|
| 1035 | + 'css' => 'min-width:300px;', |
|
| 1036 | + 'std' => '' // Default value for the page title - changed in settings |
|
| 1037 | + ), |
|
| 1038 | 1038 | |
| 1039 | - array('type' => 'sectionend', 'id' => 'geodir_script_settings'),
|
|
| 1040 | - /* Script Settings End */ |
|
| 1039 | + array('type' => 'sectionend', 'id' => 'geodir_script_settings'),
|
|
| 1040 | + /* Script Settings End */ |
|
| 1041 | 1041 | |
| 1042 | - /* Map Settings Start */ |
|
| 1043 | - array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '),
|
|
| 1042 | + /* Map Settings Start */ |
|
| 1043 | + array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '),
|
|
| 1044 | 1044 | |
| 1045 | 1045 | |
| 1046 | - // Google API key |
|
| 1047 | - array( |
|
| 1048 | - 'name' => __('Google Maps API KEY', 'geodirectory'),
|
|
| 1049 | - 'type' => 'sectionstart', |
|
| 1050 | - 'desc' => '', |
|
| 1051 | - 'id' => 'geodir_google_api_key' |
|
| 1052 | - ), |
|
| 1053 | - array( |
|
| 1054 | - 'name' => __('Google Maps API KEY', 'geodirectory'),
|
|
| 1055 | - 'desc' => sprintf( |
|
| 1056 | - __('This is a requirement to use Google Maps, you can get a key from <a href="%s" target="_blank">here</a> OR you can set GD to use Open Street Maps below under Select Maps API setting. (<a href="%s" target="_blank">How to add a Google API KEY?</a>)', 'geodirectory'),
|
|
| 1057 | - 'https://console.developers.google.com/flows/enableapi?apiid=places_backend,maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend&keyType=CLIENT_SIDE&reusekey=true','https://wpgeodirectory.com/docs/add-google-api-key/' ), |
|
| 1058 | - 'tip' => '', |
|
| 1059 | - 'id' => 'geodir_google_api_key', |
|
| 1060 | - 'css' => 'min-width:300px;', |
|
| 1061 | - 'std' => '', |
|
| 1062 | - 'type' => 'map-key', |
|
| 1063 | - ), |
|
| 1064 | - array( |
|
| 1065 | - 'type' => 'sectionend', |
|
| 1066 | - 'id' => 'geodir_google_api_key' |
|
| 1067 | - ), |
|
| 1046 | + // Google API key |
|
| 1047 | + array( |
|
| 1048 | + 'name' => __('Google Maps API KEY', 'geodirectory'),
|
|
| 1049 | + 'type' => 'sectionstart', |
|
| 1050 | + 'desc' => '', |
|
| 1051 | + 'id' => 'geodir_google_api_key' |
|
| 1052 | + ), |
|
| 1053 | + array( |
|
| 1054 | + 'name' => __('Google Maps API KEY', 'geodirectory'),
|
|
| 1055 | + 'desc' => sprintf( |
|
| 1056 | + __('This is a requirement to use Google Maps, you can get a key from <a href="%s" target="_blank">here</a> OR you can set GD to use Open Street Maps below under Select Maps API setting. (<a href="%s" target="_blank">How to add a Google API KEY?</a>)', 'geodirectory'),
|
|
| 1057 | + 'https://console.developers.google.com/flows/enableapi?apiid=places_backend,maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend&keyType=CLIENT_SIDE&reusekey=true','https://wpgeodirectory.com/docs/add-google-api-key/' ), |
|
| 1058 | + 'tip' => '', |
|
| 1059 | + 'id' => 'geodir_google_api_key', |
|
| 1060 | + 'css' => 'min-width:300px;', |
|
| 1061 | + 'std' => '', |
|
| 1062 | + 'type' => 'map-key', |
|
| 1063 | + ), |
|
| 1064 | + array( |
|
| 1065 | + 'type' => 'sectionend', |
|
| 1066 | + 'id' => 'geodir_google_api_key' |
|
| 1067 | + ), |
|
| 1068 | 1068 | |
| 1069 | - /* Untick the category by default on home map */ |
|
| 1070 | - array( |
|
| 1071 | - 'name' => __('Home Map Settings', 'geodirectory'),
|
|
| 1072 | - 'type' => 'sectionstart', |
|
| 1073 | - 'desc' => '', |
|
| 1074 | - 'id' => 'geodir_home_map_section' |
|
| 1075 | - ), |
|
| 1076 | - array( |
|
| 1077 | - 'name' => __('Select category to untick by default on map', 'geodirectory'),
|
|
| 1078 | - 'desc' => __('Select category to untick by default on the home map.', 'geodirectory'),
|
|
| 1079 | - 'tip' => '', |
|
| 1080 | - 'id' => 'geodir_home_map_untick', |
|
| 1081 | - 'css' => 'min-width:300px;', |
|
| 1082 | - 'std' => '', |
|
| 1083 | - 'type' => 'multiselect', |
|
| 1084 | - 'placeholder_text' => __('Select category', 'geodirectory'),
|
|
| 1085 | - 'class' => 'chosen_select', |
|
| 1086 | - 'options' => geodir_home_map_cats_key_value_array() |
|
| 1087 | - ), |
|
| 1088 | - array( |
|
| 1089 | - 'type' => 'sectionend', |
|
| 1090 | - 'id' => 'geodir_home_map_section' |
|
| 1091 | - ), |
|
| 1069 | + /* Untick the category by default on home map */ |
|
| 1070 | + array( |
|
| 1071 | + 'name' => __('Home Map Settings', 'geodirectory'),
|
|
| 1072 | + 'type' => 'sectionstart', |
|
| 1073 | + 'desc' => '', |
|
| 1074 | + 'id' => 'geodir_home_map_section' |
|
| 1075 | + ), |
|
| 1076 | + array( |
|
| 1077 | + 'name' => __('Select category to untick by default on map', 'geodirectory'),
|
|
| 1078 | + 'desc' => __('Select category to untick by default on the home map.', 'geodirectory'),
|
|
| 1079 | + 'tip' => '', |
|
| 1080 | + 'id' => 'geodir_home_map_untick', |
|
| 1081 | + 'css' => 'min-width:300px;', |
|
| 1082 | + 'std' => '', |
|
| 1083 | + 'type' => 'multiselect', |
|
| 1084 | + 'placeholder_text' => __('Select category', 'geodirectory'),
|
|
| 1085 | + 'class' => 'chosen_select', |
|
| 1086 | + 'options' => geodir_home_map_cats_key_value_array() |
|
| 1087 | + ), |
|
| 1088 | + array( |
|
| 1089 | + 'type' => 'sectionend', |
|
| 1090 | + 'id' => 'geodir_home_map_section' |
|
| 1091 | + ), |
|
| 1092 | 1092 | |
| 1093 | - array( |
|
| 1094 | - 'name' => __('Add Listing Map Settings', 'geodirectory'),
|
|
| 1095 | - 'type' => 'sectionstart', |
|
| 1096 | - 'desc' => '', |
|
| 1097 | - 'id' => 'geodir_add_listing_map_section' |
|
| 1098 | - ), |
|
| 1099 | - array( |
|
| 1100 | - 'name' => __('Disable mouse scroll on details page map tab', 'geodirectory'),
|
|
| 1101 | - 'desc' => __('Stops the mouse scroll zooming the map (home and listings settings set from widget)', 'geodirectory'),
|
|
| 1102 | - 'id' => 'geodir_add_listing_mouse_scroll', |
|
| 1103 | - 'type' => 'checkbox', |
|
| 1104 | - 'std' => '0' // Default value to show home top section |
|
| 1105 | - ), |
|
| 1106 | - array( |
|
| 1107 | - 'type' => 'sectionend', |
|
| 1108 | - 'id' => 'geodir_add_listing_map_section' |
|
| 1109 | - ), |
|
| 1093 | + array( |
|
| 1094 | + 'name' => __('Add Listing Map Settings', 'geodirectory'),
|
|
| 1095 | + 'type' => 'sectionstart', |
|
| 1096 | + 'desc' => '', |
|
| 1097 | + 'id' => 'geodir_add_listing_map_section' |
|
| 1098 | + ), |
|
| 1099 | + array( |
|
| 1100 | + 'name' => __('Disable mouse scroll on details page map tab', 'geodirectory'),
|
|
| 1101 | + 'desc' => __('Stops the mouse scroll zooming the map (home and listings settings set from widget)', 'geodirectory'),
|
|
| 1102 | + 'id' => 'geodir_add_listing_mouse_scroll', |
|
| 1103 | + 'type' => 'checkbox', |
|
| 1104 | + 'std' => '0' // Default value to show home top section |
|
| 1105 | + ), |
|
| 1106 | + array( |
|
| 1107 | + 'type' => 'sectionend', |
|
| 1108 | + 'id' => 'geodir_add_listing_map_section' |
|
| 1109 | + ), |
|
| 1110 | 1110 | |
| 1111 | 1111 | |
| 1112 | - array('name' => __('Default map settings', 'geodirectory'),
|
|
| 1113 | - 'type' => 'sectionstart', |
|
| 1114 | - 'desc' => '', |
|
| 1115 | - 'id' => 'geodir_map_default_settings'), |
|
| 1112 | + array('name' => __('Default map settings', 'geodirectory'),
|
|
| 1113 | + 'type' => 'sectionstart', |
|
| 1114 | + 'desc' => '', |
|
| 1115 | + 'id' => 'geodir_map_default_settings'), |
|
| 1116 | 1116 | |
| 1117 | - array( |
|
| 1118 | - 'name' => '', |
|
| 1119 | - 'desc' => '', |
|
| 1120 | - 'id' => 'map_default_settings', |
|
| 1121 | - 'type' => 'map_default_settings', |
|
| 1122 | - 'css' => 'min-width:300px;', |
|
| 1123 | - 'std' => '' // Default value for the page title - changed in settings |
|
| 1124 | - ), |
|
| 1117 | + array( |
|
| 1118 | + 'name' => '', |
|
| 1119 | + 'desc' => '', |
|
| 1120 | + 'id' => 'map_default_settings', |
|
| 1121 | + 'type' => 'map_default_settings', |
|
| 1122 | + 'css' => 'min-width:300px;', |
|
| 1123 | + 'std' => '' // Default value for the page title - changed in settings |
|
| 1124 | + ), |
|
| 1125 | 1125 | |
| 1126 | - array( |
|
| 1127 | - 'name' => __('Upload map default marker icon', 'geodirectory'),
|
|
| 1128 | - 'desc' => '', |
|
| 1129 | - 'id' => 'geodir_default_marker_icon', |
|
| 1130 | - 'type' => 'file', |
|
| 1131 | - 'std' => '0', |
|
| 1132 | - 'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section |
|
| 1133 | - ), |
|
| 1134 | - // add option that allows enable/disable map dragging to phone devices |
|
| 1135 | - array( |
|
| 1136 | - 'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'),
|
|
| 1137 | - 'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'),
|
|
| 1138 | - 'id' => 'geodir_map_onoff_dragging', |
|
| 1139 | - 'type' => 'checkbox', |
|
| 1140 | - 'std' => '0' // Default value to show home top section |
|
| 1141 | - ), |
|
| 1142 | - array( |
|
| 1143 | - 'name' => __('Select Maps API', 'geodirectory'),
|
|
| 1144 | - 'desc' => __('- Google Maps API will force to load Google JS library only.<br>- OpenStreetMap API will force to load OpenStreetMap JS library only.<br>- Load Automatic will load Google JS library first, but if Google maps JS library not loaded it then loads the OpenStreetMap JS library to load the maps (recommended for regions where Google maps banned).<br>- Disable Maps will disable and hides maps for entire site.', 'geodirectory'),
|
|
| 1145 | - 'tip' => '', |
|
| 1146 | - 'id' => 'geodir_load_map', |
|
| 1147 | - 'css' => 'min-width:300px;', |
|
| 1148 | - 'std' => 'auto', |
|
| 1149 | - 'type' => 'select', |
|
| 1150 | - 'placeholder_text' => __('Select Map', 'geodirectory'),
|
|
| 1151 | - 'options' => array( |
|
| 1152 | - 'auto' => __('Load Automatic', 'geodirectory'),
|
|
| 1153 | - 'google' => __('Load Google Maps API', 'geodirectory'),
|
|
| 1154 | - 'osm' => __('Load OpenStreetMap API', 'geodirectory'),
|
|
| 1155 | - 'none' => __('Disable Maps', 'geodirectory')
|
|
| 1156 | - ) |
|
| 1157 | - ), |
|
| 1158 | - |
|
| 1159 | - array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'),
|
|
| 1160 | - |
|
| 1161 | - array('name' => __('Show / hide post type and category on map', 'geodirectory'),
|
|
| 1162 | - 'type' => 'sectionstart', |
|
| 1163 | - 'desc' => '', |
|
| 1164 | - 'id' => 'geodir_map_settings'), |
|
| 1126 | + array( |
|
| 1127 | + 'name' => __('Upload map default marker icon', 'geodirectory'),
|
|
| 1128 | + 'desc' => '', |
|
| 1129 | + 'id' => 'geodir_default_marker_icon', |
|
| 1130 | + 'type' => 'file', |
|
| 1131 | + 'std' => '0', |
|
| 1132 | + 'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section |
|
| 1133 | + ), |
|
| 1134 | + // add option that allows enable/disable map dragging to phone devices |
|
| 1135 | + array( |
|
| 1136 | + 'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'),
|
|
| 1137 | + 'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'),
|
|
| 1138 | + 'id' => 'geodir_map_onoff_dragging', |
|
| 1139 | + 'type' => 'checkbox', |
|
| 1140 | + 'std' => '0' // Default value to show home top section |
|
| 1141 | + ), |
|
| 1142 | + array( |
|
| 1143 | + 'name' => __('Select Maps API', 'geodirectory'),
|
|
| 1144 | + 'desc' => __('- Google Maps API will force to load Google JS library only.<br>- OpenStreetMap API will force to load OpenStreetMap JS library only.<br>- Load Automatic will load Google JS library first, but if Google maps JS library not loaded it then loads the OpenStreetMap JS library to load the maps (recommended for regions where Google maps banned).<br>- Disable Maps will disable and hides maps for entire site.', 'geodirectory'),
|
|
| 1145 | + 'tip' => '', |
|
| 1146 | + 'id' => 'geodir_load_map', |
|
| 1147 | + 'css' => 'min-width:300px;', |
|
| 1148 | + 'std' => 'auto', |
|
| 1149 | + 'type' => 'select', |
|
| 1150 | + 'placeholder_text' => __('Select Map', 'geodirectory'),
|
|
| 1151 | + 'options' => array( |
|
| 1152 | + 'auto' => __('Load Automatic', 'geodirectory'),
|
|
| 1153 | + 'google' => __('Load Google Maps API', 'geodirectory'),
|
|
| 1154 | + 'osm' => __('Load OpenStreetMap API', 'geodirectory'),
|
|
| 1155 | + 'none' => __('Disable Maps', 'geodirectory')
|
|
| 1156 | + ) |
|
| 1157 | + ), |
|
| 1165 | 1158 | |
| 1166 | - array( |
|
| 1167 | - 'name' => __('Select Map Category', 'geodirectory'),
|
|
| 1168 | - 'desc' => '', |
|
| 1169 | - 'id' => 'geodir_map_settings', |
|
| 1170 | - 'type' => 'map', |
|
| 1171 | - 'css' => 'min-width:300px;', |
|
| 1172 | - 'std' => '' // Default value for the page title - changed in settings |
|
| 1173 | - ), |
|
| 1174 | - |
|
| 1175 | - array('type' => 'sectionend', 'id' => 'geodir_map_settings'),
|
|
| 1176 | - /* Map Settings End */ |
|
| 1159 | + array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'),
|
|
| 1160 | + |
|
| 1161 | + array('name' => __('Show / hide post type and category on map', 'geodirectory'),
|
|
| 1162 | + 'type' => 'sectionstart', |
|
| 1163 | + 'desc' => '', |
|
| 1164 | + 'id' => 'geodir_map_settings'), |
|
| 1165 | + |
|
| 1166 | + array( |
|
| 1167 | + 'name' => __('Select Map Category', 'geodirectory'),
|
|
| 1168 | + 'desc' => '', |
|
| 1169 | + 'id' => 'geodir_map_settings', |
|
| 1170 | + 'type' => 'map', |
|
| 1171 | + 'css' => 'min-width:300px;', |
|
| 1172 | + 'std' => '' // Default value for the page title - changed in settings |
|
| 1173 | + ), |
|
| 1174 | + |
|
| 1175 | + array('type' => 'sectionend', 'id' => 'geodir_map_settings'),
|
|
| 1176 | + /* Map Settings End */ |
|
| 1177 | 1177 | |
| 1178 | 1178 | )); // End Design settings |
@@ -19,151 +19,151 @@ discard block |
||
| 19 | 19 | * @global string $dummy_image_path The dummy image path. |
| 20 | 20 | */ |
| 21 | 21 | function geodir_dummy_data_taxonomies($post_type,$category_array) { |
| 22 | - global $wpdb, $dummy_image_path; |
|
| 22 | + global $wpdb, $dummy_image_path; |
|
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | |
| 26 | - $last_catid = ''; |
|
| 26 | + $last_catid = ''; |
|
| 27 | 27 | |
| 28 | - $uploads = wp_upload_dir(); // Array of key => value pairs |
|
| 28 | + $uploads = wp_upload_dir(); // Array of key => value pairs |
|
| 29 | 29 | |
| 30 | - for ($i = 0; $i < count($category_array); $i++) { |
|
| 31 | - $parent_catid = 0; |
|
| 32 | - if (is_array($category_array[$i])) { |
|
| 33 | - $cat_name_arr = $category_array[$i]; |
|
| 34 | - for ($j = 0; $j < count($cat_name_arr); $j++) { |
|
| 35 | - $catname = $cat_name_arr[$j]; |
|
| 30 | + for ($i = 0; $i < count($category_array); $i++) { |
|
| 31 | + $parent_catid = 0; |
|
| 32 | + if (is_array($category_array[$i])) { |
|
| 33 | + $cat_name_arr = $category_array[$i]; |
|
| 34 | + for ($j = 0; $j < count($cat_name_arr); $j++) { |
|
| 35 | + $catname = $cat_name_arr[$j]; |
|
| 36 | 36 | |
| 37 | - if (!term_exists($catname, $post_type.'category')) { |
|
| 38 | - $last_catid = wp_insert_term($catname, $post_type.'category', $args = array('parent' => $parent_catid)); |
|
| 37 | + if (!term_exists($catname, $post_type.'category')) { |
|
| 38 | + $last_catid = wp_insert_term($catname, $post_type.'category', $args = array('parent' => $parent_catid)); |
|
| 39 | 39 | |
| 40 | - if ($j == 0) { |
|
| 41 | - $parent_catid = $last_catid; |
|
| 42 | - } |
|
| 40 | + if ($j == 0) { |
|
| 41 | + $parent_catid = $last_catid; |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | 44 | |
| 45 | - if (geodir_dummy_folder_exists()) |
|
| 46 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
| 47 | - else |
|
| 48 | - $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
|
| 45 | + if (geodir_dummy_folder_exists()) |
|
| 46 | + $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
| 47 | + else |
|
| 48 | + $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
|
| 49 | 49 | |
| 50 | - $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
|
| 50 | + $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
|
| 51 | 51 | |
| 52 | - $catname = str_replace(' ', '_', $catname); |
|
| 53 | - $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
| 52 | + $catname = str_replace(' ', '_', $catname); |
|
| 53 | + $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
| 54 | 54 | |
| 55 | - if (empty($uploaded['error'])) { |
|
| 56 | - $new_path = $uploaded['file']; |
|
| 57 | - $new_url = $uploaded['url']; |
|
| 58 | - } |
|
| 55 | + if (empty($uploaded['error'])) { |
|
| 56 | + $new_path = $uploaded['file']; |
|
| 57 | + $new_url = $uploaded['url']; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | - $wp_filetype = wp_check_filetype(basename($new_path), null); |
|
| 61 | - |
|
| 62 | - $attachment = array( |
|
| 63 | - 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
| 64 | - 'post_mime_type' => $wp_filetype['type'], |
|
| 65 | - 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
|
| 66 | - 'post_content' => '', |
|
| 67 | - 'post_status' => 'inherit' |
|
| 68 | - ); |
|
| 69 | - $attach_id = wp_insert_attachment($attachment, $new_path); |
|
| 70 | - |
|
| 71 | - // you must first include the image.php file |
|
| 72 | - // for the function wp_generate_attachment_metadata() to work |
|
| 73 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 74 | - $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
|
| 75 | - wp_update_attachment_metadata($attach_id, $attach_data); |
|
| 76 | - |
|
| 77 | - if (!get_tax_meta($last_catid['term_id'], 'ct_cat_icon', false, $post_type)) { |
|
| 78 | - update_tax_meta($last_catid['term_id'], 'ct_cat_icon', array('id' => 'icon', 'src' => $new_url), $post_type); |
|
| 79 | - } |
|
| 80 | - } |
|
| 81 | - } |
|
| 60 | + $wp_filetype = wp_check_filetype(basename($new_path), null); |
|
| 82 | 61 | |
| 83 | - } else { |
|
| 84 | - $catname = $category_array[$i]; |
|
| 62 | + $attachment = array( |
|
| 63 | + 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
| 64 | + 'post_mime_type' => $wp_filetype['type'], |
|
| 65 | + 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
|
| 66 | + 'post_content' => '', |
|
| 67 | + 'post_status' => 'inherit' |
|
| 68 | + ); |
|
| 69 | + $attach_id = wp_insert_attachment($attachment, $new_path); |
|
| 85 | 70 | |
| 86 | - if (!term_exists($catname, $post_type.'category')) { |
|
| 87 | - $last_catid = wp_insert_term($catname, $post_type.'category'); |
|
| 71 | + // you must first include the image.php file |
|
| 72 | + // for the function wp_generate_attachment_metadata() to work |
|
| 73 | + require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 74 | + $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
|
| 75 | + wp_update_attachment_metadata($attach_id, $attach_data); |
|
| 88 | 76 | |
| 89 | - if (geodir_dummy_folder_exists()) |
|
| 90 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
| 91 | - else |
|
| 92 | - $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
|
| 77 | + if (!get_tax_meta($last_catid['term_id'], 'ct_cat_icon', false, $post_type)) { |
|
| 78 | + update_tax_meta($last_catid['term_id'], 'ct_cat_icon', array('id' => 'icon', 'src' => $new_url), $post_type); |
|
| 79 | + } |
|
| 80 | + } |
|
| 81 | + } |
|
| 93 | 82 | |
| 94 | - $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
|
| 83 | + } else { |
|
| 84 | + $catname = $category_array[$i]; |
|
| 95 | 85 | |
| 96 | - $catname = str_replace(' ', '_', $catname); |
|
| 97 | - $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
| 86 | + if (!term_exists($catname, $post_type.'category')) { |
|
| 87 | + $last_catid = wp_insert_term($catname, $post_type.'category'); |
|
| 98 | 88 | |
| 99 | - if (empty($uploaded['error'])) { |
|
| 100 | - $new_path = $uploaded['file']; |
|
| 101 | - $new_url = $uploaded['url']; |
|
| 102 | - } |
|
| 89 | + if (geodir_dummy_folder_exists()) |
|
| 90 | + $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy/cat_icon"; |
|
| 91 | + else |
|
| 92 | + $dummy_image_url = 'http://www.wpgeodirectory.com/dummy/cat_icon'; |
|
| 103 | 93 | |
| 104 | - $wp_filetype = wp_check_filetype(basename($new_path), null); |
|
| 94 | + $dummy_image_url = apply_filters('place_dummy_cat_image_url', $dummy_image_url); |
|
| 105 | 95 | |
| 106 | - $attachment = array( |
|
| 107 | - 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
| 108 | - 'post_mime_type' => $wp_filetype['type'], |
|
| 109 | - 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
|
| 110 | - 'post_content' => '', |
|
| 111 | - 'post_status' => 'inherit' |
|
| 112 | - ); |
|
| 96 | + $catname = str_replace(' ', '_', $catname); |
|
| 97 | + $uploaded = (array)fetch_remote_file("$dummy_image_url/" . $catname . ".png"); |
|
| 113 | 98 | |
| 114 | - $attach_id = wp_insert_attachment($attachment, $new_path); |
|
| 99 | + if (empty($uploaded['error'])) { |
|
| 100 | + $new_path = $uploaded['file']; |
|
| 101 | + $new_url = $uploaded['url']; |
|
| 102 | + } |
|
| 115 | 103 | |
| 104 | + $wp_filetype = wp_check_filetype(basename($new_path), null); |
|
| 116 | 105 | |
| 117 | - // you must first include the image.php file |
|
| 118 | - // for the function wp_generate_attachment_metadata() to work |
|
| 119 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 120 | - $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
|
| 121 | - wp_update_attachment_metadata($attach_id, $attach_data); |
|
| 106 | + $attachment = array( |
|
| 107 | + 'guid' => $uploads['baseurl'] . '/' . basename($new_path), |
|
| 108 | + 'post_mime_type' => $wp_filetype['type'], |
|
| 109 | + 'post_title' => preg_replace('/\.[^.]+$/', '', basename($new_path)), |
|
| 110 | + 'post_content' => '', |
|
| 111 | + 'post_status' => 'inherit' |
|
| 112 | + ); |
|
| 113 | + |
|
| 114 | + $attach_id = wp_insert_attachment($attachment, $new_path); |
|
| 122 | 115 | |
| 123 | - if (!get_tax_meta($last_catid['term_id'], 'ct_cat_icon', false, $post_type)) { |
|
| 124 | - update_tax_meta($last_catid['term_id'], 'ct_cat_icon', array('id' => $attach_id, 'src' => $new_url), $post_type); |
|
| 125 | - } |
|
| 126 | - } |
|
| 127 | - } |
|
| 128 | 116 | |
| 129 | - } |
|
| 117 | + // you must first include the image.php file |
|
| 118 | + // for the function wp_generate_attachment_metadata() to work |
|
| 119 | + require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
| 120 | + $attach_data = wp_generate_attachment_metadata($attach_id, $new_path); |
|
| 121 | + wp_update_attachment_metadata($attach_id, $attach_data); |
|
| 122 | + |
|
| 123 | + if (!get_tax_meta($last_catid['term_id'], 'ct_cat_icon', false, $post_type)) { |
|
| 124 | + update_tax_meta($last_catid['term_id'], 'ct_cat_icon', array('id' => $attach_id, 'src' => $new_url), $post_type); |
|
| 125 | + } |
|
| 126 | + } |
|
| 127 | + } |
|
| 128 | + |
|
| 129 | + } |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | function geodir_dummy_data_types(){ |
| 134 | - $data = array( |
|
| 135 | - 'standard_places' => array( |
|
| 136 | - 'name'=>__('Default','geodirectory'), |
|
| 137 | - 'count'=> 30 |
|
| 138 | - ), |
|
| 139 | - 'property_sale' => array( |
|
| 140 | - 'name'=>__('Property for sale','geodirectory'), |
|
| 141 | - 'count'=> 10 |
|
| 142 | - ), |
|
| 143 | - 'property_rent' => array( |
|
| 144 | - 'name'=>__('Property for rent','geodirectory'), |
|
| 145 | - 'count'=> 10 |
|
| 146 | - ) |
|
| 147 | - ); |
|
| 148 | - |
|
| 149 | - return apply_filters('geodir_dummy_data_types',$data ); |
|
| 134 | + $data = array( |
|
| 135 | + 'standard_places' => array( |
|
| 136 | + 'name'=>__('Default','geodirectory'), |
|
| 137 | + 'count'=> 30 |
|
| 138 | + ), |
|
| 139 | + 'property_sale' => array( |
|
| 140 | + 'name'=>__('Property for sale','geodirectory'), |
|
| 141 | + 'count'=> 10 |
|
| 142 | + ), |
|
| 143 | + 'property_rent' => array( |
|
| 144 | + 'name'=>__('Property for rent','geodirectory'), |
|
| 145 | + 'count'=> 10 |
|
| 146 | + ) |
|
| 147 | + ); |
|
| 148 | + |
|
| 149 | + return apply_filters('geodir_dummy_data_types',$data ); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
| 153 | 153 | function geodir_create_dummy_fields($fields) |
| 154 | 154 | { |
| 155 | 155 | |
| 156 | - /** |
|
| 157 | - * Filter the array of default custom fields DB table data. |
|
| 158 | - * |
|
| 159 | - * @since 1.0.0 |
|
| 160 | - * @param string $fields The default custom fields as an array. |
|
| 161 | - */ |
|
| 162 | - $fields = apply_filters('geodir_before_dummy_custom_fields_saved', $fields); |
|
| 163 | - foreach ($fields as $field_index => $field) { |
|
| 164 | - geodir_custom_field_save($field); |
|
| 165 | - |
|
| 166 | - } |
|
| 156 | + /** |
|
| 157 | + * Filter the array of default custom fields DB table data. |
|
| 158 | + * |
|
| 159 | + * @since 1.0.0 |
|
| 160 | + * @param string $fields The default custom fields as an array. |
|
| 161 | + */ |
|
| 162 | + $fields = apply_filters('geodir_before_dummy_custom_fields_saved', $fields); |
|
| 163 | + foreach ($fields as $field_index => $field) { |
|
| 164 | + geodir_custom_field_save($field); |
|
| 165 | + |
|
| 166 | + } |
|
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | /** |
@@ -176,20 +176,20 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | function geodir_delete_dummy_posts($post_type,$data_type) |
| 178 | 178 | { |
| 179 | - global $wpdb, $plugin_prefix; |
|
| 179 | + global $wpdb, $plugin_prefix; |
|
| 180 | 180 | |
| 181 | 181 | |
| 182 | - $post_ids = $wpdb->get_results("SELECT post_id FROM " . $plugin_prefix . $post_type."_detail WHERE post_dummy='1'"); |
|
| 182 | + $post_ids = $wpdb->get_results("SELECT post_id FROM " . $plugin_prefix . $post_type."_detail WHERE post_dummy='1'"); |
|
| 183 | 183 | |
| 184 | 184 | |
| 185 | - foreach ($post_ids as $post_ids_obj) { |
|
| 186 | - wp_delete_post($post_ids_obj->post_id); |
|
| 187 | - } |
|
| 185 | + foreach ($post_ids as $post_ids_obj) { |
|
| 186 | + wp_delete_post($post_ids_obj->post_id); |
|
| 187 | + } |
|
| 188 | 188 | |
| 189 | - //double check posts are deleted |
|
| 190 | - $wpdb->get_results("DELETE FROM " . $plugin_prefix . $post_type. "_detail WHERE post_dummy='1'"); |
|
| 189 | + //double check posts are deleted |
|
| 190 | + $wpdb->get_results("DELETE FROM " . $plugin_prefix . $post_type. "_detail WHERE post_dummy='1'"); |
|
| 191 | 191 | |
| 192 | - update_option($post_type.'_dummy_data_type',''); |
|
| 192 | + update_option($post_type.'_dummy_data_type',''); |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | /** |
@@ -203,78 +203,78 @@ discard block |
||
| 203 | 203 | function geodir_insert_dummy_posts($post_type,$data_type,$item_index) |
| 204 | 204 | { |
| 205 | 205 | |
| 206 | - ini_set('max_execution_time', 999999); //300 seconds = 5 minutes |
|
| 207 | - $data_types = geodir_dummy_data_types(); |
|
| 208 | - |
|
| 209 | - $total_count = 0; |
|
| 210 | - global $dummy_post_index; |
|
| 211 | - $dummy_post_index = $item_index; |
|
| 212 | - foreach( $data_types as $key=>$val){ |
|
| 213 | - if($key==$data_type){ |
|
| 214 | - $total_count = $val['count']; |
|
| 215 | - if($key=='standard_places'){ |
|
| 216 | - /** |
|
| 217 | - * Contains dummy post content. |
|
| 218 | - * |
|
| 219 | - * @since 1.0.0 |
|
| 220 | - * @package GeoDirectory |
|
| 221 | - */ |
|
| 222 | - include_once( 'dummy-data/standard_places.php' ); |
|
| 223 | - }elseif($key=='property_sale'){ |
|
| 224 | - /** |
|
| 225 | - * Contains dummy property for sale post content. |
|
| 226 | - * |
|
| 227 | - * @since 1.6.11 |
|
| 228 | - * @package GeoDirectory |
|
| 229 | - */ |
|
| 230 | - include_once( 'dummy-data/property_sale.php' ); |
|
| 231 | - }elseif($key=='property_rent'){ |
|
| 232 | - /** |
|
| 233 | - * Contains dummy property for sale post content. |
|
| 234 | - * |
|
| 235 | - * @since 1.6.11 |
|
| 236 | - * @package GeoDirectory |
|
| 237 | - */ |
|
| 238 | - include_once( 'dummy-data/property_rent.php' ); |
|
| 239 | - } |
|
| 240 | - |
|
| 241 | - } |
|
| 242 | - |
|
| 243 | - do_action('geodir_insert_dummy_data_loop',$post_type,$data_type,$item_index); |
|
| 244 | - } |
|
| 245 | - |
|
| 246 | - |
|
| 247 | - |
|
| 248 | - // delete image cache on last entry |
|
| 249 | - if($total_count == $item_index){ |
|
| 250 | - delete_transient( 'cached_dummy_images' ); |
|
| 251 | - flush_rewrite_rules(); |
|
| 252 | - } |
|
| 206 | + ini_set('max_execution_time', 999999); //300 seconds = 5 minutes |
|
| 207 | + $data_types = geodir_dummy_data_types(); |
|
| 208 | + |
|
| 209 | + $total_count = 0; |
|
| 210 | + global $dummy_post_index; |
|
| 211 | + $dummy_post_index = $item_index; |
|
| 212 | + foreach( $data_types as $key=>$val){ |
|
| 213 | + if($key==$data_type){ |
|
| 214 | + $total_count = $val['count']; |
|
| 215 | + if($key=='standard_places'){ |
|
| 216 | + /** |
|
| 217 | + * Contains dummy post content. |
|
| 218 | + * |
|
| 219 | + * @since 1.0.0 |
|
| 220 | + * @package GeoDirectory |
|
| 221 | + */ |
|
| 222 | + include_once( 'dummy-data/standard_places.php' ); |
|
| 223 | + }elseif($key=='property_sale'){ |
|
| 224 | + /** |
|
| 225 | + * Contains dummy property for sale post content. |
|
| 226 | + * |
|
| 227 | + * @since 1.6.11 |
|
| 228 | + * @package GeoDirectory |
|
| 229 | + */ |
|
| 230 | + include_once( 'dummy-data/property_sale.php' ); |
|
| 231 | + }elseif($key=='property_rent'){ |
|
| 232 | + /** |
|
| 233 | + * Contains dummy property for sale post content. |
|
| 234 | + * |
|
| 235 | + * @since 1.6.11 |
|
| 236 | + * @package GeoDirectory |
|
| 237 | + */ |
|
| 238 | + include_once( 'dummy-data/property_rent.php' ); |
|
| 239 | + } |
|
| 240 | + |
|
| 241 | + } |
|
| 242 | + |
|
| 243 | + do_action('geodir_insert_dummy_data_loop',$post_type,$data_type,$item_index); |
|
| 244 | + } |
|
| 245 | + |
|
| 246 | + |
|
| 247 | + |
|
| 248 | + // delete image cache on last entry |
|
| 249 | + if($total_count == $item_index){ |
|
| 250 | + delete_transient( 'cached_dummy_images' ); |
|
| 251 | + flush_rewrite_rules(); |
|
| 252 | + } |
|
| 253 | 253 | |
| 254 | 254 | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | |
| 258 | 258 | if (!function_exists('geodir_autoinstall_admin_header') && (get_option('geodir_installed') || defined( 'GD_TESTING_MODE' ))) { |
| 259 | - /** |
|
| 260 | - * GeoDirectory dummy data installation. |
|
| 261 | - * |
|
| 262 | - * @since 1.0.0 |
|
| 263 | - * @package GeoDirectory |
|
| 264 | - * @global object $wpdb WordPress Database object. |
|
| 265 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 266 | - * @param string $post_type The post type. |
|
| 267 | - */ |
|
| 268 | - function geodir_autoinstall_admin_header($post_type = 'gd_place') |
|
| 269 | - { |
|
| 270 | - |
|
| 271 | - global $wpdb, $plugin_prefix; |
|
| 272 | - |
|
| 273 | - if (!geodir_is_default_location_set()) { |
|
| 274 | - echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will help to set location of all dummy data.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>'; |
|
| 275 | - } else { |
|
| 276 | - |
|
| 277 | - ?> |
|
| 259 | + /** |
|
| 260 | + * GeoDirectory dummy data installation. |
|
| 261 | + * |
|
| 262 | + * @since 1.0.0 |
|
| 263 | + * @package GeoDirectory |
|
| 264 | + * @global object $wpdb WordPress Database object. |
|
| 265 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
| 266 | + * @param string $post_type The post type. |
|
| 267 | + */ |
|
| 268 | + function geodir_autoinstall_admin_header($post_type = 'gd_place') |
|
| 269 | + { |
|
| 270 | + |
|
| 271 | + global $wpdb, $plugin_prefix; |
|
| 272 | + |
|
| 273 | + if (!geodir_is_default_location_set()) { |
|
| 274 | + echo '<div class="updated fade"><p><strong>' . sprintf(__('Please %sclick here%s to set a default location, this will help to set location of all dummy data.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>') . '</strong></p></div>'; |
|
| 275 | + } else { |
|
| 276 | + |
|
| 277 | + ?> |
|
| 278 | 278 | <span class="gd-dummy-hint"><small><?php _e('*Hint*: Installing our Advanced Search addon FIRST will add extra search fields to non-default data types.','geodirectory');?></small></span> |
| 279 | 279 | <table class="form-table gd-dummy-table"> |
| 280 | 280 | <tbody> |
@@ -286,78 +286,78 @@ discard block |
||
| 286 | 286 | |
| 287 | 287 | <?php |
| 288 | 288 | |
| 289 | - $cpts = geodir_get_posttypes('array'); |
|
| 289 | + $cpts = geodir_get_posttypes('array'); |
|
| 290 | 290 | |
| 291 | - $data_types = geodir_dummy_data_types(); |
|
| 291 | + $data_types = geodir_dummy_data_types(); |
|
| 292 | 292 | |
| 293 | - $nonce = wp_create_nonce('geodir_dummy_posts_insert_noncename'); |
|
| 293 | + $nonce = wp_create_nonce('geodir_dummy_posts_insert_noncename'); |
|
| 294 | 294 | |
| 295 | - foreach($cpts as $post_type=>$cpt){ |
|
| 295 | + foreach($cpts as $post_type=>$cpt){ |
|
| 296 | 296 | |
| 297 | - $data_types_for = apply_filters('geodir_dummy_date_types_for',$data_types,$post_type); |
|
| 297 | + $data_types_for = apply_filters('geodir_dummy_date_types_for',$data_types,$post_type); |
|
| 298 | 298 | |
| 299 | 299 | |
| 300 | - $set_dt = get_option($post_type.'_dummy_data_type'); |
|
| 300 | + $set_dt = get_option($post_type.'_dummy_data_type'); |
|
| 301 | 301 | |
| 302 | - $count = 30; |
|
| 302 | + $count = 30; |
|
| 303 | 303 | |
| 304 | - geodir_add_column_if_not_exist($plugin_prefix . $post_type. "_detail", 'post_dummy', "enum( '1', '0' ) NULL DEFAULT '0'"); |
|
| 304 | + geodir_add_column_if_not_exist($plugin_prefix . $post_type. "_detail", 'post_dummy', "enum( '1', '0' ) NULL DEFAULT '0'"); |
|
| 305 | 305 | |
| 306 | - $post_counts = $wpdb->get_var("SELECT count(post_id) FROM " . $plugin_prefix . $post_type . "_detail WHERE post_dummy='1'"); |
|
| 306 | + $post_counts = $wpdb->get_var("SELECT count(post_id) FROM " . $plugin_prefix . $post_type . "_detail WHERE post_dummy='1'"); |
|
| 307 | 307 | |
| 308 | - echo "<tr>"; |
|
| 309 | - echo "<td><strong>".$cpt['labels']['name']."</strong></td>"; |
|
| 308 | + echo "<tr>"; |
|
| 309 | + echo "<td><strong>".$cpt['labels']['name']."</strong></td>"; |
|
| 310 | 310 | |
| 311 | 311 | |
| 312 | - $select_disabled = $post_counts > 0 ? 'disabled' : ''; |
|
| 313 | - echo "<td>"; |
|
| 314 | - echo "<select id='".$post_type."_data_type' onchange='geodir_dummy_set_count(this,\"$post_type\");' $select_disabled>"; |
|
| 312 | + $select_disabled = $post_counts > 0 ? 'disabled' : ''; |
|
| 313 | + echo "<td>"; |
|
| 314 | + echo "<select id='".$post_type."_data_type' onchange='geodir_dummy_set_count(this,\"$post_type\");' $select_disabled>"; |
|
| 315 | 315 | |
| 316 | - foreach($data_types_for as $key=>$val){ |
|
| 317 | - $selected = ($key==$set_dt) ? "selected='selected'" : ''; |
|
| 318 | - if($selected || count($data_types_for)==1){$count = $val['count'];} |
|
| 319 | - echo "<option $selected value='$key' data-count='".$val['count']."'>".$val['name']."</option>"; |
|
| 320 | - } |
|
| 321 | - echo "</select>"; |
|
| 322 | - |
|
| 323 | - $select_display = $post_counts > 0 ? 'display:none;' : ''; |
|
| 324 | - echo "<select id='".$post_type."_data_type_count' style='$select_display' >"; |
|
| 325 | - $x = 1; |
|
| 326 | - while($x <= $count){ |
|
| 327 | - $selected = ($x==$count) ? "selected='selected'" : ''; |
|
| 328 | - echo "<option $selected value='$x'>".$x."</option>"; |
|
| 329 | - $x++; |
|
| 330 | - } |
|
| 331 | - echo "</select>"; |
|
| 332 | - echo "</td>"; |
|
| 316 | + foreach($data_types_for as $key=>$val){ |
|
| 317 | + $selected = ($key==$set_dt) ? "selected='selected'" : ''; |
|
| 318 | + if($selected || count($data_types_for)==1){$count = $val['count'];} |
|
| 319 | + echo "<option $selected value='$key' data-count='".$val['count']."'>".$val['name']."</option>"; |
|
| 320 | + } |
|
| 321 | + echo "</select>"; |
|
| 333 | 322 | |
| 323 | + $select_display = $post_counts > 0 ? 'display:none;' : ''; |
|
| 324 | + echo "<select id='".$post_type."_data_type_count' style='$select_display' >"; |
|
| 325 | + $x = 1; |
|
| 326 | + while($x <= $count){ |
|
| 327 | + $selected = ($x==$count) ? "selected='selected'" : ''; |
|
| 328 | + echo "<option $selected value='$x'>".$x."</option>"; |
|
| 329 | + $x++; |
|
| 330 | + } |
|
| 331 | + echo "</select>"; |
|
| 332 | + echo "</td>"; |
|
| 334 | 333 | |
| 335 | 334 | |
| 336 | 335 | |
| 337 | 336 | |
| 338 | - if($post_counts > 0){ |
|
| 339 | - echo '<td><input type="button" value="'.__('Remove data','geodirectory').'" class="button-primary geodir_dummy_button gd-remove-data" onclick="gdInstallDummyData(this,\'' . $nonce . '\',\'' . $post_type . '\'); return false;" ></td>'; |
|
| 340 | - }else{ |
|
| 341 | - echo '<td><input type="button" value="'.__('Insert data','geodirectory').'" class="button-primary geodir_dummy_button" onclick="gdInstallDummyData(this,\'' . $nonce . '\',\'' . $post_type . '\'); return false;" ></td>'; |
|
| 342 | - } |
|
| 343 | 337 | |
| 344 | - echo "</tr>"; |
|
| 345 | - //print_r($cpt); |
|
| 346 | - } |
|
| 338 | + if($post_counts > 0){ |
|
| 339 | + echo '<td><input type="button" value="'.__('Remove data','geodirectory').'" class="button-primary geodir_dummy_button gd-remove-data" onclick="gdInstallDummyData(this,\'' . $nonce . '\',\'' . $post_type . '\'); return false;" ></td>'; |
|
| 340 | + }else{ |
|
| 341 | + echo '<td><input type="button" value="'.__('Insert data','geodirectory').'" class="button-primary geodir_dummy_button" onclick="gdInstallDummyData(this,\'' . $nonce . '\',\'' . $post_type . '\'); return false;" ></td>'; |
|
| 342 | + } |
|
| 343 | + |
|
| 344 | + echo "</tr>"; |
|
| 345 | + //print_r($cpt); |
|
| 346 | + } |
|
| 347 | 347 | |
| 348 | - ?> |
|
| 348 | + ?> |
|
| 349 | 349 | </tbody> |
| 350 | 350 | </table> |
| 351 | 351 | <?php |
| 352 | 352 | |
| 353 | 353 | |
| 354 | - $default_location = geodir_get_default_location(); |
|
| 355 | - $city = isset($default_location->city) ? $default_location->city : ''; |
|
| 356 | - $region = isset($default_location->region) ? $default_location->region : ''; |
|
| 357 | - $country = isset($default_location->country) ? $default_location->country : ''; |
|
| 358 | - $city_latitude = isset($default_location->city_latitude) ? $default_location->city_latitude : ''; |
|
| 359 | - $city_longitude = isset($default_location->city_longitude) ? $default_location->city_longitude : ''; |
|
| 360 | - ?> |
|
| 354 | + $default_location = geodir_get_default_location(); |
|
| 355 | + $city = isset($default_location->city) ? $default_location->city : ''; |
|
| 356 | + $region = isset($default_location->region) ? $default_location->region : ''; |
|
| 357 | + $country = isset($default_location->country) ? $default_location->country : ''; |
|
| 358 | + $city_latitude = isset($default_location->city_latitude) ? $default_location->city_latitude : ''; |
|
| 359 | + $city_longitude = isset($default_location->city_longitude) ? $default_location->city_longitude : ''; |
|
| 360 | + ?> |
|
| 361 | 361 | <script type="text/javascript"> |
| 362 | 362 | |
| 363 | 363 | function geodir_dummy_set_count(data,cpt){ |
@@ -533,7 +533,7 @@ discard block |
||
| 533 | 533 | } |
| 534 | 534 | </script> |
| 535 | 535 | <?php |
| 536 | - } |
|
| 537 | - } |
|
| 536 | + } |
|
| 537 | + } |
|
| 538 | 538 | } |
| 539 | 539 | |
@@ -7,33 +7,33 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | if (!function_exists('geodir_admin_panel')) {
|
| 10 | - /** |
|
| 11 | - * GeoDirectory Backend Admin Panel. |
|
| 12 | - * |
|
| 13 | - * Handles the display of the main GeoDirectory admin panel. |
|
| 14 | - * |
|
| 15 | - * @since 1.0.0 |
|
| 16 | - * @package GeoDirectory |
|
| 17 | - * @global string $current_tab Current tab in geodirectory settings. |
|
| 18 | - * @global object $geodirectory GeoDirectory plugin object. |
|
| 19 | - */ |
|
| 20 | - function geodir_admin_panel() |
|
| 21 | - {
|
|
| 22 | - global $geodirectory; |
|
| 23 | - global $current_tab; |
|
| 24 | - |
|
| 25 | - |
|
| 26 | - ?> |
|
| 10 | + /** |
|
| 11 | + * GeoDirectory Backend Admin Panel. |
|
| 12 | + * |
|
| 13 | + * Handles the display of the main GeoDirectory admin panel. |
|
| 14 | + * |
|
| 15 | + * @since 1.0.0 |
|
| 16 | + * @package GeoDirectory |
|
| 17 | + * @global string $current_tab Current tab in geodirectory settings. |
|
| 18 | + * @global object $geodirectory GeoDirectory plugin object. |
|
| 19 | + */ |
|
| 20 | + function geodir_admin_panel() |
|
| 21 | + {
|
|
| 22 | + global $geodirectory; |
|
| 23 | + global $current_tab; |
|
| 24 | + |
|
| 25 | + |
|
| 26 | + ?> |
|
| 27 | 27 | |
| 28 | 28 | <div id="gd-wrapper-main" class="wrap geodirectory"> |
| 29 | 29 | <?php |
| 30 | - /** |
|
| 31 | - * Called just after the opening wrapper div for the GD settings page in the admin area. |
|
| 32 | - * |
|
| 33 | - * @since 1.0.0 |
|
| 34 | - */ |
|
| 35 | - do_action('geodir_before_admin_panel');
|
|
| 36 | - ?> |
|
| 30 | + /** |
|
| 31 | + * Called just after the opening wrapper div for the GD settings page in the admin area. |
|
| 32 | + * |
|
| 33 | + * @since 1.0.0 |
|
| 34 | + */ |
|
| 35 | + do_action('geodir_before_admin_panel');
|
|
| 36 | + ?> |
|
| 37 | 37 | |
| 38 | 38 | <div class="gd-wrapper gd-wrapper-vr clearfix"> |
| 39 | 39 | |
@@ -44,75 +44,75 @@ discard block |
||
| 44 | 44 | alt="geo-logo" class="geo-logoalter"/> |
| 45 | 45 | <ul> |
| 46 | 46 | <?php |
| 47 | - $tabs = array(); |
|
| 48 | - /** |
|
| 49 | - * Filter the GD admin settings tabs on the left of the admin menu. |
|
| 50 | - * |
|
| 51 | - * @since 1.0.0 |
|
| 52 | - * @param array $tabs The array of tabs to display. |
|
| 53 | - */ |
|
| 54 | - $tabs = apply_filters('geodir_settings_tabs_array', $tabs);
|
|
| 55 | - update_option('geodir_tabs', $tabs);// Important to show settings menu dropdown
|
|
| 56 | - |
|
| 57 | - foreach ($tabs as $name => $args) : |
|
| 58 | - $label = $args['label']; |
|
| 59 | - |
|
| 60 | - |
|
| 61 | - $query_string = ''; |
|
| 62 | - if (isset($args['subtabs']) && !empty($args['subtabs'])): |
|
| 63 | - |
|
| 64 | - $subtabs = $args['subtabs']; |
|
| 65 | - |
|
| 66 | - $query_string = '&subtab=' . $subtabs[0]['subtab']; |
|
| 67 | - |
|
| 68 | - endif; |
|
| 69 | - |
|
| 70 | - |
|
| 71 | - $tab_link = admin_url('admin.php?page=geodirectory&tab=' . $name . $query_string);
|
|
| 72 | - |
|
| 73 | - if (isset($args['url']) && $args['url'] != '') {
|
|
| 74 | - $tab_link = $args['url']; |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - if (!empty($args['request'])) |
|
| 78 | - $tab_link = geodir_getlink($tab_link, $args['request']); |
|
| 79 | - |
|
| 80 | - if (isset($args['target']) && $args['target'] != '') {
|
|
| 81 | - $tab_target = " target='" . sanitize_text_field($args['target']) . "' "; |
|
| 82 | - } else |
|
| 83 | - $tab_target = ''; |
|
| 84 | - |
|
| 85 | - $tab_active = ''; |
|
| 86 | - if ($current_tab == $name) |
|
| 87 | - $tab_active = ' class="tab-active" '; |
|
| 88 | - /** |
|
| 89 | - * Called before the individual settings tabs are output. |
|
| 90 | - * |
|
| 91 | - * @since 1.0.0 |
|
| 92 | - * @param string $name The name of the settings tab. |
|
| 93 | - * @see 'geodir_after_settings_tabs' |
|
| 94 | - */ |
|
| 95 | - do_action('geodir_before_settings_tabs', $name);
|
|
| 96 | - echo '<li ' . $tab_active . ' ><a href="' . esc_url($tab_link) . '" ' . $tab_target . ' >' . $label . '</a></li>'; |
|
| 97 | - /** |
|
| 98 | - * Called after the individual settings tabs are output. |
|
| 99 | - * |
|
| 100 | - * @since 1.0.0 |
|
| 101 | - * @param string $name The name of the settings tab. |
|
| 102 | - * @see 'geodir_before_settings_tabs' |
|
| 103 | - */ |
|
| 104 | - do_action('geodir_after_settings_tabs', $name);
|
|
| 105 | - endforeach; |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * Called after the GD settings tabs have been output. |
|
| 109 | - * |
|
| 110 | - * Called before the closing `ul` so can be used to add new settings tab links. |
|
| 111 | - * |
|
| 112 | - * @since 1.0.0 |
|
| 113 | - */ |
|
| 114 | - do_action('geodir_settings_tabs');
|
|
| 115 | - ?> |
|
| 47 | + $tabs = array(); |
|
| 48 | + /** |
|
| 49 | + * Filter the GD admin settings tabs on the left of the admin menu. |
|
| 50 | + * |
|
| 51 | + * @since 1.0.0 |
|
| 52 | + * @param array $tabs The array of tabs to display. |
|
| 53 | + */ |
|
| 54 | + $tabs = apply_filters('geodir_settings_tabs_array', $tabs);
|
|
| 55 | + update_option('geodir_tabs', $tabs);// Important to show settings menu dropdown
|
|
| 56 | + |
|
| 57 | + foreach ($tabs as $name => $args) : |
|
| 58 | + $label = $args['label']; |
|
| 59 | + |
|
| 60 | + |
|
| 61 | + $query_string = ''; |
|
| 62 | + if (isset($args['subtabs']) && !empty($args['subtabs'])): |
|
| 63 | + |
|
| 64 | + $subtabs = $args['subtabs']; |
|
| 65 | + |
|
| 66 | + $query_string = '&subtab=' . $subtabs[0]['subtab']; |
|
| 67 | + |
|
| 68 | + endif; |
|
| 69 | + |
|
| 70 | + |
|
| 71 | + $tab_link = admin_url('admin.php?page=geodirectory&tab=' . $name . $query_string);
|
|
| 72 | + |
|
| 73 | + if (isset($args['url']) && $args['url'] != '') {
|
|
| 74 | + $tab_link = $args['url']; |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + if (!empty($args['request'])) |
|
| 78 | + $tab_link = geodir_getlink($tab_link, $args['request']); |
|
| 79 | + |
|
| 80 | + if (isset($args['target']) && $args['target'] != '') {
|
|
| 81 | + $tab_target = " target='" . sanitize_text_field($args['target']) . "' "; |
|
| 82 | + } else |
|
| 83 | + $tab_target = ''; |
|
| 84 | + |
|
| 85 | + $tab_active = ''; |
|
| 86 | + if ($current_tab == $name) |
|
| 87 | + $tab_active = ' class="tab-active" '; |
|
| 88 | + /** |
|
| 89 | + * Called before the individual settings tabs are output. |
|
| 90 | + * |
|
| 91 | + * @since 1.0.0 |
|
| 92 | + * @param string $name The name of the settings tab. |
|
| 93 | + * @see 'geodir_after_settings_tabs' |
|
| 94 | + */ |
|
| 95 | + do_action('geodir_before_settings_tabs', $name);
|
|
| 96 | + echo '<li ' . $tab_active . ' ><a href="' . esc_url($tab_link) . '" ' . $tab_target . ' >' . $label . '</a></li>'; |
|
| 97 | + /** |
|
| 98 | + * Called after the individual settings tabs are output. |
|
| 99 | + * |
|
| 100 | + * @since 1.0.0 |
|
| 101 | + * @param string $name The name of the settings tab. |
|
| 102 | + * @see 'geodir_before_settings_tabs' |
|
| 103 | + */ |
|
| 104 | + do_action('geodir_after_settings_tabs', $name);
|
|
| 105 | + endforeach; |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * Called after the GD settings tabs have been output. |
|
| 109 | + * |
|
| 110 | + * Called before the closing `ul` so can be used to add new settings tab links. |
|
| 111 | + * |
|
| 112 | + * @since 1.0.0 |
|
| 113 | + */ |
|
| 114 | + do_action('geodir_settings_tabs');
|
|
| 115 | + ?> |
|
| 116 | 116 | </ul> |
| 117 | 117 | </div> |
| 118 | 118 | <!--gd-left-nav ends here--> |
@@ -121,52 +121,52 @@ discard block |
||
| 121 | 121 | <div class="gd-tabs-main"> |
| 122 | 122 | |
| 123 | 123 | <?php |
| 124 | - unset($subtabs); |
|
| 125 | - if (isset($tabs[$current_tab]['subtabs'])) |
|
| 126 | - $subtabs = $tabs[$current_tab]['subtabs']; |
|
| 127 | - $form_action = ''; |
|
| 124 | + unset($subtabs); |
|
| 125 | + if (isset($tabs[$current_tab]['subtabs'])) |
|
| 126 | + $subtabs = $tabs[$current_tab]['subtabs']; |
|
| 127 | + $form_action = ''; |
|
| 128 | 128 | |
| 129 | - if (!empty($subtabs)): |
|
| 130 | - ?> |
|
| 129 | + if (!empty($subtabs)): |
|
| 130 | + ?> |
|
| 131 | 131 | <dl class="gd-tab-head"> |
| 132 | 132 | <?php |
| 133 | - foreach ($subtabs as $sub) {
|
|
| 134 | - $subtab_active = ''; |
|
| 135 | - if (isset($_REQUEST['subtab']) && $sub['subtab'] == $_REQUEST['subtab']) {
|
|
| 136 | - $subtab_active = 'class="gd-tab-active"'; |
|
| 137 | - $form_action = isset($sub['form_action']) ? $sub['form_action'] : ''; |
|
| 138 | - } |
|
| 139 | - |
|
| 140 | - $sub_tabs_link = admin_url() . 'admin.php?page=geodirectory&tab=' . $current_tab . '&subtab=' . $sub['subtab']; |
|
| 141 | - if (isset($sub['request']) && is_array($sub['request']) && !empty($sub['request'])) {
|
|
| 142 | - $sub_tabs_link = geodir_getlink($sub_tabs_link, $sub['request']); |
|
| 143 | - } |
|
| 144 | - echo '<dd ' . $subtab_active . ' id="claim_listing"><a href="' . esc_url($sub_tabs_link) . '" >' . sanitize_text_field($sub['label']) . '</a></dd>'; |
|
| 145 | - } |
|
| 146 | - ?> |
|
| 133 | + foreach ($subtabs as $sub) {
|
|
| 134 | + $subtab_active = ''; |
|
| 135 | + if (isset($_REQUEST['subtab']) && $sub['subtab'] == $_REQUEST['subtab']) {
|
|
| 136 | + $subtab_active = 'class="gd-tab-active"'; |
|
| 137 | + $form_action = isset($sub['form_action']) ? $sub['form_action'] : ''; |
|
| 138 | + } |
|
| 139 | + |
|
| 140 | + $sub_tabs_link = admin_url() . 'admin.php?page=geodirectory&tab=' . $current_tab . '&subtab=' . $sub['subtab']; |
|
| 141 | + if (isset($sub['request']) && is_array($sub['request']) && !empty($sub['request'])) {
|
|
| 142 | + $sub_tabs_link = geodir_getlink($sub_tabs_link, $sub['request']); |
|
| 143 | + } |
|
| 144 | + echo '<dd ' . $subtab_active . ' id="claim_listing"><a href="' . esc_url($sub_tabs_link) . '" >' . sanitize_text_field($sub['label']) . '</a></dd>'; |
|
| 145 | + } |
|
| 146 | + ?> |
|
| 147 | 147 | </dl> |
| 148 | 148 | |
| 149 | 149 | <?php endif; ?> |
| 150 | 150 | <div class="gd-tab-content <?php if (empty($subtabs)) {
|
| 151 | - echo "inner_contet_tabs"; |
|
| 152 | - } ?>"> |
|
| 151 | + echo "inner_contet_tabs"; |
|
| 152 | + } ?>"> |
|
| 153 | 153 | <form method="post" id="mainform" |
| 154 | 154 | class="geodir_optionform <?php echo $current_tab . ' '; ?><?php if (isset($sub['subtab'])) {
|
| 155 | - echo sanitize_text_field($sub['subtab']); |
|
| 156 | - } ?>" action="<?php echo $form_action; ?>" enctype="multipart/form-data"> |
|
| 155 | + echo sanitize_text_field($sub['subtab']); |
|
| 156 | + } ?>" action="<?php echo $form_action; ?>" enctype="multipart/form-data"> |
|
| 157 | 157 | <input type="hidden" class="active_tab" name="active_tab" |
| 158 | 158 | value="<?php if (isset($_REQUEST['active_tab'])) {
|
| 159 | - echo sanitize_text_field($_REQUEST['active_tab']); |
|
| 160 | - } ?>"/> |
|
| 159 | + echo sanitize_text_field($_REQUEST['active_tab']); |
|
| 160 | + } ?>"/> |
|
| 161 | 161 | <?php wp_nonce_field('geodir-settings', '_wpnonce', true, true); ?>
|
| 162 | 162 | <?php wp_nonce_field('geodir-settings-' . $current_tab, '_wpnonce-' . $current_tab, true, true); ?>
|
| 163 | 163 | <?php |
| 164 | - /** |
|
| 165 | - * Used to call the content of each GD settings tab page. |
|
| 166 | - * |
|
| 167 | - * @since 1.0.0 |
|
| 168 | - */ |
|
| 169 | - do_action('geodir_admin_option_form', $current_tab); ?>
|
|
| 164 | + /** |
|
| 165 | + * Used to call the content of each GD settings tab page. |
|
| 166 | + * |
|
| 167 | + * @since 1.0.0 |
|
| 168 | + */ |
|
| 169 | + do_action('geodir_admin_option_form', $current_tab); ?>
|
|
| 170 | 170 | </form> |
| 171 | 171 | </div> |
| 172 | 172 | |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | </script> |
| 268 | 268 | <?php |
| 269 | 269 | |
| 270 | - } |
|
| 270 | + } |
|
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | |
@@ -283,48 +283,48 @@ discard block |
||
| 283 | 283 | function geodir_admin_option_form($tab_name) |
| 284 | 284 | {
|
| 285 | 285 | |
| 286 | - //echo $tab_name.'_array.php' ; |
|
| 287 | - global $geodir_settings, $is_default, $mapzoom; |
|
| 288 | - if (file_exists(dirname(__FILE__) . '/option-pages/' . $tab_name . '_array.php')) {
|
|
| 289 | - /** |
|
| 290 | - * Contains settings array for given tab. |
|
| 291 | - * |
|
| 292 | - * @since 1.0.0 |
|
| 293 | - * @package GeoDirectory |
|
| 294 | - */ |
|
| 295 | - include_once('option-pages/' . $tab_name . '_array.php');
|
|
| 296 | - } |
|
| 297 | - |
|
| 298 | - $listing_type = isset($_REQUEST['listing_type']) ? $_REQUEST['listing_type'] : ''; |
|
| 299 | - |
|
| 300 | - switch ($tab_name) {
|
|
| 301 | - |
|
| 302 | - case 'general_settings': |
|
| 303 | - |
|
| 304 | - geodir_admin_fields($geodir_settings['general_settings']); |
|
| 305 | - /** |
|
| 306 | - * |
|
| 307 | - * Update Taxonomy Options * |
|
| 308 | - * |
|
| 309 | - **/ |
|
| 310 | - /*add_action('updated_option_place_prefix','update_listing_prefix');
|
|
| 286 | + //echo $tab_name.'_array.php' ; |
|
| 287 | + global $geodir_settings, $is_default, $mapzoom; |
|
| 288 | + if (file_exists(dirname(__FILE__) . '/option-pages/' . $tab_name . '_array.php')) {
|
|
| 289 | + /** |
|
| 290 | + * Contains settings array for given tab. |
|
| 291 | + * |
|
| 292 | + * @since 1.0.0 |
|
| 293 | + * @package GeoDirectory |
|
| 294 | + */ |
|
| 295 | + include_once('option-pages/' . $tab_name . '_array.php');
|
|
| 296 | + } |
|
| 297 | + |
|
| 298 | + $listing_type = isset($_REQUEST['listing_type']) ? $_REQUEST['listing_type'] : ''; |
|
| 299 | + |
|
| 300 | + switch ($tab_name) {
|
|
| 301 | + |
|
| 302 | + case 'general_settings': |
|
| 303 | + |
|
| 304 | + geodir_admin_fields($geodir_settings['general_settings']); |
|
| 305 | + /** |
|
| 306 | + * |
|
| 307 | + * Update Taxonomy Options * |
|
| 308 | + * |
|
| 309 | + **/ |
|
| 310 | + /*add_action('updated_option_place_prefix','update_listing_prefix');
|
|
| 311 | 311 | function update_listing_prefix(){
|
| 312 | 312 | geodir_register_defaults(); |
| 313 | 313 | }*/ |
| 314 | 314 | |
| 315 | - if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) |
|
| 316 | - $hide_save_button = "style='display:none;'"; |
|
| 317 | - else |
|
| 318 | - $hide_save_button = ''; |
|
| 315 | + if (isset($_REQUEST['active_tab']) && ($_REQUEST['active_tab'] == 'dummy_data_settings' || $_REQUEST['active_tab'] == 'csv_upload_settings')) |
|
| 316 | + $hide_save_button = "style='display:none;'"; |
|
| 317 | + else |
|
| 318 | + $hide_save_button = ''; |
|
| 319 | 319 | |
| 320 | - /** |
|
| 321 | - * Filter weather the default save button in the GD admin settings pages should be shown. |
|
| 322 | - * |
|
| 323 | - * @since 1.0.0 |
|
| 324 | - * @param string $hide_save_button The style element, either blank or: style='display:none;'. |
|
| 325 | - */ |
|
| 326 | - $hide_save_button = apply_filters('geodir_hide_save_button', $hide_save_button);
|
|
| 327 | - ?> |
|
| 320 | + /** |
|
| 321 | + * Filter weather the default save button in the GD admin settings pages should be shown. |
|
| 322 | + * |
|
| 323 | + * @since 1.0.0 |
|
| 324 | + * @param string $hide_save_button The style element, either blank or: style='display:none;'. |
|
| 325 | + */ |
|
| 326 | + $hide_save_button = apply_filters('geodir_hide_save_button', $hide_save_button);
|
|
| 327 | + ?> |
|
| 328 | 328 | |
| 329 | 329 | <p class="submit"> |
| 330 | 330 | <input <?php echo $hide_save_button;?> name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
|
@@ -334,38 +334,38 @@ discard block |
||
| 334 | 334 | </div> |
| 335 | 335 | |
| 336 | 336 | <?php break; |
| 337 | - case 'design_settings' : |
|
| 337 | + case 'design_settings' : |
|
| 338 | 338 | |
| 339 | - add_thickbox(); |
|
| 340 | - geodir_admin_fields($geodir_settings['design_settings']); |
|
| 339 | + add_thickbox(); |
|
| 340 | + geodir_admin_fields($geodir_settings['design_settings']); |
|
| 341 | 341 | |
| 342 | 342 | |
| 343 | 343 | |
| 344 | - ?> |
|
| 344 | + ?> |
|
| 345 | 345 | <p class="submit"> |
| 346 | 346 | <input name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
|
| 347 | 347 | <input type="hidden" name="subtab" id="last_tab" /> |
| 348 | 348 | </p> |
| 349 | 349 | </div> |
| 350 | 350 | <?php break; |
| 351 | - case 'permalink_settings' : |
|
| 352 | - geodir_admin_fields($geodir_settings['permalink_settings']); ?> |
|
| 351 | + case 'permalink_settings' : |
|
| 352 | + geodir_admin_fields($geodir_settings['permalink_settings']); ?> |
|
| 353 | 353 | <p class="submit"> |
| 354 | 354 | <input name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
|
| 355 | 355 | <input type="hidden" name="subtab" id="last_tab" /> |
| 356 | 356 | </p> |
| 357 | 357 | </div> |
| 358 | 358 | <?php break; |
| 359 | - case 'title_meta_settings' : |
|
| 360 | - geodir_admin_fields($geodir_settings['title_meta_settings']); ?> |
|
| 359 | + case 'title_meta_settings' : |
|
| 360 | + geodir_admin_fields($geodir_settings['title_meta_settings']); ?> |
|
| 361 | 361 | <p class="submit"> |
| 362 | 362 | <input name="save" class="button-primary" type="submit" value="<?php _e('Save changes', 'geodirectory'); ?>" />
|
| 363 | 363 | <input type="hidden" name="subtab" id="last_tab" /> |
| 364 | 364 | </p> |
| 365 | 365 | </div> |
| 366 | 366 | <?php break; |
| 367 | - case 'notifications_settings' : |
|
| 368 | - geodir_admin_fields($geodir_settings['notifications_settings']); ?> |
|
| 367 | + case 'notifications_settings' : |
|
| 368 | + geodir_admin_fields($geodir_settings['notifications_settings']); ?> |
|
| 369 | 369 | |
| 370 | 370 | <p class="submit"> |
| 371 | 371 | |
@@ -375,36 +375,36 @@ discard block |
||
| 375 | 375 | </div> |
| 376 | 376 | |
| 377 | 377 | <?php break; |
| 378 | - case 'default_location_settings' : |
|
| 379 | - ?> |
|
| 378 | + case 'default_location_settings' : |
|
| 379 | + ?> |
|
| 380 | 380 | <div class="inner_content_tab_main"> |
| 381 | 381 | <div class="gd-content-heading"> |
| 382 | 382 | <?php global $wpdb; |
| 383 | 383 | |
| 384 | 384 | |
| 385 | - $location_result = geodir_get_default_location(); |
|
| 385 | + $location_result = geodir_get_default_location(); |
|
| 386 | 386 | |
| 387 | - $prefix = ''; |
|
| 387 | + $prefix = ''; |
|
| 388 | 388 | |
| 389 | 389 | |
| 390 | - $lat = isset($location_result->city_latitude) ? $location_result->city_latitude : ''; |
|
| 391 | - $lng = isset($location_result->city_longitude) ? $location_result->city_longitude : ''; |
|
| 392 | - $city = isset($location_result->city) ? $location_result->city : ''; |
|
| 393 | - $region = isset($location_result->region) ? $location_result->region : ''; |
|
| 394 | - $country = isset($location_result->country) ? $location_result->country : ''; |
|
| 390 | + $lat = isset($location_result->city_latitude) ? $location_result->city_latitude : ''; |
|
| 391 | + $lng = isset($location_result->city_longitude) ? $location_result->city_longitude : ''; |
|
| 392 | + $city = isset($location_result->city) ? $location_result->city : ''; |
|
| 393 | + $region = isset($location_result->region) ? $location_result->region : ''; |
|
| 394 | + $country = isset($location_result->country) ? $location_result->country : ''; |
|
| 395 | 395 | |
| 396 | 396 | |
| 397 | - $map_title = __("Set Address On Map", 'geodirectory');
|
|
| 397 | + $map_title = __("Set Address On Map", 'geodirectory');
|
|
| 398 | 398 | |
| 399 | - ?> |
|
| 399 | + ?> |
|
| 400 | 400 | |
| 401 | 401 | <h3><?php _e('Set Default Location', 'geodirectory');?></h3>
|
| 402 | 402 | |
| 403 | 403 | <input type="hidden" name="add_location" value="location"> |
| 404 | 404 | |
| 405 | 405 | <input type="hidden" name="update_city" value="<?php if (isset($location_result->location_id)) {
|
| 406 | - echo $location_result->location_id; |
|
| 407 | - } ?>"> |
|
| 406 | + echo $location_result->location_id; |
|
| 407 | + } ?>"> |
|
| 408 | 408 | |
| 409 | 409 | <input type="hidden" name="address" id="<?php echo $prefix;?>address" value=""> |
| 410 | 410 | |
@@ -417,8 +417,8 @@ discard block |
||
| 417 | 417 | <input class="require" type="text" size="80" style="width:440px" |
| 418 | 418 | id="<?php echo $prefix;?>city" name="city" |
| 419 | 419 | value="<?php if (isset($location_result->city)) {
|
| 420 | - echo $location_result->city; |
|
| 421 | - } ?>"/> |
|
| 420 | + echo $location_result->city; |
|
| 421 | + } ?>"/> |
|
| 422 | 422 | |
| 423 | 423 | <div |
| 424 | 424 | class="gd-location_message_error"> <?php _e('This field is required.', 'geodirectory'); ?></div>
|
@@ -433,8 +433,8 @@ discard block |
||
| 433 | 433 | <input class="require" type="text" size="80" style="width:440px" |
| 434 | 434 | id="<?php echo $prefix;?>region" name="region" |
| 435 | 435 | value="<?php if (isset($location_result->region)) {
|
| 436 | - echo $location_result->region; |
|
| 437 | - } ?>"/> |
|
| 436 | + echo $location_result->region; |
|
| 437 | + } ?>"/> |
|
| 438 | 438 | |
| 439 | 439 | <div |
| 440 | 440 | class="gd-location_message_error"> <?php _e('This field is required.', 'geodirectory'); ?></div>
|
@@ -448,8 +448,8 @@ discard block |
||
| 448 | 448 | <div class="gtd-formfeild required" style="padding-top:10px;"> |
| 449 | 449 | <?php |
| 450 | 450 | |
| 451 | - $country_result = isset($location_result->country) ? $location_result->country : ''; |
|
| 452 | - ?> |
|
| 451 | + $country_result = isset($location_result->country) ? $location_result->country : ''; |
|
| 452 | + ?> |
|
| 453 | 453 | <select id="<?php echo $prefix ?>country" class="chosen_select" |
| 454 | 454 | data-location_type="country" name="<?php echo $prefix ?>country" |
| 455 | 455 | data-placeholder="<?php _e('Choose a country.', 'geodirectory');?>"
|
@@ -472,12 +472,12 @@ discard block |
||
| 472 | 472 | scope="row"><?php _e('Set Location on Map', 'geodirectory');?></th>
|
| 473 | 473 | <td class="forminp"> |
| 474 | 474 | <?php |
| 475 | - /** |
|
| 476 | - * Contains add listing page map functions. |
|
| 477 | - * |
|
| 478 | - * @since 1.0.0 |
|
| 479 | - */ |
|
| 480 | - include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");?> |
|
| 475 | + /** |
|
| 476 | + * Contains add listing page map functions. |
|
| 477 | + * |
|
| 478 | + * @since 1.0.0 |
|
| 479 | + */ |
|
| 480 | + include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");?> |
|
| 481 | 481 | </td> |
| 482 | 482 | </tr> |
| 483 | 483 | <tr valign="top" class="single_select_page"> |
@@ -487,8 +487,8 @@ discard block |
||
| 487 | 487 | <input type="text" class="require" size="80" style="width:440px" |
| 488 | 488 | id="<?php echo $prefix;?>latitude" name="latitude" |
| 489 | 489 | value="<?php if (isset($location_result->city_latitude)) {
|
| 490 | - echo $location_result->city_latitude; |
|
| 491 | - } ?>"/> |
|
| 490 | + echo $location_result->city_latitude; |
|
| 491 | + } ?>"/> |
|
| 492 | 492 | |
| 493 | 493 | <div |
| 494 | 494 | class="gd-location_message_error"><?php _e('This field is required.', 'geodirectory'); ?></div>
|
@@ -504,8 +504,8 @@ discard block |
||
| 504 | 504 | <input type="text" class="require" size="80" style="width:440px" |
| 505 | 505 | id="<?php echo $prefix;?>longitude" name="longitude" |
| 506 | 506 | value="<?php if (isset($location_result->city_longitude)) {
|
| 507 | - echo $location_result->city_longitude; |
|
| 508 | - } ?>"/> |
|
| 507 | + echo $location_result->city_longitude; |
|
| 508 | + } ?>"/> |
|
| 509 | 509 | |
| 510 | 510 | <div |
| 511 | 511 | class="gd-location_message_error"><?php _e('This field is required.', 'geodirectory'); ?></div>
|
@@ -537,22 +537,22 @@ discard block |
||
| 537 | 537 | </div> |
| 538 | 538 | </div> |
| 539 | 539 | <?php break; |
| 540 | - case $listing_type . '_fields_settings' : |
|
| 540 | + case $listing_type . '_fields_settings' : |
|
| 541 | 541 | |
| 542 | - geodir_custom_post_type_form(); |
|
| 542 | + geodir_custom_post_type_form(); |
|
| 543 | 543 | |
| 544 | - break; |
|
| 545 | - case 'tools_settings' : |
|
| 546 | - geodir_diagnostic_tools_setting_page(); |
|
| 547 | - break; |
|
| 548 | - case 'compatibility_settings' : |
|
| 549 | - geodir_theme_compatibility_setting_page(); |
|
| 550 | - break; |
|
| 544 | + break; |
|
| 545 | + case 'tools_settings' : |
|
| 546 | + geodir_diagnostic_tools_setting_page(); |
|
| 547 | + break; |
|
| 548 | + case 'compatibility_settings' : |
|
| 549 | + geodir_theme_compatibility_setting_page(); |
|
| 550 | + break; |
|
| 551 | 551 | case 'import_export' : |
| 552 | - geodir_import_export_page(); |
|
| 553 | - break; |
|
| 552 | + geodir_import_export_page(); |
|
| 553 | + break; |
|
| 554 | 554 | |
| 555 | - }// end of switch |
|
| 555 | + }// end of switch |
|
| 556 | 556 | } |
| 557 | 557 | |
| 558 | 558 | |
@@ -592,170 +592,170 @@ discard block |
||
| 592 | 592 | function geodir_update_options_compatibility_settings() |
| 593 | 593 | {
|
| 594 | 594 | |
| 595 | - global $wpdb; |
|
| 595 | + global $wpdb; |
|
| 596 | 596 | |
| 597 | 597 | |
| 598 | - $theme_settings = array(); |
|
| 598 | + $theme_settings = array(); |
|
| 599 | 599 | |
| 600 | - $theme_settings['geodir_wrapper_open_id'] = $_POST['geodir_wrapper_open_id']; |
|
| 601 | - $theme_settings['geodir_wrapper_open_class'] = $_POST['geodir_wrapper_open_class']; |
|
| 602 | - $theme_settings['geodir_wrapper_open_replace'] = stripslashes($_POST['geodir_wrapper_open_replace']); |
|
| 600 | + $theme_settings['geodir_wrapper_open_id'] = $_POST['geodir_wrapper_open_id']; |
|
| 601 | + $theme_settings['geodir_wrapper_open_class'] = $_POST['geodir_wrapper_open_class']; |
|
| 602 | + $theme_settings['geodir_wrapper_open_replace'] = stripslashes($_POST['geodir_wrapper_open_replace']); |
|
| 603 | 603 | |
| 604 | - $theme_settings['geodir_wrapper_close_replace'] = stripslashes($_POST['geodir_wrapper_close_replace']); |
|
| 604 | + $theme_settings['geodir_wrapper_close_replace'] = stripslashes($_POST['geodir_wrapper_close_replace']); |
|
| 605 | 605 | |
| 606 | - $theme_settings['geodir_wrapper_content_open_id'] = $_POST['geodir_wrapper_content_open_id']; |
|
| 607 | - $theme_settings['geodir_wrapper_content_open_class'] = $_POST['geodir_wrapper_content_open_class']; |
|
| 608 | - $theme_settings['geodir_wrapper_content_open_replace'] = stripslashes($_POST['geodir_wrapper_content_open_replace']); |
|
| 606 | + $theme_settings['geodir_wrapper_content_open_id'] = $_POST['geodir_wrapper_content_open_id']; |
|
| 607 | + $theme_settings['geodir_wrapper_content_open_class'] = $_POST['geodir_wrapper_content_open_class']; |
|
| 608 | + $theme_settings['geodir_wrapper_content_open_replace'] = stripslashes($_POST['geodir_wrapper_content_open_replace']); |
|
| 609 | 609 | |
| 610 | - $theme_settings['geodir_wrapper_content_close_replace'] = stripslashes($_POST['geodir_wrapper_content_close_replace']); |
|
| 610 | + $theme_settings['geodir_wrapper_content_close_replace'] = stripslashes($_POST['geodir_wrapper_content_close_replace']); |
|
| 611 | 611 | |
| 612 | - $theme_settings['geodir_article_open_id'] = $_POST['geodir_article_open_id']; |
|
| 613 | - $theme_settings['geodir_article_open_class'] = $_POST['geodir_article_open_class']; |
|
| 614 | - $theme_settings['geodir_article_open_replace'] = stripslashes($_POST['geodir_article_open_replace']); |
|
| 612 | + $theme_settings['geodir_article_open_id'] = $_POST['geodir_article_open_id']; |
|
| 613 | + $theme_settings['geodir_article_open_class'] = $_POST['geodir_article_open_class']; |
|
| 614 | + $theme_settings['geodir_article_open_replace'] = stripslashes($_POST['geodir_article_open_replace']); |
|
| 615 | 615 | |
| 616 | - $theme_settings['geodir_article_close_replace'] = stripslashes($_POST['geodir_article_close_replace']); |
|
| 616 | + $theme_settings['geodir_article_close_replace'] = stripslashes($_POST['geodir_article_close_replace']); |
|
| 617 | 617 | |
| 618 | - $theme_settings['geodir_sidebar_right_open_id'] = $_POST['geodir_sidebar_right_open_id']; |
|
| 619 | - $theme_settings['geodir_sidebar_right_open_class'] = $_POST['geodir_sidebar_right_open_class']; |
|
| 620 | - $theme_settings['geodir_sidebar_right_open_replace'] = stripslashes($_POST['geodir_sidebar_right_open_replace']); |
|
| 618 | + $theme_settings['geodir_sidebar_right_open_id'] = $_POST['geodir_sidebar_right_open_id']; |
|
| 619 | + $theme_settings['geodir_sidebar_right_open_class'] = $_POST['geodir_sidebar_right_open_class']; |
|
| 620 | + $theme_settings['geodir_sidebar_right_open_replace'] = stripslashes($_POST['geodir_sidebar_right_open_replace']); |
|
| 621 | 621 | |
| 622 | - $theme_settings['geodir_sidebar_right_close_replace'] = stripslashes($_POST['geodir_sidebar_right_close_replace']); |
|
| 622 | + $theme_settings['geodir_sidebar_right_close_replace'] = stripslashes($_POST['geodir_sidebar_right_close_replace']); |
|
| 623 | 623 | |
| 624 | - $theme_settings['geodir_sidebar_left_open_id'] = $_POST['geodir_sidebar_left_open_id']; |
|
| 625 | - $theme_settings['geodir_sidebar_left_open_class'] = $_POST['geodir_sidebar_left_open_class']; |
|
| 626 | - $theme_settings['geodir_sidebar_left_open_replace'] = stripslashes($_POST['geodir_sidebar_left_open_replace']); |
|
| 624 | + $theme_settings['geodir_sidebar_left_open_id'] = $_POST['geodir_sidebar_left_open_id']; |
|
| 625 | + $theme_settings['geodir_sidebar_left_open_class'] = $_POST['geodir_sidebar_left_open_class']; |
|
| 626 | + $theme_settings['geodir_sidebar_left_open_replace'] = stripslashes($_POST['geodir_sidebar_left_open_replace']); |
|
| 627 | 627 | |
| 628 | - $theme_settings['geodir_sidebar_left_close_replace'] = stripslashes($_POST['geodir_sidebar_left_close_replace']); |
|
| 628 | + $theme_settings['geodir_sidebar_left_close_replace'] = stripslashes($_POST['geodir_sidebar_left_close_replace']); |
|
| 629 | 629 | |
| 630 | - $theme_settings['geodir_main_content_open_id'] = $_POST['geodir_main_content_open_id']; |
|
| 631 | - $theme_settings['geodir_main_content_open_class'] = $_POST['geodir_main_content_open_class']; |
|
| 632 | - $theme_settings['geodir_main_content_open_replace'] = stripslashes($_POST['geodir_main_content_open_replace']); |
|
| 630 | + $theme_settings['geodir_main_content_open_id'] = $_POST['geodir_main_content_open_id']; |
|
| 631 | + $theme_settings['geodir_main_content_open_class'] = $_POST['geodir_main_content_open_class']; |
|
| 632 | + $theme_settings['geodir_main_content_open_replace'] = stripslashes($_POST['geodir_main_content_open_replace']); |
|
| 633 | 633 | |
| 634 | - $theme_settings['geodir_main_content_close_replace'] = stripslashes($_POST['geodir_main_content_close_replace']); |
|
| 634 | + $theme_settings['geodir_main_content_close_replace'] = stripslashes($_POST['geodir_main_content_close_replace']); |
|
| 635 | 635 | |
| 636 | 636 | // Other Actions |
| 637 | - $theme_settings['geodir_top_content_add'] = stripslashes($_POST['geodir_top_content_add']); |
|
| 638 | - $theme_settings['geodir_before_main_content_add'] = stripslashes($_POST['geodir_before_main_content_add']); |
|
| 637 | + $theme_settings['geodir_top_content_add'] = stripslashes($_POST['geodir_top_content_add']); |
|
| 638 | + $theme_settings['geodir_before_main_content_add'] = stripslashes($_POST['geodir_before_main_content_add']); |
|
| 639 | 639 | |
| 640 | 640 | // Filters |
| 641 | - $theme_settings['geodir_full_page_class_filter'] = stripslashes($_POST['geodir_full_page_class_filter']); |
|
| 642 | - $theme_settings['geodir_before_widget_filter'] = stripslashes($_POST['geodir_before_widget_filter']); |
|
| 643 | - $theme_settings['geodir_after_widget_filter'] = stripslashes($_POST['geodir_after_widget_filter']); |
|
| 644 | - $theme_settings['geodir_before_title_filter'] = stripslashes($_POST['geodir_before_title_filter']); |
|
| 645 | - $theme_settings['geodir_after_title_filter'] = stripslashes($_POST['geodir_after_title_filter']); |
|
| 646 | - $theme_settings['geodir_menu_li_class_filter'] = stripslashes($_POST['geodir_menu_li_class_filter']); |
|
| 647 | - $theme_settings['geodir_sub_menu_ul_class_filter'] = stripslashes($_POST['geodir_sub_menu_ul_class_filter']); |
|
| 648 | - $theme_settings['geodir_sub_menu_li_class_filter'] = stripslashes($_POST['geodir_sub_menu_li_class_filter']); |
|
| 649 | - $theme_settings['geodir_menu_a_class_filter'] = stripslashes($_POST['geodir_menu_a_class_filter']); |
|
| 650 | - $theme_settings['geodir_sub_menu_a_class_filter'] = stripslashes($_POST['geodir_sub_menu_a_class_filter']); |
|
| 641 | + $theme_settings['geodir_full_page_class_filter'] = stripslashes($_POST['geodir_full_page_class_filter']); |
|
| 642 | + $theme_settings['geodir_before_widget_filter'] = stripslashes($_POST['geodir_before_widget_filter']); |
|
| 643 | + $theme_settings['geodir_after_widget_filter'] = stripslashes($_POST['geodir_after_widget_filter']); |
|
| 644 | + $theme_settings['geodir_before_title_filter'] = stripslashes($_POST['geodir_before_title_filter']); |
|
| 645 | + $theme_settings['geodir_after_title_filter'] = stripslashes($_POST['geodir_after_title_filter']); |
|
| 646 | + $theme_settings['geodir_menu_li_class_filter'] = stripslashes($_POST['geodir_menu_li_class_filter']); |
|
| 647 | + $theme_settings['geodir_sub_menu_ul_class_filter'] = stripslashes($_POST['geodir_sub_menu_ul_class_filter']); |
|
| 648 | + $theme_settings['geodir_sub_menu_li_class_filter'] = stripslashes($_POST['geodir_sub_menu_li_class_filter']); |
|
| 649 | + $theme_settings['geodir_menu_a_class_filter'] = stripslashes($_POST['geodir_menu_a_class_filter']); |
|
| 650 | + $theme_settings['geodir_sub_menu_a_class_filter'] = stripslashes($_POST['geodir_sub_menu_a_class_filter']); |
|
| 651 | 651 | //location manager filters |
| 652 | - $theme_settings['geodir_location_switcher_menu_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_li_class_filter']); |
|
| 653 | - $theme_settings['geodir_location_switcher_menu_a_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_a_class_filter']); |
|
| 654 | - $theme_settings['geodir_location_switcher_menu_sub_ul_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_ul_class_filter']); |
|
| 655 | - $theme_settings['geodir_location_switcher_menu_sub_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_li_class_filter']); |
|
| 652 | + $theme_settings['geodir_location_switcher_menu_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_li_class_filter']); |
|
| 653 | + $theme_settings['geodir_location_switcher_menu_a_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_a_class_filter']); |
|
| 654 | + $theme_settings['geodir_location_switcher_menu_sub_ul_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_ul_class_filter']); |
|
| 655 | + $theme_settings['geodir_location_switcher_menu_sub_li_class_filter'] = stripslashes($_POST['geodir_location_switcher_menu_sub_li_class_filter']); |
|
| 656 | 656 | |
| 657 | 657 | |
| 658 | 658 | // theme required css |
| 659 | - $theme_settings['geodir_theme_compat_css'] = stripslashes($_POST['geodir_theme_compat_css']); |
|
| 659 | + $theme_settings['geodir_theme_compat_css'] = stripslashes($_POST['geodir_theme_compat_css']); |
|
| 660 | 660 | |
| 661 | 661 | // theme required js |
| 662 | - $theme_settings['geodir_theme_compat_js'] = stripslashes($_POST['geodir_theme_compat_js']); |
|
| 662 | + $theme_settings['geodir_theme_compat_js'] = stripslashes($_POST['geodir_theme_compat_js']); |
|
| 663 | 663 | |
| 664 | 664 | // theme compat name |
| 665 | - $theme_settings['gd_theme_compat'] = $_POST['gd_theme_compat']; |
|
| 666 | - if ($theme_settings['gd_theme_compat'] == '') {
|
|
| 667 | - update_option('gd_theme_compat', '');
|
|
| 668 | - update_option('theme_compatibility_setting', '');
|
|
| 669 | - return; |
|
| 670 | - } |
|
| 665 | + $theme_settings['gd_theme_compat'] = $_POST['gd_theme_compat']; |
|
| 666 | + if ($theme_settings['gd_theme_compat'] == '') {
|
|
| 667 | + update_option('gd_theme_compat', '');
|
|
| 668 | + update_option('theme_compatibility_setting', '');
|
|
| 669 | + return; |
|
| 670 | + } |
|
| 671 | 671 | |
| 672 | 672 | // theme default options |
| 673 | - $theme_settings['geodir_theme_compat_default_options'] = ''; |
|
| 673 | + $theme_settings['geodir_theme_compat_default_options'] = ''; |
|
| 674 | 674 | |
| 675 | 675 | |
| 676 | 676 | //supported theme code |
| 677 | - $theme_settings['geodir_theme_compat_code'] = false; |
|
| 678 | - |
|
| 679 | - $theme = wp_get_theme(); |
|
| 680 | - |
|
| 681 | - if ($theme->parent()) {
|
|
| 682 | - $theme_name = str_replace(" ", "_", $theme->parent()->get('Name'));
|
|
| 683 | - } else {
|
|
| 684 | - $theme_name = str_replace(" ", "_", $theme->get('Name'));
|
|
| 685 | - } |
|
| 686 | - |
|
| 687 | - if (in_array($theme_name, array('Avada', 'Enfold', 'X', 'Divi', 'Genesis', 'Jupiter', 'Multi_News'))) {// list of themes that have php files
|
|
| 688 | - $theme_settings['geodir_theme_compat_code'] = $theme_name; |
|
| 689 | - } |
|
| 690 | - |
|
| 691 | - |
|
| 692 | - $theme_name = $theme_name . "_custom"; |
|
| 693 | - $theme_arr = get_option('gd_theme_compats');
|
|
| 694 | - update_option('gd_theme_compat', $theme_name);
|
|
| 695 | - /** |
|
| 696 | - * Called before the theme compatibility settings are saved to the DB. |
|
| 697 | - * |
|
| 698 | - * @since 1.4.0 |
|
| 699 | - * @param array $theme_settings {
|
|
| 700 | - * Attributes of the theme compatibility settings array. |
|
| 701 | - * |
|
| 702 | - * @type string $geodir_wrapper_open_id Geodir wrapper open html id. |
|
| 703 | - * @type string $geodir_wrapper_open_class Geodir wrapper open html class. |
|
| 704 | - * @type string $geodir_wrapper_open_replace Geodir wrapper open content replace. |
|
| 705 | - * @type string $geodir_wrapper_close_replace Geodir wrapper close content replace. |
|
| 706 | - * @type string $geodir_wrapper_content_open_id Geodir wrapper content open html id. |
|
| 707 | - * @type string $geodir_wrapper_content_open_class Geodir wrapper content open html class. |
|
| 708 | - * @type string $geodir_wrapper_content_open_replace Geodir wrapper content open content replace. |
|
| 709 | - * @type string $geodir_wrapper_content_close_replace Geodir wrapper content close content replace. |
|
| 710 | - * @type string $geodir_article_open_id Geodir article open html id. |
|
| 711 | - * @type string $geodir_article_open_class Geodir article open html class. |
|
| 712 | - * @type string $geodir_article_open_replace Geodir article open content replace. |
|
| 713 | - * @type string $geodir_article_close_replace Geodir article close content replace. |
|
| 714 | - * @type string $geodir_sidebar_right_open_id Geodir sidebar right open html id. |
|
| 715 | - * @type string $geodir_sidebar_right_open_class Geodir sidebar right open html class. |
|
| 716 | - * @type string $geodir_sidebar_right_open_replace Geodir sidebar right open content replace. |
|
| 717 | - * @type string $geodir_sidebar_right_close_replace Geodir sidebar right close content replace. |
|
| 718 | - * @type string $geodir_sidebar_left_open_id Geodir sidebar left open html id. |
|
| 719 | - * @type string $geodir_sidebar_left_open_class Geodir sidebar left open html class. |
|
| 720 | - * @type string $geodir_sidebar_left_open_replace Geodir sidebar left open content replace. |
|
| 721 | - * @type string $geodir_sidebar_left_close_replace Geodir sidebar left close content replace. |
|
| 722 | - * @type string $geodir_main_content_open_id Geodir main content open html id. |
|
| 723 | - * @type string $geodir_main_content_open_class Geodir main content open html class. |
|
| 724 | - * @type string $geodir_main_content_open_replace Geodir main content open content replace. |
|
| 725 | - * @type string $geodir_main_content_close_replace Geodir main content close content replace. |
|
| 726 | - * @type string $geodir_top_content_add Geodir top content add. |
|
| 727 | - * @type string $geodir_before_main_content_add Geodir before main content add. |
|
| 728 | - * @type string $geodir_full_page_class_filter Geodir full page class filter. |
|
| 729 | - * @type string $geodir_before_widget_filter Geodir before widget filter. |
|
| 730 | - * @type string $geodir_after_widget_filter Geodir after widget filter. |
|
| 731 | - * @type string $geodir_before_title_filter Geodir before title filter. |
|
| 732 | - * @type string $geodir_after_title_filter Geodir after title filter. |
|
| 733 | - * @type string $geodir_menu_li_class_filter Geodir menu li class filter. |
|
| 734 | - * @type string $geodir_sub_menu_ul_class_filter Geodir sub menu ul class filter. |
|
| 735 | - * @type string $geodir_sub_menu_li_class_filter Geodir sub menu li class filter. |
|
| 736 | - * @type string $geodir_menu_a_class_filter Geodir menu a class filter. |
|
| 737 | - * @type string $geodir_sub_menu_a_class_filter Geodir sub menu a class filter. |
|
| 738 | - * @type string $geodir_location_switcher_menu_li_class_filter Geodir location switcher menu li class filter. |
|
| 739 | - * @type string $geodir_location_switcher_menu_a_class_filter Geodir location switcher menu a class filter. |
|
| 740 | - * @type string $geodir_location_switcher_menu_sub_ul_class_filter Geodir location switcher menu sub ul class filter. |
|
| 741 | - * @type string $geodir_location_switcher_menu_sub_li_class_filter Geodir location switcher menu sub li class filter. |
|
| 742 | - * @type string $geodir_theme_compat_css Geodir theme compatibility css. |
|
| 743 | - * @type string $geodir_theme_compat_js Geodir theme compatibility js. |
|
| 744 | - * @type string $gd_theme_compat Gd theme compatibility. |
|
| 745 | - * @type string $geodir_theme_compat_default_options Geodir theme compatibility default options. |
|
| 746 | - * @type bool $geodir_theme_compat_code Geodir theme compatibility code Ex: 'Avada. |
|
| 747 | - * |
|
| 748 | - * } |
|
| 749 | - */ |
|
| 750 | - do_action('gd_compat_save_settings', $theme_settings);
|
|
| 677 | + $theme_settings['geodir_theme_compat_code'] = false; |
|
| 678 | + |
|
| 679 | + $theme = wp_get_theme(); |
|
| 680 | + |
|
| 681 | + if ($theme->parent()) {
|
|
| 682 | + $theme_name = str_replace(" ", "_", $theme->parent()->get('Name'));
|
|
| 683 | + } else {
|
|
| 684 | + $theme_name = str_replace(" ", "_", $theme->get('Name'));
|
|
| 685 | + } |
|
| 686 | + |
|
| 687 | + if (in_array($theme_name, array('Avada', 'Enfold', 'X', 'Divi', 'Genesis', 'Jupiter', 'Multi_News'))) {// list of themes that have php files
|
|
| 688 | + $theme_settings['geodir_theme_compat_code'] = $theme_name; |
|
| 689 | + } |
|
| 690 | + |
|
| 691 | + |
|
| 692 | + $theme_name = $theme_name . "_custom"; |
|
| 693 | + $theme_arr = get_option('gd_theme_compats');
|
|
| 694 | + update_option('gd_theme_compat', $theme_name);
|
|
| 695 | + /** |
|
| 696 | + * Called before the theme compatibility settings are saved to the DB. |
|
| 697 | + * |
|
| 698 | + * @since 1.4.0 |
|
| 699 | + * @param array $theme_settings {
|
|
| 700 | + * Attributes of the theme compatibility settings array. |
|
| 701 | + * |
|
| 702 | + * @type string $geodir_wrapper_open_id Geodir wrapper open html id. |
|
| 703 | + * @type string $geodir_wrapper_open_class Geodir wrapper open html class. |
|
| 704 | + * @type string $geodir_wrapper_open_replace Geodir wrapper open content replace. |
|
| 705 | + * @type string $geodir_wrapper_close_replace Geodir wrapper close content replace. |
|
| 706 | + * @type string $geodir_wrapper_content_open_id Geodir wrapper content open html id. |
|
| 707 | + * @type string $geodir_wrapper_content_open_class Geodir wrapper content open html class. |
|
| 708 | + * @type string $geodir_wrapper_content_open_replace Geodir wrapper content open content replace. |
|
| 709 | + * @type string $geodir_wrapper_content_close_replace Geodir wrapper content close content replace. |
|
| 710 | + * @type string $geodir_article_open_id Geodir article open html id. |
|
| 711 | + * @type string $geodir_article_open_class Geodir article open html class. |
|
| 712 | + * @type string $geodir_article_open_replace Geodir article open content replace. |
|
| 713 | + * @type string $geodir_article_close_replace Geodir article close content replace. |
|
| 714 | + * @type string $geodir_sidebar_right_open_id Geodir sidebar right open html id. |
|
| 715 | + * @type string $geodir_sidebar_right_open_class Geodir sidebar right open html class. |
|
| 716 | + * @type string $geodir_sidebar_right_open_replace Geodir sidebar right open content replace. |
|
| 717 | + * @type string $geodir_sidebar_right_close_replace Geodir sidebar right close content replace. |
|
| 718 | + * @type string $geodir_sidebar_left_open_id Geodir sidebar left open html id. |
|
| 719 | + * @type string $geodir_sidebar_left_open_class Geodir sidebar left open html class. |
|
| 720 | + * @type string $geodir_sidebar_left_open_replace Geodir sidebar left open content replace. |
|
| 721 | + * @type string $geodir_sidebar_left_close_replace Geodir sidebar left close content replace. |
|
| 722 | + * @type string $geodir_main_content_open_id Geodir main content open html id. |
|
| 723 | + * @type string $geodir_main_content_open_class Geodir main content open html class. |
|
| 724 | + * @type string $geodir_main_content_open_replace Geodir main content open content replace. |
|
| 725 | + * @type string $geodir_main_content_close_replace Geodir main content close content replace. |
|
| 726 | + * @type string $geodir_top_content_add Geodir top content add. |
|
| 727 | + * @type string $geodir_before_main_content_add Geodir before main content add. |
|
| 728 | + * @type string $geodir_full_page_class_filter Geodir full page class filter. |
|
| 729 | + * @type string $geodir_before_widget_filter Geodir before widget filter. |
|
| 730 | + * @type string $geodir_after_widget_filter Geodir after widget filter. |
|
| 731 | + * @type string $geodir_before_title_filter Geodir before title filter. |
|
| 732 | + * @type string $geodir_after_title_filter Geodir after title filter. |
|
| 733 | + * @type string $geodir_menu_li_class_filter Geodir menu li class filter. |
|
| 734 | + * @type string $geodir_sub_menu_ul_class_filter Geodir sub menu ul class filter. |
|
| 735 | + * @type string $geodir_sub_menu_li_class_filter Geodir sub menu li class filter. |
|
| 736 | + * @type string $geodir_menu_a_class_filter Geodir menu a class filter. |
|
| 737 | + * @type string $geodir_sub_menu_a_class_filter Geodir sub menu a class filter. |
|
| 738 | + * @type string $geodir_location_switcher_menu_li_class_filter Geodir location switcher menu li class filter. |
|
| 739 | + * @type string $geodir_location_switcher_menu_a_class_filter Geodir location switcher menu a class filter. |
|
| 740 | + * @type string $geodir_location_switcher_menu_sub_ul_class_filter Geodir location switcher menu sub ul class filter. |
|
| 741 | + * @type string $geodir_location_switcher_menu_sub_li_class_filter Geodir location switcher menu sub li class filter. |
|
| 742 | + * @type string $geodir_theme_compat_css Geodir theme compatibility css. |
|
| 743 | + * @type string $geodir_theme_compat_js Geodir theme compatibility js. |
|
| 744 | + * @type string $gd_theme_compat Gd theme compatibility. |
|
| 745 | + * @type string $geodir_theme_compat_default_options Geodir theme compatibility default options. |
|
| 746 | + * @type bool $geodir_theme_compat_code Geodir theme compatibility code Ex: 'Avada. |
|
| 747 | + * |
|
| 748 | + * } |
|
| 749 | + */ |
|
| 750 | + do_action('gd_compat_save_settings', $theme_settings);
|
|
| 751 | 751 | |
| 752 | 752 | //if($_POST['gd_theme_compat'])== |
| 753 | - $theme_arr[$theme_name] = $theme_settings; |
|
| 754 | - update_option('gd_theme_compats', $theme_arr);
|
|
| 753 | + $theme_arr[$theme_name] = $theme_settings; |
|
| 754 | + update_option('gd_theme_compats', $theme_arr);
|
|
| 755 | 755 | |
| 756 | 756 | |
| 757 | 757 | //print_r($theme_settings);exit; |
| 758 | - update_option('theme_compatibility_setting', $theme_settings);
|
|
| 758 | + update_option('theme_compatibility_setting', $theme_settings);
|
|
| 759 | 759 | |
| 760 | 760 | } |
| 761 | 761 | |
@@ -768,12 +768,12 @@ discard block |
||
| 768 | 768 | */ |
| 769 | 769 | function geodir_theme_compatibility_setting_page() |
| 770 | 770 | {
|
| 771 | - global $wpdb; |
|
| 772 | - $tc = get_option('theme_compatibility_setting');
|
|
| 773 | - //print_r($tc); |
|
| 774 | - //print_r(wp_get_theme()); |
|
| 771 | + global $wpdb; |
|
| 772 | + $tc = get_option('theme_compatibility_setting');
|
|
| 773 | + //print_r($tc); |
|
| 774 | + //print_r(wp_get_theme()); |
|
| 775 | 775 | |
| 776 | - ?> |
|
| 776 | + ?> |
|
| 777 | 777 | <div class="inner_content_tab_main"> |
| 778 | 778 | <div class="gd-content-heading"> |
| 779 | 779 | |
@@ -815,21 +815,21 @@ discard block |
||
| 815 | 815 | <option value=""><?php _e('Select Theme', 'geodirectory');?></option>
|
| 816 | 816 | <option value="custom"><?php _e('Custom', 'geodirectory');?></option>
|
| 817 | 817 | <?php |
| 818 | - $theme_arr = get_option('gd_theme_compats');
|
|
| 819 | - $theme_active = get_option('gd_theme_compat');
|
|
| 820 | - if (is_array($theme_arr)) {
|
|
| 821 | - foreach ($theme_arr as $key => $theme) {
|
|
| 822 | - $sel = ''; |
|
| 823 | - if ($theme_active == $key) {
|
|
| 824 | - $sel = "selected"; |
|
| 825 | - } |
|
| 826 | - echo "<option $sel>$key</option>"; |
|
| 827 | - } |
|
| 818 | + $theme_arr = get_option('gd_theme_compats');
|
|
| 819 | + $theme_active = get_option('gd_theme_compat');
|
|
| 820 | + if (is_array($theme_arr)) {
|
|
| 821 | + foreach ($theme_arr as $key => $theme) {
|
|
| 822 | + $sel = ''; |
|
| 823 | + if ($theme_active == $key) {
|
|
| 824 | + $sel = "selected"; |
|
| 825 | + } |
|
| 826 | + echo "<option $sel>$key</option>"; |
|
| 827 | + } |
|
| 828 | 828 | |
| 829 | 829 | |
| 830 | - } |
|
| 830 | + } |
|
| 831 | 831 | |
| 832 | - ?> |
|
| 832 | + ?> |
|
| 833 | 833 | </select> |
| 834 | 834 | <button onclick="gd_comp_export();" type="button" |
| 835 | 835 | class="button-primary"><?php _e('Export', 'geodirectory');?></button>
|
@@ -938,11 +938,11 @@ discard block |
||
| 938 | 938 | <small>geodir_wrapper_open</small> |
| 939 | 939 | </td> |
| 940 | 940 | <td><input value="<?php if (isset($tc['geodir_wrapper_open_id'])) {
|
| 941 | - echo $tc['geodir_wrapper_open_id']; |
|
| 942 | - }?>" type="text" name="geodir_wrapper_open_id" placeholder="geodir-wrapper"/></td> |
|
| 941 | + echo $tc['geodir_wrapper_open_id']; |
|
| 942 | + }?>" type="text" name="geodir_wrapper_open_id" placeholder="geodir-wrapper"/></td> |
|
| 943 | 943 | <td><input value="<?php if (isset($tc['geodir_wrapper_open_class'])) {
|
| 944 | - echo $tc['geodir_wrapper_open_class']; |
|
| 945 | - }?>" type="text" name="geodir_wrapper_open_class" placeholder=""/></td> |
|
| 944 | + echo $tc['geodir_wrapper_open_class']; |
|
| 945 | + }?>" type="text" name="geodir_wrapper_open_class" placeholder=""/></td> |
|
| 946 | 946 | </tr> |
| 947 | 947 | |
| 948 | 948 | <tr class="gd-theme-comp-out"> |
@@ -950,8 +950,8 @@ discard block |
||
| 950 | 950 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 951 | 951 | <textarea name="geodir_wrapper_open_replace" |
| 952 | 952 | placeholder='<div id="[id]" class="[class]">'><?php if (isset($tc['geodir_wrapper_open_replace'])) {
|
| 953 | - echo $tc['geodir_wrapper_open_replace']; |
|
| 954 | - }?></textarea> |
|
| 953 | + echo $tc['geodir_wrapper_open_replace']; |
|
| 954 | + }?></textarea> |
|
| 955 | 955 | </td> |
| 956 | 956 | </tr> |
| 957 | 957 | |
@@ -971,8 +971,8 @@ discard block |
||
| 971 | 971 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 972 | 972 | <textarea name="geodir_wrapper_close_replace" |
| 973 | 973 | placeholder='</div><!-- wrapper ends here-->'><?php if (isset($tc['geodir_wrapper_close_replace'])) {
|
| 974 | - echo $tc['geodir_wrapper_close_replace']; |
|
| 975 | - }?></textarea> |
|
| 974 | + echo $tc['geodir_wrapper_close_replace']; |
|
| 975 | + }?></textarea> |
|
| 976 | 976 | </td> |
| 977 | 977 | </tr> |
| 978 | 978 | |
@@ -982,12 +982,12 @@ discard block |
||
| 982 | 982 | <small>geodir_wrapper_content_open</small> |
| 983 | 983 | </td> |
| 984 | 984 | <td><input value="<?php if (isset($tc['geodir_wrapper_content_open_id'])) {
|
| 985 | - echo $tc['geodir_wrapper_content_open_id']; |
|
| 986 | - }?>" type="text" name="geodir_wrapper_content_open_id" placeholder="geodir-wrapper-content"/> |
|
| 985 | + echo $tc['geodir_wrapper_content_open_id']; |
|
| 986 | + }?>" type="text" name="geodir_wrapper_content_open_id" placeholder="geodir-wrapper-content"/> |
|
| 987 | 987 | </td> |
| 988 | 988 | <td><input value="<?php if (isset($tc['geodir_wrapper_content_open_class'])) {
|
| 989 | - echo $tc['geodir_wrapper_content_open_class']; |
|
| 990 | - }?>" type="text" name="geodir_wrapper_content_open_class" placeholder=""/></td> |
|
| 989 | + echo $tc['geodir_wrapper_content_open_class']; |
|
| 990 | + }?>" type="text" name="geodir_wrapper_content_open_class" placeholder=""/></td> |
|
| 991 | 991 | </tr> |
| 992 | 992 | |
| 993 | 993 | <tr class="gd-theme-comp-out"> |
@@ -995,8 +995,8 @@ discard block |
||
| 995 | 995 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 996 | 996 | <textarea name="geodir_wrapper_content_open_replace" |
| 997 | 997 | placeholder='<div id="[id]" class="[class]" role="main" [width_css]>'><?php if (isset($tc['geodir_wrapper_content_open_replace'])) {
|
| 998 | - echo $tc['geodir_wrapper_content_open_replace']; |
|
| 999 | - }?></textarea> |
|
| 998 | + echo $tc['geodir_wrapper_content_open_replace']; |
|
| 999 | + }?></textarea> |
|
| 1000 | 1000 | </td> |
| 1001 | 1001 | </tr> |
| 1002 | 1002 | |
@@ -1016,8 +1016,8 @@ discard block |
||
| 1016 | 1016 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1017 | 1017 | <textarea name="geodir_wrapper_content_close_replace" |
| 1018 | 1018 | placeholder='</div><!-- content ends here-->'><?php if (isset($tc['geodir_wrapper_content_close_replace'])) {
|
| 1019 | - echo $tc['geodir_wrapper_content_close_replace']; |
|
| 1020 | - }?></textarea> |
|
| 1019 | + echo $tc['geodir_wrapper_content_close_replace']; |
|
| 1020 | + }?></textarea> |
|
| 1021 | 1021 | </td> |
| 1022 | 1022 | </tr> |
| 1023 | 1023 | |
@@ -1026,11 +1026,11 @@ discard block |
||
| 1026 | 1026 | <small>geodir_article_open</small> |
| 1027 | 1027 | </td> |
| 1028 | 1028 | <td><input value="<?php if (isset($tc['geodir_article_open_id'])) {
|
| 1029 | - echo $tc['geodir_article_open_id']; |
|
| 1030 | - }?>" type="text" name="geodir_article_open_id" placeholder="geodir-wrapper-content"/></td> |
|
| 1029 | + echo $tc['geodir_article_open_id']; |
|
| 1030 | + }?>" type="text" name="geodir_article_open_id" placeholder="geodir-wrapper-content"/></td> |
|
| 1031 | 1031 | <td><input value="<?php if (isset($tc['geodir_article_open_class'])) {
|
| 1032 | - echo $tc['geodir_article_open_class']; |
|
| 1033 | - }?>" type="text" name="geodir_article_open_class" placeholder=""/></td> |
|
| 1032 | + echo $tc['geodir_article_open_class']; |
|
| 1033 | + }?>" type="text" name="geodir_article_open_class" placeholder=""/></td> |
|
| 1034 | 1034 | </tr> |
| 1035 | 1035 | |
| 1036 | 1036 | <tr class="gd-theme-comp-out"> |
@@ -1038,8 +1038,8 @@ discard block |
||
| 1038 | 1038 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1039 | 1039 | <textarea name="geodir_article_open_replace" |
| 1040 | 1040 | placeholder='<article id="[id]" class="[class]" itemscope itemtype="[itemtype]">'><?php if (isset($tc['geodir_article_open_replace'])) {
|
| 1041 | - echo $tc['geodir_article_open_replace']; |
|
| 1042 | - }?></textarea> |
|
| 1041 | + echo $tc['geodir_article_open_replace']; |
|
| 1042 | + }?></textarea> |
|
| 1043 | 1043 | </td> |
| 1044 | 1044 | </tr> |
| 1045 | 1045 | |
@@ -1058,8 +1058,8 @@ discard block |
||
| 1058 | 1058 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1059 | 1059 | <textarea name="geodir_article_close_replace" |
| 1060 | 1060 | placeholder='</article><!-- article ends here-->'><?php if (isset($tc['geodir_article_close_replace'])) {
|
| 1061 | - echo $tc['geodir_article_close_replace']; |
|
| 1062 | - }?></textarea> |
|
| 1061 | + echo $tc['geodir_article_close_replace']; |
|
| 1062 | + }?></textarea> |
|
| 1063 | 1063 | </td> |
| 1064 | 1064 | </tr> |
| 1065 | 1065 | |
@@ -1068,11 +1068,11 @@ discard block |
||
| 1068 | 1068 | <small>geodir_sidebar_right_open</small> |
| 1069 | 1069 | </td> |
| 1070 | 1070 | <td><input value="<?php if (isset($tc['geodir_sidebar_right_open_id'])) {
|
| 1071 | - echo $tc['geodir_sidebar_right_open_id']; |
|
| 1072 | - }?>" type="text" name="geodir_sidebar_right_open_id" placeholder="geodir-sidebar-right"/></td> |
|
| 1071 | + echo $tc['geodir_sidebar_right_open_id']; |
|
| 1072 | + }?>" type="text" name="geodir_sidebar_right_open_id" placeholder="geodir-sidebar-right"/></td> |
|
| 1073 | 1073 | <td><input value="<?php if (isset($tc['geodir_sidebar_right_open_class'])) {
|
| 1074 | - echo $tc['geodir_sidebar_right_open_class']; |
|
| 1075 | - }?>" type="text" name="geodir_sidebar_right_open_class" |
|
| 1074 | + echo $tc['geodir_sidebar_right_open_class']; |
|
| 1075 | + }?>" type="text" name="geodir_sidebar_right_open_class" |
|
| 1076 | 1076 | placeholder="geodir-sidebar-right geodir-listings-sidebar-right"/></td> |
| 1077 | 1077 | </tr> |
| 1078 | 1078 | |
@@ -1081,8 +1081,8 @@ discard block |
||
| 1081 | 1081 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1082 | 1082 | <textarea name="geodir_sidebar_right_open_replace" |
| 1083 | 1083 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_right_open_replace'])) {
|
| 1084 | - echo $tc['geodir_sidebar_right_open_replace']; |
|
| 1085 | - }?></textarea> |
|
| 1084 | + echo $tc['geodir_sidebar_right_open_replace']; |
|
| 1085 | + }?></textarea> |
|
| 1086 | 1086 | </td> |
| 1087 | 1087 | </tr> |
| 1088 | 1088 | |
@@ -1101,8 +1101,8 @@ discard block |
||
| 1101 | 1101 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1102 | 1102 | <textarea name="geodir_sidebar_right_close_replace" |
| 1103 | 1103 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_right_close_replace'])) {
|
| 1104 | - echo $tc['geodir_sidebar_right_close_replace']; |
|
| 1105 | - }?></textarea> |
|
| 1104 | + echo $tc['geodir_sidebar_right_close_replace']; |
|
| 1105 | + }?></textarea> |
|
| 1106 | 1106 | </td> |
| 1107 | 1107 | </tr> |
| 1108 | 1108 | |
@@ -1112,11 +1112,11 @@ discard block |
||
| 1112 | 1112 | <small>geodir_sidebar_left_open</small> |
| 1113 | 1113 | </td> |
| 1114 | 1114 | <td><input value="<?php if (isset($tc['geodir_sidebar_left_open_id'])) {
|
| 1115 | - echo $tc['geodir_sidebar_left_open_id']; |
|
| 1116 | - }?>" type="text" name="geodir_sidebar_left_open_id" placeholder="geodir-sidebar-left"/></td> |
|
| 1115 | + echo $tc['geodir_sidebar_left_open_id']; |
|
| 1116 | + }?>" type="text" name="geodir_sidebar_left_open_id" placeholder="geodir-sidebar-left"/></td> |
|
| 1117 | 1117 | <td><input value="<?php if (isset($tc['geodir_sidebar_left_open_class'])) {
|
| 1118 | - echo $tc['geodir_sidebar_left_open_class']; |
|
| 1119 | - }?>" type="text" name="geodir_sidebar_left_open_class" |
|
| 1118 | + echo $tc['geodir_sidebar_left_open_class']; |
|
| 1119 | + }?>" type="text" name="geodir_sidebar_left_open_class" |
|
| 1120 | 1120 | placeholder="geodir-sidebar-left geodir-listings-sidebar-left"/></td> |
| 1121 | 1121 | </tr> |
| 1122 | 1122 | |
@@ -1125,8 +1125,8 @@ discard block |
||
| 1125 | 1125 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1126 | 1126 | <textarea name="geodir_sidebar_left_open_replace" |
| 1127 | 1127 | placeholder='<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'><?php if (isset($tc['geodir_sidebar_left_open_replace'])) {
|
| 1128 | - echo $tc['geodir_sidebar_left_open_replace']; |
|
| 1129 | - }?></textarea> |
|
| 1128 | + echo $tc['geodir_sidebar_left_open_replace']; |
|
| 1129 | + }?></textarea> |
|
| 1130 | 1130 | </td> |
| 1131 | 1131 | </tr> |
| 1132 | 1132 | |
@@ -1145,8 +1145,8 @@ discard block |
||
| 1145 | 1145 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1146 | 1146 | <textarea name="geodir_sidebar_left_close_replace" |
| 1147 | 1147 | placeholder='</aside><!-- sidebar ends here-->'><?php if (isset($tc['geodir_sidebar_left_close_replace'])) {
|
| 1148 | - echo $tc['geodir_sidebar_left_close_replace']; |
|
| 1149 | - }?></textarea> |
|
| 1148 | + echo $tc['geodir_sidebar_left_close_replace']; |
|
| 1149 | + }?></textarea> |
|
| 1150 | 1150 | </td> |
| 1151 | 1151 | </tr> |
| 1152 | 1152 | |
@@ -1155,11 +1155,11 @@ discard block |
||
| 1155 | 1155 | <small>geodir_main_content_open</small> |
| 1156 | 1156 | </td> |
| 1157 | 1157 | <td><input value="<?php if (isset($tc['geodir_main_content_open_id'])) {
|
| 1158 | - echo $tc['geodir_main_content_open_id']; |
|
| 1159 | - }?>" type="text" name="geodir_main_content_open_id" placeholder="geodir-main-content"/></td> |
|
| 1158 | + echo $tc['geodir_main_content_open_id']; |
|
| 1159 | + }?>" type="text" name="geodir_main_content_open_id" placeholder="geodir-main-content"/></td> |
|
| 1160 | 1160 | <td><input value="<?php if (isset($tc['geodir_main_content_open_class'])) {
|
| 1161 | - echo $tc['geodir_main_content_open_class']; |
|
| 1162 | - }?>" type="text" name="geodir_main_content_open_class" placeholder="CURRENT-PAGE-page"/></td> |
|
| 1161 | + echo $tc['geodir_main_content_open_class']; |
|
| 1162 | + }?>" type="text" name="geodir_main_content_open_class" placeholder="CURRENT-PAGE-page"/></td> |
|
| 1163 | 1163 | </tr> |
| 1164 | 1164 | |
| 1165 | 1165 | <tr class="gd-theme-comp-out"> |
@@ -1167,8 +1167,8 @@ discard block |
||
| 1167 | 1167 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1168 | 1168 | <textarea name="geodir_main_content_open_replace" |
| 1169 | 1169 | placeholder='<main id="[id]" class="[class]" role="main">'><?php if (isset($tc['geodir_main_content_open_replace'])) {
|
| 1170 | - echo $tc['geodir_main_content_open_replace']; |
|
| 1171 | - }?></textarea> |
|
| 1170 | + echo $tc['geodir_main_content_open_replace']; |
|
| 1171 | + }?></textarea> |
|
| 1172 | 1172 | </td> |
| 1173 | 1173 | </tr> |
| 1174 | 1174 | |
@@ -1187,8 +1187,8 @@ discard block |
||
| 1187 | 1187 | <span><?php _e('Output:', 'geodirectory');?></span>
|
| 1188 | 1188 | <textarea name="geodir_main_content_close_replace" |
| 1189 | 1189 | placeholder='</main><!-- main ends here-->'><?php if (isset($tc['geodir_main_content_close_replace'])) {
|
| 1190 | - echo $tc['geodir_main_content_close_replace']; |
|
| 1191 | - }?></textarea> |
|
| 1190 | + echo $tc['geodir_main_content_close_replace']; |
|
| 1191 | + }?></textarea> |
|
| 1192 | 1192 | </td> |
| 1193 | 1193 | </tr> |
| 1194 | 1194 | |
@@ -1212,8 +1212,8 @@ discard block |
||
| 1212 | 1212 | </td> |
| 1213 | 1213 | <td><textarea name="geodir_top_content_add" |
| 1214 | 1214 | placeholder=''><?php if (isset($tc['geodir_top_content_add'])) {
|
| 1215 | - echo $tc['geodir_top_content_add']; |
|
| 1216 | - }?></textarea></td> |
|
| 1215 | + echo $tc['geodir_top_content_add']; |
|
| 1216 | + }?></textarea></td> |
|
| 1217 | 1217 | </tr> |
| 1218 | 1218 | |
| 1219 | 1219 | <tr> |
@@ -1222,8 +1222,8 @@ discard block |
||
| 1222 | 1222 | </td> |
| 1223 | 1223 | <td><textarea name="geodir_before_main_content_add" |
| 1224 | 1224 | placeholder=''><?php if (isset($tc['geodir_before_main_content_add'])) {
|
| 1225 | - echo $tc['geodir_before_main_content_add']; |
|
| 1226 | - }?></textarea></td> |
|
| 1225 | + echo $tc['geodir_before_main_content_add']; |
|
| 1226 | + }?></textarea></td> |
|
| 1227 | 1227 | </tr> |
| 1228 | 1228 | |
| 1229 | 1229 | |
@@ -1246,8 +1246,8 @@ discard block |
||
| 1246 | 1246 | </td> |
| 1247 | 1247 | <td><textarea name="geodir_full_page_class_filter" |
| 1248 | 1248 | placeholder='geodir_full_page clearfix'><?php if (isset($tc['geodir_full_page_class_filter'])) {
|
| 1249 | - echo $tc['geodir_full_page_class_filter']; |
|
| 1250 | - }?></textarea></td> |
|
| 1249 | + echo $tc['geodir_full_page_class_filter']; |
|
| 1250 | + }?></textarea></td> |
|
| 1251 | 1251 | </tr> |
| 1252 | 1252 | |
| 1253 | 1253 | <tr> |
@@ -1256,8 +1256,8 @@ discard block |
||
| 1256 | 1256 | </td> |
| 1257 | 1257 | <td><textarea name="geodir_before_widget_filter" |
| 1258 | 1258 | placeholder='<section id="%1$s" class="widget geodir-widget %2$s">'><?php if (isset($tc['geodir_before_widget_filter'])) {
|
| 1259 | - echo $tc['geodir_before_widget_filter']; |
|
| 1260 | - }?></textarea></td> |
|
| 1259 | + echo $tc['geodir_before_widget_filter']; |
|
| 1260 | + }?></textarea></td> |
|
| 1261 | 1261 | </tr> |
| 1262 | 1262 | |
| 1263 | 1263 | <tr> |
@@ -1266,8 +1266,8 @@ discard block |
||
| 1266 | 1266 | </td> |
| 1267 | 1267 | <td><textarea name="geodir_after_widget_filter" |
| 1268 | 1268 | placeholder='</section>'><?php if (isset($tc['geodir_after_widget_filter'])) {
|
| 1269 | - echo $tc['geodir_after_widget_filter']; |
|
| 1270 | - }?></textarea></td> |
|
| 1269 | + echo $tc['geodir_after_widget_filter']; |
|
| 1270 | + }?></textarea></td> |
|
| 1271 | 1271 | </tr> |
| 1272 | 1272 | |
| 1273 | 1273 | <tr> |
@@ -1276,8 +1276,8 @@ discard block |
||
| 1276 | 1276 | </td> |
| 1277 | 1277 | <td><textarea name="geodir_before_title_filter" |
| 1278 | 1278 | placeholder='<h3 class="widget-title">'><?php if (isset($tc['geodir_before_title_filter'])) {
|
| 1279 | - echo $tc['geodir_before_title_filter']; |
|
| 1280 | - }?></textarea></td> |
|
| 1279 | + echo $tc['geodir_before_title_filter']; |
|
| 1280 | + }?></textarea></td> |
|
| 1281 | 1281 | </tr> |
| 1282 | 1282 | |
| 1283 | 1283 | <tr> |
@@ -1286,8 +1286,8 @@ discard block |
||
| 1286 | 1286 | </td> |
| 1287 | 1287 | <td><textarea name="geodir_after_title_filter" |
| 1288 | 1288 | placeholder='</h3>'><?php if (isset($tc['geodir_after_title_filter'])) {
|
| 1289 | - echo $tc['geodir_after_title_filter']; |
|
| 1290 | - }?></textarea></td> |
|
| 1289 | + echo $tc['geodir_after_title_filter']; |
|
| 1290 | + }?></textarea></td> |
|
| 1291 | 1291 | </tr> |
| 1292 | 1292 | |
| 1293 | 1293 | <tr> |
@@ -1296,8 +1296,8 @@ discard block |
||
| 1296 | 1296 | </td> |
| 1297 | 1297 | <td><textarea name="geodir_menu_li_class_filter" |
| 1298 | 1298 | placeholder='menu-item'><?php if (isset($tc['geodir_menu_li_class_filter'])) {
|
| 1299 | - echo $tc['geodir_menu_li_class_filter']; |
|
| 1300 | - }?></textarea></td> |
|
| 1299 | + echo $tc['geodir_menu_li_class_filter']; |
|
| 1300 | + }?></textarea></td> |
|
| 1301 | 1301 | </tr> |
| 1302 | 1302 | |
| 1303 | 1303 | <tr> |
@@ -1306,8 +1306,8 @@ discard block |
||
| 1306 | 1306 | </td> |
| 1307 | 1307 | <td><textarea name="geodir_sub_menu_ul_class_filter" |
| 1308 | 1308 | placeholder='sub-menu'><?php if (isset($tc['geodir_sub_menu_ul_class_filter'])) {
|
| 1309 | - echo $tc['geodir_sub_menu_ul_class_filter']; |
|
| 1310 | - }?></textarea></td> |
|
| 1309 | + echo $tc['geodir_sub_menu_ul_class_filter']; |
|
| 1310 | + }?></textarea></td> |
|
| 1311 | 1311 | </tr> |
| 1312 | 1312 | |
| 1313 | 1313 | <tr> |
@@ -1316,8 +1316,8 @@ discard block |
||
| 1316 | 1316 | </td> |
| 1317 | 1317 | <td><textarea name="geodir_sub_menu_li_class_filter" |
| 1318 | 1318 | placeholder='menu-item'><?php if (isset($tc['geodir_sub_menu_li_class_filter'])) {
|
| 1319 | - echo $tc['geodir_sub_menu_li_class_filter']; |
|
| 1320 | - }?></textarea></td> |
|
| 1319 | + echo $tc['geodir_sub_menu_li_class_filter']; |
|
| 1320 | + }?></textarea></td> |
|
| 1321 | 1321 | </tr> |
| 1322 | 1322 | |
| 1323 | 1323 | <tr> |
@@ -1326,8 +1326,8 @@ discard block |
||
| 1326 | 1326 | </td> |
| 1327 | 1327 | <td><textarea name="geodir_menu_a_class_filter" |
| 1328 | 1328 | placeholder=''><?php if (isset($tc['geodir_menu_a_class_filter'])) {
|
| 1329 | - echo $tc['geodir_menu_a_class_filter']; |
|
| 1330 | - }?></textarea></td> |
|
| 1329 | + echo $tc['geodir_menu_a_class_filter']; |
|
| 1330 | + }?></textarea></td> |
|
| 1331 | 1331 | </tr> |
| 1332 | 1332 | |
| 1333 | 1333 | <tr> |
@@ -1336,8 +1336,8 @@ discard block |
||
| 1336 | 1336 | </td> |
| 1337 | 1337 | <td><textarea name="geodir_sub_menu_a_class_filter" |
| 1338 | 1338 | placeholder=''><?php if (isset($tc['geodir_sub_menu_a_class_filter'])) {
|
| 1339 | - echo $tc['geodir_sub_menu_a_class_filter']; |
|
| 1340 | - }?></textarea></td> |
|
| 1339 | + echo $tc['geodir_sub_menu_a_class_filter']; |
|
| 1340 | + }?></textarea></td> |
|
| 1341 | 1341 | </tr> |
| 1342 | 1342 | |
| 1343 | 1343 | |
@@ -1347,8 +1347,8 @@ discard block |
||
| 1347 | 1347 | </td> |
| 1348 | 1348 | <td><textarea name="geodir_location_switcher_menu_li_class_filter" |
| 1349 | 1349 | placeholder='menu-item menu-item-type-social menu-item-type-social gd-location-switcher'><?php if (isset($tc['geodir_location_switcher_menu_li_class_filter'])) {
|
| 1350 | - echo $tc['geodir_location_switcher_menu_li_class_filter']; |
|
| 1351 | - }?></textarea></td> |
|
| 1350 | + echo $tc['geodir_location_switcher_menu_li_class_filter']; |
|
| 1351 | + }?></textarea></td> |
|
| 1352 | 1352 | </tr> |
| 1353 | 1353 | |
| 1354 | 1354 | <tr> |
@@ -1357,8 +1357,8 @@ discard block |
||
| 1357 | 1357 | </td> |
| 1358 | 1358 | <td><textarea name="geodir_location_switcher_menu_a_class_filter" |
| 1359 | 1359 | placeholder=''><?php if (isset($tc['geodir_location_switcher_menu_a_class_filter'])) {
|
| 1360 | - echo $tc['geodir_location_switcher_menu_a_class_filter']; |
|
| 1361 | - }?></textarea></td> |
|
| 1360 | + echo $tc['geodir_location_switcher_menu_a_class_filter']; |
|
| 1361 | + }?></textarea></td> |
|
| 1362 | 1362 | </tr> |
| 1363 | 1363 | |
| 1364 | 1364 | <tr> |
@@ -1367,8 +1367,8 @@ discard block |
||
| 1367 | 1367 | </td> |
| 1368 | 1368 | <td><textarea name="geodir_location_switcher_menu_sub_ul_class_filter" |
| 1369 | 1369 | placeholder='sub-menu'><?php if (isset($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
|
| 1370 | - echo $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
| 1371 | - }?></textarea></td> |
|
| 1370 | + echo $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
| 1371 | + }?></textarea></td> |
|
| 1372 | 1372 | </tr> |
| 1373 | 1373 | |
| 1374 | 1374 | <tr> |
@@ -1377,21 +1377,21 @@ discard block |
||
| 1377 | 1377 | </td> |
| 1378 | 1378 | <td><textarea name="geodir_location_switcher_menu_sub_li_class_filter" |
| 1379 | 1379 | placeholder='menu-item gd-location-switcher-menu-item'><?php if (isset($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
|
| 1380 | - echo $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
| 1381 | - }?></textarea></td> |
|
| 1380 | + echo $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
| 1381 | + }?></textarea></td> |
|
| 1382 | 1382 | </tr> |
| 1383 | 1383 | |
| 1384 | 1384 | |
| 1385 | 1385 | |
| 1386 | 1386 | <?php |
| 1387 | - /** |
|
| 1388 | - * Allows more filter setting to be added to theme compatibility settings page. |
|
| 1389 | - * |
|
| 1390 | - * Called after the last setting in "Other filters" section of theme compatibility settings. |
|
| 1391 | - * |
|
| 1392 | - * @since 1.4.0 |
|
| 1393 | - */ |
|
| 1394 | - do_action('gd_compat_other_filters');?>
|
|
| 1387 | + /** |
|
| 1388 | + * Allows more filter setting to be added to theme compatibility settings page. |
|
| 1389 | + * |
|
| 1390 | + * Called after the last setting in "Other filters" section of theme compatibility settings. |
|
| 1391 | + * |
|
| 1392 | + * @since 1.4.0 |
|
| 1393 | + */ |
|
| 1394 | + do_action('gd_compat_other_filters');?>
|
|
| 1395 | 1395 | |
| 1396 | 1396 | </tbody> |
| 1397 | 1397 | </table> |
@@ -1404,8 +1404,8 @@ discard block |
||
| 1404 | 1404 | <tr> |
| 1405 | 1405 | <td><textarea name="geodir_theme_compat_css" |
| 1406 | 1406 | placeholder=''><?php if (isset($tc['geodir_theme_compat_css'])) {
|
| 1407 | - echo $tc['geodir_theme_compat_css']; |
|
| 1408 | - }?></textarea></td> |
|
| 1407 | + echo $tc['geodir_theme_compat_css']; |
|
| 1408 | + }?></textarea></td> |
|
| 1409 | 1409 | </tr> |
| 1410 | 1410 | |
| 1411 | 1411 | |
@@ -1419,8 +1419,8 @@ discard block |
||
| 1419 | 1419 | <tr> |
| 1420 | 1420 | <td><textarea name="geodir_theme_compat_js" |
| 1421 | 1421 | placeholder=''><?php if (isset($tc['geodir_theme_compat_js'])) {
|
| 1422 | - echo $tc['geodir_theme_compat_js']; |
|
| 1423 | - }?></textarea></td> |
|
| 1422 | + echo $tc['geodir_theme_compat_js']; |
|
| 1423 | + }?></textarea></td> |
|
| 1424 | 1424 | </tr> |
| 1425 | 1425 | |
| 1426 | 1426 | |
@@ -1447,23 +1447,23 @@ discard block |
||
| 1447 | 1447 | */ |
| 1448 | 1448 | function geodir_custom_post_type_form() |
| 1449 | 1449 | {
|
| 1450 | - $listing_type = ($_REQUEST['listing_type'] != '') ? $_REQUEST['listing_type'] : 'gd_place'; |
|
| 1450 | + $listing_type = ($_REQUEST['listing_type'] != '') ? $_REQUEST['listing_type'] : 'gd_place'; |
|
| 1451 | 1451 | |
| 1452 | - $sub_tab = ($_REQUEST['subtab'] != '') ? $_REQUEST['subtab'] : ''; |
|
| 1452 | + $sub_tab = ($_REQUEST['subtab'] != '') ? $_REQUEST['subtab'] : ''; |
|
| 1453 | 1453 | |
| 1454 | 1454 | |
| 1455 | - ?> |
|
| 1455 | + ?> |
|
| 1456 | 1456 | |
| 1457 | 1457 | <div class="gd-content-heading"> |
| 1458 | 1458 | <?php |
| 1459 | - /** |
|
| 1460 | - * Filter custom fields panel heading. |
|
| 1461 | - * |
|
| 1462 | - * @since 1.0.0 |
|
| 1463 | - * @param string $sub_tab Sub tab name. |
|
| 1464 | - * @param string $listing_type Post type. |
|
| 1465 | - */ |
|
| 1466 | - ?> |
|
| 1459 | + /** |
|
| 1460 | + * Filter custom fields panel heading. |
|
| 1461 | + * |
|
| 1462 | + * @since 1.0.0 |
|
| 1463 | + * @param string $sub_tab Sub tab name. |
|
| 1464 | + * @param string $listing_type Post type. |
|
| 1465 | + */ |
|
| 1466 | + ?> |
|
| 1467 | 1467 | <h3><?php echo apply_filters('geodir_custom_fields_panel_head', '', $sub_tab, $listing_type);?></h3>
|
| 1468 | 1468 | </div> |
| 1469 | 1469 | <div id="container_general" class="clearfix"> |
@@ -1471,25 +1471,25 @@ discard block |
||
| 1471 | 1471 | |
| 1472 | 1472 | <div class="side-sortables" id="geodir-available-fields"> |
| 1473 | 1473 | <?php |
| 1474 | - /** |
|
| 1475 | - * Filter custom field available fields heading. |
|
| 1476 | - * |
|
| 1477 | - * @since 1.0.0 |
|
| 1478 | - * @param string $sub_tab Sub tab name. |
|
| 1479 | - * @param string $listing_type Post type. |
|
| 1480 | - */ |
|
| 1481 | - ?> |
|
| 1474 | + /** |
|
| 1475 | + * Filter custom field available fields heading. |
|
| 1476 | + * |
|
| 1477 | + * @since 1.0.0 |
|
| 1478 | + * @param string $sub_tab Sub tab name. |
|
| 1479 | + * @param string $listing_type Post type. |
|
| 1480 | + */ |
|
| 1481 | + ?> |
|
| 1482 | 1482 | <h3 class="hndle"><span><?php echo apply_filters('geodir_cf_panel_available_fields_head', '', $sub_tab, $listing_type);?>
|
| 1483 | 1483 | </span></h3> |
| 1484 | 1484 | <?php |
| 1485 | - /** |
|
| 1486 | - * Filter custom field available fields note text. |
|
| 1487 | - * |
|
| 1488 | - * @since 1.0.0 |
|
| 1489 | - * @param string $sub_tab Sub tab name. |
|
| 1490 | - * @param string $listing_type Post type. |
|
| 1491 | - */ |
|
| 1492 | - ?> |
|
| 1485 | + /** |
|
| 1486 | + * Filter custom field available fields note text. |
|
| 1487 | + * |
|
| 1488 | + * @since 1.0.0 |
|
| 1489 | + * @param string $sub_tab Sub tab name. |
|
| 1490 | + * @param string $listing_type Post type. |
|
| 1491 | + */ |
|
| 1492 | + ?> |
|
| 1493 | 1493 | <p><?php echo apply_filters('geodir_cf_panel_available_fields_note', '', $sub_tab, $listing_type);?></p>
|
| 1494 | 1494 | |
| 1495 | 1495 | <h3><?php _e('Setup New Field','geodirectory');?></h3>
|
@@ -1498,13 +1498,13 @@ discard block |
||
| 1498 | 1498 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
| 1499 | 1499 | |
| 1500 | 1500 | <?php |
| 1501 | - /** |
|
| 1502 | - * Adds the available fields to the custom fields settings page per post type. |
|
| 1503 | - * |
|
| 1504 | - * @since 1.0.0 |
|
| 1505 | - * @param string $sub_tab The current settings tab name. |
|
| 1506 | - */ |
|
| 1507 | - do_action('geodir_manage_available_fields', $sub_tab); ?>
|
|
| 1501 | + /** |
|
| 1502 | + * Adds the available fields to the custom fields settings page per post type. |
|
| 1503 | + * |
|
| 1504 | + * @since 1.0.0 |
|
| 1505 | + * @param string $sub_tab The current settings tab name. |
|
| 1506 | + */ |
|
| 1507 | + do_action('geodir_manage_available_fields', $sub_tab); ?>
|
|
| 1508 | 1508 | |
| 1509 | 1509 | <div style="clear:both"></div> |
| 1510 | 1510 | </div> |
@@ -1519,13 +1519,13 @@ discard block |
||
| 1519 | 1519 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
| 1520 | 1520 | |
| 1521 | 1521 | <?php |
| 1522 | - /** |
|
| 1523 | - * Adds the available fields to the custom fields predefined settings page per post type. |
|
| 1524 | - * |
|
| 1525 | - * @since 1.6.9 |
|
| 1526 | - * @param string $sub_tab The current settings tab name. |
|
| 1527 | - */ |
|
| 1528 | - do_action('geodir_manage_available_fields_predefined', $sub_tab); ?>
|
|
| 1522 | + /** |
|
| 1523 | + * Adds the available fields to the custom fields predefined settings page per post type. |
|
| 1524 | + * |
|
| 1525 | + * @since 1.6.9 |
|
| 1526 | + * @param string $sub_tab The current settings tab name. |
|
| 1527 | + */ |
|
| 1528 | + do_action('geodir_manage_available_fields_predefined', $sub_tab); ?>
|
|
| 1529 | 1529 | |
| 1530 | 1530 | <div style="clear:both"></div> |
| 1531 | 1531 | </div> |
@@ -1538,13 +1538,13 @@ discard block |
||
| 1538 | 1538 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
| 1539 | 1539 | |
| 1540 | 1540 | <?php |
| 1541 | - /** |
|
| 1542 | - * Adds the available fields to the custom fields custom added settings page per post type. |
|
| 1543 | - * |
|
| 1544 | - * @since 1.6.9 |
|
| 1545 | - * @param string $sub_tab The current settings tab name. |
|
| 1546 | - */ |
|
| 1547 | - do_action('geodir_manage_available_fields_custom', $sub_tab); ?>
|
|
| 1541 | + /** |
|
| 1542 | + * Adds the available fields to the custom fields custom added settings page per post type. |
|
| 1543 | + * |
|
| 1544 | + * @since 1.6.9 |
|
| 1545 | + * @param string $sub_tab The current settings tab name. |
|
| 1546 | + */ |
|
| 1547 | + do_action('geodir_manage_available_fields_custom', $sub_tab); ?>
|
|
| 1548 | 1548 | |
| 1549 | 1549 | <div style="clear:both"></div> |
| 1550 | 1550 | </div> |
@@ -1561,25 +1561,25 @@ discard block |
||
| 1561 | 1561 | <div class="side-sortables" id="geodir-selected-fields"> |
| 1562 | 1562 | <h3 class="hndle"> |
| 1563 | 1563 | <?php |
| 1564 | - /** |
|
| 1565 | - * Filter custom field selected fields heading. |
|
| 1566 | - * |
|
| 1567 | - * @since 1.0.0 |
|
| 1568 | - * @param string $sub_tab Sub tab name. |
|
| 1569 | - * @param string $listing_type Post type. |
|
| 1570 | - */ |
|
| 1571 | - ?> |
|
| 1564 | + /** |
|
| 1565 | + * Filter custom field selected fields heading. |
|
| 1566 | + * |
|
| 1567 | + * @since 1.0.0 |
|
| 1568 | + * @param string $sub_tab Sub tab name. |
|
| 1569 | + * @param string $listing_type Post type. |
|
| 1570 | + */ |
|
| 1571 | + ?> |
|
| 1572 | 1572 | <span><?php echo apply_filters('geodir_cf_panel_selected_fields_head', '', $sub_tab, $listing_type);?></span>
|
| 1573 | 1573 | </h3> |
| 1574 | 1574 | <?php |
| 1575 | - /** |
|
| 1576 | - * Filter custom field selected fields note text. |
|
| 1577 | - * |
|
| 1578 | - * @since 1.0.0 |
|
| 1579 | - * @param string $sub_tab Sub tab name. |
|
| 1580 | - * @param string $listing_type Post type. |
|
| 1581 | - */ |
|
| 1582 | - ?> |
|
| 1575 | + /** |
|
| 1576 | + * Filter custom field selected fields note text. |
|
| 1577 | + * |
|
| 1578 | + * @since 1.0.0 |
|
| 1579 | + * @param string $sub_tab Sub tab name. |
|
| 1580 | + * @param string $listing_type Post type. |
|
| 1581 | + */ |
|
| 1582 | + ?> |
|
| 1583 | 1583 | <p><?php echo apply_filters('geodir_cf_panel_selected_fields_note', '', $sub_tab, $listing_type);?></p>
|
| 1584 | 1584 | |
| 1585 | 1585 | <div class="inside"> |
@@ -1587,13 +1587,13 @@ discard block |
||
| 1587 | 1587 | <div id="gt-form-builder-tab" class="gt-tabs-panel"> |
| 1588 | 1588 | <div class="field_row_main"> |
| 1589 | 1589 | <?php |
| 1590 | - /** |
|
| 1591 | - * Adds the selected fields and setting to the custom fields settings page per post type. |
|
| 1592 | - * |
|
| 1593 | - * @since 1.0.0 |
|
| 1594 | - * @param string $sub_tab The current settings tab name. |
|
| 1595 | - */ |
|
| 1596 | - do_action('geodir_manage_selected_fields', $sub_tab); ?>
|
|
| 1590 | + /** |
|
| 1591 | + * Adds the selected fields and setting to the custom fields settings page per post type. |
|
| 1592 | + * |
|
| 1593 | + * @since 1.0.0 |
|
| 1594 | + * @param string $sub_tab The current settings tab name. |
|
| 1595 | + */ |
|
| 1596 | + do_action('geodir_manage_selected_fields', $sub_tab); ?>
|
|
| 1597 | 1597 | </div> |
| 1598 | 1598 | <div style="clear:both"></div> |
| 1599 | 1599 | </div> |
@@ -1616,7 +1616,7 @@ discard block |
||
| 1616 | 1616 | */ |
| 1617 | 1617 | function geodir_diagnostic_tools_setting_page() |
| 1618 | 1618 | {
|
| 1619 | - ?> |
|
| 1619 | + ?> |
|
| 1620 | 1620 | <div class="inner_content_tab_main"> |
| 1621 | 1621 | <div class="gd-content-heading"> |
| 1622 | 1622 | |
@@ -1718,13 +1718,13 @@ discard block |
||
| 1718 | 1718 | </td> |
| 1719 | 1719 | </tr> |
| 1720 | 1720 | <?php |
| 1721 | - /** |
|
| 1722 | - * Allows you to add more setting to the GD>Tools settings page. |
|
| 1723 | - * |
|
| 1724 | - * Called after the last setting on the GD>Tools page. |
|
| 1725 | - * @since 1.0.0 |
|
| 1726 | - */ |
|
| 1727 | - do_action('geodir_diagnostic_tool');?>
|
|
| 1721 | + /** |
|
| 1722 | + * Allows you to add more setting to the GD>Tools settings page. |
|
| 1723 | + * |
|
| 1724 | + * Called after the last setting on the GD>Tools page. |
|
| 1725 | + * @since 1.0.0 |
|
| 1726 | + */ |
|
| 1727 | + do_action('geodir_diagnostic_tool');?>
|
|
| 1728 | 1728 | |
| 1729 | 1729 | </tbody> |
| 1730 | 1730 | </table> |
@@ -7,452 +7,452 @@ discard block |
||
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | 9 | function geodir_property_rent_custom_fields($post_type='gd_place',$package_id=''){ |
| 10 | - $fields = array(); |
|
| 11 | - $package = ($package_id=='') ? '' : array($package_id); |
|
| 12 | - |
|
| 13 | - // price |
|
| 14 | - $fields[] = array('listing_type' => $post_type, |
|
| 15 | - 'field_type' => 'text', |
|
| 16 | - 'data_type' => 'FLOAT', |
|
| 17 | - 'decimal_point' => '2', |
|
| 18 | - 'admin_title' => __('Price', 'geodirectory'), |
|
| 19 | - 'site_title' => __('Price', 'geodirectory'), |
|
| 20 | - 'admin_desc' => __('Enter the price per calendar month (PCM)in $ (no currency symbol)', 'geodirectory'), |
|
| 21 | - 'htmlvar_name' => 'price', |
|
| 22 | - 'is_active' => true, |
|
| 23 | - 'for_admin_use' => false, |
|
| 24 | - 'default_value' => '', |
|
| 25 | - 'show_in' => '[detail],[listing]', |
|
| 26 | - 'is_required' => false, |
|
| 27 | - 'validation_pattern' => addslashes_gpc('\d+(\.\d{2})?'), // add slashes required |
|
| 28 | - 'validation_msg' => 'Please enter number and decimal only ie: 100.50', |
|
| 29 | - 'required_msg' => '', |
|
| 30 | - 'field_icon' => 'fa fa-usd', |
|
| 31 | - 'css_class' => '', |
|
| 32 | - 'cat_sort' => true, |
|
| 33 | - 'cat_filter' => true, |
|
| 34 | - 'extra' => array( |
|
| 35 | - 'is_price' => 1, |
|
| 36 | - 'thousand_separator' => 'comma', |
|
| 37 | - 'decimal_separator' => 'period', |
|
| 38 | - 'decimal_display' => 'if', |
|
| 39 | - 'currency_symbol' => '$', |
|
| 40 | - 'currency_symbol_placement' => 'left' |
|
| 41 | - ) |
|
| 42 | - ); |
|
| 43 | - |
|
| 44 | - // property status |
|
| 45 | - $fields[] = array('listing_type' => $post_type, |
|
| 46 | - 'data_type' => 'VARCHAR', |
|
| 47 | - 'field_type' => 'select', |
|
| 48 | - 'field_type_key' => 'property_status', |
|
| 49 | - 'is_active' => 1, |
|
| 50 | - 'for_admin_use' => 0, |
|
| 51 | - 'is_default' => 0, |
|
| 52 | - 'admin_title' => __('Property Status', 'geodirectory'), |
|
| 53 | - 'admin_desc' => __('Enter the status of the property.', 'geodirectory'), |
|
| 54 | - 'site_title' => __('Property Status', 'geodirectory'), |
|
| 55 | - 'htmlvar_name' => 'property_status', |
|
| 56 | - 'default_value' => '', |
|
| 57 | - 'is_required' => '1', |
|
| 58 | - 'required_msg' => '', |
|
| 59 | - 'show_in' => '[detail],[listing]', |
|
| 60 | - 'show_on_pkg' => $package, |
|
| 61 | - 'option_values' => 'Select Status/,For Rent,Let,Under Offer', |
|
| 62 | - 'field_icon' => 'fa fa-home', |
|
| 63 | - 'css_class' => '', |
|
| 64 | - 'cat_sort' => 1, |
|
| 65 | - 'cat_filter' => 1, |
|
| 66 | - ); |
|
| 67 | - |
|
| 68 | - // property furnishing |
|
| 69 | - $fields[] = array('listing_type' => $post_type, |
|
| 70 | - 'field_type' => 'select', |
|
| 71 | - 'data_type' => 'VARCHAR', |
|
| 72 | - 'admin_title' => __('Furnishing', 'geodirectory'), |
|
| 73 | - 'site_title' => __('Furnishing', 'geodirectory'), |
|
| 74 | - 'admin_desc' => __('Enter the furnishing status of the property.', 'geodirectory'), |
|
| 75 | - 'htmlvar_name' => 'property_furnishing', |
|
| 76 | - 'is_active' => true, |
|
| 77 | - 'for_admin_use' => false, |
|
| 78 | - 'default_value' => '', |
|
| 79 | - 'show_in' => '[detail],[listing]', |
|
| 80 | - 'is_required' => true, |
|
| 81 | - 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 82 | - 'validation_pattern' => '', |
|
| 83 | - 'validation_msg' => '', |
|
| 84 | - 'required_msg' => '', |
|
| 85 | - 'field_icon' => 'fa fa-th-large', |
|
| 86 | - 'css_class' => '', |
|
| 87 | - 'cat_sort' => true, |
|
| 88 | - 'cat_filter' => true |
|
| 89 | - ); |
|
| 90 | - |
|
| 91 | - // property type |
|
| 92 | - $fields[] = array('listing_type' => $post_type, |
|
| 93 | - 'field_type' => 'select', |
|
| 94 | - 'data_type' => 'VARCHAR', |
|
| 95 | - 'admin_title' => __('Property Type', 'geodirectory'), |
|
| 96 | - 'site_title' => __('Property Type', 'geodirectory'), |
|
| 97 | - 'admin_desc' => __('Select the property type.', 'geodirectory'), |
|
| 98 | - 'htmlvar_name' => 'property_type', |
|
| 99 | - 'is_active' => true, |
|
| 100 | - 'for_admin_use' => false, |
|
| 101 | - 'default_value' => '', |
|
| 102 | - 'show_in' => '[detail],[listing]', |
|
| 103 | - 'is_required' => true, |
|
| 104 | - 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'), |
|
| 105 | - 'validation_pattern' => '', |
|
| 106 | - 'validation_msg' => '', |
|
| 107 | - 'required_msg' => '', |
|
| 108 | - 'field_icon' => 'fa fa-home', |
|
| 109 | - 'css_class' => '', |
|
| 110 | - 'cat_sort' => true, |
|
| 111 | - 'cat_filter' => true |
|
| 112 | - ); |
|
| 113 | - |
|
| 114 | - // property bedrooms |
|
| 115 | - $fields[] = array('listing_type' => $post_type, |
|
| 116 | - 'field_type' => 'select', |
|
| 117 | - 'data_type' => 'VARCHAR', |
|
| 118 | - 'admin_title' => __('Property Bedrooms', 'geodirectory'), |
|
| 119 | - 'site_title' => __('Bedrooms', 'geodirectory'), |
|
| 120 | - 'admin_desc' => __('Select the number of bedrooms', 'geodirectory'), |
|
| 121 | - 'htmlvar_name' => 'property_bedrooms', |
|
| 122 | - 'is_active' => true, |
|
| 123 | - 'for_admin_use' => false, |
|
| 124 | - 'default_value' => '', |
|
| 125 | - 'show_in' => '[detail],[listing]', |
|
| 126 | - 'is_required' => true, |
|
| 127 | - 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 128 | - 'validation_pattern' => '', |
|
| 129 | - 'validation_msg' => '', |
|
| 130 | - 'required_msg' => '', |
|
| 131 | - 'field_icon' => 'fa fa-bed', |
|
| 132 | - 'css_class' => '', |
|
| 133 | - 'cat_sort' => true, |
|
| 134 | - 'cat_filter' => true |
|
| 135 | - ); |
|
| 136 | - |
|
| 137 | - // property bathrooms |
|
| 138 | - $fields[] = array('listing_type' => $post_type, |
|
| 139 | - 'field_type' => 'select', |
|
| 140 | - 'data_type' => 'VARCHAR', |
|
| 141 | - 'admin_title' => __('Property Bathrooms', 'geodirectory'), |
|
| 142 | - 'site_title' => __('Bathrooms', 'geodirectory'), |
|
| 143 | - 'admin_desc' => __('Select the number of bathrooms', 'geodirectory'), |
|
| 144 | - 'htmlvar_name' => 'property_bathrooms', |
|
| 145 | - 'is_active' => true, |
|
| 146 | - 'for_admin_use' => false, |
|
| 147 | - 'default_value' => '', |
|
| 148 | - 'show_in' => '[detail],[listing]', |
|
| 149 | - 'is_required' => true, |
|
| 150 | - 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 151 | - 'validation_pattern' => '', |
|
| 152 | - 'validation_msg' => '', |
|
| 153 | - 'required_msg' => '', |
|
| 154 | - 'field_icon' => 'fa fa-bold', |
|
| 155 | - 'css_class' => '', |
|
| 156 | - 'cat_sort' => true, |
|
| 157 | - 'cat_filter' => true |
|
| 158 | - ); |
|
| 159 | - |
|
| 160 | - // property area |
|
| 161 | - $fields[] = array('listing_type' => $post_type, |
|
| 162 | - 'field_type' => 'text', |
|
| 163 | - 'data_type' => 'INT', |
|
| 164 | - 'admin_title' => __('Property Area', 'geodirectory'), |
|
| 165 | - 'site_title' => __('Area (Sq Ft)', 'geodirectory'), |
|
| 166 | - 'admin_desc' => __('Enter the Sq Ft value for the property', 'geodirectory'), |
|
| 167 | - 'htmlvar_name' => 'property_area', |
|
| 168 | - 'is_active' => true, |
|
| 169 | - 'for_admin_use' => false, |
|
| 170 | - 'default_value' => '', |
|
| 171 | - 'show_in' => '[detail],[listing]', |
|
| 172 | - 'is_required' => false, |
|
| 173 | - 'validation_pattern' => addslashes_gpc('\d+(\.\d{2})?'), // add slashes required |
|
| 174 | - 'validation_msg' => 'Please enter the property area in numbers only: 1500', |
|
| 175 | - 'required_msg' => '', |
|
| 176 | - 'field_icon' => 'fa fa-area-chart', |
|
| 177 | - 'css_class' => '', |
|
| 178 | - 'cat_sort' => true, |
|
| 179 | - 'cat_filter' => true |
|
| 180 | - ); |
|
| 181 | - |
|
| 182 | - // property features |
|
| 183 | - $fields[] = array('listing_type' => $post_type, |
|
| 184 | - 'field_type' => 'multiselect', |
|
| 185 | - 'data_type' => 'VARCHAR', |
|
| 186 | - 'admin_title' => __('Property Features', 'geodirectory'), |
|
| 187 | - 'site_title' => __('Features', 'geodirectory'), |
|
| 188 | - 'admin_desc' => __('Select the property features.', 'geodirectory'), |
|
| 189 | - 'htmlvar_name' => 'property_features', |
|
| 190 | - 'is_active' => true, |
|
| 191 | - 'for_admin_use' => false, |
|
| 192 | - 'default_value' => '', |
|
| 193 | - 'show_in' => '[detail],[listing]', |
|
| 194 | - 'is_required' => false, |
|
| 195 | - 'option_values' => __('Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 196 | - 'validation_pattern' => '', |
|
| 197 | - 'validation_msg' => '', |
|
| 198 | - 'required_msg' => '', |
|
| 199 | - 'field_icon' => 'fa fa-plus-square', |
|
| 200 | - 'css_class' => 'gd-comma-list', |
|
| 201 | - 'cat_sort' => true, |
|
| 202 | - 'cat_filter' => true |
|
| 203 | - ); |
|
| 204 | - |
|
| 205 | - |
|
| 206 | - |
|
| 207 | - /** |
|
| 208 | - * Filter the array of default custom fields DB table data. |
|
| 209 | - * |
|
| 210 | - * @since 1.6.6 |
|
| 211 | - * @param string $fields The default custom fields as an array. |
|
| 212 | - */ |
|
| 213 | - $fields = apply_filters('geodir_property_rent_custom_fields', $fields); |
|
| 214 | - |
|
| 215 | - return $fields; |
|
| 10 | + $fields = array(); |
|
| 11 | + $package = ($package_id=='') ? '' : array($package_id); |
|
| 12 | + |
|
| 13 | + // price |
|
| 14 | + $fields[] = array('listing_type' => $post_type, |
|
| 15 | + 'field_type' => 'text', |
|
| 16 | + 'data_type' => 'FLOAT', |
|
| 17 | + 'decimal_point' => '2', |
|
| 18 | + 'admin_title' => __('Price', 'geodirectory'), |
|
| 19 | + 'site_title' => __('Price', 'geodirectory'), |
|
| 20 | + 'admin_desc' => __('Enter the price per calendar month (PCM)in $ (no currency symbol)', 'geodirectory'), |
|
| 21 | + 'htmlvar_name' => 'price', |
|
| 22 | + 'is_active' => true, |
|
| 23 | + 'for_admin_use' => false, |
|
| 24 | + 'default_value' => '', |
|
| 25 | + 'show_in' => '[detail],[listing]', |
|
| 26 | + 'is_required' => false, |
|
| 27 | + 'validation_pattern' => addslashes_gpc('\d+(\.\d{2})?'), // add slashes required |
|
| 28 | + 'validation_msg' => 'Please enter number and decimal only ie: 100.50', |
|
| 29 | + 'required_msg' => '', |
|
| 30 | + 'field_icon' => 'fa fa-usd', |
|
| 31 | + 'css_class' => '', |
|
| 32 | + 'cat_sort' => true, |
|
| 33 | + 'cat_filter' => true, |
|
| 34 | + 'extra' => array( |
|
| 35 | + 'is_price' => 1, |
|
| 36 | + 'thousand_separator' => 'comma', |
|
| 37 | + 'decimal_separator' => 'period', |
|
| 38 | + 'decimal_display' => 'if', |
|
| 39 | + 'currency_symbol' => '$', |
|
| 40 | + 'currency_symbol_placement' => 'left' |
|
| 41 | + ) |
|
| 42 | + ); |
|
| 43 | + |
|
| 44 | + // property status |
|
| 45 | + $fields[] = array('listing_type' => $post_type, |
|
| 46 | + 'data_type' => 'VARCHAR', |
|
| 47 | + 'field_type' => 'select', |
|
| 48 | + 'field_type_key' => 'property_status', |
|
| 49 | + 'is_active' => 1, |
|
| 50 | + 'for_admin_use' => 0, |
|
| 51 | + 'is_default' => 0, |
|
| 52 | + 'admin_title' => __('Property Status', 'geodirectory'), |
|
| 53 | + 'admin_desc' => __('Enter the status of the property.', 'geodirectory'), |
|
| 54 | + 'site_title' => __('Property Status', 'geodirectory'), |
|
| 55 | + 'htmlvar_name' => 'property_status', |
|
| 56 | + 'default_value' => '', |
|
| 57 | + 'is_required' => '1', |
|
| 58 | + 'required_msg' => '', |
|
| 59 | + 'show_in' => '[detail],[listing]', |
|
| 60 | + 'show_on_pkg' => $package, |
|
| 61 | + 'option_values' => 'Select Status/,For Rent,Let,Under Offer', |
|
| 62 | + 'field_icon' => 'fa fa-home', |
|
| 63 | + 'css_class' => '', |
|
| 64 | + 'cat_sort' => 1, |
|
| 65 | + 'cat_filter' => 1, |
|
| 66 | + ); |
|
| 67 | + |
|
| 68 | + // property furnishing |
|
| 69 | + $fields[] = array('listing_type' => $post_type, |
|
| 70 | + 'field_type' => 'select', |
|
| 71 | + 'data_type' => 'VARCHAR', |
|
| 72 | + 'admin_title' => __('Furnishing', 'geodirectory'), |
|
| 73 | + 'site_title' => __('Furnishing', 'geodirectory'), |
|
| 74 | + 'admin_desc' => __('Enter the furnishing status of the property.', 'geodirectory'), |
|
| 75 | + 'htmlvar_name' => 'property_furnishing', |
|
| 76 | + 'is_active' => true, |
|
| 77 | + 'for_admin_use' => false, |
|
| 78 | + 'default_value' => '', |
|
| 79 | + 'show_in' => '[detail],[listing]', |
|
| 80 | + 'is_required' => true, |
|
| 81 | + 'option_values' => __('Select Status/,Unfurnished,Furnished,Partially furnished,Optional','geodirectory'), |
|
| 82 | + 'validation_pattern' => '', |
|
| 83 | + 'validation_msg' => '', |
|
| 84 | + 'required_msg' => '', |
|
| 85 | + 'field_icon' => 'fa fa-th-large', |
|
| 86 | + 'css_class' => '', |
|
| 87 | + 'cat_sort' => true, |
|
| 88 | + 'cat_filter' => true |
|
| 89 | + ); |
|
| 90 | + |
|
| 91 | + // property type |
|
| 92 | + $fields[] = array('listing_type' => $post_type, |
|
| 93 | + 'field_type' => 'select', |
|
| 94 | + 'data_type' => 'VARCHAR', |
|
| 95 | + 'admin_title' => __('Property Type', 'geodirectory'), |
|
| 96 | + 'site_title' => __('Property Type', 'geodirectory'), |
|
| 97 | + 'admin_desc' => __('Select the property type.', 'geodirectory'), |
|
| 98 | + 'htmlvar_name' => 'property_type', |
|
| 99 | + 'is_active' => true, |
|
| 100 | + 'for_admin_use' => false, |
|
| 101 | + 'default_value' => '', |
|
| 102 | + 'show_in' => '[detail],[listing]', |
|
| 103 | + 'is_required' => true, |
|
| 104 | + 'option_values' => __('Select Type/,Detached house,Semi-detached house,Apartment,Bungalow,Semi-detached bungalow,Chalet,Town House,End-terrace house,Terrace house,Cottage,Hotel,Land','geodirectory'), |
|
| 105 | + 'validation_pattern' => '', |
|
| 106 | + 'validation_msg' => '', |
|
| 107 | + 'required_msg' => '', |
|
| 108 | + 'field_icon' => 'fa fa-home', |
|
| 109 | + 'css_class' => '', |
|
| 110 | + 'cat_sort' => true, |
|
| 111 | + 'cat_filter' => true |
|
| 112 | + ); |
|
| 113 | + |
|
| 114 | + // property bedrooms |
|
| 115 | + $fields[] = array('listing_type' => $post_type, |
|
| 116 | + 'field_type' => 'select', |
|
| 117 | + 'data_type' => 'VARCHAR', |
|
| 118 | + 'admin_title' => __('Property Bedrooms', 'geodirectory'), |
|
| 119 | + 'site_title' => __('Bedrooms', 'geodirectory'), |
|
| 120 | + 'admin_desc' => __('Select the number of bedrooms', 'geodirectory'), |
|
| 121 | + 'htmlvar_name' => 'property_bedrooms', |
|
| 122 | + 'is_active' => true, |
|
| 123 | + 'for_admin_use' => false, |
|
| 124 | + 'default_value' => '', |
|
| 125 | + 'show_in' => '[detail],[listing]', |
|
| 126 | + 'is_required' => true, |
|
| 127 | + 'option_values' => __('Select Bedrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 128 | + 'validation_pattern' => '', |
|
| 129 | + 'validation_msg' => '', |
|
| 130 | + 'required_msg' => '', |
|
| 131 | + 'field_icon' => 'fa fa-bed', |
|
| 132 | + 'css_class' => '', |
|
| 133 | + 'cat_sort' => true, |
|
| 134 | + 'cat_filter' => true |
|
| 135 | + ); |
|
| 136 | + |
|
| 137 | + // property bathrooms |
|
| 138 | + $fields[] = array('listing_type' => $post_type, |
|
| 139 | + 'field_type' => 'select', |
|
| 140 | + 'data_type' => 'VARCHAR', |
|
| 141 | + 'admin_title' => __('Property Bathrooms', 'geodirectory'), |
|
| 142 | + 'site_title' => __('Bathrooms', 'geodirectory'), |
|
| 143 | + 'admin_desc' => __('Select the number of bathrooms', 'geodirectory'), |
|
| 144 | + 'htmlvar_name' => 'property_bathrooms', |
|
| 145 | + 'is_active' => true, |
|
| 146 | + 'for_admin_use' => false, |
|
| 147 | + 'default_value' => '', |
|
| 148 | + 'show_in' => '[detail],[listing]', |
|
| 149 | + 'is_required' => true, |
|
| 150 | + 'option_values' => __('Select Bathrooms/,1,2,3,4,5,6,7,8,9,10','geodirectory'), |
|
| 151 | + 'validation_pattern' => '', |
|
| 152 | + 'validation_msg' => '', |
|
| 153 | + 'required_msg' => '', |
|
| 154 | + 'field_icon' => 'fa fa-bold', |
|
| 155 | + 'css_class' => '', |
|
| 156 | + 'cat_sort' => true, |
|
| 157 | + 'cat_filter' => true |
|
| 158 | + ); |
|
| 159 | + |
|
| 160 | + // property area |
|
| 161 | + $fields[] = array('listing_type' => $post_type, |
|
| 162 | + 'field_type' => 'text', |
|
| 163 | + 'data_type' => 'INT', |
|
| 164 | + 'admin_title' => __('Property Area', 'geodirectory'), |
|
| 165 | + 'site_title' => __('Area (Sq Ft)', 'geodirectory'), |
|
| 166 | + 'admin_desc' => __('Enter the Sq Ft value for the property', 'geodirectory'), |
|
| 167 | + 'htmlvar_name' => 'property_area', |
|
| 168 | + 'is_active' => true, |
|
| 169 | + 'for_admin_use' => false, |
|
| 170 | + 'default_value' => '', |
|
| 171 | + 'show_in' => '[detail],[listing]', |
|
| 172 | + 'is_required' => false, |
|
| 173 | + 'validation_pattern' => addslashes_gpc('\d+(\.\d{2})?'), // add slashes required |
|
| 174 | + 'validation_msg' => 'Please enter the property area in numbers only: 1500', |
|
| 175 | + 'required_msg' => '', |
|
| 176 | + 'field_icon' => 'fa fa-area-chart', |
|
| 177 | + 'css_class' => '', |
|
| 178 | + 'cat_sort' => true, |
|
| 179 | + 'cat_filter' => true |
|
| 180 | + ); |
|
| 181 | + |
|
| 182 | + // property features |
|
| 183 | + $fields[] = array('listing_type' => $post_type, |
|
| 184 | + 'field_type' => 'multiselect', |
|
| 185 | + 'data_type' => 'VARCHAR', |
|
| 186 | + 'admin_title' => __('Property Features', 'geodirectory'), |
|
| 187 | + 'site_title' => __('Features', 'geodirectory'), |
|
| 188 | + 'admin_desc' => __('Select the property features.', 'geodirectory'), |
|
| 189 | + 'htmlvar_name' => 'property_features', |
|
| 190 | + 'is_active' => true, |
|
| 191 | + 'for_admin_use' => false, |
|
| 192 | + 'default_value' => '', |
|
| 193 | + 'show_in' => '[detail],[listing]', |
|
| 194 | + 'is_required' => false, |
|
| 195 | + 'option_values' => __('Gas Central Heating,Oil Central Heating,Double Glazing,Triple Glazing,Front Garden,Garage,Private driveway,Off Road Parking,Fireplace','geodirectory'), |
|
| 196 | + 'validation_pattern' => '', |
|
| 197 | + 'validation_msg' => '', |
|
| 198 | + 'required_msg' => '', |
|
| 199 | + 'field_icon' => 'fa fa-plus-square', |
|
| 200 | + 'css_class' => 'gd-comma-list', |
|
| 201 | + 'cat_sort' => true, |
|
| 202 | + 'cat_filter' => true |
|
| 203 | + ); |
|
| 204 | + |
|
| 205 | + |
|
| 206 | + |
|
| 207 | + /** |
|
| 208 | + * Filter the array of default custom fields DB table data. |
|
| 209 | + * |
|
| 210 | + * @since 1.6.6 |
|
| 211 | + * @param string $fields The default custom fields as an array. |
|
| 212 | + */ |
|
| 213 | + $fields = apply_filters('geodir_property_rent_custom_fields', $fields); |
|
| 214 | + |
|
| 215 | + return $fields; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | function geodir_property_rent_custom_fields_sort($post_type='gd_place') { |
| 219 | 219 | |
| 220 | 220 | |
| 221 | - $fields = array(); |
|
| 222 | - |
|
| 223 | - // price sort |
|
| 224 | - $fields[] = array( |
|
| 225 | - 'create_field' => true, |
|
| 226 | - 'listing_type' => $post_type, |
|
| 227 | - 'field_type' => 'text', |
|
| 228 | - 'data_type' => '', |
|
| 229 | - 'htmlvar_name' => 'geodir_price', |
|
| 230 | - 'site_title' => __('Price','geodirectory'), |
|
| 231 | - 'asc' => 1, |
|
| 232 | - 'asc_title' => __('Price (lowest first)','geodirectory'), |
|
| 233 | - 'desc' => 1, |
|
| 234 | - 'desc_title' => __('Price (highest first)','geodirectory'), |
|
| 235 | - 'is_active' => 1 |
|
| 236 | - ); |
|
| 237 | - |
|
| 238 | - // area sort |
|
| 239 | - $fields[] = array( |
|
| 240 | - 'create_field' => true, |
|
| 241 | - 'listing_type' => $post_type, |
|
| 242 | - 'field_type' => 'text', |
|
| 243 | - 'data_type' => '', |
|
| 244 | - 'htmlvar_name' => 'geodir_property_area', |
|
| 245 | - 'site_title' => __('Area (Sq Ft)','geodirectory'), |
|
| 246 | - 'asc' => 1, |
|
| 247 | - 'asc_title' => __('Area (smallest first)','geodirectory'), |
|
| 248 | - 'desc' => 1, |
|
| 249 | - 'desc_title' => __('Area (largest first)','geodirectory'), |
|
| 250 | - 'is_active' => 1 |
|
| 251 | - ); |
|
| 252 | - |
|
| 253 | - // bedrooms sort |
|
| 254 | - $fields[] = array( |
|
| 255 | - 'create_field' => true, |
|
| 256 | - 'listing_type' => $post_type, |
|
| 257 | - 'field_type' => 'select', |
|
| 258 | - 'data_type' => '', |
|
| 259 | - 'htmlvar_name' => 'geodir_property_bedrooms', |
|
| 260 | - 'site_title' => __('Area (Sq Ft)','geodirectory'), |
|
| 261 | - 'asc' => 1, |
|
| 262 | - 'asc_title' => __('Bedrooms (least)','geodirectory'), |
|
| 263 | - 'desc' => 1, |
|
| 264 | - 'desc_title' => __('Bedrooms (most)','geodirectory'), |
|
| 265 | - 'is_active' => 1 |
|
| 266 | - ); |
|
| 267 | - |
|
| 268 | - /** |
|
| 269 | - * Filter the array of advanced search fields DB table data. |
|
| 270 | - * |
|
| 271 | - * @since 1.6.6 |
|
| 272 | - * @param string $fields The default custom fields as an array. |
|
| 273 | - */ |
|
| 274 | - $fields = apply_filters('geodir_property_sale_custom_fields_sort', $fields); |
|
| 275 | - |
|
| 276 | - return $fields; |
|
| 221 | + $fields = array(); |
|
| 222 | + |
|
| 223 | + // price sort |
|
| 224 | + $fields[] = array( |
|
| 225 | + 'create_field' => true, |
|
| 226 | + 'listing_type' => $post_type, |
|
| 227 | + 'field_type' => 'text', |
|
| 228 | + 'data_type' => '', |
|
| 229 | + 'htmlvar_name' => 'geodir_price', |
|
| 230 | + 'site_title' => __('Price','geodirectory'), |
|
| 231 | + 'asc' => 1, |
|
| 232 | + 'asc_title' => __('Price (lowest first)','geodirectory'), |
|
| 233 | + 'desc' => 1, |
|
| 234 | + 'desc_title' => __('Price (highest first)','geodirectory'), |
|
| 235 | + 'is_active' => 1 |
|
| 236 | + ); |
|
| 237 | + |
|
| 238 | + // area sort |
|
| 239 | + $fields[] = array( |
|
| 240 | + 'create_field' => true, |
|
| 241 | + 'listing_type' => $post_type, |
|
| 242 | + 'field_type' => 'text', |
|
| 243 | + 'data_type' => '', |
|
| 244 | + 'htmlvar_name' => 'geodir_property_area', |
|
| 245 | + 'site_title' => __('Area (Sq Ft)','geodirectory'), |
|
| 246 | + 'asc' => 1, |
|
| 247 | + 'asc_title' => __('Area (smallest first)','geodirectory'), |
|
| 248 | + 'desc' => 1, |
|
| 249 | + 'desc_title' => __('Area (largest first)','geodirectory'), |
|
| 250 | + 'is_active' => 1 |
|
| 251 | + ); |
|
| 252 | + |
|
| 253 | + // bedrooms sort |
|
| 254 | + $fields[] = array( |
|
| 255 | + 'create_field' => true, |
|
| 256 | + 'listing_type' => $post_type, |
|
| 257 | + 'field_type' => 'select', |
|
| 258 | + 'data_type' => '', |
|
| 259 | + 'htmlvar_name' => 'geodir_property_bedrooms', |
|
| 260 | + 'site_title' => __('Area (Sq Ft)','geodirectory'), |
|
| 261 | + 'asc' => 1, |
|
| 262 | + 'asc_title' => __('Bedrooms (least)','geodirectory'), |
|
| 263 | + 'desc' => 1, |
|
| 264 | + 'desc_title' => __('Bedrooms (most)','geodirectory'), |
|
| 265 | + 'is_active' => 1 |
|
| 266 | + ); |
|
| 267 | + |
|
| 268 | + /** |
|
| 269 | + * Filter the array of advanced search fields DB table data. |
|
| 270 | + * |
|
| 271 | + * @since 1.6.6 |
|
| 272 | + * @param string $fields The default custom fields as an array. |
|
| 273 | + */ |
|
| 274 | + $fields = apply_filters('geodir_property_sale_custom_fields_sort', $fields); |
|
| 275 | + |
|
| 276 | + return $fields; |
|
| 277 | 277 | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | function geodir_property_rent_custom_fields_advanced_search($post_type='gd_place') { |
| 281 | 281 | |
| 282 | 282 | |
| 283 | - $fields = array(); |
|
| 284 | - |
|
| 285 | - // Price range |
|
| 286 | - $fields[] = array( |
|
| 287 | - 'create_field' => true, |
|
| 288 | - 'listing_type' => $post_type, |
|
| 289 | - 'field_type' => 'text', |
|
| 290 | - 'data_type' => 'RANGE', |
|
| 291 | - 'is_active' => 1, |
|
| 292 | - 'site_field_title' => 'Price', |
|
| 293 | - 'field_data_type' => 'FLOAT', |
|
| 294 | - 'main_search' => 1, |
|
| 295 | - 'main_search_priority' => 15, |
|
| 296 | - 'data_type_change' => 'SELECT', |
|
| 297 | - 'search_condition_select' => 'SINGLE', |
|
| 298 | - 'search_min_value' => '1000', |
|
| 299 | - 'search_max_value' => '10000', |
|
| 300 | - 'search_diff_value' => '1000', |
|
| 301 | - 'first_search_value' => '0', |
|
| 302 | - 'first_search_text' => '', |
|
| 303 | - 'last_search_text' => '', |
|
| 304 | - 'search_condition' => 'SELECT', |
|
| 305 | - 'site_htmlvar_name' => 'geodir_price', |
|
| 306 | - 'htmlvar_name' => 'geodir_price', |
|
| 307 | - 'field_title' => 'geodir_price', |
|
| 308 | - 'expand_custom_value' => '', |
|
| 309 | - 'front_search_title' => 'Price Range pm', |
|
| 310 | - 'field_desc' => '' |
|
| 311 | - ); |
|
| 312 | - |
|
| 313 | - // bedrooms |
|
| 314 | - $fields[] = array( |
|
| 315 | - 'create_field' => true, |
|
| 316 | - 'listing_type' => $post_type, |
|
| 317 | - 'field_type' => 'select', |
|
| 318 | - 'data_type' => 'CHECK', |
|
| 319 | - 'is_active' => 1, |
|
| 320 | - 'site_field_title' => 'Bedrooms', |
|
| 321 | - 'field_data_type' => 'VARCHAR', |
|
| 322 | - 'main_search' => 1, |
|
| 323 | - 'main_search_priority' => 16, |
|
| 324 | - 'search_condition' => 'SINGLE', |
|
| 325 | - 'site_htmlvar_name' => 'geodir_property_bedrooms', |
|
| 326 | - 'htmlvar_name' => 'geodir_property_bedrooms', |
|
| 327 | - 'field_title' => 'geodir_property_bedrooms', |
|
| 328 | - 'front_search_title' => 'Bedrooms', |
|
| 329 | - 'field_desc' => '', |
|
| 330 | - 'expand_custom_value' => 5, |
|
| 331 | - 'expand_search' => 1, |
|
| 332 | - 'search_operator' => 'OR' |
|
| 333 | - ); |
|
| 334 | - |
|
| 335 | - // Property type |
|
| 336 | - $fields[] = array( |
|
| 337 | - 'create_field' => true, |
|
| 338 | - 'listing_type' => $post_type, |
|
| 339 | - 'field_type' => 'select', |
|
| 340 | - 'data_type' => 'CHECK', |
|
| 341 | - 'is_active' => 1, |
|
| 342 | - 'site_field_title' => 'Property Type', |
|
| 343 | - 'field_data_type' => 'VARCHAR', |
|
| 344 | - 'main_search' => 0, |
|
| 345 | - //'main_search_priority' => 16, |
|
| 346 | - 'search_condition' => 'SINGLE', |
|
| 347 | - 'site_htmlvar_name' => 'geodir_property_type', |
|
| 348 | - 'htmlvar_name' => 'geodir_property_type', |
|
| 349 | - 'field_title' => 'geodir_property_type', |
|
| 350 | - 'front_search_title' => 'Property Type', |
|
| 351 | - 'field_desc' => '', |
|
| 352 | - 'expand_custom_value' => 5, |
|
| 353 | - 'expand_search' => 1, |
|
| 354 | - 'search_operator' => 'OR' |
|
| 355 | - ); |
|
| 356 | - |
|
| 357 | - // Property Features |
|
| 358 | - $fields[] = array( |
|
| 359 | - 'create_field' => true, |
|
| 360 | - 'listing_type' => $post_type, |
|
| 361 | - 'field_type' => 'multiselect', |
|
| 362 | - 'data_type' => 'CHECK', |
|
| 363 | - 'is_active' => 1, |
|
| 364 | - 'site_field_title' => 'Features', |
|
| 365 | - 'field_data_type' => 'VARCHAR', |
|
| 366 | - 'main_search' => 0, |
|
| 367 | - //'main_search_priority' => 16, |
|
| 368 | - 'search_condition' => 'SINGLE', |
|
| 369 | - 'site_htmlvar_name' => 'geodir_property_features', |
|
| 370 | - 'htmlvar_name' => 'geodir_property_features', |
|
| 371 | - 'field_title' => 'geodir_property_features', |
|
| 372 | - 'front_search_title' => 'Property Features', |
|
| 373 | - 'field_desc' => '', |
|
| 374 | - 'expand_custom_value' => 5, |
|
| 375 | - 'expand_search' => 1, |
|
| 376 | - 'search_operator' => 'AND' |
|
| 377 | - ); |
|
| 378 | - |
|
| 379 | - // Property Bathrooms |
|
| 380 | - $fields[] = array( |
|
| 381 | - 'create_field' => true, |
|
| 382 | - 'listing_type' => $post_type, |
|
| 383 | - 'field_type' => 'select', |
|
| 384 | - 'data_type' => 'CHECK', |
|
| 385 | - 'is_active' => 1, |
|
| 386 | - 'site_field_title' => 'Bathrooms', |
|
| 387 | - 'field_data_type' => 'VARCHAR', |
|
| 388 | - 'main_search' => 0, |
|
| 389 | - //'main_search_priority' => 16, |
|
| 390 | - 'search_condition' => 'SINGLE', |
|
| 391 | - 'site_htmlvar_name' => 'geodir_property_bathrooms', |
|
| 392 | - 'htmlvar_name' => 'geodir_property_bathrooms', |
|
| 393 | - 'field_title' => 'geodir_property_bathrooms', |
|
| 394 | - 'front_search_title' => 'Bathrooms', |
|
| 395 | - 'field_desc' => '', |
|
| 396 | - 'expand_custom_value' => 5, |
|
| 397 | - 'expand_search' => 1, |
|
| 398 | - 'search_operator' => 'OR' |
|
| 399 | - ); |
|
| 400 | - |
|
| 401 | - // Property Furnishing |
|
| 402 | - $fields[] = array( |
|
| 403 | - 'create_field' => true, |
|
| 404 | - 'listing_type' => $post_type, |
|
| 405 | - 'field_type' => 'select', |
|
| 406 | - 'data_type' => 'CHECK', |
|
| 407 | - 'is_active' => 1, |
|
| 408 | - 'site_field_title' => 'Furnishing', |
|
| 409 | - 'field_data_type' => 'VARCHAR', |
|
| 410 | - 'main_search' => 0, |
|
| 411 | - //'main_search_priority' => 16, |
|
| 412 | - 'search_condition' => 'SINGLE', |
|
| 413 | - 'site_htmlvar_name' => 'geodir_property_furnishing', |
|
| 414 | - 'htmlvar_name' => 'geodir_property_furnishing', |
|
| 415 | - 'field_title' => 'geodir_property_furnishing', |
|
| 416 | - 'front_search_title' => 'Furnishing', |
|
| 417 | - 'field_desc' => '', |
|
| 418 | - 'expand_custom_value' => 5, |
|
| 419 | - 'expand_search' => 1, |
|
| 420 | - 'search_operator' => 'OR' |
|
| 421 | - ); |
|
| 422 | - |
|
| 423 | - // Property Status |
|
| 424 | - $fields[] = array( |
|
| 425 | - 'create_field' => true, |
|
| 426 | - 'listing_type' => $post_type, |
|
| 427 | - 'field_type' => 'select', |
|
| 428 | - 'data_type' => 'CHECK', |
|
| 429 | - 'is_active' => 1, |
|
| 430 | - 'site_field_title' => 'Property Status', |
|
| 431 | - 'field_data_type' => 'VARCHAR', |
|
| 432 | - 'main_search' => 0, |
|
| 433 | - //'main_search_priority' => 16, |
|
| 434 | - 'search_condition' => 'SINGLE', |
|
| 435 | - 'site_htmlvar_name' => 'geodir_property_status', |
|
| 436 | - 'htmlvar_name' => 'geodir_property_status', |
|
| 437 | - 'field_title' => 'geodir_property_status', |
|
| 438 | - 'front_search_title' => 'Property Status', |
|
| 439 | - 'field_desc' => '', |
|
| 440 | - 'expand_custom_value' => 5, |
|
| 441 | - 'expand_search' => 1, |
|
| 442 | - 'search_operator' => 'OR' |
|
| 443 | - ); |
|
| 444 | - |
|
| 445 | - |
|
| 446 | - |
|
| 447 | - /** |
|
| 448 | - * Filter the array of advanced search fields DB table data. |
|
| 449 | - * |
|
| 450 | - * @since 1.6.6 |
|
| 451 | - * @param string $fields The default custom fields as an array. |
|
| 452 | - */ |
|
| 453 | - $fields = apply_filters('geodir_property_rent_custom_fields_advanced_search', $fields); |
|
| 454 | - |
|
| 455 | - return $fields; |
|
| 283 | + $fields = array(); |
|
| 284 | + |
|
| 285 | + // Price range |
|
| 286 | + $fields[] = array( |
|
| 287 | + 'create_field' => true, |
|
| 288 | + 'listing_type' => $post_type, |
|
| 289 | + 'field_type' => 'text', |
|
| 290 | + 'data_type' => 'RANGE', |
|
| 291 | + 'is_active' => 1, |
|
| 292 | + 'site_field_title' => 'Price', |
|
| 293 | + 'field_data_type' => 'FLOAT', |
|
| 294 | + 'main_search' => 1, |
|
| 295 | + 'main_search_priority' => 15, |
|
| 296 | + 'data_type_change' => 'SELECT', |
|
| 297 | + 'search_condition_select' => 'SINGLE', |
|
| 298 | + 'search_min_value' => '1000', |
|
| 299 | + 'search_max_value' => '10000', |
|
| 300 | + 'search_diff_value' => '1000', |
|
| 301 | + 'first_search_value' => '0', |
|
| 302 | + 'first_search_text' => '', |
|
| 303 | + 'last_search_text' => '', |
|
| 304 | + 'search_condition' => 'SELECT', |
|
| 305 | + 'site_htmlvar_name' => 'geodir_price', |
|
| 306 | + 'htmlvar_name' => 'geodir_price', |
|
| 307 | + 'field_title' => 'geodir_price', |
|
| 308 | + 'expand_custom_value' => '', |
|
| 309 | + 'front_search_title' => 'Price Range pm', |
|
| 310 | + 'field_desc' => '' |
|
| 311 | + ); |
|
| 312 | + |
|
| 313 | + // bedrooms |
|
| 314 | + $fields[] = array( |
|
| 315 | + 'create_field' => true, |
|
| 316 | + 'listing_type' => $post_type, |
|
| 317 | + 'field_type' => 'select', |
|
| 318 | + 'data_type' => 'CHECK', |
|
| 319 | + 'is_active' => 1, |
|
| 320 | + 'site_field_title' => 'Bedrooms', |
|
| 321 | + 'field_data_type' => 'VARCHAR', |
|
| 322 | + 'main_search' => 1, |
|
| 323 | + 'main_search_priority' => 16, |
|
| 324 | + 'search_condition' => 'SINGLE', |
|
| 325 | + 'site_htmlvar_name' => 'geodir_property_bedrooms', |
|
| 326 | + 'htmlvar_name' => 'geodir_property_bedrooms', |
|
| 327 | + 'field_title' => 'geodir_property_bedrooms', |
|
| 328 | + 'front_search_title' => 'Bedrooms', |
|
| 329 | + 'field_desc' => '', |
|
| 330 | + 'expand_custom_value' => 5, |
|
| 331 | + 'expand_search' => 1, |
|
| 332 | + 'search_operator' => 'OR' |
|
| 333 | + ); |
|
| 334 | + |
|
| 335 | + // Property type |
|
| 336 | + $fields[] = array( |
|
| 337 | + 'create_field' => true, |
|
| 338 | + 'listing_type' => $post_type, |
|
| 339 | + 'field_type' => 'select', |
|
| 340 | + 'data_type' => 'CHECK', |
|
| 341 | + 'is_active' => 1, |
|
| 342 | + 'site_field_title' => 'Property Type', |
|
| 343 | + 'field_data_type' => 'VARCHAR', |
|
| 344 | + 'main_search' => 0, |
|
| 345 | + //'main_search_priority' => 16, |
|
| 346 | + 'search_condition' => 'SINGLE', |
|
| 347 | + 'site_htmlvar_name' => 'geodir_property_type', |
|
| 348 | + 'htmlvar_name' => 'geodir_property_type', |
|
| 349 | + 'field_title' => 'geodir_property_type', |
|
| 350 | + 'front_search_title' => 'Property Type', |
|
| 351 | + 'field_desc' => '', |
|
| 352 | + 'expand_custom_value' => 5, |
|
| 353 | + 'expand_search' => 1, |
|
| 354 | + 'search_operator' => 'OR' |
|
| 355 | + ); |
|
| 356 | + |
|
| 357 | + // Property Features |
|
| 358 | + $fields[] = array( |
|
| 359 | + 'create_field' => true, |
|
| 360 | + 'listing_type' => $post_type, |
|
| 361 | + 'field_type' => 'multiselect', |
|
| 362 | + 'data_type' => 'CHECK', |
|
| 363 | + 'is_active' => 1, |
|
| 364 | + 'site_field_title' => 'Features', |
|
| 365 | + 'field_data_type' => 'VARCHAR', |
|
| 366 | + 'main_search' => 0, |
|
| 367 | + //'main_search_priority' => 16, |
|
| 368 | + 'search_condition' => 'SINGLE', |
|
| 369 | + 'site_htmlvar_name' => 'geodir_property_features', |
|
| 370 | + 'htmlvar_name' => 'geodir_property_features', |
|
| 371 | + 'field_title' => 'geodir_property_features', |
|
| 372 | + 'front_search_title' => 'Property Features', |
|
| 373 | + 'field_desc' => '', |
|
| 374 | + 'expand_custom_value' => 5, |
|
| 375 | + 'expand_search' => 1, |
|
| 376 | + 'search_operator' => 'AND' |
|
| 377 | + ); |
|
| 378 | + |
|
| 379 | + // Property Bathrooms |
|
| 380 | + $fields[] = array( |
|
| 381 | + 'create_field' => true, |
|
| 382 | + 'listing_type' => $post_type, |
|
| 383 | + 'field_type' => 'select', |
|
| 384 | + 'data_type' => 'CHECK', |
|
| 385 | + 'is_active' => 1, |
|
| 386 | + 'site_field_title' => 'Bathrooms', |
|
| 387 | + 'field_data_type' => 'VARCHAR', |
|
| 388 | + 'main_search' => 0, |
|
| 389 | + //'main_search_priority' => 16, |
|
| 390 | + 'search_condition' => 'SINGLE', |
|
| 391 | + 'site_htmlvar_name' => 'geodir_property_bathrooms', |
|
| 392 | + 'htmlvar_name' => 'geodir_property_bathrooms', |
|
| 393 | + 'field_title' => 'geodir_property_bathrooms', |
|
| 394 | + 'front_search_title' => 'Bathrooms', |
|
| 395 | + 'field_desc' => '', |
|
| 396 | + 'expand_custom_value' => 5, |
|
| 397 | + 'expand_search' => 1, |
|
| 398 | + 'search_operator' => 'OR' |
|
| 399 | + ); |
|
| 400 | + |
|
| 401 | + // Property Furnishing |
|
| 402 | + $fields[] = array( |
|
| 403 | + 'create_field' => true, |
|
| 404 | + 'listing_type' => $post_type, |
|
| 405 | + 'field_type' => 'select', |
|
| 406 | + 'data_type' => 'CHECK', |
|
| 407 | + 'is_active' => 1, |
|
| 408 | + 'site_field_title' => 'Furnishing', |
|
| 409 | + 'field_data_type' => 'VARCHAR', |
|
| 410 | + 'main_search' => 0, |
|
| 411 | + //'main_search_priority' => 16, |
|
| 412 | + 'search_condition' => 'SINGLE', |
|
| 413 | + 'site_htmlvar_name' => 'geodir_property_furnishing', |
|
| 414 | + 'htmlvar_name' => 'geodir_property_furnishing', |
|
| 415 | + 'field_title' => 'geodir_property_furnishing', |
|
| 416 | + 'front_search_title' => 'Furnishing', |
|
| 417 | + 'field_desc' => '', |
|
| 418 | + 'expand_custom_value' => 5, |
|
| 419 | + 'expand_search' => 1, |
|
| 420 | + 'search_operator' => 'OR' |
|
| 421 | + ); |
|
| 422 | + |
|
| 423 | + // Property Status |
|
| 424 | + $fields[] = array( |
|
| 425 | + 'create_field' => true, |
|
| 426 | + 'listing_type' => $post_type, |
|
| 427 | + 'field_type' => 'select', |
|
| 428 | + 'data_type' => 'CHECK', |
|
| 429 | + 'is_active' => 1, |
|
| 430 | + 'site_field_title' => 'Property Status', |
|
| 431 | + 'field_data_type' => 'VARCHAR', |
|
| 432 | + 'main_search' => 0, |
|
| 433 | + //'main_search_priority' => 16, |
|
| 434 | + 'search_condition' => 'SINGLE', |
|
| 435 | + 'site_htmlvar_name' => 'geodir_property_status', |
|
| 436 | + 'htmlvar_name' => 'geodir_property_status', |
|
| 437 | + 'field_title' => 'geodir_property_status', |
|
| 438 | + 'front_search_title' => 'Property Status', |
|
| 439 | + 'field_desc' => '', |
|
| 440 | + 'expand_custom_value' => 5, |
|
| 441 | + 'expand_search' => 1, |
|
| 442 | + 'search_operator' => 'OR' |
|
| 443 | + ); |
|
| 444 | + |
|
| 445 | + |
|
| 446 | + |
|
| 447 | + /** |
|
| 448 | + * Filter the array of advanced search fields DB table data. |
|
| 449 | + * |
|
| 450 | + * @since 1.6.6 |
|
| 451 | + * @param string $fields The default custom fields as an array. |
|
| 452 | + */ |
|
| 453 | + $fields = apply_filters('geodir_property_rent_custom_fields_advanced_search', $fields); |
|
| 454 | + |
|
| 455 | + return $fields; |
|
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | global $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2,$wpdb, $current_user,$dummy_post_index; |
@@ -462,52 +462,52 @@ discard block |
||
| 462 | 462 | $category_array = array('Apartments', 'Houses', 'Commercial', 'Land'); |
| 463 | 463 | |
| 464 | 464 | if($dummy_post_index==1){ |
| 465 | - // add the dummy categories |
|
| 466 | - geodir_dummy_data_taxonomies($post_type,$category_array ); |
|
| 467 | - |
|
| 468 | - // add the dummy custom fields |
|
| 469 | - $fields = geodir_property_rent_custom_fields($post_type); |
|
| 470 | - geodir_create_dummy_fields($fields); |
|
| 471 | - |
|
| 472 | - // add sort order items |
|
| 473 | - $sort_fields = geodir_property_rent_custom_fields_sort($post_type); |
|
| 474 | - foreach($sort_fields as $sort){ |
|
| 475 | - geodir_custom_sort_field_save($sort); |
|
| 476 | - } |
|
| 477 | - |
|
| 478 | - // update the type currently installed |
|
| 479 | - update_option($post_type.'_dummy_data_type','property_rent'); |
|
| 480 | - |
|
| 481 | - // add the advanced search fields |
|
| 482 | - if (defined('GEODIRADVANCESEARCH_VERSION')){ |
|
| 483 | - $search_fields = geodir_property_rent_custom_fields_advanced_search($post_type); |
|
| 484 | - foreach($search_fields as $sfield){ |
|
| 485 | - geodir_custom_advance_search_field_save( $sfield ); |
|
| 486 | - } |
|
| 487 | - } |
|
| 465 | + // add the dummy categories |
|
| 466 | + geodir_dummy_data_taxonomies($post_type,$category_array ); |
|
| 467 | + |
|
| 468 | + // add the dummy custom fields |
|
| 469 | + $fields = geodir_property_rent_custom_fields($post_type); |
|
| 470 | + geodir_create_dummy_fields($fields); |
|
| 471 | + |
|
| 472 | + // add sort order items |
|
| 473 | + $sort_fields = geodir_property_rent_custom_fields_sort($post_type); |
|
| 474 | + foreach($sort_fields as $sort){ |
|
| 475 | + geodir_custom_sort_field_save($sort); |
|
| 476 | + } |
|
| 477 | + |
|
| 478 | + // update the type currently installed |
|
| 479 | + update_option($post_type.'_dummy_data_type','property_rent'); |
|
| 480 | + |
|
| 481 | + // add the advanced search fields |
|
| 482 | + if (defined('GEODIRADVANCESEARCH_VERSION')){ |
|
| 483 | + $search_fields = geodir_property_rent_custom_fields_advanced_search($post_type); |
|
| 484 | + foreach($search_fields as $sfield){ |
|
| 485 | + geodir_custom_advance_search_field_save( $sfield ); |
|
| 486 | + } |
|
| 487 | + } |
|
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | if (geodir_dummy_folder_exists()) |
| 491 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
|
| 491 | + $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
|
| 492 | 492 | else |
| 493 | - $dummy_image_url = 'https://www.wpgeodirectory.com/dummy'; |
|
| 493 | + $dummy_image_url = 'https://www.wpgeodirectory.com/dummy'; |
|
| 494 | 494 | |
| 495 | 495 | $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url); |
| 496 | 496 | |
| 497 | 497 | switch ($dummy_post_index) { |
| 498 | 498 | |
| 499 | - case(1): |
|
| 500 | - $image_array[] = "$dummy_image_url/ps/psf1.jpg"; |
|
| 501 | - $image_array[] = "$dummy_image_url/ps/psl1.jpg"; |
|
| 502 | - $image_array[] = "$dummy_image_url/ps/psb1.jpg"; |
|
| 503 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 504 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 499 | + case(1): |
|
| 500 | + $image_array[] = "$dummy_image_url/ps/psf1.jpg"; |
|
| 501 | + $image_array[] = "$dummy_image_url/ps/psl1.jpg"; |
|
| 502 | + $image_array[] = "$dummy_image_url/ps/psb1.jpg"; |
|
| 503 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 504 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 505 | 505 | |
| 506 | 506 | |
| 507 | - $post_info[] = array( |
|
| 508 | - "listing_type" => $post_type, |
|
| 509 | - "post_title" => 'Eastern Lodge', |
|
| 510 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa. |
|
| 507 | + $post_info[] = array( |
|
| 508 | + "listing_type" => $post_type, |
|
| 509 | + "post_title" => 'Eastern Lodge', |
|
| 510 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec non augue ultrices, vulputate nulla at, consectetur ante. Quisque neque mi, vulputate quis nulla a, sollicitudin fringilla leo. Nam dictum id neque eu imperdiet. Curabitur ligula turpis, malesuada at lobortis commodo, vulputate volutpat arcu. Duis bibendum blandit aliquam. In ipsum diam, tristique ut bibendum vel, lobortis non tellus. Nulla ultricies, ante vitae placerat auctor, nisi quam blandit enim, sit amet aliquam est diam id urna. Suspendisse eget nibh volutpat, malesuada enim sed, egestas massa. |
|
| 511 | 511 | |
| 512 | 512 | Aliquam ut odio ullamcorper, posuere enim sed, venenatis tortor. Donec justo elit, aliquam sed cursus sed, semper eget libero. Mauris consequat lorem sed fringilla tincidunt. Phasellus suscipit velit et elit tristique, ac commodo metus scelerisque. Vivamus finibus ipsum placerat pulvinar aliquet. Maecenas augue orci, blandit at nibh pharetra, condimentum congue ligula. Duis non ante sagittis odio convallis lacinia in quis sapien. |
| 513 | 513 | |
@@ -516,42 +516,42 @@ discard block |
||
| 516 | 516 | Vestibulum tristique quam eget bibendum pulvinar. Mauris sit amet magna ut arcu rutrum pellentesque feugiat et ipsum. Proin porta quam sed risus accumsan pharetra. Nulla quis semper nisl. Nulla facilisi. Nulla facilisi. Pellentesque euismod sollicitudin lacus vel ultricies. Vestibulum ut sem ut nulla ultricies convallis in at mi. Nunc vitae nibh arcu. Maecenas nunc enim, tempus a rhoncus eget, pellentesque ut erat. |
| 517 | 517 | |
| 518 | 518 | Suspendisse interdum accumsan magna et tempor. Suspendisse scelerisque at lorem sit amet faucibus. Aenean quis consectetur enim. Duis aliquet tristique tempus. Suspendisse id ullamcorper mauris. Aliquam in libero eu justo porttitor pulvinar. Nulla semper placerat lectus. Nulla mollis suscipit lacus, a blandit purus cursus non. Maecenas id tellus mi. Pellentesque sollicitudin nibh eget magna scelerisque consequat. Aliquam convallis orci arcu, et euismod dui cursus et. Donec nec pellentesque nulla, ac pretium massa. In gravida bibendum ornare.', |
| 519 | - "post_images" => $image_array, |
|
| 520 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 521 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 522 | - "geodir_video" => '', |
|
| 523 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 524 | - "geodir_contact" => '(111) 677-4444', |
|
| 525 | - "geodir_email" => '[email protected]', |
|
| 526 | - "geodir_website" => 'http://example.com/', |
|
| 527 | - "geodir_twitter" => 'http://example.com/', |
|
| 528 | - "geodir_facebook" => 'http://example.com/', |
|
| 529 | - "geodir_price" => '1750', |
|
| 530 | - "geodir_property_status" => 'For Rent', |
|
| 531 | - 'geodir_property_furnishing' => 'Furnished', |
|
| 532 | - 'geodir_property_type' => 'Detached house', |
|
| 533 | - 'geodir_property_bedrooms' => '3', |
|
| 534 | - 'geodir_property_bathrooms' => '2', |
|
| 535 | - 'geodir_property_area' => '1850', |
|
| 536 | - 'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace', |
|
| 537 | - "post_dummy" => '1' |
|
| 538 | - ); |
|
| 539 | - |
|
| 540 | - |
|
| 541 | - break; |
|
| 542 | - case 2: |
|
| 543 | - $image_array = array(); |
|
| 544 | - $post_meta = array(); |
|
| 545 | - $image_array[] = "$dummy_image_url/ps/psf2.jpg"; |
|
| 546 | - $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
| 547 | - $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 548 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 549 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 550 | - |
|
| 551 | - $post_info[] = array( |
|
| 552 | - "listing_type" => $post_type, |
|
| 553 | - "post_title" => 'Daisy Street', |
|
| 554 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 519 | + "post_images" => $image_array, |
|
| 520 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 521 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 522 | + "geodir_video" => '', |
|
| 523 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 524 | + "geodir_contact" => '(111) 677-4444', |
|
| 525 | + "geodir_email" => '[email protected]', |
|
| 526 | + "geodir_website" => 'http://example.com/', |
|
| 527 | + "geodir_twitter" => 'http://example.com/', |
|
| 528 | + "geodir_facebook" => 'http://example.com/', |
|
| 529 | + "geodir_price" => '1750', |
|
| 530 | + "geodir_property_status" => 'For Rent', |
|
| 531 | + 'geodir_property_furnishing' => 'Furnished', |
|
| 532 | + 'geodir_property_type' => 'Detached house', |
|
| 533 | + 'geodir_property_bedrooms' => '3', |
|
| 534 | + 'geodir_property_bathrooms' => '2', |
|
| 535 | + 'geodir_property_area' => '1850', |
|
| 536 | + 'geodir_property_features' => 'Gas Central Heating,Triple Glazing,Front Garden,Private driveway,Fireplace', |
|
| 537 | + "post_dummy" => '1' |
|
| 538 | + ); |
|
| 539 | + |
|
| 540 | + |
|
| 541 | + break; |
|
| 542 | + case 2: |
|
| 543 | + $image_array = array(); |
|
| 544 | + $post_meta = array(); |
|
| 545 | + $image_array[] = "$dummy_image_url/ps/psf2.jpg"; |
|
| 546 | + $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
| 547 | + $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 548 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 549 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 550 | + |
|
| 551 | + $post_info[] = array( |
|
| 552 | + "listing_type" => $post_type, |
|
| 553 | + "post_title" => 'Daisy Street', |
|
| 554 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 555 | 555 | |
| 556 | 556 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
| 557 | 557 | |
@@ -561,42 +561,42 @@ discard block |
||
| 561 | 561 | |
| 562 | 562 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
| 563 | 563 | |
| 564 | - "post_images" => $image_array, |
|
| 565 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 566 | - "post_tags" => array('Garage'), |
|
| 567 | - "geodir_video" => '', |
|
| 568 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 569 | - "geodir_contact" => '(222) 777-1111', |
|
| 570 | - "geodir_email" => '[email protected]', |
|
| 571 | - "geodir_website" => 'http://example.com/', |
|
| 572 | - "geodir_twitter" => 'http://example.com/', |
|
| 573 | - "geodir_facebook" => 'http://example.com/', |
|
| 574 | - "geodir_price" => '1150', |
|
| 575 | - "geodir_property_status" => 'Let', |
|
| 576 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 577 | - 'geodir_property_type' => 'Detached house', |
|
| 578 | - 'geodir_property_bedrooms' => '5', |
|
| 579 | - 'geodir_property_bathrooms' => '3', |
|
| 580 | - 'geodir_property_area' => '2650', |
|
| 581 | - 'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace', |
|
| 582 | - "post_dummy" => '1' |
|
| 583 | - ); |
|
| 584 | - |
|
| 585 | - break; |
|
| 586 | - |
|
| 587 | - case 3: |
|
| 588 | - $image_array = array(); |
|
| 589 | - $post_meta = array(); |
|
| 590 | - $image_array[] = "$dummy_image_url/ps/psf3.jpg"; |
|
| 591 | - $image_array[] = "$dummy_image_url/ps/psl3.jpg"; |
|
| 592 | - $image_array[] = "$dummy_image_url/ps/psb3.jpg"; |
|
| 593 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 594 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 595 | - |
|
| 596 | - $post_info[] = array( |
|
| 597 | - "listing_type" => $post_type, |
|
| 598 | - "post_title" => 'Northbay House', |
|
| 599 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 564 | + "post_images" => $image_array, |
|
| 565 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 566 | + "post_tags" => array('Garage'), |
|
| 567 | + "geodir_video" => '', |
|
| 568 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 569 | + "geodir_contact" => '(222) 777-1111', |
|
| 570 | + "geodir_email" => '[email protected]', |
|
| 571 | + "geodir_website" => 'http://example.com/', |
|
| 572 | + "geodir_twitter" => 'http://example.com/', |
|
| 573 | + "geodir_facebook" => 'http://example.com/', |
|
| 574 | + "geodir_price" => '1150', |
|
| 575 | + "geodir_property_status" => 'Let', |
|
| 576 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 577 | + 'geodir_property_type' => 'Detached house', |
|
| 578 | + 'geodir_property_bedrooms' => '5', |
|
| 579 | + 'geodir_property_bathrooms' => '3', |
|
| 580 | + 'geodir_property_area' => '2650', |
|
| 581 | + 'geodir_property_features' => 'Select Features/,Oil Central Heating,Front Garden,Garage,Private driveway,Fireplace', |
|
| 582 | + "post_dummy" => '1' |
|
| 583 | + ); |
|
| 584 | + |
|
| 585 | + break; |
|
| 586 | + |
|
| 587 | + case 3: |
|
| 588 | + $image_array = array(); |
|
| 589 | + $post_meta = array(); |
|
| 590 | + $image_array[] = "$dummy_image_url/ps/psf3.jpg"; |
|
| 591 | + $image_array[] = "$dummy_image_url/ps/psl3.jpg"; |
|
| 592 | + $image_array[] = "$dummy_image_url/ps/psb3.jpg"; |
|
| 593 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 594 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 595 | + |
|
| 596 | + $post_info[] = array( |
|
| 597 | + "listing_type" => $post_type, |
|
| 598 | + "post_title" => 'Northbay House', |
|
| 599 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 600 | 600 | |
| 601 | 601 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
| 602 | 602 | |
@@ -606,43 +606,43 @@ discard block |
||
| 606 | 606 | |
| 607 | 607 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
| 608 | 608 | |
| 609 | - "post_images" => $image_array, |
|
| 610 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 611 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 612 | - "geodir_video" => '', |
|
| 613 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 614 | - "geodir_contact" => '(222) 777-1111', |
|
| 615 | - "geodir_email" => '[email protected]', |
|
| 616 | - "geodir_website" => 'http://example.com/', |
|
| 617 | - "geodir_twitter" => 'http://example.com/', |
|
| 618 | - "geodir_facebook" => 'http://example.com/', |
|
| 619 | - "geodir_price" => '1300', |
|
| 620 | - "geodir_property_status" => 'Under Offer', |
|
| 621 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 622 | - 'geodir_property_type' => 'Detached house', |
|
| 623 | - 'geodir_property_bedrooms' => '6', |
|
| 624 | - 'geodir_property_bathrooms' => '6', |
|
| 625 | - 'geodir_property_area' => '1650', |
|
| 626 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace', |
|
| 627 | - "post_dummy" => '1' |
|
| 628 | - ); |
|
| 629 | - |
|
| 630 | - break; |
|
| 631 | - |
|
| 632 | - |
|
| 633 | - case 4: |
|
| 634 | - $image_array = array(); |
|
| 635 | - $post_meta = array(); |
|
| 636 | - $image_array[] = "$dummy_image_url/ps/psf4.jpg"; |
|
| 637 | - $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
| 638 | - $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
| 639 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 640 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 641 | - |
|
| 642 | - $post_info[] = array( |
|
| 643 | - "listing_type" => $post_type, |
|
| 644 | - "post_title" => 'Jesmond Mansion', |
|
| 645 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 609 | + "post_images" => $image_array, |
|
| 610 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 611 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 612 | + "geodir_video" => '', |
|
| 613 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 614 | + "geodir_contact" => '(222) 777-1111', |
|
| 615 | + "geodir_email" => '[email protected]', |
|
| 616 | + "geodir_website" => 'http://example.com/', |
|
| 617 | + "geodir_twitter" => 'http://example.com/', |
|
| 618 | + "geodir_facebook" => 'http://example.com/', |
|
| 619 | + "geodir_price" => '1300', |
|
| 620 | + "geodir_property_status" => 'Under Offer', |
|
| 621 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 622 | + 'geodir_property_type' => 'Detached house', |
|
| 623 | + 'geodir_property_bedrooms' => '6', |
|
| 624 | + 'geodir_property_bathrooms' => '6', |
|
| 625 | + 'geodir_property_area' => '1650', |
|
| 626 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Triple Glazing,Off Road Parking,Fireplace', |
|
| 627 | + "post_dummy" => '1' |
|
| 628 | + ); |
|
| 629 | + |
|
| 630 | + break; |
|
| 631 | + |
|
| 632 | + |
|
| 633 | + case 4: |
|
| 634 | + $image_array = array(); |
|
| 635 | + $post_meta = array(); |
|
| 636 | + $image_array[] = "$dummy_image_url/ps/psf4.jpg"; |
|
| 637 | + $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
| 638 | + $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
| 639 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 640 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 641 | + |
|
| 642 | + $post_info[] = array( |
|
| 643 | + "listing_type" => $post_type, |
|
| 644 | + "post_title" => 'Jesmond Mansion', |
|
| 645 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 646 | 646 | |
| 647 | 647 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
| 648 | 648 | |
@@ -652,42 +652,42 @@ discard block |
||
| 652 | 652 | |
| 653 | 653 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
| 654 | 654 | |
| 655 | - "post_images" => $image_array, |
|
| 656 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 657 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 658 | - "geodir_video" => '', |
|
| 659 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 660 | - "geodir_contact" => '(222) 777-1111', |
|
| 661 | - "geodir_email" => '[email protected]', |
|
| 662 | - "geodir_website" => 'http://example.com/', |
|
| 663 | - "geodir_twitter" => 'http://example.com/', |
|
| 664 | - "geodir_facebook" => 'http://example.com/', |
|
| 665 | - "geodir_price" => '13000', |
|
| 666 | - "geodir_property_status" => 'Under Offer', |
|
| 667 | - 'geodir_property_furnishing' => 'Partially furnished', |
|
| 668 | - 'geodir_property_type' => 'Detached house', |
|
| 669 | - 'geodir_property_bedrooms' => '10', |
|
| 670 | - 'geodir_property_bathrooms' => '7', |
|
| 671 | - 'geodir_property_area' => '6600', |
|
| 672 | - 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace', |
|
| 673 | - "post_dummy" => '1' |
|
| 674 | - ); |
|
| 675 | - |
|
| 676 | - break; |
|
| 677 | - |
|
| 678 | - case 5: |
|
| 679 | - $image_array = array(); |
|
| 680 | - $post_meta = array(); |
|
| 681 | - $image_array[] = "$dummy_image_url/ps/psf5.jpg"; |
|
| 682 | - $image_array[] = "$dummy_image_url/ps/psl5.jpg"; |
|
| 683 | - $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
| 684 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 685 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 686 | - |
|
| 687 | - $post_info[] = array( |
|
| 688 | - "listing_type" => $post_type, |
|
| 689 | - "post_title" => 'Springfield Lodge', |
|
| 690 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 655 | + "post_images" => $image_array, |
|
| 656 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 657 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 658 | + "geodir_video" => '', |
|
| 659 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 660 | + "geodir_contact" => '(222) 777-1111', |
|
| 661 | + "geodir_email" => '[email protected]', |
|
| 662 | + "geodir_website" => 'http://example.com/', |
|
| 663 | + "geodir_twitter" => 'http://example.com/', |
|
| 664 | + "geodir_facebook" => 'http://example.com/', |
|
| 665 | + "geodir_price" => '13000', |
|
| 666 | + "geodir_property_status" => 'Under Offer', |
|
| 667 | + 'geodir_property_furnishing' => 'Partially furnished', |
|
| 668 | + 'geodir_property_type' => 'Detached house', |
|
| 669 | + 'geodir_property_bedrooms' => '10', |
|
| 670 | + 'geodir_property_bathrooms' => '7', |
|
| 671 | + 'geodir_property_area' => '6600', |
|
| 672 | + 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden,Garage,Private driveway,Fireplace', |
|
| 673 | + "post_dummy" => '1' |
|
| 674 | + ); |
|
| 675 | + |
|
| 676 | + break; |
|
| 677 | + |
|
| 678 | + case 5: |
|
| 679 | + $image_array = array(); |
|
| 680 | + $post_meta = array(); |
|
| 681 | + $image_array[] = "$dummy_image_url/ps/psf5.jpg"; |
|
| 682 | + $image_array[] = "$dummy_image_url/ps/psl5.jpg"; |
|
| 683 | + $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
| 684 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 685 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 686 | + |
|
| 687 | + $post_info[] = array( |
|
| 688 | + "listing_type" => $post_type, |
|
| 689 | + "post_title" => 'Springfield Lodge', |
|
| 690 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 691 | 691 | |
| 692 | 692 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
| 693 | 693 | |
@@ -697,42 +697,42 @@ discard block |
||
| 697 | 697 | |
| 698 | 698 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
| 699 | 699 | |
| 700 | - "post_images" => $image_array, |
|
| 701 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 702 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 703 | - "geodir_video" => '', |
|
| 704 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 705 | - "geodir_contact" => '(222) 777-1111', |
|
| 706 | - "geodir_email" => '[email protected]', |
|
| 707 | - "geodir_website" => 'http://example.com/', |
|
| 708 | - "geodir_twitter" => 'http://example.com/', |
|
| 709 | - "geodir_facebook" => 'http://example.com/', |
|
| 710 | - "geodir_price" => '1800', |
|
| 711 | - "geodir_property_status" => 'For Rent', |
|
| 712 | - 'geodir_property_furnishing' => 'Optional', |
|
| 713 | - 'geodir_property_type' => 'Detached house', |
|
| 714 | - 'geodir_property_bedrooms' => '4', |
|
| 715 | - 'geodir_property_bathrooms' => '3', |
|
| 716 | - 'geodir_property_area' => '3700', |
|
| 717 | - 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden', |
|
| 718 | - "post_dummy" => '1' |
|
| 719 | - ); |
|
| 720 | - |
|
| 721 | - break; |
|
| 722 | - |
|
| 723 | - case 6: |
|
| 724 | - $image_array = array(); |
|
| 725 | - $post_meta = array(); |
|
| 726 | - $image_array[] = "$dummy_image_url/ps/psf6.jpg"; |
|
| 727 | - $image_array[] = "$dummy_image_url/ps/psl6.jpg"; |
|
| 728 | - $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
| 729 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 730 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 731 | - |
|
| 732 | - $post_info[] = array( |
|
| 733 | - "listing_type" => $post_type, |
|
| 734 | - "post_title" => 'Forrest Park', |
|
| 735 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 700 | + "post_images" => $image_array, |
|
| 701 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 702 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 703 | + "geodir_video" => '', |
|
| 704 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 705 | + "geodir_contact" => '(222) 777-1111', |
|
| 706 | + "geodir_email" => '[email protected]', |
|
| 707 | + "geodir_website" => 'http://example.com/', |
|
| 708 | + "geodir_twitter" => 'http://example.com/', |
|
| 709 | + "geodir_facebook" => 'http://example.com/', |
|
| 710 | + "geodir_price" => '1800', |
|
| 711 | + "geodir_property_status" => 'For Rent', |
|
| 712 | + 'geodir_property_furnishing' => 'Optional', |
|
| 713 | + 'geodir_property_type' => 'Detached house', |
|
| 714 | + 'geodir_property_bedrooms' => '4', |
|
| 715 | + 'geodir_property_bathrooms' => '3', |
|
| 716 | + 'geodir_property_area' => '3700', |
|
| 717 | + 'geodir_property_features' => 'Select Features/,Oil Central Heating,Double Glazing,Front Garden', |
|
| 718 | + "post_dummy" => '1' |
|
| 719 | + ); |
|
| 720 | + |
|
| 721 | + break; |
|
| 722 | + |
|
| 723 | + case 6: |
|
| 724 | + $image_array = array(); |
|
| 725 | + $post_meta = array(); |
|
| 726 | + $image_array[] = "$dummy_image_url/ps/psf6.jpg"; |
|
| 727 | + $image_array[] = "$dummy_image_url/ps/psl6.jpg"; |
|
| 728 | + $image_array[] = "$dummy_image_url/ps/psb5.jpg"; |
|
| 729 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 730 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 731 | + |
|
| 732 | + $post_info[] = array( |
|
| 733 | + "listing_type" => $post_type, |
|
| 734 | + "post_title" => 'Forrest Park', |
|
| 735 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 736 | 736 | |
| 737 | 737 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
| 738 | 738 | |
@@ -742,42 +742,42 @@ discard block |
||
| 742 | 742 | |
| 743 | 743 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
| 744 | 744 | |
| 745 | - "post_images" => $image_array, |
|
| 746 | - "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 747 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 748 | - "geodir_video" => '', |
|
| 749 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 750 | - "geodir_contact" => '(222) 777-1111', |
|
| 751 | - "geodir_email" => '[email protected]', |
|
| 752 | - "geodir_website" => 'http://example.com/', |
|
| 753 | - "geodir_twitter" => 'http://example.com/', |
|
| 754 | - "geodir_facebook" => 'http://example.com/', |
|
| 755 | - "geodir_price" => '2700', |
|
| 756 | - "geodir_property_status" => 'For Rent', |
|
| 757 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 758 | - 'geodir_property_type' => 'Detached house', |
|
| 759 | - 'geodir_property_bedrooms' => '5', |
|
| 760 | - 'geodir_property_bathrooms' => '4', |
|
| 761 | - 'geodir_property_area' => '2250', |
|
| 762 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway', |
|
| 763 | - "post_dummy" => '1' |
|
| 764 | - ); |
|
| 765 | - |
|
| 766 | - break; |
|
| 767 | - |
|
| 768 | - case 7: |
|
| 769 | - $image_array = array(); |
|
| 770 | - $post_meta = array(); |
|
| 771 | - $image_array[] = "$dummy_image_url/ps/psf7.jpg"; |
|
| 772 | - $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
| 773 | - $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
| 774 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 775 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 776 | - |
|
| 777 | - $post_info[] = array( |
|
| 778 | - "listing_type" => $post_type, |
|
| 779 | - "post_title" => 'Fraser Suites', |
|
| 780 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 745 | + "post_images" => $image_array, |
|
| 746 | + "post_category" => array($post_type.'category' => array($category_array[1])), |
|
| 747 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 748 | + "geodir_video" => '', |
|
| 749 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 750 | + "geodir_contact" => '(222) 777-1111', |
|
| 751 | + "geodir_email" => '[email protected]', |
|
| 752 | + "geodir_website" => 'http://example.com/', |
|
| 753 | + "geodir_twitter" => 'http://example.com/', |
|
| 754 | + "geodir_facebook" => 'http://example.com/', |
|
| 755 | + "geodir_price" => '2700', |
|
| 756 | + "geodir_property_status" => 'For Rent', |
|
| 757 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 758 | + 'geodir_property_type' => 'Detached house', |
|
| 759 | + 'geodir_property_bedrooms' => '5', |
|
| 760 | + 'geodir_property_bathrooms' => '4', |
|
| 761 | + 'geodir_property_area' => '2250', |
|
| 762 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Front Garden,Private driveway', |
|
| 763 | + "post_dummy" => '1' |
|
| 764 | + ); |
|
| 765 | + |
|
| 766 | + break; |
|
| 767 | + |
|
| 768 | + case 7: |
|
| 769 | + $image_array = array(); |
|
| 770 | + $post_meta = array(); |
|
| 771 | + $image_array[] = "$dummy_image_url/ps/psf7.jpg"; |
|
| 772 | + $image_array[] = "$dummy_image_url/ps/psl4.jpg"; |
|
| 773 | + $image_array[] = "$dummy_image_url/ps/psb4.jpg"; |
|
| 774 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 775 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 776 | + |
|
| 777 | + $post_info[] = array( |
|
| 778 | + "listing_type" => $post_type, |
|
| 779 | + "post_title" => 'Fraser Suites', |
|
| 780 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 781 | 781 | |
| 782 | 782 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
| 783 | 783 | |
@@ -787,42 +787,42 @@ discard block |
||
| 787 | 787 | |
| 788 | 788 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
| 789 | 789 | |
| 790 | - "post_images" => $image_array, |
|
| 791 | - "post_category" => array($post_type.'category' => array($category_array[0])), |
|
| 792 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 793 | - "geodir_video" => '', |
|
| 794 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 795 | - "geodir_contact" => '(222) 777-1111', |
|
| 796 | - "geodir_email" => '[email protected]', |
|
| 797 | - "geodir_website" => 'http://example.com/', |
|
| 798 | - "geodir_twitter" => 'http://example.com/', |
|
| 799 | - "geodir_facebook" => 'http://example.com/', |
|
| 800 | - "geodir_price" => '1450', |
|
| 801 | - "geodir_property_status" => 'For Rent', |
|
| 802 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 803 | - 'geodir_property_type' => 'Apartment', |
|
| 804 | - 'geodir_property_bedrooms' => '3', |
|
| 805 | - 'geodir_property_bathrooms' => '2', |
|
| 806 | - 'geodir_property_area' => '1250', |
|
| 807 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing', |
|
| 808 | - "post_dummy" => '1' |
|
| 809 | - ); |
|
| 810 | - |
|
| 811 | - break; |
|
| 812 | - |
|
| 813 | - case 8: |
|
| 814 | - $image_array = array(); |
|
| 815 | - $post_meta = array(); |
|
| 816 | - $image_array[] = "$dummy_image_url/ps/psf8.jpg"; |
|
| 817 | - $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
| 818 | - $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 819 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 820 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 821 | - |
|
| 822 | - $post_info[] = array( |
|
| 823 | - "listing_type" => $post_type, |
|
| 824 | - "post_title" => 'Richmore Apartments', |
|
| 825 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 790 | + "post_images" => $image_array, |
|
| 791 | + "post_category" => array($post_type.'category' => array($category_array[0])), |
|
| 792 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 793 | + "geodir_video" => '', |
|
| 794 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 795 | + "geodir_contact" => '(222) 777-1111', |
|
| 796 | + "geodir_email" => '[email protected]', |
|
| 797 | + "geodir_website" => 'http://example.com/', |
|
| 798 | + "geodir_twitter" => 'http://example.com/', |
|
| 799 | + "geodir_facebook" => 'http://example.com/', |
|
| 800 | + "geodir_price" => '1450', |
|
| 801 | + "geodir_property_status" => 'For Rent', |
|
| 802 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 803 | + 'geodir_property_type' => 'Apartment', |
|
| 804 | + 'geodir_property_bedrooms' => '3', |
|
| 805 | + 'geodir_property_bathrooms' => '2', |
|
| 806 | + 'geodir_property_area' => '1250', |
|
| 807 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing', |
|
| 808 | + "post_dummy" => '1' |
|
| 809 | + ); |
|
| 810 | + |
|
| 811 | + break; |
|
| 812 | + |
|
| 813 | + case 8: |
|
| 814 | + $image_array = array(); |
|
| 815 | + $post_meta = array(); |
|
| 816 | + $image_array[] = "$dummy_image_url/ps/psf8.jpg"; |
|
| 817 | + $image_array[] = "$dummy_image_url/ps/psl2.jpg"; |
|
| 818 | + $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 819 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 820 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 821 | + |
|
| 822 | + $post_info[] = array( |
|
| 823 | + "listing_type" => $post_type, |
|
| 824 | + "post_title" => 'Richmore Apartments', |
|
| 825 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 826 | 826 | |
| 827 | 827 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
| 828 | 828 | |
@@ -832,43 +832,43 @@ discard block |
||
| 832 | 832 | |
| 833 | 833 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
| 834 | 834 | |
| 835 | - "post_images" => $image_array, |
|
| 836 | - "post_category" => array($post_type.'category' => array($category_array[0])), |
|
| 837 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 838 | - "geodir_video" => '', |
|
| 839 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 840 | - "geodir_contact" => '(222) 777-1111', |
|
| 841 | - "geodir_email" => '[email protected]', |
|
| 842 | - "geodir_website" => 'http://example.com/', |
|
| 843 | - "geodir_twitter" => 'http://example.com/', |
|
| 844 | - "geodir_facebook" => 'http://example.com/', |
|
| 845 | - "geodir_price" => '2000', |
|
| 846 | - "geodir_property_status" => 'For Rent', |
|
| 847 | - 'geodir_property_furnishing' => 'Unfurnished', |
|
| 848 | - 'geodir_property_type' => 'Apartment', |
|
| 849 | - 'geodir_property_bedrooms' => '2', |
|
| 850 | - 'geodir_property_bathrooms' => '2', |
|
| 851 | - 'geodir_property_area' => '1750', |
|
| 852 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
| 853 | - "post_dummy" => '1' |
|
| 854 | - ); |
|
| 855 | - |
|
| 856 | - break; |
|
| 857 | - |
|
| 858 | - |
|
| 859 | - case 9: |
|
| 860 | - $image_array = array(); |
|
| 861 | - $post_meta = array(); |
|
| 862 | - $image_array[] = "$dummy_image_url/ps/psf9.jpg"; |
|
| 863 | - $image_array[] = "$dummy_image_url/ps/psc9.jpg"; |
|
| 864 | - $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 865 | - $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 866 | - $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 867 | - |
|
| 868 | - $post_info[] = array( |
|
| 869 | - "listing_type" => $post_type, |
|
| 870 | - "post_title" => 'Hotel Alpina', |
|
| 871 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 835 | + "post_images" => $image_array, |
|
| 836 | + "post_category" => array($post_type.'category' => array($category_array[0])), |
|
| 837 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 838 | + "geodir_video" => '', |
|
| 839 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 840 | + "geodir_contact" => '(222) 777-1111', |
|
| 841 | + "geodir_email" => '[email protected]', |
|
| 842 | + "geodir_website" => 'http://example.com/', |
|
| 843 | + "geodir_twitter" => 'http://example.com/', |
|
| 844 | + "geodir_facebook" => 'http://example.com/', |
|
| 845 | + "geodir_price" => '2000', |
|
| 846 | + "geodir_property_status" => 'For Rent', |
|
| 847 | + 'geodir_property_furnishing' => 'Unfurnished', |
|
| 848 | + 'geodir_property_type' => 'Apartment', |
|
| 849 | + 'geodir_property_bedrooms' => '2', |
|
| 850 | + 'geodir_property_bathrooms' => '2', |
|
| 851 | + 'geodir_property_area' => '1750', |
|
| 852 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
| 853 | + "post_dummy" => '1' |
|
| 854 | + ); |
|
| 855 | + |
|
| 856 | + break; |
|
| 857 | + |
|
| 858 | + |
|
| 859 | + case 9: |
|
| 860 | + $image_array = array(); |
|
| 861 | + $post_meta = array(); |
|
| 862 | + $image_array[] = "$dummy_image_url/ps/psf9.jpg"; |
|
| 863 | + $image_array[] = "$dummy_image_url/ps/psc9.jpg"; |
|
| 864 | + $image_array[] = "$dummy_image_url/ps/psb2.jpg"; |
|
| 865 | + $image_array[] = "$dummy_image_url/ps/psk.jpg"; |
|
| 866 | + $image_array[] = "$dummy_image_url/ps/psbr.jpg"; |
|
| 867 | + |
|
| 868 | + $post_info[] = array( |
|
| 869 | + "listing_type" => $post_type, |
|
| 870 | + "post_title" => 'Hotel Alpina', |
|
| 871 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 872 | 872 | |
| 873 | 873 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
| 874 | 874 | |
@@ -878,39 +878,39 @@ discard block |
||
| 878 | 878 | |
| 879 | 879 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
| 880 | 880 | |
| 881 | - "post_images" => $image_array, |
|
| 882 | - "post_category" => array($post_type.'category' => array($category_array[2])), |
|
| 883 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 884 | - "geodir_video" => '', |
|
| 885 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 886 | - "geodir_contact" => '(222) 777-1111', |
|
| 887 | - "geodir_email" => '[email protected]', |
|
| 888 | - "geodir_website" => 'http://example.com/', |
|
| 889 | - "geodir_twitter" => 'http://example.com/', |
|
| 890 | - "geodir_facebook" => 'http://example.com/', |
|
| 891 | - "geodir_price" => '60000', |
|
| 892 | - "geodir_property_status" => 'For Rent', |
|
| 893 | - 'geodir_property_furnishing' => 'Furnished', |
|
| 894 | - 'geodir_property_type' => 'Hotel', |
|
| 895 | - 'geodir_property_bedrooms' => '120', |
|
| 896 | - 'geodir_property_bathrooms' => '133', |
|
| 897 | - 'geodir_property_area' => '35000', |
|
| 898 | - 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
| 899 | - "post_dummy" => '1' |
|
| 900 | - ); |
|
| 901 | - |
|
| 902 | - break; |
|
| 903 | - |
|
| 904 | - case 10: |
|
| 905 | - $image_array = array(); |
|
| 906 | - $post_meta = array(); |
|
| 907 | - $image_array[] = "$dummy_image_url/ps/psf10.jpg"; |
|
| 908 | - $image_array[] = "$dummy_image_url/ps/psf102.jpg"; |
|
| 909 | - |
|
| 910 | - $post_info[] = array( |
|
| 911 | - "listing_type" => $post_type, |
|
| 912 | - "post_title" => 'Development Land', |
|
| 913 | - "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 881 | + "post_images" => $image_array, |
|
| 882 | + "post_category" => array($post_type.'category' => array($category_array[2])), |
|
| 883 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 884 | + "geodir_video" => '', |
|
| 885 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 886 | + "geodir_contact" => '(222) 777-1111', |
|
| 887 | + "geodir_email" => '[email protected]', |
|
| 888 | + "geodir_website" => 'http://example.com/', |
|
| 889 | + "geodir_twitter" => 'http://example.com/', |
|
| 890 | + "geodir_facebook" => 'http://example.com/', |
|
| 891 | + "geodir_price" => '60000', |
|
| 892 | + "geodir_property_status" => 'For Rent', |
|
| 893 | + 'geodir_property_furnishing' => 'Furnished', |
|
| 894 | + 'geodir_property_type' => 'Hotel', |
|
| 895 | + 'geodir_property_bedrooms' => '120', |
|
| 896 | + 'geodir_property_bathrooms' => '133', |
|
| 897 | + 'geodir_property_area' => '35000', |
|
| 898 | + 'geodir_property_features' => 'Select Features/,Gas Central Heating,Double Glazing,Garage', |
|
| 899 | + "post_dummy" => '1' |
|
| 900 | + ); |
|
| 901 | + |
|
| 902 | + break; |
|
| 903 | + |
|
| 904 | + case 10: |
|
| 905 | + $image_array = array(); |
|
| 906 | + $post_meta = array(); |
|
| 907 | + $image_array[] = "$dummy_image_url/ps/psf10.jpg"; |
|
| 908 | + $image_array[] = "$dummy_image_url/ps/psf102.jpg"; |
|
| 909 | + |
|
| 910 | + $post_info[] = array( |
|
| 911 | + "listing_type" => $post_type, |
|
| 912 | + "post_title" => 'Development Land', |
|
| 913 | + "post_desc" => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut fringilla ipsum congue enim elementum ornare. Vestibulum id ipsum ac massa malesuada rutrum. Curabitur id erat nec mauris hendrerit pretium. Aliquam pretium sollicitudin enim ac hendrerit. Phasellus et enim elit. Mauris ac maximus enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Ut ut cursus leo. Aenean lacinia risus ut ex sodales, a dictum eros vulputate. Sed ornare ex eget velit fringilla luctus. Etiam a purus massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam non felis ultrices, dignissim metus mattis, interdum urna. |
|
| 914 | 914 | |
| 915 | 915 | Vivamus at ipsum consectetur, pellentesque lectus vitae, vulputate leo. Cras tincidunt suscipit vulputate. Aenean pretium diam dui, efficitur porttitor lorem cursus in. Aenean convallis, mauris quis fermentum vehicula, purus libero fringilla lorem, placerat ultricies magna velit sit amet neque. Aenean tempor ut eros et volutpat. Proin ac lacus et odio volutpat aliquet. Proin at erat enim. Vivamus venenatis dictum magna, id dignissim lacus molestie non. Nullam ornare placerat metus, quis aliquam orci tincidunt at. Sed semper imperdiet arcu, eu convallis eros fringilla vel. |
| 916 | 916 | |
@@ -920,93 +920,93 @@ discard block |
||
| 920 | 920 | |
| 921 | 921 | Mauris ac elit vitae massa dignissim posuere. Sed blandit nibh ut elementum ullamcorper. Nunc facilisis elit eget lorem bibendum, eu fermentum neque ultrices. Etiam vestibulum gravida sollicitudin. Nullam velit quam, luctus vel suscipit id, ullamcorper sit amet ipsum. Donec a elit ac lorem porttitor gravida. Sed non dui sed lacus vulputate varius. Nullam in tincidunt odio, ac pharetra mauris. Integer ac volutpat quam. Mauris fermentum facilisis porttitor. Nunc ornare vel erat volutpat consectetur. Phasellus ut lacinia ante. Vestibulum massa orci, tincidunt sit amet urna in, maximus mollis ligula.', |
| 922 | 922 | |
| 923 | - "post_images" => $image_array, |
|
| 924 | - "post_category" => array($post_type.'category' => array($category_array[3])), |
|
| 925 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 926 | - "geodir_video" => '', |
|
| 927 | - "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 928 | - "geodir_contact" => '(222) 777-1111', |
|
| 929 | - "geodir_email" => '[email protected]', |
|
| 930 | - "geodir_website" => 'http://example.com/', |
|
| 931 | - "geodir_twitter" => 'http://example.com/', |
|
| 932 | - "geodir_facebook" => 'http://example.com/', |
|
| 933 | - "geodir_price" => '800', |
|
| 934 | - "geodir_property_status" => 'For Rent', |
|
| 935 | - 'geodir_property_furnishing' => '', |
|
| 936 | - 'geodir_property_type' => 'Land', |
|
| 937 | - 'geodir_property_bedrooms' => '', |
|
| 938 | - 'geodir_property_bathrooms' => '', |
|
| 939 | - 'geodir_property_area' => '250000', |
|
| 940 | - 'geodir_property_features' => '', |
|
| 941 | - "post_dummy" => '1' |
|
| 942 | - ); |
|
| 943 | - |
|
| 944 | - break; |
|
| 923 | + "post_images" => $image_array, |
|
| 924 | + "post_category" => array($post_type.'category' => array($category_array[3])), |
|
| 925 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 926 | + "geodir_video" => '', |
|
| 927 | + "geodir_timing" => 'Viewing Sunday 10 am to 9 pm', |
|
| 928 | + "geodir_contact" => '(222) 777-1111', |
|
| 929 | + "geodir_email" => '[email protected]', |
|
| 930 | + "geodir_website" => 'http://example.com/', |
|
| 931 | + "geodir_twitter" => 'http://example.com/', |
|
| 932 | + "geodir_facebook" => 'http://example.com/', |
|
| 933 | + "geodir_price" => '800', |
|
| 934 | + "geodir_property_status" => 'For Rent', |
|
| 935 | + 'geodir_property_furnishing' => '', |
|
| 936 | + 'geodir_property_type' => 'Land', |
|
| 937 | + 'geodir_property_bedrooms' => '', |
|
| 938 | + 'geodir_property_bathrooms' => '', |
|
| 939 | + 'geodir_property_area' => '250000', |
|
| 940 | + 'geodir_property_features' => '', |
|
| 941 | + "post_dummy" => '1' |
|
| 942 | + ); |
|
| 943 | + |
|
| 944 | + break; |
|
| 945 | 945 | |
| 946 | 946 | } // end of switch |
| 947 | 947 | |
| 948 | 948 | foreach ($post_info as $post_info) { |
| 949 | - $default_location = geodir_get_default_location(); |
|
| 950 | - if ($city_bound_lat1 > $city_bound_lat2) |
|
| 951 | - $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1)); |
|
| 952 | - else |
|
| 953 | - $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2)); |
|
| 949 | + $default_location = geodir_get_default_location(); |
|
| 950 | + if ($city_bound_lat1 > $city_bound_lat2) |
|
| 951 | + $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1)); |
|
| 952 | + else |
|
| 953 | + $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2)); |
|
| 954 | 954 | |
| 955 | 955 | |
| 956 | - if ($city_bound_lng1 > $city_bound_lng2) |
|
| 957 | - $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1)); |
|
| 958 | - else |
|
| 959 | - $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2)); |
|
| 956 | + if ($city_bound_lng1 > $city_bound_lng2) |
|
| 957 | + $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1)); |
|
| 958 | + else |
|
| 959 | + $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2)); |
|
| 960 | 960 | |
| 961 | - $load_map = get_option('geodir_load_map'); |
|
| 961 | + $load_map = get_option('geodir_load_map'); |
|
| 962 | 962 | |
| 963 | - if ($load_map == 'osm') { |
|
| 964 | - $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 965 | - } else { |
|
| 966 | - $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 967 | - } |
|
| 968 | - |
|
| 969 | - $postal_code = ''; |
|
| 970 | - if (!empty($post_address)) { |
|
| 971 | - if ($load_map == 'osm') { |
|
| 972 | - $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : ''; |
|
| 973 | - $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : ''; |
|
| 974 | - } else { |
|
| 975 | - $addresses = array(); |
|
| 976 | - $addresses_default = array(); |
|
| 963 | + if ($load_map == 'osm') { |
|
| 964 | + $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 965 | + } else { |
|
| 966 | + $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 967 | + } |
|
| 968 | + |
|
| 969 | + $postal_code = ''; |
|
| 970 | + if (!empty($post_address)) { |
|
| 971 | + if ($load_map == 'osm') { |
|
| 972 | + $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : ''; |
|
| 973 | + $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : ''; |
|
| 974 | + } else { |
|
| 975 | + $addresses = array(); |
|
| 976 | + $addresses_default = array(); |
|
| 977 | 977 | |
| 978 | - foreach ($post_address as $add_key => $add_value) { |
|
| 979 | - if ($add_key < 2 && !empty($add_value->long_name)) { |
|
| 980 | - $addresses_default[] = $add_value->long_name; |
|
| 981 | - } |
|
| 982 | - if ($add_value->types[0] == 'postal_code') { |
|
| 983 | - $postal_code = $add_value->long_name; |
|
| 984 | - } |
|
| 985 | - if ($add_value->types[0] == 'street_number') { |
|
| 986 | - $addresses[] = $add_value->long_name; |
|
| 987 | - } |
|
| 988 | - if ($add_value->types[0] == 'route') { |
|
| 989 | - $addresses[] = $add_value->long_name; |
|
| 990 | - } |
|
| 991 | - if ($add_value->types[0] == 'neighborhood') { |
|
| 992 | - $addresses[] = $add_value->long_name; |
|
| 993 | - } |
|
| 994 | - if ($add_value->types[0] == 'sublocality') { |
|
| 995 | - $addresses[] = $add_value->long_name; |
|
| 996 | - } |
|
| 997 | - } |
|
| 998 | - $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : ''); |
|
| 999 | - } |
|
| 1000 | - |
|
| 1001 | - $post_info['post_address'] = !empty($address) ? $address : $default_location->city; |
|
| 1002 | - $post_info['post_city'] = $default_location->city; |
|
| 1003 | - $post_info['post_region'] = $default_location->region; |
|
| 1004 | - $post_info['post_country'] = $default_location->country; |
|
| 1005 | - $post_info['post_zip'] = $postal_code; |
|
| 1006 | - $post_info['post_latitude'] = $dummy_post_latitude; |
|
| 1007 | - $post_info['post_longitude'] = $dummy_post_longitude; |
|
| 1008 | - } |
|
| 978 | + foreach ($post_address as $add_key => $add_value) { |
|
| 979 | + if ($add_key < 2 && !empty($add_value->long_name)) { |
|
| 980 | + $addresses_default[] = $add_value->long_name; |
|
| 981 | + } |
|
| 982 | + if ($add_value->types[0] == 'postal_code') { |
|
| 983 | + $postal_code = $add_value->long_name; |
|
| 984 | + } |
|
| 985 | + if ($add_value->types[0] == 'street_number') { |
|
| 986 | + $addresses[] = $add_value->long_name; |
|
| 987 | + } |
|
| 988 | + if ($add_value->types[0] == 'route') { |
|
| 989 | + $addresses[] = $add_value->long_name; |
|
| 990 | + } |
|
| 991 | + if ($add_value->types[0] == 'neighborhood') { |
|
| 992 | + $addresses[] = $add_value->long_name; |
|
| 993 | + } |
|
| 994 | + if ($add_value->types[0] == 'sublocality') { |
|
| 995 | + $addresses[] = $add_value->long_name; |
|
| 996 | + } |
|
| 997 | + } |
|
| 998 | + $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : ''); |
|
| 999 | + } |
|
| 1000 | + |
|
| 1001 | + $post_info['post_address'] = !empty($address) ? $address : $default_location->city; |
|
| 1002 | + $post_info['post_city'] = $default_location->city; |
|
| 1003 | + $post_info['post_region'] = $default_location->region; |
|
| 1004 | + $post_info['post_country'] = $default_location->country; |
|
| 1005 | + $post_info['post_zip'] = $postal_code; |
|
| 1006 | + $post_info['post_latitude'] = $dummy_post_latitude; |
|
| 1007 | + $post_info['post_longitude'] = $dummy_post_longitude; |
|
| 1008 | + } |
|
| 1009 | 1009 | |
| 1010 | - geodir_save_listing($post_info, true); |
|
| 1011 | - echo 1; |
|
| 1010 | + geodir_save_listing($post_info, true); |
|
| 1011 | + echo 1; |
|
| 1012 | 1012 | } |
@@ -12,38 +12,38 @@ discard block |
||
| 12 | 12 | $post_meta = array(); |
| 13 | 13 | |
| 14 | 14 | if($dummy_post_index==1){ |
| 15 | - $category_array = array('Attractions', 'Hotels', 'Restaurants', 'Food Nightlife', 'Festival', 'Videos', 'Feature'); |
|
| 16 | - geodir_dummy_data_taxonomies($post_type,$category_array ); |
|
| 17 | - update_option($post_type.'_dummy_data_type','standard_places'); |
|
| 15 | + $category_array = array('Attractions', 'Hotels', 'Restaurants', 'Food Nightlife', 'Festival', 'Videos', 'Feature'); |
|
| 16 | + geodir_dummy_data_taxonomies($post_type,$category_array ); |
|
| 17 | + update_option($post_type.'_dummy_data_type','standard_places'); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | if (geodir_dummy_folder_exists()) |
| 21 | - $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
|
| 21 | + $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy"; |
|
| 22 | 22 | else |
| 23 | - $dummy_image_url = 'https://www.wpgeodirectory.com/dummy'; |
|
| 23 | + $dummy_image_url = 'https://www.wpgeodirectory.com/dummy'; |
|
| 24 | 24 | |
| 25 | 25 | $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url); |
| 26 | 26 | |
| 27 | 27 | switch ($dummy_post_index) { |
| 28 | 28 | |
| 29 | - case(1): |
|
| 30 | - $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 31 | - $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 32 | - $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 33 | - $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 34 | - $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 35 | - $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 36 | - $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 37 | - $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 38 | - $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 39 | - $image_array[] = "$dummy_image_url/a10.jpg"; |
|
| 40 | - $image_array[] = "$dummy_image_url/a11.jpg"; |
|
| 41 | - |
|
| 42 | - |
|
| 43 | - $post_info[] = array( |
|
| 44 | - "listing_type" => $post_type, |
|
| 45 | - "post_title" => 'Franklin Square', |
|
| 46 | - "post_desc" => ' <h3> Location </h3> |
|
| 29 | + case(1): |
|
| 30 | + $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 31 | + $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 32 | + $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 33 | + $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 34 | + $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 35 | + $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 36 | + $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 37 | + $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 38 | + $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 39 | + $image_array[] = "$dummy_image_url/a10.jpg"; |
|
| 40 | + $image_array[] = "$dummy_image_url/a11.jpg"; |
|
| 41 | + |
|
| 42 | + |
|
| 43 | + $post_info[] = array( |
|
| 44 | + "listing_type" => $post_type, |
|
| 45 | + "post_title" => 'Franklin Square', |
|
| 46 | + "post_desc" => ' <h3> Location </h3> |
|
| 47 | 47 | |
| 48 | 48 | 6th and Race Streets in Historic Philadelphia |
| 49 | 49 | <h3>The Experience</h3> |
@@ -78,42 +78,42 @@ discard block |
||
| 78 | 78 | Just in time for summer, Franklin Square has opened SquareBurger, a Stephen Starr-run “burger shack” selling summer staples: hot dogs, fries, milkshakes (made with Tasty Kakes) and, of course, hamburgers and cheeseburgers. |
| 79 | 79 | |
| 80 | 80 | SquareBurger is open until October - perfect for a couple bites between rounds of miniature golf!', |
| 81 | - "post_images" => $image_array, |
|
| 82 | - "post_category" => array($post_type.'category' => array('Attractions', 'Feature')), |
|
| 83 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 84 | - "geodir_video" => '', |
|
| 85 | - "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm', |
|
| 86 | - "geodir_contact" => '(111) 677-4444', |
|
| 87 | - "geodir_email" => '[email protected]', |
|
| 88 | - "geodir_website" => 'http://franklinsquare.com', |
|
| 89 | - "geodir_twitter" => 'http://twitter.com/franklinsquare', |
|
| 90 | - "geodir_facebook" => 'http://facebook.com/franklinsquare', |
|
| 91 | - "post_dummy" => '1' |
|
| 92 | - ); |
|
| 93 | - |
|
| 94 | - |
|
| 95 | - break; |
|
| 96 | - case 2: |
|
| 97 | - $image_array = array(); |
|
| 98 | - $post_meta = array(); |
|
| 99 | - |
|
| 100 | - /// Attractions ////post start 2/// |
|
| 101 | - $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 102 | - $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 103 | - $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 104 | - $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 105 | - $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 106 | - $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 107 | - $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 108 | - $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 109 | - $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 110 | - $image_array[] = "$dummy_image_url/a10.jpg"; |
|
| 111 | - $image_array[] = "$dummy_image_url/a11.jpg"; |
|
| 112 | - |
|
| 113 | - $post_info[] = array( |
|
| 114 | - "listing_type" => $post_type, |
|
| 115 | - "post_title" => 'Please Touch Museum', |
|
| 116 | - "post_desc" => '<h3>New Location! </h3> |
|
| 81 | + "post_images" => $image_array, |
|
| 82 | + "post_category" => array($post_type.'category' => array('Attractions', 'Feature')), |
|
| 83 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 84 | + "geodir_video" => '', |
|
| 85 | + "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm', |
|
| 86 | + "geodir_contact" => '(111) 677-4444', |
|
| 87 | + "geodir_email" => '[email protected]', |
|
| 88 | + "geodir_website" => 'http://franklinsquare.com', |
|
| 89 | + "geodir_twitter" => 'http://twitter.com/franklinsquare', |
|
| 90 | + "geodir_facebook" => 'http://facebook.com/franklinsquare', |
|
| 91 | + "post_dummy" => '1' |
|
| 92 | + ); |
|
| 93 | + |
|
| 94 | + |
|
| 95 | + break; |
|
| 96 | + case 2: |
|
| 97 | + $image_array = array(); |
|
| 98 | + $post_meta = array(); |
|
| 99 | + |
|
| 100 | + /// Attractions ////post start 2/// |
|
| 101 | + $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 102 | + $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 103 | + $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 104 | + $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 105 | + $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 106 | + $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 107 | + $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 108 | + $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 109 | + $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 110 | + $image_array[] = "$dummy_image_url/a10.jpg"; |
|
| 111 | + $image_array[] = "$dummy_image_url/a11.jpg"; |
|
| 112 | + |
|
| 113 | + $post_info[] = array( |
|
| 114 | + "listing_type" => $post_type, |
|
| 115 | + "post_title" => 'Please Touch Museum', |
|
| 116 | + "post_desc" => '<h3>New Location! </h3> |
|
| 117 | 117 | |
| 118 | 118 | Who doesn´t love the Please Touch Museum? And now, taking kids to the Museum is better than ever. The nation´s premier children´s museum - which has been a beloved landmark since it opened in 1976 - has a new home in Fairmount Park, opening its doors to a world of educational, hands-on fun. |
| 119 | 119 | |
@@ -145,42 +145,42 @@ discard block |
||
| 145 | 145 | |
| 146 | 146 | You can buy admission tickets to the Please Touch Museum online through our partners at the Independence Visitor Center. Just click the button below.', |
| 147 | 147 | |
| 148 | - "post_images" => $image_array, |
|
| 149 | - "post_category" => array($post_type.'category' => array('Attractions', 'Feature')), |
|
| 150 | - "post_tags" => array('Tags', 'Sample Tags'), |
|
| 151 | - "geodir_video" => '', |
|
| 152 | - "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm', |
|
| 153 | - "geodir_contact" => '(222) 777-1111', |
|
| 154 | - "geodir_email" => '[email protected]', |
|
| 155 | - "geodir_website" => 'http://pleasetouchmuseum.com', |
|
| 156 | - "geodir_twitter" => 'http://twitter.com/pleasetouchmuseum', |
|
| 157 | - "geodir_facebook" => 'http://facebook.com/pleasetouchmuseum', |
|
| 158 | - "post_dummy" => '1' |
|
| 159 | - ); |
|
| 160 | - |
|
| 161 | - break; |
|
| 162 | - case 3: |
|
| 163 | - $image_array = array(); |
|
| 164 | - $post_meta = array(); |
|
| 165 | - |
|
| 166 | - ////post end/// |
|
| 167 | - /// Attractions ////post start 3/// |
|
| 168 | - $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 169 | - $image_array[] = "$dummy_image_url/a10.jpg"; |
|
| 170 | - $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 171 | - $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 172 | - $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 173 | - $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 174 | - $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 175 | - $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 176 | - $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 177 | - $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 178 | - $image_array[] = "$dummy_image_url/a11.jpg"; |
|
| 179 | - |
|
| 180 | - $post_info[] = array( |
|
| 181 | - "listing_type" => $post_type, |
|
| 182 | - "post_title" => 'Longwood Gardens', |
|
| 183 | - "post_desc" => '<h3>The Experience </h3> |
|
| 148 | + "post_images" => $image_array, |
|
| 149 | + "post_category" => array($post_type.'category' => array('Attractions', 'Feature')), |
|
| 150 | + "post_tags" => array('Tags', 'Sample Tags'), |
|
| 151 | + "geodir_video" => '', |
|
| 152 | + "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm', |
|
| 153 | + "geodir_contact" => '(222) 777-1111', |
|
| 154 | + "geodir_email" => '[email protected]', |
|
| 155 | + "geodir_website" => 'http://pleasetouchmuseum.com', |
|
| 156 | + "geodir_twitter" => 'http://twitter.com/pleasetouchmuseum', |
|
| 157 | + "geodir_facebook" => 'http://facebook.com/pleasetouchmuseum', |
|
| 158 | + "post_dummy" => '1' |
|
| 159 | + ); |
|
| 160 | + |
|
| 161 | + break; |
|
| 162 | + case 3: |
|
| 163 | + $image_array = array(); |
|
| 164 | + $post_meta = array(); |
|
| 165 | + |
|
| 166 | + ////post end/// |
|
| 167 | + /// Attractions ////post start 3/// |
|
| 168 | + $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 169 | + $image_array[] = "$dummy_image_url/a10.jpg"; |
|
| 170 | + $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 171 | + $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 172 | + $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 173 | + $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 174 | + $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 175 | + $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 176 | + $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 177 | + $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 178 | + $image_array[] = "$dummy_image_url/a11.jpg"; |
|
| 179 | + |
|
| 180 | + $post_info[] = array( |
|
| 181 | + "listing_type" => $post_type, |
|
| 182 | + "post_title" => 'Longwood Gardens', |
|
| 183 | + "post_desc" => '<h3>The Experience </h3> |
|
| 184 | 184 | |
| 185 | 185 | When you´re at Longwood Gardens, it´s easy to imagine that you´re at a giant, royal garden in Europe. Stroll along the many paths through acres of exquisitely maintained grounds featuring 11,000 different types of plants. |
| 186 | 186 | |
@@ -205,42 +205,42 @@ discard block |
||
| 205 | 205 | <h3>Buy Tickets Online In Advance </h3> |
| 206 | 206 | |
| 207 | 207 | You can buy admission tickets to Longwood Gardens online through our partners at the Independence Visitor Center. Just click the button below.', |
| 208 | - "post_images" => $image_array, |
|
| 209 | - "post_category" => array($post_type.'category' => array('Attractions')), |
|
| 210 | - "post_tags" => array('wood', 'garden'), |
|
| 211 | - "geodir_video" => '', |
|
| 212 | - "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm', |
|
| 213 | - "geodir_contact" => '(111) 888-1111', |
|
| 214 | - "geodir_email" => '[email protected]', |
|
| 215 | - "geodir_website" => 'http://longwoodgardens.com', |
|
| 216 | - "geodir_twitter" => 'http://twitter.com/longwoodgardens', |
|
| 217 | - "geodir_facebook" => 'http://facebook.com/longwoodgardens', |
|
| 218 | - "post_dummy" => '1' |
|
| 219 | - ); |
|
| 220 | - break; |
|
| 221 | - ////post end/// |
|
| 222 | - /// Attractions ////post start 4/// |
|
| 223 | - |
|
| 224 | - case 4: |
|
| 225 | - |
|
| 226 | - $image_array = array(); |
|
| 227 | - $post_meta = array(); |
|
| 228 | - $image_array[] = "$dummy_image_url/a11.jpg"; |
|
| 229 | - $image_array[] = "$dummy_image_url/a10.jpg"; |
|
| 230 | - $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 231 | - $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 232 | - $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 233 | - $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 234 | - $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 235 | - $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 236 | - $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 237 | - $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 238 | - $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 239 | - |
|
| 240 | - $post_info[] = array( |
|
| 241 | - "listing_type" => $post_type, |
|
| 242 | - "post_title" => 'The Philadelphia Zoo', |
|
| 243 | - "post_desc" => '<h3>The Zoo 150th Birthday</h3> |
|
| 208 | + "post_images" => $image_array, |
|
| 209 | + "post_category" => array($post_type.'category' => array('Attractions')), |
|
| 210 | + "post_tags" => array('wood', 'garden'), |
|
| 211 | + "geodir_video" => '', |
|
| 212 | + "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm', |
|
| 213 | + "geodir_contact" => '(111) 888-1111', |
|
| 214 | + "geodir_email" => '[email protected]', |
|
| 215 | + "geodir_website" => 'http://longwoodgardens.com', |
|
| 216 | + "geodir_twitter" => 'http://twitter.com/longwoodgardens', |
|
| 217 | + "geodir_facebook" => 'http://facebook.com/longwoodgardens', |
|
| 218 | + "post_dummy" => '1' |
|
| 219 | + ); |
|
| 220 | + break; |
|
| 221 | + ////post end/// |
|
| 222 | + /// Attractions ////post start 4/// |
|
| 223 | + |
|
| 224 | + case 4: |
|
| 225 | + |
|
| 226 | + $image_array = array(); |
|
| 227 | + $post_meta = array(); |
|
| 228 | + $image_array[] = "$dummy_image_url/a11.jpg"; |
|
| 229 | + $image_array[] = "$dummy_image_url/a10.jpg"; |
|
| 230 | + $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 231 | + $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 232 | + $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 233 | + $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 234 | + $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 235 | + $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 236 | + $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 237 | + $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 238 | + $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 239 | + |
|
| 240 | + $post_info[] = array( |
|
| 241 | + "listing_type" => $post_type, |
|
| 242 | + "post_title" => 'The Philadelphia Zoo', |
|
| 243 | + "post_desc" => '<h3>The Zoo 150th Birthday</h3> |
|
| 244 | 244 | |
| 245 | 245 | The Philadelphia Zoo celebrated its 150th anniversary in 2009. So stop by and celebrate this major achievement at America´s first zoo! |
| 246 | 246 | |
@@ -275,45 +275,45 @@ discard block |
||
| 275 | 275 | The nation´s oldest zoo was chartered in 1859, but the impending Civil War delayed its opening until 1874. In addition to its animals, the zoo is known for its historic architecture, which includes the country home of William Penn´s grandson; its botanical collections of over 500 plant species; its groundbreaking research and its fine veterinary facilities. |
| 276 | 276 | |
| 277 | 277 | The Primate Reserve, Carnivore Kingdom, and Rare Animal Conservation Center, with its tree kangaroos and blue-eyed lemurs, are brand new, but there´s still fun to be had in the historic, old-style bird, pachyderm and carnivore houses. In the Treehouse, kids can investigate the world from an animal´s perspective; outdoors, the Zoo Balloon lifts passengers 400 feet into the air for a bird´s-eye view of the zoo.', |
| 278 | - "post_images" => $image_array, |
|
| 279 | - "post_category" => array($post_type.'category' => array('Attractions')), |
|
| 280 | - "post_tags" => array('wood', 'garden'), |
|
| 281 | - "geodir_video" => '', |
|
| 282 | - "geodir_timing" => 'Open today until 11.30 a.m., Sunday 11 am to 7 pm', |
|
| 283 | - "geodir_contact" => '(211) 143-1900', |
|
| 284 | - "geodir_email" => '[email protected]', |
|
| 285 | - "geodir_website" => 'http://philadelphiazoo.com', |
|
| 286 | - "geodir_twitter" => 'http://twitter.com/philadelphiazoo', |
|
| 287 | - "geodir_facebook" => 'http://facebook.com/philadelphiazoo', |
|
| 288 | - "post_dummy" => '1' |
|
| 289 | - ); |
|
| 290 | - |
|
| 291 | - ////post end/// |
|
| 292 | - /// Attractions ////post start 4/// |
|
| 293 | - break; |
|
| 294 | - case 5: |
|
| 295 | - |
|
| 296 | - |
|
| 297 | - $image_array = array(); |
|
| 298 | - $post_meta = array(); |
|
| 299 | - |
|
| 300 | - /// Attractions ////post start 5/// |
|
| 301 | - $image_array[] = "$dummy_image_url/a12.jpg"; |
|
| 302 | - $image_array[] = "$dummy_image_url/a13.jpg"; |
|
| 303 | - $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 304 | - $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 305 | - $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 306 | - $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 307 | - $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 308 | - $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 309 | - $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 310 | - $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 311 | - $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 312 | - |
|
| 313 | - $post_info[] = array( |
|
| 314 | - "listing_type" => $post_type, |
|
| 315 | - "post_title" => 'National Constitution Center', |
|
| 316 | - "post_desc" => '<h3>The Experience</h3> |
|
| 278 | + "post_images" => $image_array, |
|
| 279 | + "post_category" => array($post_type.'category' => array('Attractions')), |
|
| 280 | + "post_tags" => array('wood', 'garden'), |
|
| 281 | + "geodir_video" => '', |
|
| 282 | + "geodir_timing" => 'Open today until 11.30 a.m., Sunday 11 am to 7 pm', |
|
| 283 | + "geodir_contact" => '(211) 143-1900', |
|
| 284 | + "geodir_email" => '[email protected]', |
|
| 285 | + "geodir_website" => 'http://philadelphiazoo.com', |
|
| 286 | + "geodir_twitter" => 'http://twitter.com/philadelphiazoo', |
|
| 287 | + "geodir_facebook" => 'http://facebook.com/philadelphiazoo', |
|
| 288 | + "post_dummy" => '1' |
|
| 289 | + ); |
|
| 290 | + |
|
| 291 | + ////post end/// |
|
| 292 | + /// Attractions ////post start 4/// |
|
| 293 | + break; |
|
| 294 | + case 5: |
|
| 295 | + |
|
| 296 | + |
|
| 297 | + $image_array = array(); |
|
| 298 | + $post_meta = array(); |
|
| 299 | + |
|
| 300 | + /// Attractions ////post start 5/// |
|
| 301 | + $image_array[] = "$dummy_image_url/a12.jpg"; |
|
| 302 | + $image_array[] = "$dummy_image_url/a13.jpg"; |
|
| 303 | + $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 304 | + $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 305 | + $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 306 | + $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 307 | + $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 308 | + $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 309 | + $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 310 | + $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 311 | + $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 312 | + |
|
| 313 | + $post_info[] = array( |
|
| 314 | + "listing_type" => $post_type, |
|
| 315 | + "post_title" => 'National Constitution Center', |
|
| 316 | + "post_desc" => '<h3>The Experience</h3> |
|
| 317 | 317 | |
| 318 | 318 | It only four pages long, but the U.S. Constitution is among the most influential and important documents in the history of the world. |
| 319 | 319 | |
@@ -335,45 +335,45 @@ discard block |
||
| 335 | 335 | <h3>Kids Stuff </h3> |
| 336 | 336 | |
| 337 | 337 | The Center frequently hosts special events with a focus on children that include informative and engaging hands-on activities. For specific information, check out the Center website.', |
| 338 | - "post_images" => $image_array, |
|
| 339 | - "post_category" => array($post_type.'category' => array('Attractions', 'Feature')), |
|
| 340 | - "post_tags" => array('Tag', 'Center'), |
|
| 341 | - "geodir_video" => '', |
|
| 342 | - "geodir_timing" => 'Open today until 9.30 a.m., Sunday 11 am to 7 pm', |
|
| 343 | - "geodir_contact" => '(111) 111-1111', |
|
| 344 | - "geodir_email" => '[email protected]', |
|
| 345 | - "geodir_website" => 'http://ncc.com', |
|
| 346 | - "geodir_twitter" => 'http://twitter.com/ncc', |
|
| 347 | - "geodir_facebook" => 'http://facebook.com/ncc', |
|
| 348 | - "post_dummy" => '1' |
|
| 349 | - ); |
|
| 350 | - |
|
| 351 | - ////post end/// |
|
| 352 | - /// Attractions ////post start 5/// |
|
| 353 | - break; |
|
| 354 | - case 6: |
|
| 355 | - |
|
| 356 | - |
|
| 357 | - $image_array = array(); |
|
| 358 | - $post_meta = array(); |
|
| 359 | - |
|
| 360 | - /// Attractions ////post start 6/// |
|
| 361 | - $image_array[] = "$dummy_image_url/a14.jpg"; |
|
| 362 | - $image_array[] = "$dummy_image_url/a13.jpg"; |
|
| 363 | - $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 364 | - $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 365 | - $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 366 | - $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 367 | - $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 368 | - $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 369 | - $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 370 | - $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 371 | - $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 372 | - |
|
| 373 | - $post_info[] = array( |
|
| 374 | - "listing_type" => $post_type, |
|
| 375 | - "post_title" => 'Sadsbury Woods Preserve', |
|
| 376 | - "post_desc" => 'A more than 500-acre nature preserve ideal for walking and hiking, Sadsbury Woods is also an important habitat for interior nesting birds and small mammals. An increasingly rare area of interior woodlands, defined as an area at least 300 feet from any road, lawn or meadow, provides a critical habitat for many species of birds, especially neo-tropical migrant songbirds. |
|
| 338 | + "post_images" => $image_array, |
|
| 339 | + "post_category" => array($post_type.'category' => array('Attractions', 'Feature')), |
|
| 340 | + "post_tags" => array('Tag', 'Center'), |
|
| 341 | + "geodir_video" => '', |
|
| 342 | + "geodir_timing" => 'Open today until 9.30 a.m., Sunday 11 am to 7 pm', |
|
| 343 | + "geodir_contact" => '(111) 111-1111', |
|
| 344 | + "geodir_email" => '[email protected]', |
|
| 345 | + "geodir_website" => 'http://ncc.com', |
|
| 346 | + "geodir_twitter" => 'http://twitter.com/ncc', |
|
| 347 | + "geodir_facebook" => 'http://facebook.com/ncc', |
|
| 348 | + "post_dummy" => '1' |
|
| 349 | + ); |
|
| 350 | + |
|
| 351 | + ////post end/// |
|
| 352 | + /// Attractions ////post start 5/// |
|
| 353 | + break; |
|
| 354 | + case 6: |
|
| 355 | + |
|
| 356 | + |
|
| 357 | + $image_array = array(); |
|
| 358 | + $post_meta = array(); |
|
| 359 | + |
|
| 360 | + /// Attractions ////post start 6/// |
|
| 361 | + $image_array[] = "$dummy_image_url/a14.jpg"; |
|
| 362 | + $image_array[] = "$dummy_image_url/a13.jpg"; |
|
| 363 | + $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 364 | + $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 365 | + $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 366 | + $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 367 | + $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 368 | + $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 369 | + $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 370 | + $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 371 | + $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 372 | + |
|
| 373 | + $post_info[] = array( |
|
| 374 | + "listing_type" => $post_type, |
|
| 375 | + "post_title" => 'Sadsbury Woods Preserve', |
|
| 376 | + "post_desc" => 'A more than 500-acre nature preserve ideal for walking and hiking, Sadsbury Woods is also an important habitat for interior nesting birds and small mammals. An increasingly rare area of interior woodlands, defined as an area at least 300 feet from any road, lawn or meadow, provides a critical habitat for many species of birds, especially neo-tropical migrant songbirds. |
|
| 377 | 377 | |
| 378 | 378 | Situated on the western edge of Chester County, the land remains much as it did centuries ago, and now serves as a permanent refuge in an area facing dramatically increasing development pressure. |
| 379 | 379 | |
@@ -389,45 +389,45 @@ discard block |
||
| 389 | 389 | Outsider Tip |
| 390 | 390 | |
| 391 | 391 | The deep forest is a great place for spotting neo-tropical songbirds in the spring and summer months', |
| 392 | - "post_images" => $image_array, |
|
| 393 | - "post_category" => array($post_type.'category' => array('Attractions')), |
|
| 394 | - "post_tags" => array('sample', 'tags'), |
|
| 395 | - "geodir_video" => '', |
|
| 396 | - "geodir_timing" => 'Open today until 12.30 p.m., Sunday 12 pm to 7 pm', |
|
| 397 | - "geodir_contact" => '(222) 999-9999', |
|
| 398 | - "geodir_email" => '[email protected]', |
|
| 399 | - "geodir_website" => 'http://swp.com', |
|
| 400 | - "geodir_twitter" => 'http://twitter.com/swp', |
|
| 401 | - "geodir_facebook" => 'http://facebook.com/swp', |
|
| 402 | - "post_dummy" => '1' |
|
| 403 | - ); |
|
| 404 | - |
|
| 405 | - ////post end/// |
|
| 406 | - /// Attractions ////post start 6/// |
|
| 407 | - |
|
| 408 | - break; |
|
| 409 | - case 7: |
|
| 410 | - |
|
| 411 | - $image_array = array(); |
|
| 412 | - $post_meta = array(); |
|
| 413 | - |
|
| 414 | - /// Attractions ////post start 7/// |
|
| 415 | - $image_array[] = "$dummy_image_url/a15.jpg"; |
|
| 416 | - $image_array[] = "$dummy_image_url/a16.jpg"; |
|
| 417 | - $image_array[] = "$dummy_image_url/a17.jpg"; |
|
| 418 | - $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 419 | - $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 420 | - $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 421 | - $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 422 | - $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 423 | - $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 424 | - $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 425 | - $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 426 | - |
|
| 427 | - $post_info[] = array( |
|
| 428 | - "listing_type" => $post_type, |
|
| 429 | - "post_title" => 'Museum Without Walls', |
|
| 430 | - "post_desc" => '<h3>The Experience </h3> |
|
| 392 | + "post_images" => $image_array, |
|
| 393 | + "post_category" => array($post_type.'category' => array('Attractions')), |
|
| 394 | + "post_tags" => array('sample', 'tags'), |
|
| 395 | + "geodir_video" => '', |
|
| 396 | + "geodir_timing" => 'Open today until 12.30 p.m., Sunday 12 pm to 7 pm', |
|
| 397 | + "geodir_contact" => '(222) 999-9999', |
|
| 398 | + "geodir_email" => '[email protected]', |
|
| 399 | + "geodir_website" => 'http://swp.com', |
|
| 400 | + "geodir_twitter" => 'http://twitter.com/swp', |
|
| 401 | + "geodir_facebook" => 'http://facebook.com/swp', |
|
| 402 | + "post_dummy" => '1' |
|
| 403 | + ); |
|
| 404 | + |
|
| 405 | + ////post end/// |
|
| 406 | + /// Attractions ////post start 6/// |
|
| 407 | + |
|
| 408 | + break; |
|
| 409 | + case 7: |
|
| 410 | + |
|
| 411 | + $image_array = array(); |
|
| 412 | + $post_meta = array(); |
|
| 413 | + |
|
| 414 | + /// Attractions ////post start 7/// |
|
| 415 | + $image_array[] = "$dummy_image_url/a15.jpg"; |
|
| 416 | + $image_array[] = "$dummy_image_url/a16.jpg"; |
|
| 417 | + $image_array[] = "$dummy_image_url/a17.jpg"; |
|
| 418 | + $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 419 | + $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 420 | + $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 421 | + $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 422 | + $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 423 | + $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 424 | + $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 425 | + $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 426 | + |
|
| 427 | + $post_info[] = array( |
|
| 428 | + "listing_type" => $post_type, |
|
| 429 | + "post_title" => 'Museum Without Walls', |
|
| 430 | + "post_desc" => '<h3>The Experience </h3> |
|
| 431 | 431 | |
| 432 | 432 | Museum Without Walls: AUDIO is a multi-platform, interactive audio tour, designed to allow locals and visitors alike to experience Philadelphia extensive collection of public art and outdoor sculpture along the Benjamin Franklin Parkway and Kelly Drive. This innovative program invites passersby to stop, look, listen and see this city public art in a new way. Discover the untold histories of the 51 outdoor sculptures at 35 stops through these professionally produced three-minute interpretive audio segments. The many narratives have been spoken by more than 100 individuals, all with personal connections to the pieces of art. |
| 433 | 433 | |
@@ -437,45 +437,45 @@ discard block |
||
| 437 | 437 | <h3>History </h3> |
| 438 | 438 | |
| 439 | 439 | Philadelphia has more outdoor sculpture than any other American city, yet this extensive collection often goes unnoticed. This program is intended to reveal the distinct stories behind each of these works, that have become visual white noise for so many of the city residents and visitors. ', |
| 440 | - "post_images" => $image_array, |
|
| 441 | - "post_category" => array($post_type.'category' => array('Attractions')), |
|
| 442 | - "post_tags" => array('Museum'), |
|
| 443 | - "geodir_video" => '', |
|
| 444 | - "geodir_timing" => 'Open today until 10.30 a.m., Sunday 10 am to 7 pm', |
|
| 445 | - "geodir_contact" => '(222) 999-9999', |
|
| 446 | - "geodir_email" => '[email protected]', |
|
| 447 | - "geodir_website" => 'http://museumwithoutwallsaudio.org/', |
|
| 448 | - "geodir_twitter" => 'http://twitter.com/mwwalls', |
|
| 449 | - "geodir_facebook" => 'http://facebook.com/mwwalls', |
|
| 450 | - "post_dummy" => '1' |
|
| 451 | - ); |
|
| 452 | - |
|
| 453 | - ////post end/// |
|
| 454 | - /// Attractions ////post start 7/// |
|
| 455 | - |
|
| 456 | - break; |
|
| 457 | - case 8: |
|
| 458 | - |
|
| 459 | - $image_array = array(); |
|
| 460 | - $post_meta = array(); |
|
| 461 | - |
|
| 462 | - /// Attractions ////post start 8/// |
|
| 463 | - $image_array[] = "$dummy_image_url/a18.jpg"; |
|
| 464 | - $image_array[] = "$dummy_image_url/a10.jpg"; |
|
| 465 | - $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 466 | - $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 467 | - $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 468 | - $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 469 | - $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 470 | - $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 471 | - $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 472 | - $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 473 | - $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 474 | - |
|
| 475 | - $post_info[] = array( |
|
| 476 | - "listing_type" => $post_type, |
|
| 477 | - "post_title" => 'Audacious Freedom', |
|
| 478 | - "post_desc" => 'Audacious Freedom, the major, new exhibit at the African American Museum in Philadelphia , explores the lives of people of African descent living in Philadelphia between 1776 and 1876. |
|
| 440 | + "post_images" => $image_array, |
|
| 441 | + "post_category" => array($post_type.'category' => array('Attractions')), |
|
| 442 | + "post_tags" => array('Museum'), |
|
| 443 | + "geodir_video" => '', |
|
| 444 | + "geodir_timing" => 'Open today until 10.30 a.m., Sunday 10 am to 7 pm', |
|
| 445 | + "geodir_contact" => '(222) 999-9999', |
|
| 446 | + "geodir_email" => '[email protected]', |
|
| 447 | + "geodir_website" => 'http://museumwithoutwallsaudio.org/', |
|
| 448 | + "geodir_twitter" => 'http://twitter.com/mwwalls', |
|
| 449 | + "geodir_facebook" => 'http://facebook.com/mwwalls', |
|
| 450 | + "post_dummy" => '1' |
|
| 451 | + ); |
|
| 452 | + |
|
| 453 | + ////post end/// |
|
| 454 | + /// Attractions ////post start 7/// |
|
| 455 | + |
|
| 456 | + break; |
|
| 457 | + case 8: |
|
| 458 | + |
|
| 459 | + $image_array = array(); |
|
| 460 | + $post_meta = array(); |
|
| 461 | + |
|
| 462 | + /// Attractions ////post start 8/// |
|
| 463 | + $image_array[] = "$dummy_image_url/a18.jpg"; |
|
| 464 | + $image_array[] = "$dummy_image_url/a10.jpg"; |
|
| 465 | + $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 466 | + $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 467 | + $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 468 | + $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 469 | + $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 470 | + $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 471 | + $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 472 | + $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 473 | + $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 474 | + |
|
| 475 | + $post_info[] = array( |
|
| 476 | + "listing_type" => $post_type, |
|
| 477 | + "post_title" => 'Audacious Freedom', |
|
| 478 | + "post_desc" => 'Audacious Freedom, the major, new exhibit at the African American Museum in Philadelphia , explores the lives of people of African descent living in Philadelphia between 1776 and 1876. |
|
| 479 | 479 | |
| 480 | 480 | Discover how African Americans in Philadelphia lived and worked while helping to shape the young nation in its formative stages. |
| 481 | 481 | |
@@ -483,45 +483,45 @@ discard block |
||
| 483 | 483 | |
| 484 | 484 | The groundbreaking exhibit allows visitors to “walk the streets” of Historic Philadelphia using a large-scale map. Young children can join the action with Children´s Corner, which highlights the daily lives of children during that period. |
| 485 | 485 | ', |
| 486 | - "post_images" => $image_array, |
|
| 487 | - "post_category" => array($post_type.'category' => array('Attractions')), |
|
| 488 | - "post_tags" => array('Tag1'), |
|
| 489 | - "geodir_video" => '', |
|
| 490 | - "geodir_timing" => 'Open today until 11.30 a.m., Sunday 1 pm to 7 pm', |
|
| 491 | - "geodir_contact" => '(777) 777-7777', |
|
| 492 | - "geodir_email" => '[email protected]', |
|
| 493 | - "geodir_website" => 'http://www.aampmuseum.org/', |
|
| 494 | - "geodir_twitter" => 'http://twitter.com/aampmuseum', |
|
| 495 | - "geodir_facebook" => 'http://facebook.com/aampmuseum', |
|
| 496 | - "post_dummy" => '1' |
|
| 497 | - ); |
|
| 498 | - |
|
| 499 | - ////post end/// |
|
| 500 | - /// Attractions ////post start 8/// |
|
| 501 | - |
|
| 502 | - |
|
| 503 | - break; |
|
| 504 | - case 9: |
|
| 505 | - $image_array = array(); |
|
| 506 | - $post_meta = array(); |
|
| 507 | - |
|
| 508 | - /// Attractions ////post start 9/// |
|
| 509 | - $image_array[] = "$dummy_image_url/a19.jpg"; |
|
| 510 | - $image_array[] = "$dummy_image_url/a20.jpg"; |
|
| 511 | - $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 512 | - $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 513 | - $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 514 | - $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 515 | - $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 516 | - $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 517 | - $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 518 | - $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 519 | - $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 520 | - |
|
| 521 | - $post_info[] = array( |
|
| 522 | - "listing_type" => $post_type, |
|
| 523 | - "post_title" => 'The Liberty Bell Center', |
|
| 524 | - "post_desc" => '<h3>The Experience </h3> |
|
| 486 | + "post_images" => $image_array, |
|
| 487 | + "post_category" => array($post_type.'category' => array('Attractions')), |
|
| 488 | + "post_tags" => array('Tag1'), |
|
| 489 | + "geodir_video" => '', |
|
| 490 | + "geodir_timing" => 'Open today until 11.30 a.m., Sunday 1 pm to 7 pm', |
|
| 491 | + "geodir_contact" => '(777) 777-7777', |
|
| 492 | + "geodir_email" => '[email protected]', |
|
| 493 | + "geodir_website" => 'http://www.aampmuseum.org/', |
|
| 494 | + "geodir_twitter" => 'http://twitter.com/aampmuseum', |
|
| 495 | + "geodir_facebook" => 'http://facebook.com/aampmuseum', |
|
| 496 | + "post_dummy" => '1' |
|
| 497 | + ); |
|
| 498 | + |
|
| 499 | + ////post end/// |
|
| 500 | + /// Attractions ////post start 8/// |
|
| 501 | + |
|
| 502 | + |
|
| 503 | + break; |
|
| 504 | + case 9: |
|
| 505 | + $image_array = array(); |
|
| 506 | + $post_meta = array(); |
|
| 507 | + |
|
| 508 | + /// Attractions ////post start 9/// |
|
| 509 | + $image_array[] = "$dummy_image_url/a19.jpg"; |
|
| 510 | + $image_array[] = "$dummy_image_url/a20.jpg"; |
|
| 511 | + $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 512 | + $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 513 | + $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 514 | + $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 515 | + $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 516 | + $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 517 | + $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 518 | + $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 519 | + $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 520 | + |
|
| 521 | + $post_info[] = array( |
|
| 522 | + "listing_type" => $post_type, |
|
| 523 | + "post_title" => 'The Liberty Bell Center', |
|
| 524 | + "post_desc" => '<h3>The Experience </h3> |
|
| 525 | 525 | |
| 526 | 526 | The Liberty Bell has a new home, and it is as powerful and dramatic as the Bell itself. Throughout the expansive, light-filled Center, larger-than-life historic documents and graphic images explore the facts and the myths surrounding the Bell. |
| 527 | 527 | |
@@ -542,45 +542,45 @@ discard block |
||
| 542 | 542 | The Bell is suspended from what is believed to be its original yoke, made of American elm. |
| 543 | 543 | |
| 544 | 544 | The Liberty Bell weighs 2,080 pounds. The yoke weighs about 100 pounds.', |
| 545 | - "post_images" => $image_array, |
|
| 546 | - "post_category" => array($post_type.'category' => array('Attractions', 'Feature')), |
|
| 547 | - "post_tags" => array(''), |
|
| 548 | - "geodir_video" => '', |
|
| 549 | - "geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.', |
|
| 550 | - "geodir_contact" => '(777) 666-6666', |
|
| 551 | - "geodir_email" => '[email protected]', |
|
| 552 | - "geodir_website" => 'http://www.nps.gov/inde', |
|
| 553 | - "geodir_twitter" => 'http://twitter.com/nps', |
|
| 554 | - "geodir_facebook" => 'http://facebook.com/nps', |
|
| 555 | - "post_dummy" => '1' |
|
| 556 | - ); |
|
| 557 | - |
|
| 558 | - ////post end/// |
|
| 559 | - /// Attractions ////post start 9/// |
|
| 560 | - break; |
|
| 561 | - case 10: |
|
| 562 | - |
|
| 563 | - |
|
| 564 | - $image_array = array(); |
|
| 565 | - $post_meta = array(); |
|
| 566 | - |
|
| 567 | - /// Attractions ////post start 10/// |
|
| 568 | - $image_array[] = "$dummy_image_url/a19.jpg"; |
|
| 569 | - $image_array[] = "$dummy_image_url/a20.jpg"; |
|
| 570 | - $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 571 | - $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 572 | - $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 573 | - $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 574 | - $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 575 | - $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 576 | - $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 577 | - $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 578 | - $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 579 | - |
|
| 580 | - $post_info[] = array( |
|
| 581 | - "listing_type" => $post_type, |
|
| 582 | - "post_title" => 'Rittenhouse Square', |
|
| 583 | - "post_desc" => ' |
|
| 545 | + "post_images" => $image_array, |
|
| 546 | + "post_category" => array($post_type.'category' => array('Attractions', 'Feature')), |
|
| 547 | + "post_tags" => array(''), |
|
| 548 | + "geodir_video" => '', |
|
| 549 | + "geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.', |
|
| 550 | + "geodir_contact" => '(777) 666-6666', |
|
| 551 | + "geodir_email" => '[email protected]', |
|
| 552 | + "geodir_website" => 'http://www.nps.gov/inde', |
|
| 553 | + "geodir_twitter" => 'http://twitter.com/nps', |
|
| 554 | + "geodir_facebook" => 'http://facebook.com/nps', |
|
| 555 | + "post_dummy" => '1' |
|
| 556 | + ); |
|
| 557 | + |
|
| 558 | + ////post end/// |
|
| 559 | + /// Attractions ////post start 9/// |
|
| 560 | + break; |
|
| 561 | + case 10: |
|
| 562 | + |
|
| 563 | + |
|
| 564 | + $image_array = array(); |
|
| 565 | + $post_meta = array(); |
|
| 566 | + |
|
| 567 | + /// Attractions ////post start 10/// |
|
| 568 | + $image_array[] = "$dummy_image_url/a19.jpg"; |
|
| 569 | + $image_array[] = "$dummy_image_url/a20.jpg"; |
|
| 570 | + $image_array[] = "$dummy_image_url/a3.jpg"; |
|
| 571 | + $image_array[] = "$dummy_image_url/a4.jpg"; |
|
| 572 | + $image_array[] = "$dummy_image_url/a5.jpg"; |
|
| 573 | + $image_array[] = "$dummy_image_url/a2.jpg"; |
|
| 574 | + $image_array[] = "$dummy_image_url/a7.jpg"; |
|
| 575 | + $image_array[] = "$dummy_image_url/a8.jpg"; |
|
| 576 | + $image_array[] = "$dummy_image_url/a6.jpg"; |
|
| 577 | + $image_array[] = "$dummy_image_url/a1.jpg"; |
|
| 578 | + $image_array[] = "$dummy_image_url/a9.jpg"; |
|
| 579 | + |
|
| 580 | + $post_info[] = array( |
|
| 581 | + "listing_type" => $post_type, |
|
| 582 | + "post_title" => 'Rittenhouse Square', |
|
| 583 | + "post_desc" => ' |
|
| 584 | 584 | |
| 585 | 585 | Unlike the other squares, the early Southwest Square was never used as a burial ground, although it offered pasturage for local livestock and a convenient dumping spot for “night soil”. |
| 586 | 586 | <h3> History </h3> |
@@ -613,45 +613,45 @@ discard block |
||
| 613 | 613 | |
| 614 | 614 | Meanwhile, several more restaurants, bars and clubs have opened along the surrounding blocks in recent years, like Parc, Tria, Continental Midtown, Alfa, Walnut Room, and Twenty Manning just to name a few. |
| 615 | 615 | ', |
| 616 | - "post_images" => $image_array, |
|
| 617 | - "post_category" => array($post_type.'category' => array('Attractions')), |
|
| 618 | - "post_tags" => array('Museum'), |
|
| 619 | - "geodir_video" => '', |
|
| 620 | - "geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.', |
|
| 621 | - "geodir_contact" => '(777) 666-6666', |
|
| 622 | - "geodir_email" => '[email protected]', |
|
| 623 | - "geodir_website" => 'http://www.fairmountpark.org/rittenhousesquare.asp', |
|
| 624 | - "geodir_twitter" => 'http://twitter.com/fairmountpark', |
|
| 625 | - "geodir_facebook" => 'http://facebook.com/fairmountpark', |
|
| 626 | - "post_dummy" => '1' |
|
| 627 | - ); |
|
| 628 | - |
|
| 629 | - ////post end/// |
|
| 630 | - /// Attractions ////post start 10/// |
|
| 631 | - break; |
|
| 632 | - case 11: |
|
| 633 | - |
|
| 634 | - |
|
| 635 | - $image_array = array(); |
|
| 636 | - $post_meta = array(); |
|
| 637 | - |
|
| 638 | - /// Hotels ////post start 1/// |
|
| 639 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 640 | - $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 641 | - $image_array[] = "$dummy_image_url/hotels3.jpg"; |
|
| 642 | - $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 643 | - $image_array[] = "$dummy_image_url/hotels5.jpg"; |
|
| 644 | - $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 645 | - $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 646 | - $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 647 | - $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 648 | - $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 649 | - $image_array[] = "$dummy_image_url/hotels11.jpg"; |
|
| 650 | - |
|
| 651 | - $post_info[] = array( |
|
| 652 | - "listing_type" => $post_type, |
|
| 653 | - "post_title" => 'Loews Philadelphia Hotel', |
|
| 654 | - "post_desc" => ' |
|
| 616 | + "post_images" => $image_array, |
|
| 617 | + "post_category" => array($post_type.'category' => array('Attractions')), |
|
| 618 | + "post_tags" => array('Museum'), |
|
| 619 | + "geodir_video" => '', |
|
| 620 | + "geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.', |
|
| 621 | + "geodir_contact" => '(777) 666-6666', |
|
| 622 | + "geodir_email" => '[email protected]', |
|
| 623 | + "geodir_website" => 'http://www.fairmountpark.org/rittenhousesquare.asp', |
|
| 624 | + "geodir_twitter" => 'http://twitter.com/fairmountpark', |
|
| 625 | + "geodir_facebook" => 'http://facebook.com/fairmountpark', |
|
| 626 | + "post_dummy" => '1' |
|
| 627 | + ); |
|
| 628 | + |
|
| 629 | + ////post end/// |
|
| 630 | + /// Attractions ////post start 10/// |
|
| 631 | + break; |
|
| 632 | + case 11: |
|
| 633 | + |
|
| 634 | + |
|
| 635 | + $image_array = array(); |
|
| 636 | + $post_meta = array(); |
|
| 637 | + |
|
| 638 | + /// Hotels ////post start 1/// |
|
| 639 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 640 | + $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 641 | + $image_array[] = "$dummy_image_url/hotels3.jpg"; |
|
| 642 | + $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 643 | + $image_array[] = "$dummy_image_url/hotels5.jpg"; |
|
| 644 | + $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 645 | + $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 646 | + $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 647 | + $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 648 | + $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 649 | + $image_array[] = "$dummy_image_url/hotels11.jpg"; |
|
| 650 | + |
|
| 651 | + $post_info[] = array( |
|
| 652 | + "listing_type" => $post_type, |
|
| 653 | + "post_title" => 'Loews Philadelphia Hotel', |
|
| 654 | + "post_desc" => ' |
|
| 655 | 655 | |
| 656 | 656 | <h3>OVERVIEW </h3> |
| 657 | 657 | |
@@ -718,45 +718,45 @@ discard block |
||
| 718 | 718 | |
| 719 | 719 | SoleFood Restaurant is proud to be serving Starbucks. Come in and enjoy a fresh cup of coffee during your morning rush. The Coffee Bar also offer small breakfast items for your enjoyment. |
| 720 | 720 | ', |
| 721 | - "post_images" => $image_array, |
|
| 722 | - "post_category" => array($post_type.'category' => array('Hotels', 'Feature')), |
|
| 723 | - "post_tags" => array(''), |
|
| 724 | - "geodir_video" => '', |
|
| 725 | - "geodir_timing" => 'Daily, 6:30 am – 12:00 pm', |
|
| 726 | - "geodir_contact" => '(111) 111-0000', |
|
| 727 | - "geodir_email" => '[email protected]', |
|
| 728 | - "geodir_website" => 'http://www.loewshotels.com/en/hotels/philadelphia-hotel/overview.aspx', |
|
| 729 | - "geodir_twitter" => 'http://twitter.com/loewshotels', |
|
| 730 | - "geodir_facebook" => 'http://facebook.com/loewshotels', |
|
| 731 | - "post_dummy" => '1' |
|
| 732 | - ); |
|
| 733 | - |
|
| 734 | - ////post end/// |
|
| 735 | - /// Hotels ////post start 1/// |
|
| 736 | - break; |
|
| 737 | - case 12: |
|
| 738 | - |
|
| 739 | - |
|
| 740 | - $image_array = array(); |
|
| 741 | - $post_meta = array(); |
|
| 742 | - |
|
| 743 | - /// Hotels ////post start 2/// |
|
| 744 | - $image_array[] = "$dummy_image_url/hotels5.jpg"; |
|
| 745 | - $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 746 | - $image_array[] = "$dummy_image_url/hotels3.jpg"; |
|
| 747 | - $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 748 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 749 | - $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 750 | - $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 751 | - $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 752 | - $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 753 | - $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 754 | - $image_array[] = "$dummy_image_url/hotels11.jpg"; |
|
| 755 | - |
|
| 756 | - $post_info[] = array( |
|
| 757 | - "listing_type" => $post_type, |
|
| 758 | - "post_title" => 'Embassy Suites Philadelphia', |
|
| 759 | - "post_desc" => ' |
|
| 721 | + "post_images" => $image_array, |
|
| 722 | + "post_category" => array($post_type.'category' => array('Hotels', 'Feature')), |
|
| 723 | + "post_tags" => array(''), |
|
| 724 | + "geodir_video" => '', |
|
| 725 | + "geodir_timing" => 'Daily, 6:30 am – 12:00 pm', |
|
| 726 | + "geodir_contact" => '(111) 111-0000', |
|
| 727 | + "geodir_email" => '[email protected]', |
|
| 728 | + "geodir_website" => 'http://www.loewshotels.com/en/hotels/philadelphia-hotel/overview.aspx', |
|
| 729 | + "geodir_twitter" => 'http://twitter.com/loewshotels', |
|
| 730 | + "geodir_facebook" => 'http://facebook.com/loewshotels', |
|
| 731 | + "post_dummy" => '1' |
|
| 732 | + ); |
|
| 733 | + |
|
| 734 | + ////post end/// |
|
| 735 | + /// Hotels ////post start 1/// |
|
| 736 | + break; |
|
| 737 | + case 12: |
|
| 738 | + |
|
| 739 | + |
|
| 740 | + $image_array = array(); |
|
| 741 | + $post_meta = array(); |
|
| 742 | + |
|
| 743 | + /// Hotels ////post start 2/// |
|
| 744 | + $image_array[] = "$dummy_image_url/hotels5.jpg"; |
|
| 745 | + $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 746 | + $image_array[] = "$dummy_image_url/hotels3.jpg"; |
|
| 747 | + $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 748 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 749 | + $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 750 | + $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 751 | + $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 752 | + $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 753 | + $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 754 | + $image_array[] = "$dummy_image_url/hotels11.jpg"; |
|
| 755 | + |
|
| 756 | + $post_info[] = array( |
|
| 757 | + "listing_type" => $post_type, |
|
| 758 | + "post_title" => 'Embassy Suites Philadelphia', |
|
| 759 | + "post_desc" => ' |
|
| 760 | 760 | The newly renovated Embassy Suites Philadelphia – Center City hotel is conveniently situated in the heart of downtown Philadelphia, Pennsylvania and Philadelphia´s Center City business district. This hotel in Philadelphia is located only eight miles from Philadelphia International Airport and just minutes from top Philadelphia attractions, including: |
| 761 | 761 | |
| 762 | 762 | Philadelphia Museum of Art |
@@ -772,45 +772,45 @@ discard block |
||
| 772 | 772 | |
| 773 | 773 | A delicious, complimentary cooked-to-order breakfast is offered each morning, and a hotel Manager´s Reception every night – featuring complimentary refreshments and great company. |
| 774 | 774 | ', |
| 775 | - "post_images" => $image_array, |
|
| 776 | - "post_category" => array($post_type.'category' => array('Hotels')), |
|
| 777 | - "post_tags" => array(''), |
|
| 778 | - "geodir_video" => '', |
|
| 779 | - "geodir_timing" => 'Daily, 10:30 am – 10 pm', |
|
| 780 | - "geodir_contact" => '(111) 111-0000', |
|
| 781 | - "geodir_email" => '[email protected]', |
|
| 782 | - "geodir_website" => 'http://embassysuites1.hilton.com/en_US/es/hotel/PHLDTES-Embassy-Suites-Philadelphia-Center-City-Pennsylvania/index.do', |
|
| 783 | - "geodir_twitter" => 'http://twitter.com/embassysuites1', |
|
| 784 | - "geodir_facebook" => 'http://facebook.com/embassysuites1', |
|
| 785 | - "post_dummy" => '1' |
|
| 786 | - ); |
|
| 787 | - |
|
| 788 | - ////post end/// |
|
| 789 | - /// Hotels ////post start 2/// |
|
| 790 | - |
|
| 791 | - break; |
|
| 792 | - case 13: |
|
| 793 | - |
|
| 794 | - $image_array = array(); |
|
| 795 | - $post_meta = array(); |
|
| 796 | - |
|
| 797 | - /// Hotels ////post start 3/// |
|
| 798 | - $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 799 | - $image_array[] = "$dummy_image_url/hotels11.jpg"; |
|
| 800 | - $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 801 | - $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 802 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 803 | - $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 804 | - $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 805 | - $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 806 | - $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 807 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 808 | - $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 809 | - |
|
| 810 | - $post_info[] = array( |
|
| 811 | - "listing_type" => $post_type, |
|
| 812 | - "post_title" => 'Doubletree Hotel Philadelphia', |
|
| 813 | - "post_desc" => ' |
|
| 775 | + "post_images" => $image_array, |
|
| 776 | + "post_category" => array($post_type.'category' => array('Hotels')), |
|
| 777 | + "post_tags" => array(''), |
|
| 778 | + "geodir_video" => '', |
|
| 779 | + "geodir_timing" => 'Daily, 10:30 am – 10 pm', |
|
| 780 | + "geodir_contact" => '(111) 111-0000', |
|
| 781 | + "geodir_email" => '[email protected]', |
|
| 782 | + "geodir_website" => 'http://embassysuites1.hilton.com/en_US/es/hotel/PHLDTES-Embassy-Suites-Philadelphia-Center-City-Pennsylvania/index.do', |
|
| 783 | + "geodir_twitter" => 'http://twitter.com/embassysuites1', |
|
| 784 | + "geodir_facebook" => 'http://facebook.com/embassysuites1', |
|
| 785 | + "post_dummy" => '1' |
|
| 786 | + ); |
|
| 787 | + |
|
| 788 | + ////post end/// |
|
| 789 | + /// Hotels ////post start 2/// |
|
| 790 | + |
|
| 791 | + break; |
|
| 792 | + case 13: |
|
| 793 | + |
|
| 794 | + $image_array = array(); |
|
| 795 | + $post_meta = array(); |
|
| 796 | + |
|
| 797 | + /// Hotels ////post start 3/// |
|
| 798 | + $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 799 | + $image_array[] = "$dummy_image_url/hotels11.jpg"; |
|
| 800 | + $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 801 | + $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 802 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 803 | + $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 804 | + $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 805 | + $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 806 | + $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 807 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 808 | + $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 809 | + |
|
| 810 | + $post_info[] = array( |
|
| 811 | + "listing_type" => $post_type, |
|
| 812 | + "post_title" => 'Doubletree Hotel Philadelphia', |
|
| 813 | + "post_desc" => ' |
|
| 814 | 814 | With 434 rooms, the Doubletree Hotel is a great option for your upcoming stay in Philadelphia. |
| 815 | 815 | |
| 816 | 816 | <h3>Location </h3> |
@@ -840,47 +840,47 @@ discard block |
||
| 840 | 840 | Stop in the restaurant - which serves lunch and dinner daily - for a drink and some light fare. With its location right on Broad Street, you´re close to everything you could ever want in a night on the town. |
| 841 | 841 | ', |
| 842 | 842 | |
| 843 | - "post_images" => $image_array, |
|
| 844 | - |
|
| 845 | - "post_category" => array($post_type.'category' => array('Hotels')), |
|
| 846 | - "post_tags" => array(''), |
|
| 847 | - "geodir_video" => '', |
|
| 848 | - "geodir_timing" => 'Daily, 10:30 am – 10 pm', |
|
| 849 | - "geodir_contact" => '(111) 111-0000', |
|
| 850 | - "geodir_email" => '[email protected]', |
|
| 851 | - "geodir_website" => 'http://doubletree1.hilton.com/en_US/dt/hotel/PHLBLDT-Doubletree-Hotel-Philadelphia-Pennsylvania/index.do', |
|
| 852 | - "geodir_twitter" => 'http://twitter.com/doubletree1', |
|
| 853 | - "geodir_facebook" => 'http://facebook.com/doubletree1', |
|
| 854 | - "post_dummy" => '1' |
|
| 855 | - ); |
|
| 856 | - |
|
| 857 | - ////post end/// |
|
| 858 | - /// Hotels ////post start 3/// |
|
| 859 | - |
|
| 860 | - break; |
|
| 861 | - case 14: |
|
| 862 | - |
|
| 863 | - |
|
| 864 | - $image_array = array(); |
|
| 865 | - $post_meta = array(); |
|
| 866 | - |
|
| 867 | - /// Hotels ////post start 4/// |
|
| 868 | - $image_array[] = "$dummy_image_url/hotels15.jpg"; |
|
| 869 | - $image_array[] = "$dummy_image_url/hotels16.jpg"; |
|
| 870 | - $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 871 | - $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 872 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 873 | - $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 874 | - $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 875 | - $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 876 | - $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 877 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 878 | - $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 879 | - |
|
| 880 | - $post_info[] = array( |
|
| 881 | - "listing_type" => $post_type, |
|
| 882 | - "post_title" => 'Philadelphia Marriott Downtown', |
|
| 883 | - "post_desc" => ' |
|
| 843 | + "post_images" => $image_array, |
|
| 844 | + |
|
| 845 | + "post_category" => array($post_type.'category' => array('Hotels')), |
|
| 846 | + "post_tags" => array(''), |
|
| 847 | + "geodir_video" => '', |
|
| 848 | + "geodir_timing" => 'Daily, 10:30 am – 10 pm', |
|
| 849 | + "geodir_contact" => '(111) 111-0000', |
|
| 850 | + "geodir_email" => '[email protected]', |
|
| 851 | + "geodir_website" => 'http://doubletree1.hilton.com/en_US/dt/hotel/PHLBLDT-Doubletree-Hotel-Philadelphia-Pennsylvania/index.do', |
|
| 852 | + "geodir_twitter" => 'http://twitter.com/doubletree1', |
|
| 853 | + "geodir_facebook" => 'http://facebook.com/doubletree1', |
|
| 854 | + "post_dummy" => '1' |
|
| 855 | + ); |
|
| 856 | + |
|
| 857 | + ////post end/// |
|
| 858 | + /// Hotels ////post start 3/// |
|
| 859 | + |
|
| 860 | + break; |
|
| 861 | + case 14: |
|
| 862 | + |
|
| 863 | + |
|
| 864 | + $image_array = array(); |
|
| 865 | + $post_meta = array(); |
|
| 866 | + |
|
| 867 | + /// Hotels ////post start 4/// |
|
| 868 | + $image_array[] = "$dummy_image_url/hotels15.jpg"; |
|
| 869 | + $image_array[] = "$dummy_image_url/hotels16.jpg"; |
|
| 870 | + $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 871 | + $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 872 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 873 | + $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 874 | + $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 875 | + $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 876 | + $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 877 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 878 | + $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 879 | + |
|
| 880 | + $post_info[] = array( |
|
| 881 | + "listing_type" => $post_type, |
|
| 882 | + "post_title" => 'Philadelphia Marriott Downtown', |
|
| 883 | + "post_desc" => ' |
|
| 884 | 884 | Get ready to stay and play at the new aloft Philadelphia Airport! |
| 885 | 885 | |
| 886 | 886 | This incredibly modern hotel is located just five minutes from Philadelphia International Airport, offering a great convenience to travelers looking for fresh and fun accommodations. |
@@ -907,45 +907,45 @@ discard block |
||
| 907 | 907 | |
| 908 | 908 | Aahh…breathe deep at Aloft. This hotel is smoke-free. |
| 909 | 909 | ', |
| 910 | - "post_images" => $image_array, |
|
| 911 | - "post_category" => array($post_type.'category' => array('Hotels', 'Feature')), |
|
| 912 | - "post_tags" => array(''), |
|
| 913 | - "geodir_video" => '', |
|
| 914 | - "geodir_timing" => '24 Hours', |
|
| 915 | - "geodir_contact" => '(123) 111-2222', |
|
| 916 | - "geodir_email" => '[email protected]', |
|
| 917 | - "geodir_website" => 'http://www.marriott.com/hotels/travel/phldt-philadelphia-marriott-downtown/', |
|
| 918 | - "geodir_twitter" => 'http://twitter.com/marriott', |
|
| 919 | - "geodir_facebook" => 'http://facebook.com/marriott', |
|
| 920 | - "post_dummy" => '1' |
|
| 921 | - ); |
|
| 922 | - |
|
| 923 | - ////post end/// |
|
| 924 | - /// Hotels ////post start 4/// |
|
| 925 | - break; |
|
| 926 | - case 15: |
|
| 927 | - |
|
| 928 | - |
|
| 929 | - $image_array = array(); |
|
| 930 | - $post_meta = array(); |
|
| 931 | - |
|
| 932 | - /// Hotels ////post start 5/// |
|
| 933 | - $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 934 | - $image_array[] = "$dummy_image_url/hotels16.jpg"; |
|
| 935 | - $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 936 | - $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 937 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 938 | - $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 939 | - $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 940 | - $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 941 | - $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 942 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 943 | - $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 944 | - |
|
| 945 | - $post_info[] = array( |
|
| 946 | - "listing_type" => $post_type, |
|
| 947 | - "post_title" => 'Hilton Inn at Penn', |
|
| 948 | - "post_desc" => ' |
|
| 910 | + "post_images" => $image_array, |
|
| 911 | + "post_category" => array($post_type.'category' => array('Hotels', 'Feature')), |
|
| 912 | + "post_tags" => array(''), |
|
| 913 | + "geodir_video" => '', |
|
| 914 | + "geodir_timing" => '24 Hours', |
|
| 915 | + "geodir_contact" => '(123) 111-2222', |
|
| 916 | + "geodir_email" => '[email protected]', |
|
| 917 | + "geodir_website" => 'http://www.marriott.com/hotels/travel/phldt-philadelphia-marriott-downtown/', |
|
| 918 | + "geodir_twitter" => 'http://twitter.com/marriott', |
|
| 919 | + "geodir_facebook" => 'http://facebook.com/marriott', |
|
| 920 | + "post_dummy" => '1' |
|
| 921 | + ); |
|
| 922 | + |
|
| 923 | + ////post end/// |
|
| 924 | + /// Hotels ////post start 4/// |
|
| 925 | + break; |
|
| 926 | + case 15: |
|
| 927 | + |
|
| 928 | + |
|
| 929 | + $image_array = array(); |
|
| 930 | + $post_meta = array(); |
|
| 931 | + |
|
| 932 | + /// Hotels ////post start 5/// |
|
| 933 | + $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 934 | + $image_array[] = "$dummy_image_url/hotels16.jpg"; |
|
| 935 | + $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 936 | + $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 937 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 938 | + $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 939 | + $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 940 | + $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 941 | + $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 942 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 943 | + $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 944 | + |
|
| 945 | + $post_info[] = array( |
|
| 946 | + "listing_type" => $post_type, |
|
| 947 | + "post_title" => 'Hilton Inn at Penn', |
|
| 948 | + "post_desc" => ' |
|
| 949 | 949 | Located in the heart of Penn´s campus in the beautiful University City neighborhood of Philadelphia, The Hilton Inn at Penn is a great choice for accommodations during your upcoming visit to Philadelphia. |
| 950 | 950 | |
| 951 | 951 | The location puts you right in the middle of the prestigious University of Pennsylvania and its many nearby educational, medical and corporate centers. And Center City Philadelphia is only a short cab ride away. So if you want to get out and explore the city, you are set. |
@@ -961,45 +961,45 @@ discard block |
||
| 961 | 961 | |
| 962 | 962 | The pasta is handmade right in front of you and then dished up along side delectable entrées such as grilled veal tenderloin and honey glazed sea scallops. And the wine bar offers more than 30 varieties by the glass and more than 100 by the bottle. |
| 963 | 963 | ', |
| 964 | - "post_images" => $image_array, |
|
| 965 | - "post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')), |
|
| 966 | - "post_tags" => array(''), |
|
| 967 | - "geodir_video" => '', |
|
| 968 | - "geodir_timing" => 'Daily : 11 am to 11 pm', |
|
| 969 | - "geodir_contact" => '(888) 888-8888', |
|
| 970 | - "geodir_email" => '[email protected]', |
|
| 971 | - "geodir_website" => 'http://www.theinnatpenn.com/', |
|
| 972 | - "geodir_twitter" => 'http://twitter.com/theinnatpenn', |
|
| 973 | - "geodir_facebook" => 'http://facebook.com/theinnatpenn', |
|
| 974 | - "post_dummy" => '1' |
|
| 975 | - ); |
|
| 976 | - |
|
| 977 | - ////post end/// |
|
| 978 | - /// Hotels ////post start 5/// |
|
| 979 | - break; |
|
| 980 | - case 16: |
|
| 981 | - |
|
| 982 | - |
|
| 983 | - $image_array = array(); |
|
| 984 | - $post_meta = array(); |
|
| 985 | - |
|
| 986 | - /// Hotels ////post start 6/// |
|
| 987 | - $image_array[] = "$dummy_image_url/hotels17.jpg"; |
|
| 988 | - $image_array[] = "$dummy_image_url/hotels18.jpg"; |
|
| 989 | - $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 990 | - $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 991 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 992 | - $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 993 | - $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 994 | - $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 995 | - $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 996 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 997 | - $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 998 | - |
|
| 999 | - $post_info[] = array( |
|
| 1000 | - "listing_type" => $post_type, |
|
| 1001 | - "post_title" => 'Courtyard Philadelphia Downtown', |
|
| 1002 | - "post_desc" => ' |
|
| 964 | + "post_images" => $image_array, |
|
| 965 | + "post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')), |
|
| 966 | + "post_tags" => array(''), |
|
| 967 | + "geodir_video" => '', |
|
| 968 | + "geodir_timing" => 'Daily : 11 am to 11 pm', |
|
| 969 | + "geodir_contact" => '(888) 888-8888', |
|
| 970 | + "geodir_email" => '[email protected]', |
|
| 971 | + "geodir_website" => 'http://www.theinnatpenn.com/', |
|
| 972 | + "geodir_twitter" => 'http://twitter.com/theinnatpenn', |
|
| 973 | + "geodir_facebook" => 'http://facebook.com/theinnatpenn', |
|
| 974 | + "post_dummy" => '1' |
|
| 975 | + ); |
|
| 976 | + |
|
| 977 | + ////post end/// |
|
| 978 | + /// Hotels ////post start 5/// |
|
| 979 | + break; |
|
| 980 | + case 16: |
|
| 981 | + |
|
| 982 | + |
|
| 983 | + $image_array = array(); |
|
| 984 | + $post_meta = array(); |
|
| 985 | + |
|
| 986 | + /// Hotels ////post start 6/// |
|
| 987 | + $image_array[] = "$dummy_image_url/hotels17.jpg"; |
|
| 988 | + $image_array[] = "$dummy_image_url/hotels18.jpg"; |
|
| 989 | + $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 990 | + $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 991 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 992 | + $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 993 | + $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 994 | + $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 995 | + $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 996 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 997 | + $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 998 | + |
|
| 999 | + $post_info[] = array( |
|
| 1000 | + "listing_type" => $post_type, |
|
| 1001 | + "post_title" => 'Courtyard Philadelphia Downtown', |
|
| 1002 | + "post_desc" => ' |
|
| 1003 | 1003 | <h3>Overview </h3> |
| 1004 | 1004 | |
| 1005 | 1005 | The Philadelphia Downtown Courtyard opened it´s doors after a grand $75 million restoration, recapturing the grandeur of its 1926 origins while incorporating state of the art systems throughout. |
@@ -1029,45 +1029,45 @@ discard block |
||
| 1029 | 1029 | |
| 1030 | 1030 | Recently featured on WE TV´s “My Fair Wedding”, the Courtyard Marriott Philadelphia is one of the city´s leading venues for corporate and social affairs with over 10,000 sq ft of flexible meeting space, including two Grand Ballrooms each with over 3,000 square feet accommodating up to 250 people. In addition, the hotel has a total of 11 meeting rooms making it an ideal home for all occasions. The hotel boasts an experienced full-service Event and Culinary Teams, ready to take care of all the details and ensure your event is not only a success, but a lasting memory. |
| 1031 | 1031 | ', |
| 1032 | - "post_images" => $image_array, |
|
| 1033 | - "post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')), |
|
| 1034 | - "post_tags" => array(''), |
|
| 1035 | - "geodir_video" => '', |
|
| 1036 | - "geodir_timing" => 'Daily : 11 am to 11 pm', |
|
| 1037 | - "geodir_contact" => '(888) 888-8888', |
|
| 1038 | - "geodir_email" => '[email protected]', |
|
| 1039 | - "geodir_website" => 'http://www.theinnatpenn.com/', |
|
| 1040 | - "geodir_twitter" => 'http://twitter.com/theinnatpenn', |
|
| 1041 | - "geodir_facebook" => 'http://facebook.com/theinnatpenn', |
|
| 1042 | - "post_dummy" => '1' |
|
| 1043 | - ); |
|
| 1044 | - |
|
| 1045 | - ////post end/// |
|
| 1046 | - /// Hotels ////post start 6/// |
|
| 1047 | - |
|
| 1048 | - break; |
|
| 1049 | - case 17: |
|
| 1050 | - |
|
| 1051 | - $image_array = array(); |
|
| 1052 | - $post_meta = array(); |
|
| 1053 | - |
|
| 1054 | - /// Hotels ////post start 7/// |
|
| 1055 | - $image_array[] = "$dummy_image_url/hotels11.jpg"; |
|
| 1056 | - $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 1057 | - $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 1058 | - $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 1059 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1060 | - $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 1061 | - $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 1062 | - $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 1063 | - $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 1064 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1065 | - $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 1066 | - |
|
| 1067 | - $post_info[] = array( |
|
| 1068 | - "listing_type" => $post_type, |
|
| 1069 | - "post_title" => 'Four Seasons Philadelphia', |
|
| 1070 | - "post_desc" => ' |
|
| 1032 | + "post_images" => $image_array, |
|
| 1033 | + "post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')), |
|
| 1034 | + "post_tags" => array(''), |
|
| 1035 | + "geodir_video" => '', |
|
| 1036 | + "geodir_timing" => 'Daily : 11 am to 11 pm', |
|
| 1037 | + "geodir_contact" => '(888) 888-8888', |
|
| 1038 | + "geodir_email" => '[email protected]', |
|
| 1039 | + "geodir_website" => 'http://www.theinnatpenn.com/', |
|
| 1040 | + "geodir_twitter" => 'http://twitter.com/theinnatpenn', |
|
| 1041 | + "geodir_facebook" => 'http://facebook.com/theinnatpenn', |
|
| 1042 | + "post_dummy" => '1' |
|
| 1043 | + ); |
|
| 1044 | + |
|
| 1045 | + ////post end/// |
|
| 1046 | + /// Hotels ////post start 6/// |
|
| 1047 | + |
|
| 1048 | + break; |
|
| 1049 | + case 17: |
|
| 1050 | + |
|
| 1051 | + $image_array = array(); |
|
| 1052 | + $post_meta = array(); |
|
| 1053 | + |
|
| 1054 | + /// Hotels ////post start 7/// |
|
| 1055 | + $image_array[] = "$dummy_image_url/hotels11.jpg"; |
|
| 1056 | + $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 1057 | + $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 1058 | + $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 1059 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1060 | + $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 1061 | + $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 1062 | + $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 1063 | + $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 1064 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1065 | + $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 1066 | + |
|
| 1067 | + $post_info[] = array( |
|
| 1068 | + "listing_type" => $post_type, |
|
| 1069 | + "post_title" => 'Four Seasons Philadelphia', |
|
| 1070 | + "post_desc" => ' |
|
| 1071 | 1071 | <h3>Overview </h3> |
| 1072 | 1072 | |
| 1073 | 1073 | The Philadelphia Downtown Courtyard opened it´s doors after a grand $75 million restoration, recapturing the grandeur of its 1926 origins while incorporating state of the art systems throughout. |
@@ -1097,45 +1097,45 @@ discard block |
||
| 1097 | 1097 | |
| 1098 | 1098 | Recently featured on WE TV´s “My Fair Wedding”, the Courtyard Marriott Philadelphia is one of the city´s leading venues for corporate and social affairs with over 10,000 sq ft of flexible meeting space, including two Grand Ballrooms each with over 3,000 square feet accommodating up to 250 people. In addition, the hotel has a total of 11 meeting rooms making it an ideal home for all occasions. The hotel boasts an experienced full-service Event and Culinary Teams, ready to take care of all the details and ensure your event is not only a success, but a lasting memory. |
| 1099 | 1099 | ', |
| 1100 | - "post_images" => $image_array, |
|
| 1101 | - "post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')), |
|
| 1102 | - "post_tags" => array(''), |
|
| 1103 | - "geodir_video" => '', |
|
| 1104 | - "geodir_timing" => 'Daily : 11 am to 11 pm', |
|
| 1105 | - "geodir_contact" => '(143) 888-8888', |
|
| 1106 | - "geodir_email" => '[email protected]', |
|
| 1107 | - "geodir_website" => 'http://www.fourseasons.com/philadelphia/', |
|
| 1108 | - "geodir_twitter" => 'http://twitter.com/fourseasons', |
|
| 1109 | - "geodir_facebook" => 'http://facebook.com/fourseasons', |
|
| 1110 | - "post_dummy" => '1' |
|
| 1111 | - ); |
|
| 1112 | - |
|
| 1113 | - ////post end/// |
|
| 1114 | - /// Hotels ////post start 7/// |
|
| 1115 | - break; |
|
| 1116 | - case 18: |
|
| 1117 | - |
|
| 1118 | - |
|
| 1119 | - $image_array = array(); |
|
| 1120 | - $post_meta = array(); |
|
| 1121 | - |
|
| 1122 | - /// Hotels ////post start 8/// |
|
| 1123 | - $image_array[] = "$dummy_image_url/hotels11.jpg"; |
|
| 1124 | - $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 1125 | - $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 1126 | - $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 1127 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1128 | - $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 1129 | - $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 1130 | - $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 1131 | - $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 1132 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1133 | - $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 1134 | - |
|
| 1135 | - $post_info[] = array( |
|
| 1136 | - "listing_type" => $post_type, |
|
| 1137 | - "post_title" => 'Alexander Inn', |
|
| 1138 | - "post_desc" => ' |
|
| 1100 | + "post_images" => $image_array, |
|
| 1101 | + "post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')), |
|
| 1102 | + "post_tags" => array(''), |
|
| 1103 | + "geodir_video" => '', |
|
| 1104 | + "geodir_timing" => 'Daily : 11 am to 11 pm', |
|
| 1105 | + "geodir_contact" => '(143) 888-8888', |
|
| 1106 | + "geodir_email" => '[email protected]', |
|
| 1107 | + "geodir_website" => 'http://www.fourseasons.com/philadelphia/', |
|
| 1108 | + "geodir_twitter" => 'http://twitter.com/fourseasons', |
|
| 1109 | + "geodir_facebook" => 'http://facebook.com/fourseasons', |
|
| 1110 | + "post_dummy" => '1' |
|
| 1111 | + ); |
|
| 1112 | + |
|
| 1113 | + ////post end/// |
|
| 1114 | + /// Hotels ////post start 7/// |
|
| 1115 | + break; |
|
| 1116 | + case 18: |
|
| 1117 | + |
|
| 1118 | + |
|
| 1119 | + $image_array = array(); |
|
| 1120 | + $post_meta = array(); |
|
| 1121 | + |
|
| 1122 | + /// Hotels ////post start 8/// |
|
| 1123 | + $image_array[] = "$dummy_image_url/hotels11.jpg"; |
|
| 1124 | + $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 1125 | + $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 1126 | + $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 1127 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1128 | + $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 1129 | + $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 1130 | + $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 1131 | + $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 1132 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1133 | + $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 1134 | + |
|
| 1135 | + $post_info[] = array( |
|
| 1136 | + "listing_type" => $post_type, |
|
| 1137 | + "post_title" => 'Alexander Inn', |
|
| 1138 | + "post_desc" => ' |
|
| 1139 | 1139 | The Alexander Inn is one of Philadelphia´s most popular and reasonably priced small hotels. |
| 1140 | 1140 | |
| 1141 | 1141 | Conveniently located in the heart of the Washington Square West neighborhood in Center City Philadelphia, the Alexander Inn is a great place to base your stay in Philadelphia. |
@@ -1144,45 +1144,45 @@ discard block |
||
| 1144 | 1144 | |
| 1145 | 1145 | Rooms are also fitted with DirecTV (including many complimentary channels like CNN, ESPN, eight movie channels, etc.) and telephones with modem ports and direct dial. You will also have access to the hotel´s free 24-hour fitness and e-mail centers. |
| 1146 | 1146 | ', |
| 1147 | - "post_images" => $image_array, |
|
| 1148 | - "post_category" => array($post_type.'category' => array('Hotels')), |
|
| 1149 | - "post_tags" => array(''), |
|
| 1150 | - "geodir_video" => '', |
|
| 1151 | - "geodir_timing" => 'Daily : 11 am to 11 pm', |
|
| 1152 | - "geodir_contact" => '(143) 888-8888', |
|
| 1153 | - "geodir_email" => '[email protected]', |
|
| 1154 | - "geodir_website" => 'http://www.alexanderinn.com/', |
|
| 1155 | - "geodir_twitter" => 'http://twitter.com/alexanderinn', |
|
| 1156 | - "geodir_facebook" => 'http://facebook.com/alexanderinn', |
|
| 1157 | - "post_dummy" => '1' |
|
| 1158 | - ); |
|
| 1159 | - |
|
| 1160 | - ////post end/// |
|
| 1161 | - /// Hotels ////post start 8/// |
|
| 1162 | - break; |
|
| 1163 | - case 19: |
|
| 1164 | - |
|
| 1165 | - |
|
| 1166 | - $image_array = array(); |
|
| 1167 | - $post_meta = array(); |
|
| 1168 | - |
|
| 1169 | - /// Hotels ////post start 9/// |
|
| 1170 | - $image_array[] = "$dummy_image_url/hotels5.jpg"; |
|
| 1171 | - $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 1172 | - $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 1173 | - $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 1174 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1175 | - $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 1176 | - $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 1177 | - $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 1178 | - $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 1179 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1180 | - $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 1181 | - |
|
| 1182 | - $post_info[] = array( |
|
| 1183 | - "listing_type" => $post_type, |
|
| 1184 | - "post_title" => 'Best Western Center City Hotel', |
|
| 1185 | - "post_desc" => ' |
|
| 1147 | + "post_images" => $image_array, |
|
| 1148 | + "post_category" => array($post_type.'category' => array('Hotels')), |
|
| 1149 | + "post_tags" => array(''), |
|
| 1150 | + "geodir_video" => '', |
|
| 1151 | + "geodir_timing" => 'Daily : 11 am to 11 pm', |
|
| 1152 | + "geodir_contact" => '(143) 888-8888', |
|
| 1153 | + "geodir_email" => '[email protected]', |
|
| 1154 | + "geodir_website" => 'http://www.alexanderinn.com/', |
|
| 1155 | + "geodir_twitter" => 'http://twitter.com/alexanderinn', |
|
| 1156 | + "geodir_facebook" => 'http://facebook.com/alexanderinn', |
|
| 1157 | + "post_dummy" => '1' |
|
| 1158 | + ); |
|
| 1159 | + |
|
| 1160 | + ////post end/// |
|
| 1161 | + /// Hotels ////post start 8/// |
|
| 1162 | + break; |
|
| 1163 | + case 19: |
|
| 1164 | + |
|
| 1165 | + |
|
| 1166 | + $image_array = array(); |
|
| 1167 | + $post_meta = array(); |
|
| 1168 | + |
|
| 1169 | + /// Hotels ////post start 9/// |
|
| 1170 | + $image_array[] = "$dummy_image_url/hotels5.jpg"; |
|
| 1171 | + $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 1172 | + $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 1173 | + $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 1174 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1175 | + $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 1176 | + $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 1177 | + $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 1178 | + $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 1179 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1180 | + $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 1181 | + |
|
| 1182 | + $post_info[] = array( |
|
| 1183 | + "listing_type" => $post_type, |
|
| 1184 | + "post_title" => 'Best Western Center City Hotel', |
|
| 1185 | + "post_desc" => ' |
|
| 1186 | 1186 | The Alexander Inn is one of Philadelphia´s most popular and reasonably priced small hotels. |
| 1187 | 1187 | |
| 1188 | 1188 | Conveniently located in the heart of the Washington Square West neighborhood in Center City Philadelphia, the Alexander Inn is a great place to base your stay in Philadelphia. |
@@ -1191,91 +1191,91 @@ discard block |
||
| 1191 | 1191 | |
| 1192 | 1192 | Rooms are also fitted with DirecTV (including many complimentary channels like CNN, ESPN, eight movie channels, etc.) and telephones with modem ports and direct dial. You will also have access to the hotel´s free 24-hour fitness and e-mail centers. |
| 1193 | 1193 | ', |
| 1194 | - "post_images" => $image_array, |
|
| 1195 | - "post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')), |
|
| 1196 | - "post_tags" => array(''), |
|
| 1197 | - "geodir_video" => '', |
|
| 1198 | - "geodir_timing" => 'Daily : 10 am to 11 pm', |
|
| 1199 | - "geodir_contact" => '(243) 222-12344', |
|
| 1200 | - "geodir_email" => '[email protected]', |
|
| 1201 | - "geodir_website" => 'http://book.bestwestern.com/bestwestern/productInfo.do?propertyCode=39087', |
|
| 1202 | - "geodir_twitter" => 'http://twitter.com/bestwestern', |
|
| 1203 | - "geodir_facebook" => 'http://facebook.com/bestwestern', |
|
| 1204 | - "post_dummy" => '1' |
|
| 1205 | - ); |
|
| 1206 | - |
|
| 1207 | - ////post end/// |
|
| 1208 | - /// Hotels ////post start 9/// |
|
| 1209 | - break; |
|
| 1210 | - case 20: |
|
| 1211 | - |
|
| 1212 | - |
|
| 1213 | - $image_array = array(); |
|
| 1214 | - $post_meta = array(); |
|
| 1215 | - |
|
| 1216 | - /// Hotels ////post start 10/// |
|
| 1217 | - $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 1218 | - $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 1219 | - $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 1220 | - $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 1221 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1222 | - $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 1223 | - $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 1224 | - $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 1225 | - $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 1226 | - $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1227 | - $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 1228 | - |
|
| 1229 | - $post_info[] = array( |
|
| 1230 | - "listing_type" => $post_type, |
|
| 1231 | - "post_title" => 'Chestnut Hill Hotel', |
|
| 1232 | - "post_desc" => ' |
|
| 1194 | + "post_images" => $image_array, |
|
| 1195 | + "post_category" => array($post_type.'category' => array('Hotels', 'Food Nightlife')), |
|
| 1196 | + "post_tags" => array(''), |
|
| 1197 | + "geodir_video" => '', |
|
| 1198 | + "geodir_timing" => 'Daily : 10 am to 11 pm', |
|
| 1199 | + "geodir_contact" => '(243) 222-12344', |
|
| 1200 | + "geodir_email" => '[email protected]', |
|
| 1201 | + "geodir_website" => 'http://book.bestwestern.com/bestwestern/productInfo.do?propertyCode=39087', |
|
| 1202 | + "geodir_twitter" => 'http://twitter.com/bestwestern', |
|
| 1203 | + "geodir_facebook" => 'http://facebook.com/bestwestern', |
|
| 1204 | + "post_dummy" => '1' |
|
| 1205 | + ); |
|
| 1206 | + |
|
| 1207 | + ////post end/// |
|
| 1208 | + /// Hotels ////post start 9/// |
|
| 1209 | + break; |
|
| 1210 | + case 20: |
|
| 1211 | + |
|
| 1212 | + |
|
| 1213 | + $image_array = array(); |
|
| 1214 | + $post_meta = array(); |
|
| 1215 | + |
|
| 1216 | + /// Hotels ////post start 10/// |
|
| 1217 | + $image_array[] = "$dummy_image_url/hotels7.jpg"; |
|
| 1218 | + $image_array[] = "$dummy_image_url/hotels10.jpg"; |
|
| 1219 | + $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 1220 | + $image_array[] = "$dummy_image_url/hotels4.jpg"; |
|
| 1221 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1222 | + $image_array[] = "$dummy_image_url/hotels6.jpg"; |
|
| 1223 | + $image_array[] = "$dummy_image_url/hotels12.jpg"; |
|
| 1224 | + $image_array[] = "$dummy_image_url/hotels8.jpg"; |
|
| 1225 | + $image_array[] = "$dummy_image_url/hotels9.jpg"; |
|
| 1226 | + $image_array[] = "$dummy_image_url/hotels1.jpg"; |
|
| 1227 | + $image_array[] = "$dummy_image_url/hotels2.jpg"; |
|
| 1228 | + |
|
| 1229 | + $post_info[] = array( |
|
| 1230 | + "listing_type" => $post_type, |
|
| 1231 | + "post_title" => 'Chestnut Hill Hotel', |
|
| 1232 | + "post_desc" => ' |
|
| 1233 | 1233 | The Chestnut Hill Hotel is located in the historic community of Chestnut Hill, approximately nine miles northwest from Center City Philadelphia. Although Chestnut Hill is close to Center City by today´s standards, it was originally a distant “suburb” on the outskirts of the Philadelphia countryside. |
| 1234 | 1234 | |
| 1235 | 1235 | Today, it is one of the region´s most charming neighborhoods. Tree-lined streets and grand estates surround its main street, Germantown Avenue, where you can stroll and shop at more than 200 specialty shops and restaurants, along with trendy salons and other modern boutiques. |
| 1236 | 1236 | |
| 1237 | 1237 | The Chestnut Hill Hotel fits perfectly in this setting - the hotel´s 36 rooms and suites, decorated in an 18th-century style, hold the hotel to its boutique roots. It´s a perfect place at which to enjoy a romantic getaway in Philadelphia. |
| 1238 | 1238 | ', |
| 1239 | - "post_images" => $image_array, |
|
| 1240 | - "post_category" => array($post_type.'category' => array('Hotels', 'Feature')), |
|
| 1241 | - "post_tags" => array(''), |
|
| 1242 | - "geodir_video" => '', |
|
| 1243 | - "geodir_timing" => 'Daily : 10 am to 11 pm', |
|
| 1244 | - "geodir_contact" => '(243) 222-12344', |
|
| 1245 | - "geodir_email" => '[email protected]', |
|
| 1246 | - "geodir_website" => 'http://www.chestnuthillhotel.com/', |
|
| 1247 | - "geodir_twitter" => 'http://twitter.com/chestnuthillhotel', |
|
| 1248 | - "geodir_facebook" => 'http://facebook.com/chestnuthillhotel', |
|
| 1249 | - "post_dummy" => '1' |
|
| 1250 | - ); |
|
| 1251 | - |
|
| 1252 | - ////post end/// |
|
| 1253 | - /// Hotels ////post start 10/// |
|
| 1254 | - |
|
| 1255 | - break; |
|
| 1256 | - case 21: |
|
| 1257 | - |
|
| 1258 | - |
|
| 1259 | - $image_array = array(); |
|
| 1260 | - $post_meta = array(); |
|
| 1261 | - |
|
| 1262 | - /// Restaurants ////post start 1// |
|
| 1263 | - $image_array[] = "$dummy_image_url/restaurants1.jpg"; |
|
| 1264 | - $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1265 | - $image_array[] = "$dummy_image_url/restaurants3.jpg"; |
|
| 1266 | - $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1267 | - $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1268 | - $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1269 | - $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1270 | - $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1271 | - $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1272 | - $image_array[] = "$dummy_image_url/restaurants10.jpg"; |
|
| 1273 | - $image_array[] = "$dummy_image_url/restaurants11.jpg"; |
|
| 1274 | - |
|
| 1275 | - $post_info[] = array( |
|
| 1276 | - "listing_type" => $post_type, |
|
| 1277 | - "post_title" => 'Village Whiskey', |
|
| 1278 | - "post_desc" => ' |
|
| 1239 | + "post_images" => $image_array, |
|
| 1240 | + "post_category" => array($post_type.'category' => array('Hotels', 'Feature')), |
|
| 1241 | + "post_tags" => array(''), |
|
| 1242 | + "geodir_video" => '', |
|
| 1243 | + "geodir_timing" => 'Daily : 10 am to 11 pm', |
|
| 1244 | + "geodir_contact" => '(243) 222-12344', |
|
| 1245 | + "geodir_email" => '[email protected]', |
|
| 1246 | + "geodir_website" => 'http://www.chestnuthillhotel.com/', |
|
| 1247 | + "geodir_twitter" => 'http://twitter.com/chestnuthillhotel', |
|
| 1248 | + "geodir_facebook" => 'http://facebook.com/chestnuthillhotel', |
|
| 1249 | + "post_dummy" => '1' |
|
| 1250 | + ); |
|
| 1251 | + |
|
| 1252 | + ////post end/// |
|
| 1253 | + /// Hotels ////post start 10/// |
|
| 1254 | + |
|
| 1255 | + break; |
|
| 1256 | + case 21: |
|
| 1257 | + |
|
| 1258 | + |
|
| 1259 | + $image_array = array(); |
|
| 1260 | + $post_meta = array(); |
|
| 1261 | + |
|
| 1262 | + /// Restaurants ////post start 1// |
|
| 1263 | + $image_array[] = "$dummy_image_url/restaurants1.jpg"; |
|
| 1264 | + $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1265 | + $image_array[] = "$dummy_image_url/restaurants3.jpg"; |
|
| 1266 | + $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1267 | + $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1268 | + $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1269 | + $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1270 | + $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1271 | + $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1272 | + $image_array[] = "$dummy_image_url/restaurants10.jpg"; |
|
| 1273 | + $image_array[] = "$dummy_image_url/restaurants11.jpg"; |
|
| 1274 | + |
|
| 1275 | + $post_info[] = array( |
|
| 1276 | + "listing_type" => $post_type, |
|
| 1277 | + "post_title" => 'Village Whiskey', |
|
| 1278 | + "post_desc" => ' |
|
| 1279 | 1279 | |
| 1280 | 1280 | |
| 1281 | 1281 | Located in a Rittenhouse Square space evoking the free-wheeling spirit of a speakeasy, Village Whiskey is prolific Chef Jose Garces’ intimate, 30-seat tribute to the time-honored liquor. |
@@ -1301,45 +1301,45 @@ discard block |
||
| 1301 | 1301 | |
| 1302 | 1302 | During the warmer months, diners can sit at large, wooden tables placed along Sansom Street for whiskey alfresco. |
| 1303 | 1303 | ', |
| 1304 | - "post_images" => $image_array, |
|
| 1305 | - "post_category" => array($post_type.'category' => array('Restaurants', 'Feature')), |
|
| 1306 | - "post_tags" => array('Sample Tag1'), |
|
| 1307 | - "geodir_video" => '', |
|
| 1308 | - "geodir_timing" => 'Daily : 10 am to 11 pm', |
|
| 1309 | - "geodir_contact" => '(243) 222-12344', |
|
| 1310 | - "geodir_email" => '[email protected]', |
|
| 1311 | - "geodir_website" => 'http://www.villagewhiskey.com/', |
|
| 1312 | - "geodir_twitter" => 'http://twitter.com/villagewhiskey', |
|
| 1313 | - "geodir_facebook" => 'http://facebook.com/villagewhiskey', |
|
| 1314 | - "post_dummy" => '1' |
|
| 1315 | - ); |
|
| 1316 | - |
|
| 1317 | - ////post end/// |
|
| 1318 | - /// Restaurants ////post start 1/// |
|
| 1319 | - break; |
|
| 1320 | - case 22: |
|
| 1321 | - |
|
| 1322 | - |
|
| 1323 | - $image_array = array(); |
|
| 1324 | - $post_meta = array(); |
|
| 1325 | - |
|
| 1326 | - /// Restaurants ////post start 2// |
|
| 1327 | - $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1328 | - $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1329 | - $image_array[] = "$dummy_image_url/restaurants3.jpg"; |
|
| 1330 | - $image_array[] = "$dummy_image_url/restaurants1.jpg"; |
|
| 1331 | - $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1332 | - $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1333 | - $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1334 | - $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1335 | - $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1336 | - $image_array[] = "$dummy_image_url/restaurants10.jpg"; |
|
| 1337 | - $image_array[] = "$dummy_image_url/restaurants11.jpg"; |
|
| 1338 | - |
|
| 1339 | - $post_info[] = array( |
|
| 1340 | - "listing_type" => $post_type, |
|
| 1341 | - "post_title" => 'Zavino Pizzeria and Wine Bar', |
|
| 1342 | - "post_desc" => ' |
|
| 1304 | + "post_images" => $image_array, |
|
| 1305 | + "post_category" => array($post_type.'category' => array('Restaurants', 'Feature')), |
|
| 1306 | + "post_tags" => array('Sample Tag1'), |
|
| 1307 | + "geodir_video" => '', |
|
| 1308 | + "geodir_timing" => 'Daily : 10 am to 11 pm', |
|
| 1309 | + "geodir_contact" => '(243) 222-12344', |
|
| 1310 | + "geodir_email" => '[email protected]', |
|
| 1311 | + "geodir_website" => 'http://www.villagewhiskey.com/', |
|
| 1312 | + "geodir_twitter" => 'http://twitter.com/villagewhiskey', |
|
| 1313 | + "geodir_facebook" => 'http://facebook.com/villagewhiskey', |
|
| 1314 | + "post_dummy" => '1' |
|
| 1315 | + ); |
|
| 1316 | + |
|
| 1317 | + ////post end/// |
|
| 1318 | + /// Restaurants ////post start 1/// |
|
| 1319 | + break; |
|
| 1320 | + case 22: |
|
| 1321 | + |
|
| 1322 | + |
|
| 1323 | + $image_array = array(); |
|
| 1324 | + $post_meta = array(); |
|
| 1325 | + |
|
| 1326 | + /// Restaurants ////post start 2// |
|
| 1327 | + $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1328 | + $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1329 | + $image_array[] = "$dummy_image_url/restaurants3.jpg"; |
|
| 1330 | + $image_array[] = "$dummy_image_url/restaurants1.jpg"; |
|
| 1331 | + $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1332 | + $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1333 | + $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1334 | + $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1335 | + $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1336 | + $image_array[] = "$dummy_image_url/restaurants10.jpg"; |
|
| 1337 | + $image_array[] = "$dummy_image_url/restaurants11.jpg"; |
|
| 1338 | + |
|
| 1339 | + $post_info[] = array( |
|
| 1340 | + "listing_type" => $post_type, |
|
| 1341 | + "post_title" => 'Zavino Pizzeria and Wine Bar', |
|
| 1342 | + "post_desc" => ' |
|
| 1343 | 1343 | Zavino is a new pizzeria and wine bar located at the epicenter of the city´s trendy Midtown Village neighborhood. The restaurant features a seasonal menu, classic cocktails, an approachable selection of wine and beer and some of the best late night menu offerings in the area. |
| 1344 | 1344 | |
| 1345 | 1345 | The restaurant´s interior looks great - it has a simple, rustic feel with an original brick wall, large picture windows, a long bar and a large outdoor cafe coming this spring. |
@@ -1358,46 +1358,46 @@ discard block |
||
| 1358 | 1358 | |
| 1359 | 1359 | Pizzas vary in price from $8 to $12. |
| 1360 | 1360 | ', |
| 1361 | - "post_images" => $image_array, |
|
| 1362 | - "post_category" => array($post_type.'category' => array('Restaurants')), |
|
| 1363 | - "post_tags" => array('Sample Tag1'), |
|
| 1364 | - "geodir_video" => '', |
|
| 1365 | - "geodir_timing" => 'Daily : 10 am to 11 pm', |
|
| 1366 | - "geodir_contact" => '(243) 222-12344', |
|
| 1367 | - "geodir_email" => '[email protected]', |
|
| 1368 | - "geodir_website" => 'http://www.villagewhiskey.com/', |
|
| 1369 | - "geodir_twitter" => 'http://twitter.com/villagewhiskey', |
|
| 1370 | - "geodir_facebook" => 'http://facebook.com/villagewhiskey', |
|
| 1371 | - "post_dummy" => '1' |
|
| 1372 | - ); |
|
| 1373 | - |
|
| 1374 | - ////post end/// |
|
| 1375 | - /// Restaurants ////post start 2/// |
|
| 1376 | - |
|
| 1377 | - break; |
|
| 1378 | - case 23: |
|
| 1379 | - |
|
| 1380 | - |
|
| 1381 | - $image_array = array(); |
|
| 1382 | - $post_meta = array(); |
|
| 1383 | - |
|
| 1384 | - /// Restaurants ////post start 3// |
|
| 1385 | - $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1386 | - $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1387 | - $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1388 | - $image_array[] = "$dummy_image_url/restaurants1.jpg"; |
|
| 1389 | - $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1390 | - $image_array[] = "$dummy_image_url/restaurants3.jpg"; |
|
| 1391 | - $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1392 | - $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1393 | - $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1394 | - $image_array[] = "$dummy_image_url/restaurants10.jpg"; |
|
| 1395 | - $image_array[] = "$dummy_image_url/restaurants11.jpg"; |
|
| 1396 | - |
|
| 1397 | - $post_info[] = array( |
|
| 1398 | - "listing_type" => $post_type, |
|
| 1399 | - "post_title" => 'Parc', |
|
| 1400 | - "post_desc" => ' |
|
| 1361 | + "post_images" => $image_array, |
|
| 1362 | + "post_category" => array($post_type.'category' => array('Restaurants')), |
|
| 1363 | + "post_tags" => array('Sample Tag1'), |
|
| 1364 | + "geodir_video" => '', |
|
| 1365 | + "geodir_timing" => 'Daily : 10 am to 11 pm', |
|
| 1366 | + "geodir_contact" => '(243) 222-12344', |
|
| 1367 | + "geodir_email" => '[email protected]', |
|
| 1368 | + "geodir_website" => 'http://www.villagewhiskey.com/', |
|
| 1369 | + "geodir_twitter" => 'http://twitter.com/villagewhiskey', |
|
| 1370 | + "geodir_facebook" => 'http://facebook.com/villagewhiskey', |
|
| 1371 | + "post_dummy" => '1' |
|
| 1372 | + ); |
|
| 1373 | + |
|
| 1374 | + ////post end/// |
|
| 1375 | + /// Restaurants ////post start 2/// |
|
| 1376 | + |
|
| 1377 | + break; |
|
| 1378 | + case 23: |
|
| 1379 | + |
|
| 1380 | + |
|
| 1381 | + $image_array = array(); |
|
| 1382 | + $post_meta = array(); |
|
| 1383 | + |
|
| 1384 | + /// Restaurants ////post start 3// |
|
| 1385 | + $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1386 | + $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1387 | + $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1388 | + $image_array[] = "$dummy_image_url/restaurants1.jpg"; |
|
| 1389 | + $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1390 | + $image_array[] = "$dummy_image_url/restaurants3.jpg"; |
|
| 1391 | + $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1392 | + $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1393 | + $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1394 | + $image_array[] = "$dummy_image_url/restaurants10.jpg"; |
|
| 1395 | + $image_array[] = "$dummy_image_url/restaurants11.jpg"; |
|
| 1396 | + |
|
| 1397 | + $post_info[] = array( |
|
| 1398 | + "listing_type" => $post_type, |
|
| 1399 | + "post_title" => 'Parc', |
|
| 1400 | + "post_desc" => ' |
|
| 1401 | 1401 | If you love Paris in the springtime, Parc is a veritable grand cru. |
| 1402 | 1402 | |
| 1403 | 1403 | With Parc, famed restaurateur Stephen Starr brings a certain je ne sais quoi to Rittenhouse Square. Parc offers an authentic French bistro experience, fully equipped with a chic Parisian ambiance and gorgeous sidewalk seating overlooking the Square. |
@@ -1425,45 +1425,45 @@ discard block |
||
| 1425 | 1425 | |
| 1426 | 1426 | To put it simply, Parc is nothing short of an authentic Parisian dining experience - right here in the heart of Rittenhouse Square. |
| 1427 | 1427 | ', |
| 1428 | - "post_images" => $image_array, |
|
| 1429 | - "post_category" => array($post_type.'category' => array('Restaurants')), |
|
| 1430 | - "post_tags" => array('Sample Tag1'), |
|
| 1431 | - "geodir_video" => '', |
|
| 1432 | - "geodir_timing" => 'Daily : 10 am to 12 pm', |
|
| 1433 | - "geodir_contact" => '(143) 222-12344', |
|
| 1434 | - "geodir_email" => '[email protected]', |
|
| 1435 | - "geodir_website" => 'http://www.parc-restaurant.com/', |
|
| 1436 | - "geodir_twitter" => 'http://twitter.com/parc-restaurant', |
|
| 1437 | - "geodir_facebook" => 'http://facebook.com/parc-restaurant', |
|
| 1438 | - "post_dummy" => '1' |
|
| 1439 | - ); |
|
| 1440 | - |
|
| 1441 | - ////post end/// |
|
| 1442 | - /// Restaurants ////post start 3/// |
|
| 1443 | - break; |
|
| 1444 | - case 24: |
|
| 1445 | - |
|
| 1446 | - |
|
| 1447 | - $image_array = array(); |
|
| 1448 | - $post_meta = array(); |
|
| 1449 | - |
|
| 1450 | - /// Restaurants ////post start 4// |
|
| 1451 | - $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1452 | - $image_array[] = "$dummy_image_url/restaurants10.jpg"; |
|
| 1453 | - $image_array[] = "$dummy_image_url/restaurants3.jpg"; |
|
| 1454 | - $image_array[] = "$dummy_image_url/restaurants1.jpg"; |
|
| 1455 | - $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1456 | - $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1457 | - $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1458 | - $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1459 | - $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1460 | - $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1461 | - $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1462 | - |
|
| 1463 | - $post_info[] = array( |
|
| 1464 | - "listing_type" => $post_type, |
|
| 1465 | - "post_title" => 'Percy Street Barbecue', |
|
| 1466 | - "post_desc" => ' |
|
| 1428 | + "post_images" => $image_array, |
|
| 1429 | + "post_category" => array($post_type.'category' => array('Restaurants')), |
|
| 1430 | + "post_tags" => array('Sample Tag1'), |
|
| 1431 | + "geodir_video" => '', |
|
| 1432 | + "geodir_timing" => 'Daily : 10 am to 12 pm', |
|
| 1433 | + "geodir_contact" => '(143) 222-12344', |
|
| 1434 | + "geodir_email" => '[email protected]', |
|
| 1435 | + "geodir_website" => 'http://www.parc-restaurant.com/', |
|
| 1436 | + "geodir_twitter" => 'http://twitter.com/parc-restaurant', |
|
| 1437 | + "geodir_facebook" => 'http://facebook.com/parc-restaurant', |
|
| 1438 | + "post_dummy" => '1' |
|
| 1439 | + ); |
|
| 1440 | + |
|
| 1441 | + ////post end/// |
|
| 1442 | + /// Restaurants ////post start 3/// |
|
| 1443 | + break; |
|
| 1444 | + case 24: |
|
| 1445 | + |
|
| 1446 | + |
|
| 1447 | + $image_array = array(); |
|
| 1448 | + $post_meta = array(); |
|
| 1449 | + |
|
| 1450 | + /// Restaurants ////post start 4// |
|
| 1451 | + $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1452 | + $image_array[] = "$dummy_image_url/restaurants10.jpg"; |
|
| 1453 | + $image_array[] = "$dummy_image_url/restaurants3.jpg"; |
|
| 1454 | + $image_array[] = "$dummy_image_url/restaurants1.jpg"; |
|
| 1455 | + $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1456 | + $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1457 | + $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1458 | + $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1459 | + $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1460 | + $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1461 | + $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1462 | + |
|
| 1463 | + $post_info[] = array( |
|
| 1464 | + "listing_type" => $post_type, |
|
| 1465 | + "post_title" => 'Percy Street Barbecue', |
|
| 1466 | + "post_desc" => ' |
|
| 1467 | 1467 | Percy Street Barbecue sees the South Street debut of restaurateurs Steven Cook and Michael Solomonov (Zahav, Xochitl). |
| 1468 | 1468 | |
| 1469 | 1469 | Serving a straightforward selection of slowly smoked meats and homey side dishes alongside craft beers and tasty cocktails, Percy Street is an ideal venue for Chef Erin OShea much-lauded Southern cooking, and is on its way to become the city top spot for barbecue. |
@@ -1489,46 +1489,46 @@ discard block |
||
| 1489 | 1489 | |
| 1490 | 1490 | Seating in the form of repurposed church pews, and bare light bulbs overhead in the dining room lend to the restaurant Texas-esque aesthetic. |
| 1491 | 1491 | ', |
| 1492 | - "post_images" => $image_array, |
|
| 1493 | - "post_category" => array($post_type.'category' => array('Restaurants', 'Feature')), |
|
| 1494 | - "post_tags" => array('Sample Tag1'), |
|
| 1495 | - "geodir_video" => '', |
|
| 1496 | - "geodir_timing" => 'Percy Street is closed on Mondays. The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.', |
|
| 1497 | - "geodir_contact" => '(143) 222-12344', |
|
| 1498 | - "geodir_email" => '[email protected]', |
|
| 1499 | - "geodir_website" => 'http://www.percystreet.com/', |
|
| 1500 | - "geodir_twitter" => 'http://twitter.com/percystreet', |
|
| 1501 | - "geodir_facebook" => 'http://facebook.com/percystreet', |
|
| 1502 | - "post_dummy" => '1' |
|
| 1503 | - ); |
|
| 1504 | - |
|
| 1505 | - ////post end/// |
|
| 1506 | - /// Restaurants ////post start 4/// |
|
| 1507 | - |
|
| 1508 | - break; |
|
| 1509 | - case 25: |
|
| 1510 | - |
|
| 1511 | - |
|
| 1512 | - $image_array = array(); |
|
| 1513 | - $post_meta = array(); |
|
| 1514 | - |
|
| 1515 | - /// Restaurants ////post start 5// |
|
| 1516 | - $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1517 | - $image_array[] = "$dummy_image_url/restaurants10.jpg"; |
|
| 1518 | - $image_array[] = "$dummy_image_url/restaurants3.jpg"; |
|
| 1519 | - $image_array[] = "$dummy_image_url/restaurants1.jpg"; |
|
| 1520 | - $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1521 | - $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1522 | - $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1523 | - $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1524 | - $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1525 | - $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1526 | - $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1527 | - |
|
| 1528 | - $post_info[] = array( |
|
| 1529 | - "listing_type" => $post_type, |
|
| 1530 | - "post_title" => 'The Fountain Restaurant', |
|
| 1531 | - "post_desc" => ' |
|
| 1492 | + "post_images" => $image_array, |
|
| 1493 | + "post_category" => array($post_type.'category' => array('Restaurants', 'Feature')), |
|
| 1494 | + "post_tags" => array('Sample Tag1'), |
|
| 1495 | + "geodir_video" => '', |
|
| 1496 | + "geodir_timing" => 'Percy Street is closed on Mondays. The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.', |
|
| 1497 | + "geodir_contact" => '(143) 222-12344', |
|
| 1498 | + "geodir_email" => '[email protected]', |
|
| 1499 | + "geodir_website" => 'http://www.percystreet.com/', |
|
| 1500 | + "geodir_twitter" => 'http://twitter.com/percystreet', |
|
| 1501 | + "geodir_facebook" => 'http://facebook.com/percystreet', |
|
| 1502 | + "post_dummy" => '1' |
|
| 1503 | + ); |
|
| 1504 | + |
|
| 1505 | + ////post end/// |
|
| 1506 | + /// Restaurants ////post start 4/// |
|
| 1507 | + |
|
| 1508 | + break; |
|
| 1509 | + case 25: |
|
| 1510 | + |
|
| 1511 | + |
|
| 1512 | + $image_array = array(); |
|
| 1513 | + $post_meta = array(); |
|
| 1514 | + |
|
| 1515 | + /// Restaurants ////post start 5// |
|
| 1516 | + $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1517 | + $image_array[] = "$dummy_image_url/restaurants10.jpg"; |
|
| 1518 | + $image_array[] = "$dummy_image_url/restaurants3.jpg"; |
|
| 1519 | + $image_array[] = "$dummy_image_url/restaurants1.jpg"; |
|
| 1520 | + $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1521 | + $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1522 | + $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1523 | + $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1524 | + $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1525 | + $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1526 | + $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1527 | + |
|
| 1528 | + $post_info[] = array( |
|
| 1529 | + "listing_type" => $post_type, |
|
| 1530 | + "post_title" => 'The Fountain Restaurant', |
|
| 1531 | + "post_desc" => ' |
|
| 1532 | 1532 | The Fountain Restaurant in the Four Seasons Hotel Philadelphia has received seemingly every type of accolade there is, from top honors in Gourmet magazine to Forbes Travel Guide´s 2010 Five Star award to a perfect Five Diamond rating from AAA. It´s been a Philadelphia favorite for special occasion meals for decades. |
| 1533 | 1533 | |
| 1534 | 1534 | Additionally rated as the best restaurant in Philadelphia by Zagat´s, the Fountain Restaurant overlooks the majestic Swann Memorial Fountain sculpture by Alexander Stirling Calder in the center of Logan Square. You´ll also enjoy sweeping views of the grand Benjamin Franklin Parkway and its gorgeous Beaux Arts architecture. |
@@ -1538,45 +1538,45 @@ discard block |
||
| 1538 | 1538 | You can order a la carte or select the prix fix option to enjoy the “spontaneous tastes” menu which gives the chef control of a few courses. The menu changes regularly, but you can expect to see globaly influenced items like Pan-fried Veal Sweetbreads, Braised Dover Sole Roulade, Sautéed Venison Medallions and Roasted Australian Lamb Saddle. |
| 1539 | 1539 | |
| 1540 | 1540 | ', |
| 1541 | - "post_images" => $image_array, |
|
| 1542 | - "post_category" => array($post_type.'category' => array('Restaurants')), |
|
| 1543 | - "post_tags" => array('food'), |
|
| 1544 | - "geodir_video" => '', |
|
| 1545 | - "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.', |
|
| 1546 | - "geodir_contact" => '(103) 100-12344', |
|
| 1547 | - "geodir_email" => '[email protected]', |
|
| 1548 | - "geodir_website" => 'http://www.fourseasons.com/philadelphia/dining', |
|
| 1549 | - "geodir_twitter" => 'http://twitter.com/fourseasons', |
|
| 1550 | - "geodir_facebook" => 'http://facebook.com/fourseasons', |
|
| 1551 | - "post_dummy" => '1' |
|
| 1552 | - ); |
|
| 1553 | - |
|
| 1554 | - ////post end/// |
|
| 1555 | - /// Restaurants ////post start 5/// |
|
| 1556 | - break; |
|
| 1557 | - case 26: |
|
| 1558 | - |
|
| 1559 | - |
|
| 1560 | - $image_array = array(); |
|
| 1561 | - $post_meta = array(); |
|
| 1562 | - |
|
| 1563 | - /// Restaurants ////post start 6// |
|
| 1564 | - $image_array[] = "$dummy_image_url/restaurants11.jpg"; |
|
| 1565 | - $image_array[] = "$dummy_image_url/restaurants10.jpg"; |
|
| 1566 | - $image_array[] = "$dummy_image_url/restaurants3.jpg"; |
|
| 1567 | - $image_array[] = "$dummy_image_url/restaurants1.jpg"; |
|
| 1568 | - $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1569 | - $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1570 | - $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1571 | - $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1572 | - $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1573 | - $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1574 | - $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1575 | - |
|
| 1576 | - $post_info[] = array( |
|
| 1577 | - "listing_type" => $post_type, |
|
| 1578 | - "post_title" => 'Lacroix at The Rittenhouse', |
|
| 1579 | - "post_desc" => ' |
|
| 1541 | + "post_images" => $image_array, |
|
| 1542 | + "post_category" => array($post_type.'category' => array('Restaurants')), |
|
| 1543 | + "post_tags" => array('food'), |
|
| 1544 | + "geodir_video" => '', |
|
| 1545 | + "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.', |
|
| 1546 | + "geodir_contact" => '(103) 100-12344', |
|
| 1547 | + "geodir_email" => '[email protected]', |
|
| 1548 | + "geodir_website" => 'http://www.fourseasons.com/philadelphia/dining', |
|
| 1549 | + "geodir_twitter" => 'http://twitter.com/fourseasons', |
|
| 1550 | + "geodir_facebook" => 'http://facebook.com/fourseasons', |
|
| 1551 | + "post_dummy" => '1' |
|
| 1552 | + ); |
|
| 1553 | + |
|
| 1554 | + ////post end/// |
|
| 1555 | + /// Restaurants ////post start 5/// |
|
| 1556 | + break; |
|
| 1557 | + case 26: |
|
| 1558 | + |
|
| 1559 | + |
|
| 1560 | + $image_array = array(); |
|
| 1561 | + $post_meta = array(); |
|
| 1562 | + |
|
| 1563 | + /// Restaurants ////post start 6// |
|
| 1564 | + $image_array[] = "$dummy_image_url/restaurants11.jpg"; |
|
| 1565 | + $image_array[] = "$dummy_image_url/restaurants10.jpg"; |
|
| 1566 | + $image_array[] = "$dummy_image_url/restaurants3.jpg"; |
|
| 1567 | + $image_array[] = "$dummy_image_url/restaurants1.jpg"; |
|
| 1568 | + $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1569 | + $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1570 | + $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1571 | + $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1572 | + $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1573 | + $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1574 | + $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1575 | + |
|
| 1576 | + $post_info[] = array( |
|
| 1577 | + "listing_type" => $post_type, |
|
| 1578 | + "post_title" => 'Lacroix at The Rittenhouse', |
|
| 1579 | + "post_desc" => ' |
|
| 1580 | 1580 | A deluxe hotel like The Rittenhouse deserves a deluxe restaurant, a fitting description for Lacroix, named “Restaurant of the Year” in 2003 by Esquire magazine. |
| 1581 | 1581 | |
| 1582 | 1582 | Located on the second floor of the Rittenhouse Hotel, Lacroix features elegant décor and a broad view of Rittenhouse Square, which combine to make the ambiance at Lacroix as enjoyable as the meal itself. |
@@ -1587,46 +1587,46 @@ discard block |
||
| 1587 | 1587 | |
| 1588 | 1588 | Sunday Brunch at Lacroix - which features such delectable dishes as baby lamb chops with garlic crust and banyuls sauce, niman ranch smoked bacon, quail eggs with artichoke, golden beet and shiitakes, and french baguette toast with apple, raspberry and rosemary jam - is also highly recommended. |
| 1589 | 1589 | ', |
| 1590 | - "post_images" => $image_array, |
|
| 1591 | - "post_category" => array($post_type.'category' => array('Restaurants')), |
|
| 1592 | - "post_tags" => array('food'), |
|
| 1593 | - "geodir_video" => '', |
|
| 1594 | - "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.', |
|
| 1595 | - "geodir_contact" => '(113) 121-12344', |
|
| 1596 | - "geodir_email" => '[email protected]', |
|
| 1597 | - "geodir_website" => 'http://www.rittenhousehotel.com/lacroix.cfm', |
|
| 1598 | - "geodir_twitter" => 'http://twitter.com/rittenhousehotel', |
|
| 1599 | - "geodir_facebook" => 'http://facebook.com/rittenhousehotel', |
|
| 1600 | - "post_dummy" => '1' |
|
| 1601 | - ); |
|
| 1602 | - |
|
| 1603 | - ////post end/// |
|
| 1604 | - /// Restaurants ////post start 6/// |
|
| 1605 | - |
|
| 1606 | - break; |
|
| 1607 | - case 27: |
|
| 1608 | - |
|
| 1609 | - |
|
| 1610 | - $image_array = array(); |
|
| 1611 | - $post_meta = array(); |
|
| 1612 | - |
|
| 1613 | - /// Restaurants ////post start 7// |
|
| 1614 | - $image_array[] = "$dummy_image_url/restaurants12.jpg"; |
|
| 1615 | - $image_array[] = "$dummy_image_url/restaurants13.jpg"; |
|
| 1616 | - $image_array[] = "$dummy_image_url/restaurants14.jpg"; |
|
| 1617 | - $image_array[] = "$dummy_image_url/restaurants15.jpg"; |
|
| 1618 | - $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1619 | - $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1620 | - $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1621 | - $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1622 | - $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1623 | - $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1624 | - $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1625 | - |
|
| 1626 | - $post_info[] = array( |
|
| 1627 | - "listing_type" => $post_type, |
|
| 1628 | - "post_title" => 'Lacroix at The Rittenhouse', |
|
| 1629 | - "post_desc" => ' |
|
| 1590 | + "post_images" => $image_array, |
|
| 1591 | + "post_category" => array($post_type.'category' => array('Restaurants')), |
|
| 1592 | + "post_tags" => array('food'), |
|
| 1593 | + "geodir_video" => '', |
|
| 1594 | + "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.', |
|
| 1595 | + "geodir_contact" => '(113) 121-12344', |
|
| 1596 | + "geodir_email" => '[email protected]', |
|
| 1597 | + "geodir_website" => 'http://www.rittenhousehotel.com/lacroix.cfm', |
|
| 1598 | + "geodir_twitter" => 'http://twitter.com/rittenhousehotel', |
|
| 1599 | + "geodir_facebook" => 'http://facebook.com/rittenhousehotel', |
|
| 1600 | + "post_dummy" => '1' |
|
| 1601 | + ); |
|
| 1602 | + |
|
| 1603 | + ////post end/// |
|
| 1604 | + /// Restaurants ////post start 6/// |
|
| 1605 | + |
|
| 1606 | + break; |
|
| 1607 | + case 27: |
|
| 1608 | + |
|
| 1609 | + |
|
| 1610 | + $image_array = array(); |
|
| 1611 | + $post_meta = array(); |
|
| 1612 | + |
|
| 1613 | + /// Restaurants ////post start 7// |
|
| 1614 | + $image_array[] = "$dummy_image_url/restaurants12.jpg"; |
|
| 1615 | + $image_array[] = "$dummy_image_url/restaurants13.jpg"; |
|
| 1616 | + $image_array[] = "$dummy_image_url/restaurants14.jpg"; |
|
| 1617 | + $image_array[] = "$dummy_image_url/restaurants15.jpg"; |
|
| 1618 | + $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1619 | + $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1620 | + $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1621 | + $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1622 | + $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1623 | + $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1624 | + $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1625 | + |
|
| 1626 | + $post_info[] = array( |
|
| 1627 | + "listing_type" => $post_type, |
|
| 1628 | + "post_title" => 'Lacroix at The Rittenhouse', |
|
| 1629 | + "post_desc" => ' |
|
| 1630 | 1630 | A deluxe hotel like The Rittenhouse deserves a deluxe restaurant, a fitting description for Lacroix, named “Restaurant of the Year” in 2003 by Esquire magazine. |
| 1631 | 1631 | |
| 1632 | 1632 | Located on the second floor of the Rittenhouse Hotel, Lacroix features elegant décor and a broad view of Rittenhouse Square, which combine to make the ambiance at Lacroix as enjoyable as the meal itself. |
@@ -1637,45 +1637,45 @@ discard block |
||
| 1637 | 1637 | |
| 1638 | 1638 | Sunday Brunch at Lacroix - which features such delectable dishes as baby lamb chops with garlic crust and banyuls sauce, niman ranch smoked bacon, quail eggs with artichoke, golden beet and shiitakes, and french baguette toast with apple, raspberry and rosemary jam - is also highly recommended. |
| 1639 | 1639 | ', |
| 1640 | - "post_images" => $image_array, |
|
| 1641 | - "post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife')), |
|
| 1642 | - "post_tags" => array('food'), |
|
| 1643 | - "geodir_video" => '', |
|
| 1644 | - "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.', |
|
| 1645 | - "geodir_contact" => '(113) 121-12344', |
|
| 1646 | - "geodir_email" => '[email protected]', |
|
| 1647 | - "geodir_website" => 'http://www.zamarestaurant.com/', |
|
| 1648 | - "geodir_twitter" => 'http://twitter.com/zamarestaurant', |
|
| 1649 | - "geodir_facebook" => 'http://facebook.com/zamarestaurant', |
|
| 1650 | - "post_dummy" => '1' |
|
| 1651 | - ); |
|
| 1652 | - |
|
| 1653 | - ////post end/// |
|
| 1654 | - /// Restaurants ////post start 7/// |
|
| 1655 | - |
|
| 1656 | - break; |
|
| 1657 | - case 28: |
|
| 1658 | - |
|
| 1659 | - $image_array = array(); |
|
| 1660 | - $post_meta = array(); |
|
| 1661 | - |
|
| 1662 | - /// Restaurants ////post start 8// |
|
| 1663 | - $image_array[] = "$dummy_image_url/restaurants16.jpg"; |
|
| 1664 | - $image_array[] = "$dummy_image_url/restaurants17.jpg"; |
|
| 1665 | - $image_array[] = "$dummy_image_url/restaurants18.jpg"; |
|
| 1666 | - $image_array[] = "$dummy_image_url/restaurants19.jpg"; |
|
| 1667 | - $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1668 | - $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1669 | - $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1670 | - $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1671 | - $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1672 | - $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1673 | - $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1674 | - |
|
| 1675 | - $post_info[] = array( |
|
| 1676 | - "listing_type" => $post_type, |
|
| 1677 | - "post_title" => 'Sampan', |
|
| 1678 | - "post_desc" => ' |
|
| 1640 | + "post_images" => $image_array, |
|
| 1641 | + "post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife')), |
|
| 1642 | + "post_tags" => array('food'), |
|
| 1643 | + "geodir_video" => '', |
|
| 1644 | + "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.', |
|
| 1645 | + "geodir_contact" => '(113) 121-12344', |
|
| 1646 | + "geodir_email" => '[email protected]', |
|
| 1647 | + "geodir_website" => 'http://www.zamarestaurant.com/', |
|
| 1648 | + "geodir_twitter" => 'http://twitter.com/zamarestaurant', |
|
| 1649 | + "geodir_facebook" => 'http://facebook.com/zamarestaurant', |
|
| 1650 | + "post_dummy" => '1' |
|
| 1651 | + ); |
|
| 1652 | + |
|
| 1653 | + ////post end/// |
|
| 1654 | + /// Restaurants ////post start 7/// |
|
| 1655 | + |
|
| 1656 | + break; |
|
| 1657 | + case 28: |
|
| 1658 | + |
|
| 1659 | + $image_array = array(); |
|
| 1660 | + $post_meta = array(); |
|
| 1661 | + |
|
| 1662 | + /// Restaurants ////post start 8// |
|
| 1663 | + $image_array[] = "$dummy_image_url/restaurants16.jpg"; |
|
| 1664 | + $image_array[] = "$dummy_image_url/restaurants17.jpg"; |
|
| 1665 | + $image_array[] = "$dummy_image_url/restaurants18.jpg"; |
|
| 1666 | + $image_array[] = "$dummy_image_url/restaurants19.jpg"; |
|
| 1667 | + $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1668 | + $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1669 | + $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1670 | + $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1671 | + $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1672 | + $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1673 | + $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1674 | + |
|
| 1675 | + $post_info[] = array( |
|
| 1676 | + "listing_type" => $post_type, |
|
| 1677 | + "post_title" => 'Sampan', |
|
| 1678 | + "post_desc" => ' |
|
| 1679 | 1679 | Chef and charismatic television star Michael Schulson returns to Philadelphia with the opening of Sampan, a modern Asian restaurant where he serves the acclaimed cuisine that has made him one of the country´s highly sought-after culinary talents. |
| 1680 | 1680 | |
| 1681 | 1681 | Schulson returns to Philadelphia after having opened Buddakan in New York City for Stephen Starr and Izakaya at the Borgata in Atlantic City and then having gone on to star in Style network´s popular series Pantry Raid and TLC Ultimate Cake Off. |
@@ -1694,45 +1694,45 @@ discard block |
||
| 1694 | 1694 | |
| 1695 | 1695 | Prices range from $5 to $19. |
| 1696 | 1696 | ', |
| 1697 | - "post_images" => $image_array, |
|
| 1698 | - "post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife')), |
|
| 1699 | - "post_tags" => array('restaurant'), |
|
| 1700 | - "geodir_video" => '', |
|
| 1701 | - "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.', |
|
| 1702 | - "geodir_contact" => '(000) 111-2222', |
|
| 1703 | - "geodir_email" => '[email protected]', |
|
| 1704 | - "geodir_website" => 'http://www.sampanphilly.com/', |
|
| 1705 | - "geodir_twitter" => 'http://twitter.com/sampanphilly', |
|
| 1706 | - "geodir_facebook" => 'http://facebook.com/sampanphilly', |
|
| 1707 | - "post_dummy" => '1' |
|
| 1708 | - ); |
|
| 1709 | - |
|
| 1710 | - ////post end/// |
|
| 1711 | - /// Restaurants ////post start 8/// |
|
| 1712 | - |
|
| 1713 | - break; |
|
| 1714 | - case 29: |
|
| 1715 | - |
|
| 1716 | - $image_array = array(); |
|
| 1717 | - $post_meta = array(); |
|
| 1718 | - |
|
| 1719 | - /// Restaurants ////post start 9// |
|
| 1720 | - $image_array[] = "$dummy_image_url/restaurants17.jpg"; |
|
| 1721 | - $image_array[] = "$dummy_image_url/restaurants16.jpg"; |
|
| 1722 | - $image_array[] = "$dummy_image_url/restaurants18.jpg"; |
|
| 1723 | - $image_array[] = "$dummy_image_url/restaurants19.jpg"; |
|
| 1724 | - $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1725 | - $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1726 | - $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1727 | - $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1728 | - $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1729 | - $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1730 | - $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1731 | - |
|
| 1732 | - $post_info[] = array( |
|
| 1733 | - "listing_type" => $post_type, |
|
| 1734 | - "post_title" => 'Morimoto', |
|
| 1735 | - "post_desc" => ' |
|
| 1697 | + "post_images" => $image_array, |
|
| 1698 | + "post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife')), |
|
| 1699 | + "post_tags" => array('restaurant'), |
|
| 1700 | + "geodir_video" => '', |
|
| 1701 | + "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.', |
|
| 1702 | + "geodir_contact" => '(000) 111-2222', |
|
| 1703 | + "geodir_email" => '[email protected]', |
|
| 1704 | + "geodir_website" => 'http://www.sampanphilly.com/', |
|
| 1705 | + "geodir_twitter" => 'http://twitter.com/sampanphilly', |
|
| 1706 | + "geodir_facebook" => 'http://facebook.com/sampanphilly', |
|
| 1707 | + "post_dummy" => '1' |
|
| 1708 | + ); |
|
| 1709 | + |
|
| 1710 | + ////post end/// |
|
| 1711 | + /// Restaurants ////post start 8/// |
|
| 1712 | + |
|
| 1713 | + break; |
|
| 1714 | + case 29: |
|
| 1715 | + |
|
| 1716 | + $image_array = array(); |
|
| 1717 | + $post_meta = array(); |
|
| 1718 | + |
|
| 1719 | + /// Restaurants ////post start 9// |
|
| 1720 | + $image_array[] = "$dummy_image_url/restaurants17.jpg"; |
|
| 1721 | + $image_array[] = "$dummy_image_url/restaurants16.jpg"; |
|
| 1722 | + $image_array[] = "$dummy_image_url/restaurants18.jpg"; |
|
| 1723 | + $image_array[] = "$dummy_image_url/restaurants19.jpg"; |
|
| 1724 | + $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1725 | + $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1726 | + $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1727 | + $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1728 | + $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1729 | + $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1730 | + $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1731 | + |
|
| 1732 | + $post_info[] = array( |
|
| 1733 | + "listing_type" => $post_type, |
|
| 1734 | + "post_title" => 'Morimoto', |
|
| 1735 | + "post_desc" => ' |
|
| 1736 | 1736 | Stephen Starr creative Japanese restaurant has garnered all kinds of national and international attention since opening a few years back. Located a block from Independence Hall on Chestnut Street, Morimoto has an interior - awash in glass and colors - that is both striking and serene in its design. |
| 1737 | 1737 | |
| 1738 | 1738 | The restaurant´s namesake and head chef, Morimoto (of Food Network´s Iron Chef fame), has created a menu offering the very best in contemporary Japanese cusine. While regulars flock here for the exquisitely prepared sushi, Morimoto offers diners a broad spectrum of flavors that delve beyond nigiri and sashimi. |
@@ -1745,45 +1745,45 @@ discard block |
||
| 1745 | 1745 | |
| 1746 | 1746 | The mezzanine level lounge is a great spot to have a pre-meal cocktail while waiting for your table. You can enjoy a sake or try a “Sakura” - a cosmo made with Sake - in the sleek space that overlooks the brilliant restaurant below. |
| 1747 | 1747 | ', |
| 1748 | - "post_images" => $image_array, |
|
| 1749 | - "post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife', 'Feature')), |
|
| 1750 | - "post_tags" => array('America'), |
|
| 1751 | - "geodir_video" => '', |
|
| 1752 | - "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.', |
|
| 1753 | - "geodir_contact" => '(000) 111-2222', |
|
| 1754 | - "geodir_email" => '[email protected]', |
|
| 1755 | - "geodir_website" => 'http://www.morimotorestaurant.com/', |
|
| 1756 | - "geodir_twitter" => 'http://twitter.com/morimotorestaurant', |
|
| 1757 | - "geodir_facebook" => 'http://facebook.com/morimotorestaurant', |
|
| 1758 | - "post_dummy" => '1' |
|
| 1759 | - ); |
|
| 1760 | - |
|
| 1761 | - ////post end/// |
|
| 1762 | - /// Restaurants ////post start 9/// |
|
| 1763 | - break; |
|
| 1764 | - case 30: |
|
| 1765 | - |
|
| 1766 | - |
|
| 1767 | - $image_array = array(); |
|
| 1768 | - $post_meta = array(); |
|
| 1769 | - |
|
| 1770 | - /// Restaurants ////post start 10// |
|
| 1771 | - $image_array[] = "$dummy_image_url/restaurants19.jpg"; |
|
| 1772 | - $image_array[] = "$dummy_image_url/restaurants17.jpg"; |
|
| 1773 | - $image_array[] = "$dummy_image_url/restaurants18.jpg"; |
|
| 1774 | - $image_array[] = "$dummy_image_url/restaurants16.jpg"; |
|
| 1775 | - $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1776 | - $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1777 | - $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1778 | - $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1779 | - $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1780 | - $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1781 | - $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1782 | - |
|
| 1783 | - $post_info[] = array( |
|
| 1784 | - "listing_type" => $post_type, |
|
| 1785 | - "post_title" => 'Buddakan', |
|
| 1786 | - "post_desc" => ' |
|
| 1748 | + "post_images" => $image_array, |
|
| 1749 | + "post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife', 'Feature')), |
|
| 1750 | + "post_tags" => array('America'), |
|
| 1751 | + "geodir_video" => '', |
|
| 1752 | + "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.', |
|
| 1753 | + "geodir_contact" => '(000) 111-2222', |
|
| 1754 | + "geodir_email" => '[email protected]', |
|
| 1755 | + "geodir_website" => 'http://www.morimotorestaurant.com/', |
|
| 1756 | + "geodir_twitter" => 'http://twitter.com/morimotorestaurant', |
|
| 1757 | + "geodir_facebook" => 'http://facebook.com/morimotorestaurant', |
|
| 1758 | + "post_dummy" => '1' |
|
| 1759 | + ); |
|
| 1760 | + |
|
| 1761 | + ////post end/// |
|
| 1762 | + /// Restaurants ////post start 9/// |
|
| 1763 | + break; |
|
| 1764 | + case 30: |
|
| 1765 | + |
|
| 1766 | + |
|
| 1767 | + $image_array = array(); |
|
| 1768 | + $post_meta = array(); |
|
| 1769 | + |
|
| 1770 | + /// Restaurants ////post start 10// |
|
| 1771 | + $image_array[] = "$dummy_image_url/restaurants19.jpg"; |
|
| 1772 | + $image_array[] = "$dummy_image_url/restaurants17.jpg"; |
|
| 1773 | + $image_array[] = "$dummy_image_url/restaurants18.jpg"; |
|
| 1774 | + $image_array[] = "$dummy_image_url/restaurants16.jpg"; |
|
| 1775 | + $image_array[] = "$dummy_image_url/restaurants5.jpg"; |
|
| 1776 | + $image_array[] = "$dummy_image_url/restaurants6.jpg"; |
|
| 1777 | + $image_array[] = "$dummy_image_url/restaurants7.jpg"; |
|
| 1778 | + $image_array[] = "$dummy_image_url/restaurants8.jpg"; |
|
| 1779 | + $image_array[] = "$dummy_image_url/restaurants9.jpg"; |
|
| 1780 | + $image_array[] = "$dummy_image_url/restaurants2.jpg"; |
|
| 1781 | + $image_array[] = "$dummy_image_url/restaurants4.jpg"; |
|
| 1782 | + |
|
| 1783 | + $post_info[] = array( |
|
| 1784 | + "listing_type" => $post_type, |
|
| 1785 | + "post_title" => 'Buddakan', |
|
| 1786 | + "post_desc" => ' |
|
| 1787 | 1787 | <h3>The Experience </h3> |
| 1788 | 1788 | |
| 1789 | 1789 | A towering gilded statue of the Buddha generates elegant calm in this 175-seat, Pan Asian restaurant with sleek, modern decor. Immensely popular, Buddakan is a restaurant that is great for both large parties and intimate dinners. |
@@ -1794,85 +1794,85 @@ discard block |
||
| 1794 | 1794 | |
| 1795 | 1795 | Be sure to make your reservation before coming to town as Buddakan fills up quickly especially on weekends. Better yet, make your reservation right now . |
| 1796 | 1796 | ', |
| 1797 | - "post_images" => $image_array, |
|
| 1798 | - "post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife')), |
|
| 1799 | - "post_tags" => array('America'), |
|
| 1800 | - "geodir_video" => '', |
|
| 1801 | - "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.', |
|
| 1802 | - "geodir_contact" => '(000) 111-2222', |
|
| 1803 | - "geodir_email" => '[email protected]', |
|
| 1804 | - "geodir_website" => 'http://www.buddakan.com/', |
|
| 1805 | - "geodir_twitter" => 'http://twitter.com/buddakan', |
|
| 1806 | - "geodir_facebook" => 'http://facebook.com/buddakan', |
|
| 1807 | - "post_dummy" => '1' |
|
| 1808 | - ); |
|
| 1809 | - break; |
|
| 1810 | - |
|
| 1811 | - ////post end/// |
|
| 1812 | - /// Restaurants ////post start 10/// |
|
| 1797 | + "post_images" => $image_array, |
|
| 1798 | + "post_category" => array($post_type.'category' => array('Restaurants', 'Food Nightlife')), |
|
| 1799 | + "post_tags" => array('America'), |
|
| 1800 | + "geodir_video" => '', |
|
| 1801 | + "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.', |
|
| 1802 | + "geodir_contact" => '(000) 111-2222', |
|
| 1803 | + "geodir_email" => '[email protected]', |
|
| 1804 | + "geodir_website" => 'http://www.buddakan.com/', |
|
| 1805 | + "geodir_twitter" => 'http://twitter.com/buddakan', |
|
| 1806 | + "geodir_facebook" => 'http://facebook.com/buddakan', |
|
| 1807 | + "post_dummy" => '1' |
|
| 1808 | + ); |
|
| 1809 | + break; |
|
| 1810 | + |
|
| 1811 | + ////post end/// |
|
| 1812 | + /// Restaurants ////post start 10/// |
|
| 1813 | 1813 | } // end of switch |
| 1814 | 1814 | |
| 1815 | 1815 | foreach ($post_info as $post_info) { |
| 1816 | - $default_location = geodir_get_default_location(); |
|
| 1817 | - if ($city_bound_lat1 > $city_bound_lat2) |
|
| 1818 | - $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1)); |
|
| 1819 | - else |
|
| 1820 | - $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2)); |
|
| 1816 | + $default_location = geodir_get_default_location(); |
|
| 1817 | + if ($city_bound_lat1 > $city_bound_lat2) |
|
| 1818 | + $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1)); |
|
| 1819 | + else |
|
| 1820 | + $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2)); |
|
| 1821 | 1821 | |
| 1822 | 1822 | |
| 1823 | - if ($city_bound_lng1 > $city_bound_lng2) |
|
| 1824 | - $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1)); |
|
| 1825 | - else |
|
| 1826 | - $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2)); |
|
| 1823 | + if ($city_bound_lng1 > $city_bound_lng2) |
|
| 1824 | + $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1)); |
|
| 1825 | + else |
|
| 1826 | + $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2)); |
|
| 1827 | 1827 | |
| 1828 | - $load_map = get_option('geodir_load_map'); |
|
| 1828 | + $load_map = get_option('geodir_load_map'); |
|
| 1829 | 1829 | |
| 1830 | - if ($load_map == 'osm') { |
|
| 1831 | - $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 1832 | - } else { |
|
| 1833 | - $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 1834 | - } |
|
| 1835 | - |
|
| 1836 | - $postal_code = ''; |
|
| 1837 | - if (!empty($post_address)) { |
|
| 1838 | - if ($load_map == 'osm') { |
|
| 1839 | - $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : ''; |
|
| 1840 | - $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : ''; |
|
| 1841 | - } else { |
|
| 1842 | - $addresses = array(); |
|
| 1843 | - $addresses_default = array(); |
|
| 1830 | + if ($load_map == 'osm') { |
|
| 1831 | + $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 1832 | + } else { |
|
| 1833 | + $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude); |
|
| 1834 | + } |
|
| 1835 | + |
|
| 1836 | + $postal_code = ''; |
|
| 1837 | + if (!empty($post_address)) { |
|
| 1838 | + if ($load_map == 'osm') { |
|
| 1839 | + $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : ''; |
|
| 1840 | + $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : ''; |
|
| 1841 | + } else { |
|
| 1842 | + $addresses = array(); |
|
| 1843 | + $addresses_default = array(); |
|
| 1844 | 1844 | |
| 1845 | - foreach ($post_address as $add_key => $add_value) { |
|
| 1846 | - if ($add_key < 2 && !empty($add_value->long_name)) { |
|
| 1847 | - $addresses_default[] = $add_value->long_name; |
|
| 1848 | - } |
|
| 1849 | - if ($add_value->types[0] == 'postal_code') { |
|
| 1850 | - $postal_code = $add_value->long_name; |
|
| 1851 | - } |
|
| 1852 | - if ($add_value->types[0] == 'street_number') { |
|
| 1853 | - $addresses[] = $add_value->long_name; |
|
| 1854 | - } |
|
| 1855 | - if ($add_value->types[0] == 'route') { |
|
| 1856 | - $addresses[] = $add_value->long_name; |
|
| 1857 | - } |
|
| 1858 | - if ($add_value->types[0] == 'neighborhood') { |
|
| 1859 | - $addresses[] = $add_value->long_name; |
|
| 1860 | - } |
|
| 1861 | - if ($add_value->types[0] == 'sublocality') { |
|
| 1862 | - $addresses[] = $add_value->long_name; |
|
| 1863 | - } |
|
| 1864 | - } |
|
| 1865 | - $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : ''); |
|
| 1866 | - } |
|
| 1867 | - |
|
| 1868 | - $post_info['post_address'] = !empty($address) ? $address : $default_location->city; |
|
| 1869 | - $post_info['post_city'] = $default_location->city; |
|
| 1870 | - $post_info['post_region'] = $default_location->region; |
|
| 1871 | - $post_info['post_country'] = $default_location->country; |
|
| 1872 | - $post_info['post_zip'] = $postal_code; |
|
| 1873 | - $post_info['post_latitude'] = $dummy_post_latitude; |
|
| 1874 | - $post_info['post_longitude'] = $dummy_post_longitude; |
|
| 1875 | - } |
|
| 1845 | + foreach ($post_address as $add_key => $add_value) { |
|
| 1846 | + if ($add_key < 2 && !empty($add_value->long_name)) { |
|
| 1847 | + $addresses_default[] = $add_value->long_name; |
|
| 1848 | + } |
|
| 1849 | + if ($add_value->types[0] == 'postal_code') { |
|
| 1850 | + $postal_code = $add_value->long_name; |
|
| 1851 | + } |
|
| 1852 | + if ($add_value->types[0] == 'street_number') { |
|
| 1853 | + $addresses[] = $add_value->long_name; |
|
| 1854 | + } |
|
| 1855 | + if ($add_value->types[0] == 'route') { |
|
| 1856 | + $addresses[] = $add_value->long_name; |
|
| 1857 | + } |
|
| 1858 | + if ($add_value->types[0] == 'neighborhood') { |
|
| 1859 | + $addresses[] = $add_value->long_name; |
|
| 1860 | + } |
|
| 1861 | + if ($add_value->types[0] == 'sublocality') { |
|
| 1862 | + $addresses[] = $add_value->long_name; |
|
| 1863 | + } |
|
| 1864 | + } |
|
| 1865 | + $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : ''); |
|
| 1866 | + } |
|
| 1867 | + |
|
| 1868 | + $post_info['post_address'] = !empty($address) ? $address : $default_location->city; |
|
| 1869 | + $post_info['post_city'] = $default_location->city; |
|
| 1870 | + $post_info['post_region'] = $default_location->region; |
|
| 1871 | + $post_info['post_country'] = $default_location->country; |
|
| 1872 | + $post_info['post_zip'] = $postal_code; |
|
| 1873 | + $post_info['post_latitude'] = $dummy_post_latitude; |
|
| 1874 | + $post_info['post_longitude'] = $dummy_post_longitude; |
|
| 1875 | + } |
|
| 1876 | 1876 | |
| 1877 | - geodir_save_listing($post_info, true); |
|
| 1877 | + geodir_save_listing($post_info, true); |
|
| 1878 | 1878 | } |