@@ -393,7 +393,7 @@ |
||
393 | 393 | * @global object $post The current post object. |
394 | 394 | * @global object $geodirectory Not yet implemented. |
395 | 395 | * @param string $slug The template slug. |
396 | - * @param null $name The template name. |
|
396 | + * @param string $name The template name. |
|
397 | 397 | */ |
398 | 398 | function geodir_get_template_part($slug = '', $name = NULL) |
399 | 399 | { |
@@ -47,16 +47,19 @@ discard block |
||
47 | 47 | |
48 | 48 | if ($listing_page_id != '' && (is_page($listing_page_id) || ($is_wpml && !empty($wp->query_vars['page_id']))) && isset($_REQUEST['listing_type']) |
49 | 49 | && in_array($_REQUEST['listing_type'], geodir_get_posttypes()) |
50 | - ) |
|
51 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
50 | + ) { |
|
51 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
52 | + } |
|
52 | 53 | if (empty($post_type) && !isset($_REQUEST['pid'])) { |
53 | 54 | $pagename = $wp->query_vars['pagename']; |
54 | 55 | $post_types = geodir_get_posttypes(); |
55 | - if (!empty($post_types)) |
|
56 | - $post_type = $post_types[0]; |
|
56 | + if (!empty($post_types)) { |
|
57 | + $post_type = $post_types[0]; |
|
58 | + } |
|
57 | 59 | |
58 | - if($sc_post_type != '' ) |
|
59 | - $post_type = $sc_post_type; |
|
60 | + if($sc_post_type != '' ) { |
|
61 | + $post_type = $sc_post_type; |
|
62 | + } |
|
60 | 63 | |
61 | 64 | if ($is_wpml && !empty($wp->query_vars['page_id'])) { |
62 | 65 | wp_redirect(geodir_getlink(get_permalink($wp->query_vars['page_id']), array('listing_type' => $post_type))); |
@@ -71,14 +74,16 @@ discard block |
||
71 | 74 | $success_page_id = geodir_success_page_id(); |
72 | 75 | if ($success_page_id != '' && is_page($success_page_id) && isset($_REQUEST['listing_type']) |
73 | 76 | && in_array($_REQUEST['listing_type'], geodir_get_posttypes()) |
74 | - ) |
|
75 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
77 | + ) { |
|
78 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
79 | + } |
|
76 | 80 | return $template = locate_template(array("geodirectory/{$post_type}-success.php", "geodirectory/listing-success.php")); |
77 | 81 | break; |
78 | 82 | case 'detail': |
79 | 83 | case 'preview': |
80 | - if (in_array(get_post_type(), geodir_get_posttypes())) |
|
81 | - $post_type = get_post_type(); |
|
84 | + if (in_array(get_post_type(), geodir_get_posttypes())) { |
|
85 | + $post_type = get_post_type(); |
|
86 | + } |
|
82 | 87 | return $template = locate_template(array("geodirectory/single-{$post_type}.php", "geodirectory/listing-detail.php")); |
83 | 88 | break; |
84 | 89 | case 'listing': |
@@ -184,7 +189,9 @@ discard block |
||
184 | 189 | |
185 | 190 | $template = geodir_locate_template('signup'); |
186 | 191 | |
187 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
192 | + if (!$template) { |
|
193 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
194 | + } |
|
188 | 195 | |
189 | 196 | /** |
190 | 197 | * Filter the signup template path. |
@@ -202,7 +209,9 @@ discard block |
||
202 | 209 | |
203 | 210 | $template = geodir_locate_template('information'); |
204 | 211 | |
205 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
212 | + if (!$template) { |
|
213 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
214 | + } |
|
206 | 215 | /** |
207 | 216 | * Filter the information template path. |
208 | 217 | * |
@@ -219,7 +228,9 @@ discard block |
||
219 | 228 | if (!$is_current_user_owner) { |
220 | 229 | $template = geodir_locate_template('information'); |
221 | 230 | |
222 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
231 | + if (!$template) { |
|
232 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
233 | + } |
|
223 | 234 | /** |
224 | 235 | * Filter the information template path. |
225 | 236 | * |
@@ -241,7 +252,9 @@ discard block |
||
241 | 252 | |
242 | 253 | $template = geodir_locate_template('add-listing'); |
243 | 254 | |
244 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php'; |
|
255 | + if (!$template) { |
|
256 | + $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php'; |
|
257 | + } |
|
245 | 258 | /** |
246 | 259 | * Filter the add listing template path. |
247 | 260 | * |
@@ -258,7 +271,9 @@ discard block |
||
258 | 271 | |
259 | 272 | $template = geodir_locate_template('preview'); |
260 | 273 | |
261 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
274 | + if (!$template) { |
|
275 | + $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
276 | + } |
|
262 | 277 | /** |
263 | 278 | * Filter the preview template path. |
264 | 279 | * |
@@ -274,7 +289,9 @@ discard block |
||
274 | 289 | |
275 | 290 | $template = geodir_locate_template('success'); |
276 | 291 | |
277 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php'; |
|
292 | + if (!$template) { |
|
293 | + $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php'; |
|
294 | + } |
|
278 | 295 | /** |
279 | 296 | * Filter the success template path. |
280 | 297 | * |
@@ -289,7 +306,9 @@ discard block |
||
289 | 306 | |
290 | 307 | $template = geodir_locate_template('detail'); |
291 | 308 | |
292 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
309 | + if (!$template) { |
|
310 | + $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
311 | + } |
|
293 | 312 | /** |
294 | 313 | * Filter the detail template path. |
295 | 314 | * |
@@ -304,7 +323,9 @@ discard block |
||
304 | 323 | |
305 | 324 | $template = geodir_locate_template('listing'); |
306 | 325 | |
307 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php'; |
|
326 | + if (!$template) { |
|
327 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php'; |
|
328 | + } |
|
308 | 329 | /** |
309 | 330 | * Filter the listing template path. |
310 | 331 | * |
@@ -319,7 +340,9 @@ discard block |
||
319 | 340 | |
320 | 341 | $template = geodir_locate_template('search'); |
321 | 342 | |
322 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php'; |
|
343 | + if (!$template) { |
|
344 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php'; |
|
345 | + } |
|
323 | 346 | /** |
324 | 347 | * Filter the search template path. |
325 | 348 | * |
@@ -334,7 +357,9 @@ discard block |
||
334 | 357 | |
335 | 358 | $template = geodir_locate_template('author'); |
336 | 359 | |
337 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php'; |
|
360 | + if (!$template) { |
|
361 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php'; |
|
362 | + } |
|
338 | 363 | /** |
339 | 364 | * Filter the author template path. |
340 | 365 | * |
@@ -355,7 +380,9 @@ discard block |
||
355 | 380 | |
356 | 381 | $template = geodir_locate_template('geodir-home'); |
357 | 382 | |
358 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php'; |
|
383 | + if (!$template) { |
|
384 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php'; |
|
385 | + } |
|
359 | 386 | /** |
360 | 387 | * Filter the home page template path. |
361 | 388 | * |
@@ -368,7 +395,9 @@ discard block |
||
368 | 395 | |
369 | 396 | $template = geodir_locate_template('location'); |
370 | 397 | |
371 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php'; |
|
398 | + if (!$template) { |
|
399 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php'; |
|
400 | + } |
|
372 | 401 | /** |
373 | 402 | * Filter the location template path. |
374 | 403 | * |
@@ -377,8 +406,9 @@ discard block |
||
377 | 406 | */ |
378 | 407 | return $template = apply_filters('geodir_template_location', $template); |
379 | 408 | |
380 | - } else |
|
381 | - return $template; |
|
409 | + } else { |
|
410 | + return $template; |
|
411 | + } |
|
382 | 412 | |
383 | 413 | } |
384 | 414 | |
@@ -432,8 +462,10 @@ discard block |
||
432 | 462 | * @since 1.0.0 |
433 | 463 | */ |
434 | 464 | include($template); |
435 | - else: |
|
436 | - locate_template(array("geodirectory/" . $template_name), true, false); |
|
465 | + else { |
|
466 | + : |
|
467 | + locate_template(array("geodirectory/" . $template_name), true, false); |
|
468 | + } |
|
437 | 469 | endif; |
438 | 470 | |
439 | 471 | } |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | if (!empty($post_types)) |
56 | 56 | $post_type = $post_types[0]; |
57 | 57 | |
58 | - if($sc_post_type != '' ) |
|
58 | + if ($sc_post_type != '') |
|
59 | 59 | $post_type = $sc_post_type; |
60 | 60 | |
61 | 61 | if ($is_wpml && !empty($wp->query_vars['page_id'])) { |
62 | 62 | wp_redirect(geodir_getlink(get_permalink($wp->query_vars['page_id']), array('listing_type' => $post_type))); |
63 | 63 | } else { |
64 | - wp_redirect(trailingslashit(get_site_url()) . $pagename . '/?listing_type=' . $post_type); |
|
64 | + wp_redirect(trailingslashit(get_site_url()).$pagename.'/?listing_type='.$post_type); |
|
65 | 65 | } |
66 | 66 | exit(); |
67 | 67 | } |
@@ -119,14 +119,14 @@ discard block |
||
119 | 119 | case 'listing-listview': |
120 | 120 | $template = locate_template(array("geodirectory/listing-listview.php")); |
121 | 121 | if (!$template) { |
122 | - $template = geodir_plugin_path() . '/geodirectory-templates/listing-listview.php'; |
|
122 | + $template = geodir_plugin_path().'/geodirectory-templates/listing-listview.php'; |
|
123 | 123 | } |
124 | 124 | return $template; |
125 | 125 | break; |
126 | 126 | case 'widget-listing-listview': |
127 | 127 | $template = locate_template(array("geodirectory/widget-listing-listview.php")); |
128 | 128 | if (!$template) { |
129 | - $template = geodir_plugin_path() . '/geodirectory-templates/widget-listing-listview.php'; |
|
129 | + $template = geodir_plugin_path().'/geodirectory-templates/widget-listing-listview.php'; |
|
130 | 130 | } |
131 | 131 | return $template; |
132 | 132 | break; |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | |
185 | 185 | $template = geodir_locate_template('signup'); |
186 | 186 | |
187 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
187 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-signup.php'; |
|
188 | 188 | |
189 | 189 | /** |
190 | 190 | * Filter the signup template path. |
@@ -198,11 +198,11 @@ discard block |
||
198 | 198 | if (geodir_is_page('add-listing') || $geodir_custom_page_list['geodir_add_listing_page']) { |
199 | 199 | if (!geodir_is_default_location_set()) { |
200 | 200 | global $information; |
201 | - $information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>'); |
|
201 | + $information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\''.admin_url('admin.php?page=geodirectory&tab=default_location_settings').'\'>', '</a>'); |
|
202 | 202 | |
203 | 203 | $template = geodir_locate_template('information'); |
204 | 204 | |
205 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
205 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-information.php'; |
|
206 | 206 | /** |
207 | 207 | * Filter the information template path. |
208 | 208 | * |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | if (!$is_current_user_owner) { |
220 | 220 | $template = geodir_locate_template('information'); |
221 | 221 | |
222 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
222 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-information.php'; |
|
223 | 223 | /** |
224 | 224 | * Filter the information template path. |
225 | 225 | * |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | |
242 | 242 | $template = geodir_locate_template('add-listing'); |
243 | 243 | |
244 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php'; |
|
244 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/add-listing.php'; |
|
245 | 245 | /** |
246 | 246 | * Filter the add listing template path. |
247 | 247 | * |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | |
259 | 259 | $template = geodir_locate_template('preview'); |
260 | 260 | |
261 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
261 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/listing-detail.php'; |
|
262 | 262 | /** |
263 | 263 | * Filter the preview template path. |
264 | 264 | * |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | |
275 | 275 | $template = geodir_locate_template('success'); |
276 | 276 | |
277 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php'; |
|
277 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/listing-success.php'; |
|
278 | 278 | /** |
279 | 279 | * Filter the success template path. |
280 | 280 | * |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | |
290 | 290 | $template = geodir_locate_template('detail'); |
291 | 291 | |
292 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
292 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/listing-detail.php'; |
|
293 | 293 | /** |
294 | 294 | * Filter the detail template path. |
295 | 295 | * |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | |
305 | 305 | $template = geodir_locate_template('listing'); |
306 | 306 | |
307 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php'; |
|
307 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-listing.php'; |
|
308 | 308 | /** |
309 | 309 | * Filter the listing template path. |
310 | 310 | * |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | |
320 | 320 | $template = geodir_locate_template('search'); |
321 | 321 | |
322 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php'; |
|
322 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-search.php'; |
|
323 | 323 | /** |
324 | 324 | * Filter the search template path. |
325 | 325 | * |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | |
335 | 335 | $template = geodir_locate_template('author'); |
336 | 336 | |
337 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php'; |
|
337 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-author.php'; |
|
338 | 338 | /** |
339 | 339 | * Filter the author template path. |
340 | 340 | * |
@@ -355,7 +355,7 @@ discard block |
||
355 | 355 | |
356 | 356 | $template = geodir_locate_template('geodir-home'); |
357 | 357 | |
358 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php'; |
|
358 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-home.php'; |
|
359 | 359 | /** |
360 | 360 | * Filter the home page template path. |
361 | 361 | * |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | |
369 | 369 | $template = geodir_locate_template('location'); |
370 | 370 | |
371 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php'; |
|
371 | + if (!$template) $template = geodir_plugin_path().'/geodirectory-templates/geodir-location.php'; |
|
372 | 372 | /** |
373 | 373 | * Filter the location template path. |
374 | 374 | * |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | */ |
411 | 411 | do_action("geodir_get_template_part_{$slug}", $slug, $name); |
412 | 412 | $templates = array(); |
413 | - $name = (string)$name; |
|
413 | + $name = (string) $name; |
|
414 | 414 | if ('' !== $name) { |
415 | 415 | $template_name = "{$slug}-{$name}.php"; |
416 | 416 | |
@@ -418,14 +418,14 @@ discard block |
||
418 | 418 | $template_name = "{$slug}.php"; |
419 | 419 | } |
420 | 420 | |
421 | - if (!locate_template(array("geodirectory/" . $template_name))) : |
|
421 | + if (!locate_template(array("geodirectory/".$template_name))) : |
|
422 | 422 | /** |
423 | 423 | * Filter the template part with slug and name. |
424 | 424 | * |
425 | 425 | * @since 1.0.0 |
426 | 426 | * @param string $template_name The template name. |
427 | 427 | */ |
428 | - $template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path() . '/geodirectory-templates/' . $template_name); |
|
428 | + $template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path().'/geodirectory-templates/'.$template_name); |
|
429 | 429 | /** |
430 | 430 | * Includes the template part with slug and name. |
431 | 431 | * |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | */ |
434 | 434 | include($template); |
435 | 435 | else: |
436 | - locate_template(array("geodirectory/" . $template_name), true, false); |
|
436 | + locate_template(array("geodirectory/".$template_name), true, false); |
|
437 | 437 | endif; |
438 | 438 | |
439 | 439 | } |
@@ -461,9 +461,9 @@ discard block |
||
461 | 461 | $gdp_post_type = $gdp_post_type != '' && !empty($all_postypes) && in_array($gdp_post_type, $all_postypes) ? $gdp_post_type : NULL; |
462 | 462 | |
463 | 463 | if ($gdp_post_id && $gdp_post_type) { |
464 | - $append_class = 'gd-post-' . $gdp_post_type; |
|
464 | + $append_class = 'gd-post-'.$gdp_post_type; |
|
465 | 465 | $append_class .= isset($post->is_featured) && $post->is_featured > 0 ? ' gd-post-featured' : ''; |
466 | - $class = $class != '' ? $class . ' ' . $append_class : $append_class; |
|
466 | + $class = $class != '' ? $class.' '.$append_class : $append_class; |
|
467 | 467 | } |
468 | 468 | |
469 | 469 | return $class; |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | */ |
496 | 496 | $message = apply_filters('geodir_message_listing_not_found', $message, $template_listview, $favorite); |
497 | 497 | |
498 | - echo '<li class="no-listing">' . $message . '</li>'; |
|
498 | + echo '<li class="no-listing">'.$message.'</li>'; |
|
499 | 499 | } |
500 | 500 | |
501 | 501 | /** |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | function geodir_convert_listing_view_class($columns = '') { |
525 | 525 | $class = ''; |
526 | 526 | |
527 | - switch ((int)$columns) { |
|
527 | + switch ((int) $columns) { |
|
528 | 528 | case 1: |
529 | 529 | $class = ''; |
530 | 530 | break; |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | $html .= '<option value=""></option>'; |
590 | 590 | if (!empty($star_texts) && is_array($star_texts)) { |
591 | 591 | foreach ($star_texts as $i => $text) { |
592 | - $html .= '<option ' . selected((int)($i + 1), (int)$default, false) . ' value="' . (int)($i + 1) . '">' . $text . '</option>'; |
|
592 | + $html .= '<option '.selected((int) ($i + 1), (int) $default, false).' value="'.(int) ($i + 1).'">'.$text.'</option>'; |
|
593 | 593 | } |
594 | 594 | } else { |
595 | 595 | $html .= '<option value="1">1</option>'; |
@@ -618,14 +618,14 @@ discard block |
||
618 | 618 | function geodir_font_awesome_rating_stars_html($html, $rating, $star_count = 5) { |
619 | 619 | if (get_option('geodir_reviewrating_enable_font_awesome') == '1') { |
620 | 620 | $rating = min($rating, $star_count); |
621 | - $full_stars = floor( $rating ); |
|
622 | - $half_stars = ceil( $rating - $full_stars ); |
|
621 | + $full_stars = floor($rating); |
|
622 | + $half_stars = ceil($rating - $full_stars); |
|
623 | 623 | $empty_stars = $star_count - $full_stars - $half_stars; |
624 | 624 | |
625 | 625 | $html = '<div class="gd-star-rating gd-fa-star-rating">'; |
626 | - $html .= str_repeat( '<i class="fa fa-star gd-full-star"></i>', $full_stars ); |
|
627 | - $html .= str_repeat( '<i class="fa fa-star-o fa-star-half-full gd-half-star"></i>', $half_stars ); |
|
628 | - $html .= str_repeat( '<i class="fa fa-star-o gd-empty-star"></i>', $empty_stars); |
|
626 | + $html .= str_repeat('<i class="fa fa-star gd-full-star"></i>', $full_stars); |
|
627 | + $html .= str_repeat('<i class="fa fa-star-o fa-star-half-full gd-half-star"></i>', $half_stars); |
|
628 | + $html .= str_repeat('<i class="fa fa-star-o gd-empty-star"></i>', $empty_stars); |
|
629 | 629 | $html .= '</div>'; |
630 | 630 | } |
631 | 631 | |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | $full_color = get_option('geodir_reviewrating_fa_full_rating_color', '#757575'); |
645 | 645 | if ($full_color != '#757575') { |
646 | 646 | echo '<style type="text/css">.br-theme-fontawesome-stars .br-widget a.br-active:after,.br-theme-fontawesome-stars .br-widget a.br-selected:after, |
647 | - .gd-star-rating i.fa {color:' . stripslashes($full_color) . '!important;}</style>'; |
|
647 | + .gd-star-rating i.fa {color:' . stripslashes($full_color).'!important;}</style>'; |
|
648 | 648 | } |
649 | 649 | } |
650 | 650 | } |
651 | 651 | \ No newline at end of file |
@@ -19,18 +19,18 @@ discard block |
||
19 | 19 | */ |
20 | 20 | function geodir_locate_template($template = '') |
21 | 21 | { |
22 | - global $post_type, $wp, $post; |
|
23 | - $fields = array(); |
|
22 | + global $post_type, $wp, $post; |
|
23 | + $fields = array(); |
|
24 | 24 | |
25 | - switch ($template): |
|
26 | - case 'signup': |
|
27 | - return $template = locate_template(array("geodirectory/geodir-signup.php")); |
|
28 | - break; |
|
29 | - case 'add-listing': |
|
25 | + switch ($template): |
|
26 | + case 'signup': |
|
27 | + return $template = locate_template(array("geodirectory/geodir-signup.php")); |
|
28 | + break; |
|
29 | + case 'add-listing': |
|
30 | 30 | |
31 | - $sc_post_type = ''; |
|
31 | + $sc_post_type = ''; |
|
32 | 32 | if (is_page() && isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) { |
33 | - $listing_page_id = $post->ID; |
|
33 | + $listing_page_id = $post->ID; |
|
34 | 34 | |
35 | 35 | $regex_pattern = get_shortcode_regex(); |
36 | 36 | preg_match('/'.$regex_pattern.'/s', $post->post_content, $regex_matches); |
@@ -39,100 +39,100 @@ discard block |
||
39 | 39 | $shortcode_atts = shortcode_parse_atts($regex_matches[3]); |
40 | 40 | $sc_post_type = !empty($shortcode_atts) && isset($shortcode_atts['listing_type']) && !empty($shortcode_atts['listing_type']) ? $shortcode_atts['listing_type'] : ''; |
41 | 41 | } |
42 | - } else { |
|
43 | - $listing_page_id = geodir_add_listing_page_id(); |
|
44 | - } |
|
42 | + } else { |
|
43 | + $listing_page_id = geodir_add_listing_page_id(); |
|
44 | + } |
|
45 | 45 | |
46 | 46 | $is_wpml = function_exists('icl_object_id') ? true : false; |
47 | 47 | |
48 | - if ($listing_page_id != '' && (is_page($listing_page_id) || ($is_wpml && !empty($wp->query_vars['page_id']))) && isset($_REQUEST['listing_type']) |
|
49 | - && in_array($_REQUEST['listing_type'], geodir_get_posttypes()) |
|
50 | - ) |
|
51 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
52 | - if (empty($post_type) && !isset($_REQUEST['pid'])) { |
|
53 | - $pagename = $wp->query_vars['pagename']; |
|
54 | - $post_types = geodir_get_posttypes(); |
|
55 | - if (!empty($post_types)) |
|
56 | - $post_type = $post_types[0]; |
|
48 | + if ($listing_page_id != '' && (is_page($listing_page_id) || ($is_wpml && !empty($wp->query_vars['page_id']))) && isset($_REQUEST['listing_type']) |
|
49 | + && in_array($_REQUEST['listing_type'], geodir_get_posttypes()) |
|
50 | + ) |
|
51 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
52 | + if (empty($post_type) && !isset($_REQUEST['pid'])) { |
|
53 | + $pagename = $wp->query_vars['pagename']; |
|
54 | + $post_types = geodir_get_posttypes(); |
|
55 | + if (!empty($post_types)) |
|
56 | + $post_type = $post_types[0]; |
|
57 | 57 | |
58 | 58 | if($sc_post_type != '' ) |
59 | 59 | $post_type = $sc_post_type; |
60 | 60 | |
61 | - if ($is_wpml && !empty($wp->query_vars['page_id'])) { |
|
61 | + if ($is_wpml && !empty($wp->query_vars['page_id'])) { |
|
62 | 62 | wp_redirect(geodir_getlink(get_permalink($wp->query_vars['page_id']), array('listing_type' => $post_type))); |
63 | 63 | } else { |
64 | 64 | wp_redirect(trailingslashit(get_site_url()) . $pagename . '/?listing_type=' . $post_type); |
65 | 65 | } |
66 | - gd_die(); |
|
67 | - } |
|
68 | - return $template = locate_template(array("geodirectory/add-{$post_type}.php", "geodirectory/add-listing.php")); |
|
69 | - break; |
|
70 | - case 'success': |
|
71 | - $success_page_id = geodir_success_page_id(); |
|
72 | - if ($success_page_id != '' && is_page($success_page_id) && isset($_REQUEST['listing_type']) |
|
73 | - && in_array($_REQUEST['listing_type'], geodir_get_posttypes()) |
|
74 | - ) |
|
75 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
76 | - return $template = locate_template(array("geodirectory/{$post_type}-success.php", "geodirectory/listing-success.php")); |
|
77 | - break; |
|
78 | - case 'detail': |
|
79 | - case 'preview': |
|
80 | - if (in_array(get_post_type(), geodir_get_posttypes())) |
|
81 | - $post_type = get_post_type(); |
|
82 | - return $template = locate_template(array("geodirectory/single-{$post_type}.php", "geodirectory/listing-detail.php")); |
|
83 | - break; |
|
84 | - case 'listing': |
|
85 | - $templates = array(); |
|
86 | - if (is_post_type_archive() && in_array(get_post_type(), geodir_get_posttypes())) { |
|
87 | - $post_type = get_post_type(); |
|
88 | - $templates[] = "geodirectory/archive-$post_type.php"; |
|
89 | - } |
|
90 | - |
|
91 | - |
|
92 | - if (is_tax() && geodir_get_taxonomy_posttype()) { |
|
93 | - $query_obj = get_queried_object(); |
|
94 | - $curr_taxonomy = isset($query_obj->taxonomy) ? $query_obj->taxonomy : ''; |
|
95 | - $curr_term = isset($query_obj->slug) ? $query_obj->slug : ''; |
|
96 | - $templates[] = "geodirectory/taxonomy-$curr_taxonomy-$curr_term.php"; |
|
97 | - $templates[] = "geodirectory/taxonomy-$curr_taxonomy.php"; |
|
98 | - } |
|
99 | - |
|
100 | - $templates[] = "geodirectory/geodir-listing.php"; |
|
101 | - |
|
102 | - return $template = locate_template($templates); |
|
103 | - break; |
|
104 | - case 'information': |
|
105 | - return $template = locate_template(array("geodirectory/geodir-information.php")); |
|
106 | - break; |
|
107 | - case 'author': |
|
108 | - return $template = locate_template(array("geodirectory/geodir-author.php")); |
|
109 | - break; |
|
110 | - case 'search': |
|
111 | - return $template = locate_template(array("geodirectory/geodir-search.php")); |
|
112 | - break; |
|
113 | - case 'location': |
|
114 | - return $template = locate_template(array("geodirectory/geodir-location.php")); |
|
115 | - break; |
|
116 | - case 'geodir-home': |
|
117 | - return $template = locate_template(array("geodirectory/geodir-home.php")); |
|
118 | - break; |
|
119 | - case 'listing-listview': |
|
120 | - $template = locate_template(array("geodirectory/listing-listview.php")); |
|
121 | - if (!$template) { |
|
122 | - $template = geodir_plugin_path() . '/geodirectory-templates/listing-listview.php'; |
|
123 | - } |
|
124 | - return $template; |
|
125 | - break; |
|
126 | - case 'widget-listing-listview': |
|
127 | - $template = locate_template(array("geodirectory/widget-listing-listview.php")); |
|
128 | - if (!$template) { |
|
129 | - $template = geodir_plugin_path() . '/geodirectory-templates/widget-listing-listview.php'; |
|
130 | - } |
|
131 | - return $template; |
|
132 | - break; |
|
133 | - endswitch; |
|
134 | - |
|
135 | - return false; |
|
66 | + gd_die(); |
|
67 | + } |
|
68 | + return $template = locate_template(array("geodirectory/add-{$post_type}.php", "geodirectory/add-listing.php")); |
|
69 | + break; |
|
70 | + case 'success': |
|
71 | + $success_page_id = geodir_success_page_id(); |
|
72 | + if ($success_page_id != '' && is_page($success_page_id) && isset($_REQUEST['listing_type']) |
|
73 | + && in_array($_REQUEST['listing_type'], geodir_get_posttypes()) |
|
74 | + ) |
|
75 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
76 | + return $template = locate_template(array("geodirectory/{$post_type}-success.php", "geodirectory/listing-success.php")); |
|
77 | + break; |
|
78 | + case 'detail': |
|
79 | + case 'preview': |
|
80 | + if (in_array(get_post_type(), geodir_get_posttypes())) |
|
81 | + $post_type = get_post_type(); |
|
82 | + return $template = locate_template(array("geodirectory/single-{$post_type}.php", "geodirectory/listing-detail.php")); |
|
83 | + break; |
|
84 | + case 'listing': |
|
85 | + $templates = array(); |
|
86 | + if (is_post_type_archive() && in_array(get_post_type(), geodir_get_posttypes())) { |
|
87 | + $post_type = get_post_type(); |
|
88 | + $templates[] = "geodirectory/archive-$post_type.php"; |
|
89 | + } |
|
90 | + |
|
91 | + |
|
92 | + if (is_tax() && geodir_get_taxonomy_posttype()) { |
|
93 | + $query_obj = get_queried_object(); |
|
94 | + $curr_taxonomy = isset($query_obj->taxonomy) ? $query_obj->taxonomy : ''; |
|
95 | + $curr_term = isset($query_obj->slug) ? $query_obj->slug : ''; |
|
96 | + $templates[] = "geodirectory/taxonomy-$curr_taxonomy-$curr_term.php"; |
|
97 | + $templates[] = "geodirectory/taxonomy-$curr_taxonomy.php"; |
|
98 | + } |
|
99 | + |
|
100 | + $templates[] = "geodirectory/geodir-listing.php"; |
|
101 | + |
|
102 | + return $template = locate_template($templates); |
|
103 | + break; |
|
104 | + case 'information': |
|
105 | + return $template = locate_template(array("geodirectory/geodir-information.php")); |
|
106 | + break; |
|
107 | + case 'author': |
|
108 | + return $template = locate_template(array("geodirectory/geodir-author.php")); |
|
109 | + break; |
|
110 | + case 'search': |
|
111 | + return $template = locate_template(array("geodirectory/geodir-search.php")); |
|
112 | + break; |
|
113 | + case 'location': |
|
114 | + return $template = locate_template(array("geodirectory/geodir-location.php")); |
|
115 | + break; |
|
116 | + case 'geodir-home': |
|
117 | + return $template = locate_template(array("geodirectory/geodir-home.php")); |
|
118 | + break; |
|
119 | + case 'listing-listview': |
|
120 | + $template = locate_template(array("geodirectory/listing-listview.php")); |
|
121 | + if (!$template) { |
|
122 | + $template = geodir_plugin_path() . '/geodirectory-templates/listing-listview.php'; |
|
123 | + } |
|
124 | + return $template; |
|
125 | + break; |
|
126 | + case 'widget-listing-listview': |
|
127 | + $template = locate_template(array("geodirectory/widget-listing-listview.php")); |
|
128 | + if (!$template) { |
|
129 | + $template = geodir_plugin_path() . '/geodirectory-templates/widget-listing-listview.php'; |
|
130 | + } |
|
131 | + return $template; |
|
132 | + break; |
|
133 | + endswitch; |
|
134 | + |
|
135 | + return false; |
|
136 | 136 | |
137 | 137 | } |
138 | 138 | |
@@ -151,238 +151,238 @@ discard block |
||
151 | 151 | function geodir_template_loader($template) |
152 | 152 | { |
153 | 153 | |
154 | - global $wp_query; |
|
155 | - |
|
156 | - /** |
|
157 | - * Filter the custom page list. |
|
158 | - * |
|
159 | - * @since 1.0.0 |
|
160 | - */ |
|
161 | - $geodir_custom_page_list = apply_filters('geodir_set_custom_pages', array( |
|
162 | - 'geodir_signup_page' => |
|
163 | - apply_filters('geodir_set_custom_signup_page', false), |
|
164 | - 'geodir_add_listing_page' => |
|
165 | - apply_filters('geodir_set_custom_add_listing_page', false), |
|
166 | - 'geodir_preview_page' => |
|
167 | - apply_filters('geodir_set_custom_preview_page', false), |
|
168 | - 'geodir_listing_success_page' => |
|
169 | - apply_filters('geodir_set_custom_listing_success_page', false), |
|
170 | - 'geodir_listing_detail_page' => |
|
171 | - apply_filters('geodir_set_custom_listing_detail_page', false), |
|
172 | - 'geodir_listing_page' => |
|
173 | - apply_filters('geodir_set_custom_listing_page', false), |
|
174 | - 'geodir_search_page' => |
|
175 | - apply_filters('geodir_set_custom_search_page', false), |
|
176 | - 'geodir_author_page' => |
|
177 | - apply_filters('geodir_set_custom_author_page', false), |
|
178 | - 'geodir_home_map_page' => |
|
179 | - apply_filters('geodir_set_custom_home_map_page', false) |
|
180 | - )); |
|
181 | - |
|
182 | - |
|
183 | - if (geodir_is_page('login') || $geodir_custom_page_list['geodir_signup_page']) { |
|
184 | - |
|
185 | - $template = geodir_locate_template('signup'); |
|
186 | - |
|
187 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
188 | - |
|
189 | - /** |
|
190 | - * Filter the signup template path. |
|
191 | - * |
|
192 | - * @since 1.0.0 |
|
193 | - * @param string $template The template path. |
|
194 | - */ |
|
195 | - return $template = apply_filters('geodir_template_signup', $template); |
|
196 | - } |
|
197 | - |
|
198 | - if (geodir_is_page('add-listing') || $geodir_custom_page_list['geodir_add_listing_page']) { |
|
199 | - if (!geodir_is_default_location_set()) { |
|
200 | - global $information; |
|
201 | - $information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>'); |
|
202 | - |
|
203 | - $template = geodir_locate_template('information'); |
|
204 | - |
|
205 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
206 | - /** |
|
207 | - * Filter the information template path. |
|
208 | - * |
|
209 | - * @since 1.0.0 |
|
210 | - * @param string $template The template path. |
|
211 | - */ |
|
212 | - return $template = apply_filters('geodir_template_information', $template); |
|
213 | - } |
|
214 | - // check if pid exists in the record if yes then check if this post belongs to the user who is logged in. |
|
215 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
216 | - global $information; |
|
217 | - $information = __('This listing does not belong to your account, please check the listing id carefully.', 'geodirectory'); |
|
218 | - $is_current_user_owner = geodir_listing_belong_to_current_user(); |
|
219 | - if (!$is_current_user_owner) { |
|
220 | - $template = geodir_locate_template('information'); |
|
221 | - |
|
222 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
223 | - /** |
|
224 | - * Filter the information template path. |
|
225 | - * |
|
226 | - * @since 1.0.0 |
|
227 | - * @param string $template The template path. |
|
228 | - */ |
|
229 | - return $template = apply_filters('geodir_template_information', $template); |
|
230 | - } |
|
231 | - |
|
232 | - |
|
233 | - } |
|
234 | - |
|
235 | - //geodir_is_login(true); |
|
236 | - global $current_user; |
|
237 | - if (!$current_user->ID) { |
|
238 | - wp_redirect(geodir_login_url(array('redirect_add_listing'=>urlencode(geodir_curPageURL()))), 302); |
|
239 | - exit; |
|
240 | - } |
|
241 | - |
|
242 | - $template = geodir_locate_template('add-listing'); |
|
243 | - |
|
244 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php'; |
|
245 | - /** |
|
246 | - * Filter the add listing template path. |
|
247 | - * |
|
248 | - * @since 1.0.0 |
|
249 | - * @param string $template The template path. |
|
250 | - */ |
|
251 | - return $template = apply_filters('geodir_template_add_listing', $template); |
|
252 | - } |
|
253 | - |
|
254 | - |
|
255 | - if (geodir_is_page('preview') || $geodir_custom_page_list['geodir_preview_page']) { |
|
256 | - global $preview; |
|
257 | - $preview = true; |
|
258 | - |
|
259 | - $template = geodir_locate_template('preview'); |
|
260 | - |
|
261 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
262 | - /** |
|
263 | - * Filter the preview template path. |
|
264 | - * |
|
265 | - * @since 1.0.0 |
|
266 | - * @param string $template The template path. |
|
267 | - */ |
|
268 | - return $template = apply_filters('geodir_template_preview', $template); |
|
269 | - |
|
270 | - } |
|
271 | - |
|
272 | - |
|
273 | - if (geodir_is_page('listing-success') || $geodir_custom_page_list['geodir_listing_success_page']) { |
|
274 | - |
|
275 | - $template = geodir_locate_template('success'); |
|
276 | - |
|
277 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php'; |
|
278 | - /** |
|
279 | - * Filter the success template path. |
|
280 | - * |
|
281 | - * @since 1.0.0 |
|
282 | - * @param string $template The template path. |
|
283 | - */ |
|
284 | - return $template = apply_filters('geodir_template_success', $template); |
|
285 | - |
|
286 | - } |
|
287 | - |
|
288 | - if (geodir_is_page('detail') || $geodir_custom_page_list['geodir_listing_detail_page']) { |
|
289 | - |
|
290 | - $template = geodir_locate_template('detail'); |
|
291 | - |
|
292 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
293 | - /** |
|
294 | - * Filter the detail template path. |
|
295 | - * |
|
296 | - * @since 1.0.0 |
|
297 | - * @param string $template The template path. |
|
298 | - */ |
|
299 | - return $template = apply_filters('geodir_template_detail', $template); |
|
300 | - |
|
301 | - } |
|
302 | - |
|
303 | - if (geodir_is_page('listing') || $geodir_custom_page_list['geodir_listing_page']) { |
|
304 | - |
|
305 | - $template = geodir_locate_template('listing'); |
|
306 | - |
|
307 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php'; |
|
308 | - /** |
|
309 | - * Filter the listing template path. |
|
310 | - * |
|
311 | - * @since 1.0.0 |
|
312 | - * @param string $template The template path. |
|
313 | - */ |
|
314 | - return $template = apply_filters('geodir_template_listing', $template); |
|
154 | + global $wp_query; |
|
315 | 155 | |
316 | - } |
|
156 | + /** |
|
157 | + * Filter the custom page list. |
|
158 | + * |
|
159 | + * @since 1.0.0 |
|
160 | + */ |
|
161 | + $geodir_custom_page_list = apply_filters('geodir_set_custom_pages', array( |
|
162 | + 'geodir_signup_page' => |
|
163 | + apply_filters('geodir_set_custom_signup_page', false), |
|
164 | + 'geodir_add_listing_page' => |
|
165 | + apply_filters('geodir_set_custom_add_listing_page', false), |
|
166 | + 'geodir_preview_page' => |
|
167 | + apply_filters('geodir_set_custom_preview_page', false), |
|
168 | + 'geodir_listing_success_page' => |
|
169 | + apply_filters('geodir_set_custom_listing_success_page', false), |
|
170 | + 'geodir_listing_detail_page' => |
|
171 | + apply_filters('geodir_set_custom_listing_detail_page', false), |
|
172 | + 'geodir_listing_page' => |
|
173 | + apply_filters('geodir_set_custom_listing_page', false), |
|
174 | + 'geodir_search_page' => |
|
175 | + apply_filters('geodir_set_custom_search_page', false), |
|
176 | + 'geodir_author_page' => |
|
177 | + apply_filters('geodir_set_custom_author_page', false), |
|
178 | + 'geodir_home_map_page' => |
|
179 | + apply_filters('geodir_set_custom_home_map_page', false) |
|
180 | + )); |
|
181 | + |
|
182 | + |
|
183 | + if (geodir_is_page('login') || $geodir_custom_page_list['geodir_signup_page']) { |
|
184 | + |
|
185 | + $template = geodir_locate_template('signup'); |
|
186 | + |
|
187 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
188 | + |
|
189 | + /** |
|
190 | + * Filter the signup template path. |
|
191 | + * |
|
192 | + * @since 1.0.0 |
|
193 | + * @param string $template The template path. |
|
194 | + */ |
|
195 | + return $template = apply_filters('geodir_template_signup', $template); |
|
196 | + } |
|
317 | 197 | |
318 | - if (geodir_is_page('search') || $geodir_custom_page_list['geodir_search_page']) { |
|
198 | + if (geodir_is_page('add-listing') || $geodir_custom_page_list['geodir_add_listing_page']) { |
|
199 | + if (!geodir_is_default_location_set()) { |
|
200 | + global $information; |
|
201 | + $information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>'); |
|
202 | + |
|
203 | + $template = geodir_locate_template('information'); |
|
204 | + |
|
205 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
206 | + /** |
|
207 | + * Filter the information template path. |
|
208 | + * |
|
209 | + * @since 1.0.0 |
|
210 | + * @param string $template The template path. |
|
211 | + */ |
|
212 | + return $template = apply_filters('geodir_template_information', $template); |
|
213 | + } |
|
214 | + // check if pid exists in the record if yes then check if this post belongs to the user who is logged in. |
|
215 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
216 | + global $information; |
|
217 | + $information = __('This listing does not belong to your account, please check the listing id carefully.', 'geodirectory'); |
|
218 | + $is_current_user_owner = geodir_listing_belong_to_current_user(); |
|
219 | + if (!$is_current_user_owner) { |
|
220 | + $template = geodir_locate_template('information'); |
|
221 | + |
|
222 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
223 | + /** |
|
224 | + * Filter the information template path. |
|
225 | + * |
|
226 | + * @since 1.0.0 |
|
227 | + * @param string $template The template path. |
|
228 | + */ |
|
229 | + return $template = apply_filters('geodir_template_information', $template); |
|
230 | + } |
|
319 | 231 | |
320 | - $template = geodir_locate_template('search'); |
|
321 | 232 | |
322 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php'; |
|
323 | - /** |
|
324 | - * Filter the search template path. |
|
325 | - * |
|
326 | - * @since 1.0.0 |
|
327 | - * @param string $template The template path. |
|
328 | - */ |
|
329 | - return $template = apply_filters('geodir_template_search', $template); |
|
233 | + } |
|
234 | + |
|
235 | + //geodir_is_login(true); |
|
236 | + global $current_user; |
|
237 | + if (!$current_user->ID) { |
|
238 | + wp_redirect(geodir_login_url(array('redirect_add_listing'=>urlencode(geodir_curPageURL()))), 302); |
|
239 | + exit; |
|
240 | + } |
|
241 | + |
|
242 | + $template = geodir_locate_template('add-listing'); |
|
243 | + |
|
244 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php'; |
|
245 | + /** |
|
246 | + * Filter the add listing template path. |
|
247 | + * |
|
248 | + * @since 1.0.0 |
|
249 | + * @param string $template The template path. |
|
250 | + */ |
|
251 | + return $template = apply_filters('geodir_template_add_listing', $template); |
|
252 | + } |
|
330 | 253 | |
331 | - } |
|
332 | 254 | |
333 | - if (geodir_is_page('author') || $geodir_custom_page_list['geodir_author_page']) { |
|
255 | + if (geodir_is_page('preview') || $geodir_custom_page_list['geodir_preview_page']) { |
|
256 | + global $preview; |
|
257 | + $preview = true; |
|
334 | 258 | |
335 | - $template = geodir_locate_template('author'); |
|
259 | + $template = geodir_locate_template('preview'); |
|
336 | 260 | |
337 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php'; |
|
338 | - /** |
|
339 | - * Filter the author template path. |
|
340 | - * |
|
341 | - * @since 1.0.0 |
|
342 | - * @param string $template The template path. |
|
343 | - */ |
|
344 | - return $template = apply_filters('geodir_template_author', $template); |
|
261 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
262 | + /** |
|
263 | + * Filter the preview template path. |
|
264 | + * |
|
265 | + * @since 1.0.0 |
|
266 | + * @param string $template The template path. |
|
267 | + */ |
|
268 | + return $template = apply_filters('geodir_template_preview', $template); |
|
345 | 269 | |
346 | - } |
|
270 | + } |
|
347 | 271 | |
348 | - if (get_option('geodir_set_as_home') || geodir_is_page('home') || geodir_is_page('location')) { |
|
349 | 272 | |
350 | - global $post, $wp_query; |
|
273 | + if (geodir_is_page('listing-success') || $geodir_custom_page_list['geodir_listing_success_page']) { |
|
351 | 274 | |
352 | - if (geodir_is_page('home') || ('page' == get_option('show_on_front') && isset($post->ID) && $post->ID == get_option('page_on_front')) |
|
353 | - || (is_home() && !$wp_query->is_posts_page) |
|
354 | - ) { |
|
275 | + $template = geodir_locate_template('success'); |
|
355 | 276 | |
356 | - $template = geodir_locate_template('geodir-home'); |
|
277 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php'; |
|
278 | + /** |
|
279 | + * Filter the success template path. |
|
280 | + * |
|
281 | + * @since 1.0.0 |
|
282 | + * @param string $template The template path. |
|
283 | + */ |
|
284 | + return $template = apply_filters('geodir_template_success', $template); |
|
357 | 285 | |
358 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php'; |
|
359 | - /** |
|
360 | - * Filter the home page template path. |
|
361 | - * |
|
362 | - * @since 1.0.0 |
|
363 | - * @param string $template The template path. |
|
364 | - */ |
|
365 | - return $template = apply_filters('geodir_template_homepage', $template); |
|
286 | + } |
|
366 | 287 | |
367 | - } elseif (geodir_is_page('location')) { |
|
288 | + if (geodir_is_page('detail') || $geodir_custom_page_list['geodir_listing_detail_page']) { |
|
368 | 289 | |
369 | - $template = geodir_locate_template('location'); |
|
290 | + $template = geodir_locate_template('detail'); |
|
370 | 291 | |
371 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php'; |
|
372 | - /** |
|
373 | - * Filter the location template path. |
|
374 | - * |
|
375 | - * @since 1.0.0 |
|
376 | - * @param string $template The template path. |
|
377 | - */ |
|
378 | - return $template = apply_filters('geodir_template_location', $template); |
|
292 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
293 | + /** |
|
294 | + * Filter the detail template path. |
|
295 | + * |
|
296 | + * @since 1.0.0 |
|
297 | + * @param string $template The template path. |
|
298 | + */ |
|
299 | + return $template = apply_filters('geodir_template_detail', $template); |
|
300 | + |
|
301 | + } |
|
302 | + |
|
303 | + if (geodir_is_page('listing') || $geodir_custom_page_list['geodir_listing_page']) { |
|
304 | + |
|
305 | + $template = geodir_locate_template('listing'); |
|
306 | + |
|
307 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php'; |
|
308 | + /** |
|
309 | + * Filter the listing template path. |
|
310 | + * |
|
311 | + * @since 1.0.0 |
|
312 | + * @param string $template The template path. |
|
313 | + */ |
|
314 | + return $template = apply_filters('geodir_template_listing', $template); |
|
315 | + |
|
316 | + } |
|
379 | 317 | |
380 | - } else |
|
381 | - return $template; |
|
318 | + if (geodir_is_page('search') || $geodir_custom_page_list['geodir_search_page']) { |
|
382 | 319 | |
383 | - } |
|
320 | + $template = geodir_locate_template('search'); |
|
384 | 321 | |
385 | - return $template; |
|
322 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php'; |
|
323 | + /** |
|
324 | + * Filter the search template path. |
|
325 | + * |
|
326 | + * @since 1.0.0 |
|
327 | + * @param string $template The template path. |
|
328 | + */ |
|
329 | + return $template = apply_filters('geodir_template_search', $template); |
|
330 | + |
|
331 | + } |
|
332 | + |
|
333 | + if (geodir_is_page('author') || $geodir_custom_page_list['geodir_author_page']) { |
|
334 | + |
|
335 | + $template = geodir_locate_template('author'); |
|
336 | + |
|
337 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php'; |
|
338 | + /** |
|
339 | + * Filter the author template path. |
|
340 | + * |
|
341 | + * @since 1.0.0 |
|
342 | + * @param string $template The template path. |
|
343 | + */ |
|
344 | + return $template = apply_filters('geodir_template_author', $template); |
|
345 | + |
|
346 | + } |
|
347 | + |
|
348 | + if (get_option('geodir_set_as_home') || geodir_is_page('home') || geodir_is_page('location')) { |
|
349 | + |
|
350 | + global $post, $wp_query; |
|
351 | + |
|
352 | + if (geodir_is_page('home') || ('page' == get_option('show_on_front') && isset($post->ID) && $post->ID == get_option('page_on_front')) |
|
353 | + || (is_home() && !$wp_query->is_posts_page) |
|
354 | + ) { |
|
355 | + |
|
356 | + $template = geodir_locate_template('geodir-home'); |
|
357 | + |
|
358 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php'; |
|
359 | + /** |
|
360 | + * Filter the home page template path. |
|
361 | + * |
|
362 | + * @since 1.0.0 |
|
363 | + * @param string $template The template path. |
|
364 | + */ |
|
365 | + return $template = apply_filters('geodir_template_homepage', $template); |
|
366 | + |
|
367 | + } elseif (geodir_is_page('location')) { |
|
368 | + |
|
369 | + $template = geodir_locate_template('location'); |
|
370 | + |
|
371 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php'; |
|
372 | + /** |
|
373 | + * Filter the location template path. |
|
374 | + * |
|
375 | + * @since 1.0.0 |
|
376 | + * @param string $template The template path. |
|
377 | + */ |
|
378 | + return $template = apply_filters('geodir_template_location', $template); |
|
379 | + |
|
380 | + } else |
|
381 | + return $template; |
|
382 | + |
|
383 | + } |
|
384 | + |
|
385 | + return $template; |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | /** |
@@ -397,44 +397,44 @@ discard block |
||
397 | 397 | */ |
398 | 398 | function geodir_get_template_part($slug = '', $name = NULL) |
399 | 399 | { |
400 | - global $geodirectory, $post; |
|
401 | - /** |
|
402 | - * Called at the start for the geodir_get_template_part() function. |
|
403 | - * |
|
404 | - * Used dynamic hook name: geodir_get_template_part_{$slug} |
|
405 | - * |
|
406 | - * @since 1.0.0 |
|
407 | - * @package GeoDirectory |
|
408 | - * @param string $slug The template slug. |
|
409 | - * @param string $name The template name. |
|
410 | - */ |
|
411 | - do_action("geodir_get_template_part_{$slug}", $slug, $name); |
|
412 | - $templates = array(); |
|
413 | - $name = (string)$name; |
|
414 | - if ('' !== $name) { |
|
415 | - $template_name = "{$slug}-{$name}.php"; |
|
416 | - |
|
417 | - } else { |
|
418 | - $template_name = "{$slug}.php"; |
|
419 | - } |
|
420 | - |
|
421 | - if (!locate_template(array("geodirectory/" . $template_name))) : |
|
422 | - /** |
|
423 | - * Filter the template part with slug and name. |
|
424 | - * |
|
425 | - * @since 1.0.0 |
|
426 | - * @param string $template_name The template name. |
|
427 | - */ |
|
428 | - $template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path() . '/geodirectory-templates/' . $template_name); |
|
429 | - /** |
|
430 | - * Includes the template part with slug and name. |
|
431 | - * |
|
432 | - * @since 1.0.0 |
|
433 | - */ |
|
434 | - include($template); |
|
435 | - else: |
|
436 | - locate_template(array("geodirectory/" . $template_name), true, false); |
|
437 | - endif; |
|
400 | + global $geodirectory, $post; |
|
401 | + /** |
|
402 | + * Called at the start for the geodir_get_template_part() function. |
|
403 | + * |
|
404 | + * Used dynamic hook name: geodir_get_template_part_{$slug} |
|
405 | + * |
|
406 | + * @since 1.0.0 |
|
407 | + * @package GeoDirectory |
|
408 | + * @param string $slug The template slug. |
|
409 | + * @param string $name The template name. |
|
410 | + */ |
|
411 | + do_action("geodir_get_template_part_{$slug}", $slug, $name); |
|
412 | + $templates = array(); |
|
413 | + $name = (string)$name; |
|
414 | + if ('' !== $name) { |
|
415 | + $template_name = "{$slug}-{$name}.php"; |
|
416 | + |
|
417 | + } else { |
|
418 | + $template_name = "{$slug}.php"; |
|
419 | + } |
|
420 | + |
|
421 | + if (!locate_template(array("geodirectory/" . $template_name))) : |
|
422 | + /** |
|
423 | + * Filter the template part with slug and name. |
|
424 | + * |
|
425 | + * @since 1.0.0 |
|
426 | + * @param string $template_name The template name. |
|
427 | + */ |
|
428 | + $template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path() . '/geodirectory-templates/' . $template_name); |
|
429 | + /** |
|
430 | + * Includes the template part with slug and name. |
|
431 | + * |
|
432 | + * @since 1.0.0 |
|
433 | + */ |
|
434 | + include($template); |
|
435 | + else: |
|
436 | + locate_template(array("geodirectory/" . $template_name), true, false); |
|
437 | + endif; |
|
438 | 438 | |
439 | 439 | } |
440 | 440 | |
@@ -450,23 +450,23 @@ discard block |
||
450 | 450 | */ |
451 | 451 | function geodir_core_post_view_extra_class($class, $all_postypes = '') |
452 | 452 | { |
453 | - global $post; |
|
453 | + global $post; |
|
454 | 454 | |
455 | - if (!$all_postypes) { |
|
456 | - $all_postypes = geodir_get_posttypes(); |
|
457 | - } |
|
455 | + if (!$all_postypes) { |
|
456 | + $all_postypes = geodir_get_posttypes(); |
|
457 | + } |
|
458 | 458 | |
459 | - $gdp_post_id = !empty($post) && isset($post->ID) ? $post->ID : NULL; |
|
460 | - $gdp_post_type = $gdp_post_id > 0 && isset($post->post_type) ? $post->post_type : NULL; |
|
461 | - $gdp_post_type = $gdp_post_type != '' && !empty($all_postypes) && in_array($gdp_post_type, $all_postypes) ? $gdp_post_type : NULL; |
|
459 | + $gdp_post_id = !empty($post) && isset($post->ID) ? $post->ID : NULL; |
|
460 | + $gdp_post_type = $gdp_post_id > 0 && isset($post->post_type) ? $post->post_type : NULL; |
|
461 | + $gdp_post_type = $gdp_post_type != '' && !empty($all_postypes) && in_array($gdp_post_type, $all_postypes) ? $gdp_post_type : NULL; |
|
462 | 462 | |
463 | - if ($gdp_post_id && $gdp_post_type) { |
|
464 | - $append_class = 'gd-post-' . $gdp_post_type; |
|
465 | - $append_class .= isset($post->is_featured) && $post->is_featured > 0 ? ' gd-post-featured' : ''; |
|
466 | - $class = $class != '' ? $class . ' ' . $append_class : $append_class; |
|
467 | - } |
|
463 | + if ($gdp_post_id && $gdp_post_type) { |
|
464 | + $append_class = 'gd-post-' . $gdp_post_type; |
|
465 | + $append_class .= isset($post->is_featured) && $post->is_featured > 0 ? ' gd-post-featured' : ''; |
|
466 | + $class = $class != '' ? $class . ' ' . $append_class : $append_class; |
|
467 | + } |
|
468 | 468 | |
469 | - return $class; |
|
469 | + return $class; |
|
470 | 470 | } |
471 | 471 | |
472 | 472 | /** |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | * @param bool $favorite Listing Optional. Are favorite listings results? Default: false. |
481 | 481 | */ |
482 | 482 | function geodir_display_message_not_found_on_listing($template_listview = 'listing-listview', $favorite = false) { |
483 | - if ($favorite) { |
|
483 | + if ($favorite) { |
|
484 | 484 | $message = __('No favorite listings found which match your selection.', 'geodirectory'); |
485 | 485 | } else { |
486 | 486 | $message = __('No listings found which match your selection.', 'geodirectory'); |
@@ -107,7 +107,6 @@ |
||
107 | 107 | * @link http://php.net/manual/en/arrayaccess.offsetset.php |
108 | 108 | * |
109 | 109 | * @param mixed $offset The offset to assign the value to. |
110 | - * @param mixed $value The value to set. |
|
111 | 110 | * |
112 | 111 | * @return void |
113 | 112 | */ |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
14 | +if (!defined('ABSPATH')) exit; |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * Recursive array class to allow multidimensional array access. |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * |
40 | 40 | * @param array $data |
41 | 41 | */ |
42 | - protected function __construct( $data = array() ) { |
|
43 | - foreach ( $data as $key => $value ) { |
|
44 | - $this[ $key ] = $value; |
|
42 | + protected function __construct($data = array()) { |
|
43 | + foreach ($data as $key => $value) { |
|
44 | + $this[$key] = $value; |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | * Allow deep copies of objects |
50 | 50 | */ |
51 | 51 | public function __clone() { |
52 | - foreach ( $this->container as $key => $value ) { |
|
53 | - if ( $value instanceof self ) { |
|
54 | - $this[ $key ] = clone $value; |
|
52 | + foreach ($this->container as $key => $value) { |
|
53 | + if ($value instanceof self) { |
|
54 | + $this[$key] = clone $value; |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | } |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function toArray() { |
65 | 65 | $data = $this->container; |
66 | - foreach ( $data as $key => $value ) { |
|
67 | - if ( $value instanceof self ) { |
|
68 | - $data[ $key ] = $value->toArray(); |
|
66 | + foreach ($data as $key => $value) { |
|
67 | + if ($value instanceof self) { |
|
68 | + $data[$key] = $value->toArray(); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | return $data; |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | * |
85 | 85 | * @return boolean true on success or false on failure. |
86 | 86 | */ |
87 | - public function offsetExists( $offset ) { |
|
88 | - return isset( $this->container[ $offset ]) ; |
|
87 | + public function offsetExists($offset) { |
|
88 | + return isset($this->container[$offset]); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @return mixed Can return all value types. |
99 | 99 | */ |
100 | - public function offsetGet( $offset ) { |
|
101 | - return isset( $this->container[ $offset ] ) ? $this->container[ $offset ] : null; |
|
100 | + public function offsetGet($offset) { |
|
101 | + return isset($this->container[$offset]) ? $this->container[$offset] : null; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -111,14 +111,14 @@ discard block |
||
111 | 111 | * |
112 | 112 | * @return void |
113 | 113 | */ |
114 | - public function offsetSet( $offset, $data ) { |
|
115 | - if ( is_array( $data ) ) { |
|
116 | - $data = new self( $data ); |
|
114 | + public function offsetSet($offset, $data) { |
|
115 | + if (is_array($data)) { |
|
116 | + $data = new self($data); |
|
117 | 117 | } |
118 | - if ( $offset === null ) { // don't forget this! |
|
118 | + if ($offset === null) { // don't forget this! |
|
119 | 119 | $this->container[] = $data; |
120 | 120 | } else { |
121 | - $this->container[ $offset ] = $data; |
|
121 | + $this->container[$offset] = $data; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | $this->dirty = true; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * |
134 | 134 | * @return void |
135 | 135 | */ |
136 | - public function offsetUnset( $offset ) { |
|
137 | - unset( $this->container[ $offset ] ); |
|
136 | + public function offsetUnset($offset) { |
|
137 | + unset($this->container[$offset]); |
|
138 | 138 | } |
139 | 139 | } |
@@ -11,7 +11,9 @@ |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
14 | +if ( ! defined( 'ABSPATH' ) ) { |
|
15 | + exit; |
|
16 | +} |
|
15 | 17 | |
16 | 18 | /** |
17 | 19 | * Return the current cache expire setting. |
@@ -72,8 +72,8 @@ |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
75 | - * ArrayAccess Implementation |
|
76 | - **/ |
|
75 | + * ArrayAccess Implementation |
|
76 | + **/ |
|
77 | 77 | |
78 | 78 | /** |
79 | 79 | * Whether a offset exists |
@@ -51,7 +51,6 @@ |
||
51 | 51 | /** |
52 | 52 | * Retrieve the current session instance. |
53 | 53 | * |
54 | - * @param bool $session_id Session ID from which to populate data. |
|
55 | 54 | * |
56 | 55 | * @return bool|WP_Session |
57 | 56 | */ |
@@ -11,7 +11,9 @@ |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
14 | +if ( ! defined( 'ABSPATH' ) ) { |
|
15 | + exit; |
|
16 | +} |
|
15 | 17 | |
16 | 18 | /** |
17 | 19 | * Return the current cache expire setting. |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
14 | +if (!defined('ABSPATH')) exit; |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * WordPress Session class for managing user session data. |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @return bool|WP_Session |
57 | 57 | */ |
58 | 58 | public static function get_instance() { |
59 | - if ( ! self::$instance ) { |
|
59 | + if (!self::$instance) { |
|
60 | 60 | self::$instance = new self(); |
61 | 61 | } |
62 | 62 | |
@@ -72,17 +72,17 @@ discard block |
||
72 | 72 | * @uses apply_filters Calls `wp_session_expiration` to determine how long until sessions expire. |
73 | 73 | */ |
74 | 74 | protected function __construct() { |
75 | - if ( isset( $_COOKIE[WP_SESSION_COOKIE] ) ) { |
|
76 | - $cookie = stripslashes( $_COOKIE[WP_SESSION_COOKIE] ); |
|
77 | - $cookie_crumbs = explode( '||', $cookie ); |
|
75 | + if (isset($_COOKIE[WP_SESSION_COOKIE])) { |
|
76 | + $cookie = stripslashes($_COOKIE[WP_SESSION_COOKIE]); |
|
77 | + $cookie_crumbs = explode('||', $cookie); |
|
78 | 78 | |
79 | - if( $this->is_valid_md5( $cookie_crumbs[0] ) ) { |
|
79 | + if ($this->is_valid_md5($cookie_crumbs[0])) { |
|
80 | 80 | |
81 | 81 | $this->session_id = $cookie_crumbs[0]; |
82 | 82 | |
83 | 83 | } else { |
84 | 84 | |
85 | - $this->regenerate_id( true ); |
|
85 | + $this->regenerate_id(true); |
|
86 | 86 | |
87 | 87 | } |
88 | 88 | |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | $this->exp_variant = $cookie_crumbs[2]; |
91 | 91 | |
92 | 92 | // Update the session expiration if we're past the variant time |
93 | - if ( time() > $this->exp_variant ) { |
|
93 | + if (time() > $this->exp_variant) { |
|
94 | 94 | $this->set_expiration(); |
95 | - delete_option( "_wp_session_expires_{$this->session_id}" ); |
|
96 | - add_option( "_wp_session_expires_{$this->session_id}", $this->expires, '', 'no' ); |
|
95 | + delete_option("_wp_session_expires_{$this->session_id}"); |
|
96 | + add_option("_wp_session_expires_{$this->session_id}", $this->expires, '', 'no'); |
|
97 | 97 | } |
98 | 98 | } else { |
99 | 99 | $this->session_id = $this->generate_id(); |
@@ -125,19 +125,19 @@ discard block |
||
125 | 125 | * @uses apply_filters Calls `wp_session_expiration` to get the standard expiration time for sessions. |
126 | 126 | */ |
127 | 127 | protected function set_expiration() { |
128 | - $this->exp_variant = time() + (int) apply_filters( 'wp_session_expiration_variant', 24 * 60 ); |
|
129 | - $this->expires = time() + (int) apply_filters( 'wp_session_expiration', 30 * 60 ); |
|
128 | + $this->exp_variant = time() + (int) apply_filters('wp_session_expiration_variant', 24 * 60); |
|
129 | + $this->expires = time() + (int) apply_filters('wp_session_expiration', 30 * 60); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
133 | 133 | * Set the session cookie |
134 | 134 | */ |
135 | 135 | protected function set_cookie() { |
136 | - if (! defined( 'GD_TESTING_MODE' )) { |
|
136 | + if (!defined('GD_TESTING_MODE')) { |
|
137 | 137 | try { |
138 | - setcookie( WP_SESSION_COOKIE, $this->session_id . '||' . $this->expires . '||' . $this->exp_variant , $this->expires, COOKIEPATH, COOKIE_DOMAIN ); |
|
139 | - } catch(Exception $e) { |
|
140 | - error_log( 'Set Cookie Error: ' . $e->getMessage() ); |
|
138 | + setcookie(WP_SESSION_COOKIE, $this->session_id.'||'.$this->expires.'||'.$this->exp_variant, $this->expires, COOKIEPATH, COOKIE_DOMAIN); |
|
139 | + } catch (Exception $e) { |
|
140 | + error_log('Set Cookie Error: '.$e->getMessage()); |
|
141 | 141 | } |
142 | 142 | } |
143 | 143 | } |
@@ -148,10 +148,10 @@ discard block |
||
148 | 148 | * @return string |
149 | 149 | */ |
150 | 150 | protected function generate_id() { |
151 | - require_once( ABSPATH . 'wp-includes/class-phpass.php'); |
|
152 | - $hasher = new PasswordHash( 8, false ); |
|
151 | + require_once(ABSPATH.'wp-includes/class-phpass.php'); |
|
152 | + $hasher = new PasswordHash(8, false); |
|
153 | 153 | |
154 | - return md5( $hasher->get_random_bytes( 32 ) ); |
|
154 | + return md5($hasher->get_random_bytes(32)); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -160,8 +160,8 @@ discard block |
||
160 | 160 | * @param string $md5 |
161 | 161 | * @return int |
162 | 162 | */ |
163 | - protected function is_valid_md5( $md5 = '' ){ |
|
164 | - return preg_match( '/^[a-f0-9]{32}$/', $md5 ); |
|
163 | + protected function is_valid_md5($md5 = '') { |
|
164 | + return preg_match('/^[a-f0-9]{32}$/', $md5); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * @return array |
173 | 173 | */ |
174 | 174 | protected function read_data() { |
175 | - $this->container = get_option( "_wp_session_{$this->session_id}", array() ); |
|
175 | + $this->container = get_option("_wp_session_{$this->session_id}", array()); |
|
176 | 176 | |
177 | 177 | return $this->container; |
178 | 178 | } |
@@ -184,13 +184,13 @@ discard block |
||
184 | 184 | $option_key = "_wp_session_{$this->session_id}"; |
185 | 185 | |
186 | 186 | // Only write the collection to the DB if it's changed. |
187 | - if ( $this->dirty ) { |
|
188 | - if ( false === get_option( $option_key ) ) { |
|
189 | - add_option( "_wp_session_{$this->session_id}", $this->container, '', 'no' ); |
|
190 | - add_option( "_wp_session_expires_{$this->session_id}", $this->expires, '', 'no' ); |
|
187 | + if ($this->dirty) { |
|
188 | + if (false === get_option($option_key)) { |
|
189 | + add_option("_wp_session_{$this->session_id}", $this->container, '', 'no'); |
|
190 | + add_option("_wp_session_expires_{$this->session_id}", $this->expires, '', 'no'); |
|
191 | 191 | } else { |
192 | - delete_option( "_wp_session_{$this->session_id}" ); |
|
193 | - add_option( "_wp_session_{$this->session_id}", $this->container, '', 'no' ); |
|
192 | + delete_option("_wp_session_{$this->session_id}"); |
|
193 | + add_option("_wp_session_{$this->session_id}", $this->container, '', 'no'); |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | * @return string |
202 | 202 | */ |
203 | 203 | public function json_out() { |
204 | - return json_encode( $this->container ); |
|
204 | + return json_encode($this->container); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -211,10 +211,10 @@ discard block |
||
211 | 211 | * |
212 | 212 | * @return bool |
213 | 213 | */ |
214 | - public function json_in( $data ) { |
|
215 | - $array = json_decode( $data ); |
|
214 | + public function json_in($data) { |
|
215 | + $array = json_decode($data); |
|
216 | 216 | |
217 | - if ( is_array( $array ) ) { |
|
217 | + if (is_array($array)) { |
|
218 | 218 | $this->container = $array; |
219 | 219 | return true; |
220 | 220 | } |
@@ -227,9 +227,9 @@ discard block |
||
227 | 227 | * |
228 | 228 | * @param bool $delete_old Flag whether or not to delete the old session data from the server. |
229 | 229 | */ |
230 | - public function regenerate_id( $delete_old = false ) { |
|
231 | - if ( $delete_old ) { |
|
232 | - delete_option( "_wp_session_{$this->session_id}" ); |
|
230 | + public function regenerate_id($delete_old = false) { |
|
231 | + if ($delete_old) { |
|
232 | + delete_option("_wp_session_{$this->session_id}"); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | $this->session_id = $this->generate_id(); |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | * @return mixed |
275 | 275 | */ |
276 | 276 | public function current() { |
277 | - return current( $this->container ); |
|
277 | + return current($this->container); |
|
278 | 278 | } |
279 | 279 | |
280 | 280 | /** |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | * @return mixed |
286 | 286 | */ |
287 | 287 | public function key() { |
288 | - return key( $this->container ); |
|
288 | + return key($this->container); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * @return void |
297 | 297 | */ |
298 | 298 | public function next() { |
299 | - next( $this->container ); |
|
299 | + next($this->container); |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | /** |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | * @return void |
308 | 308 | */ |
309 | 309 | public function rewind() { |
310 | - reset( $this->container ); |
|
310 | + reset($this->container); |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | /** |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | * @return bool |
319 | 319 | */ |
320 | 320 | public function valid() { |
321 | - return $this->offsetExists( $this->key() ); |
|
321 | + return $this->offsetExists($this->key()); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | /*****************************************************************/ |
@@ -333,6 +333,6 @@ discard block |
||
333 | 333 | * @return int |
334 | 334 | */ |
335 | 335 | public function count() { |
336 | - return count( $this->container ); |
|
336 | + return count($this->container); |
|
337 | 337 | } |
338 | 338 | } |
@@ -40,8 +40,9 @@ |
||
40 | 40 | $geodir_active_nav_locations = get_nav_menu_locations(); |
41 | 41 | if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) { |
42 | 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]; |
|
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 | + } |
|
45 | 46 | } |
46 | 47 | } |
47 | 48 |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | ), |
150 | 150 | array( |
151 | 151 | 'name' => __('Resize image large size', 'geodirectory'), |
152 | - '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')), |
|
152 | + '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')), |
|
153 | 153 | 'id' => 'geodir_use_wp_media_large_size', |
154 | 154 | 'type' => 'checkbox', |
155 | 155 | 'std' => '0' |
@@ -590,11 +590,11 @@ discard block |
||
590 | 590 | 'id' => 'geodir_default_rating_star_icon', |
591 | 591 | 'type' => 'file', |
592 | 592 | 'std' => '0', |
593 | - 'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section |
|
593 | + 'value' => geodir_plugin_url().'/geodirectory-assets/images/stars.png'// Default value to show home top section |
|
594 | 594 | ), |
595 | 595 | array( |
596 | 596 | 'name' => __('Enable Font Awesome', 'geodirectory'), |
597 | - 'desc' => __('When enabled all rating images will be using font awesome rating icons as images.', 'geodirectory' ), |
|
597 | + 'desc' => __('When enabled all rating images will be using font awesome rating icons as images.', 'geodirectory'), |
|
598 | 598 | 'id' => 'geodir_reviewrating_enable_font_awesome', |
599 | 599 | 'type' => 'checkbox', |
600 | 600 | 'std' => '0' |
@@ -1059,7 +1059,7 @@ discard block |
||
1059 | 1059 | 'name' => __('Google Maps API KEY', 'geodirectory'), |
1060 | 1060 | 'desc' => sprintf( |
1061 | 1061 | __('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'), |
1062 | - 'https://console.developers.google.com/flows/enableapi?apiid=maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend&keyType=CLIENT_SIDE&reusekey=true','https://wpgeodirectory.com/docs/add-google-api-key/' ), |
|
1062 | + 'https://console.developers.google.com/flows/enableapi?apiid=maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend&keyType=CLIENT_SIDE&reusekey=true', 'https://wpgeodirectory.com/docs/add-google-api-key/' ), |
|
1063 | 1063 | 'tip' => '', |
1064 | 1064 | 'id' => 'geodir_google_api_key', |
1065 | 1065 | 'css' => 'min-width:300px;', |
@@ -1134,7 +1134,7 @@ discard block |
||
1134 | 1134 | 'id' => 'geodir_default_marker_icon', |
1135 | 1135 | 'type' => 'file', |
1136 | 1136 | 'std' => '0', |
1137 | - 'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section |
|
1137 | + 'value' => geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section |
|
1138 | 1138 | ), |
1139 | 1139 | // add option that allows enable/disable map dragging to phone devices |
1140 | 1140 | array( |
@@ -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 | * Filter GD design settings array. |
@@ -55,543 +55,543 @@ discard block |
||
55 | 55 | */ |
56 | 56 | $geodir_settings['design_settings'] = apply_filters('geodir_design_settings', array( |
57 | 57 | |
58 | - /* Home Layout Settings start */ |
|
59 | - array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '), |
|
58 | + /* Home Layout Settings start */ |
|
59 | + array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '), |
|
60 | 60 | |
61 | 61 | |
62 | - array('name' => __('Home Top Section Settings', 'geodirectory'), |
|
63 | - 'type' => 'sectionstart', |
|
64 | - 'desc' => '', |
|
65 | - 'id' => 'geodir_home_top_section'), |
|
62 | + array('name' => __('Home Top Section Settings', 'geodirectory'), |
|
63 | + 'type' => 'sectionstart', |
|
64 | + 'desc' => '', |
|
65 | + 'id' => 'geodir_home_top_section'), |
|
66 | 66 | |
67 | - array( |
|
68 | - 'name' => __('Geodirectory home page', 'geodirectory'), |
|
69 | - 'desc' => __('Set geodirectory home page as your home. <b style="color:red;">This setting has been depreciated and will be removed in the next version, instead please set the GD home page in GD>Permalinks and then set this page to the front page under Settings>Reading>Front Page</b>', 'geodirectory'), |
|
70 | - 'id' => 'geodir_set_as_home', |
|
71 | - 'type' => 'checkbox', |
|
72 | - 'std' => '0' // Default value to show home top section |
|
73 | - ), |
|
67 | + array( |
|
68 | + 'name' => __('Geodirectory home page', 'geodirectory'), |
|
69 | + 'desc' => __('Set geodirectory home page as your home. <b style="color:red;">This setting has been depreciated and will be removed in the next version, instead please set the GD home page in GD>Permalinks and then set this page to the front page under Settings>Reading>Front Page</b>', 'geodirectory'), |
|
70 | + 'id' => 'geodir_set_as_home', |
|
71 | + 'type' => 'checkbox', |
|
72 | + 'std' => '0' // Default value to show home top section |
|
73 | + ), |
|
74 | 74 | |
75 | - array( |
|
76 | - 'name' => __('Home top section', 'geodirectory'), |
|
77 | - 'desc' => __('Show the top section of home page', 'geodirectory'), |
|
78 | - 'id' => 'geodir_show_home_top_section', |
|
79 | - 'type' => 'checkbox', |
|
80 | - 'std' => '1' // Default value to show home top section |
|
81 | - ), |
|
75 | + array( |
|
76 | + 'name' => __('Home top section', 'geodirectory'), |
|
77 | + 'desc' => __('Show the top section of home page', 'geodirectory'), |
|
78 | + 'id' => 'geodir_show_home_top_section', |
|
79 | + 'type' => 'checkbox', |
|
80 | + 'std' => '1' // Default value to show home top section |
|
81 | + ), |
|
82 | 82 | |
83 | 83 | |
84 | - array('type' => 'sectionend', 'id' => 'geodir_home_top_section'), |
|
84 | + array('type' => 'sectionend', 'id' => 'geodir_home_top_section'), |
|
85 | 85 | |
86 | 86 | |
87 | - array('name' => __('Home Page Layout Settings', 'geodirectory'), |
|
88 | - 'type' => 'sectionstart', |
|
89 | - 'desc' => '', |
|
90 | - 'id' => 'geodir_home_layout'), |
|
87 | + array('name' => __('Home Page Layout Settings', 'geodirectory'), |
|
88 | + 'type' => 'sectionstart', |
|
89 | + 'desc' => '', |
|
90 | + 'id' => 'geodir_home_layout'), |
|
91 | 91 | |
92 | - array( |
|
93 | - 'name' => __('Home right section', 'geodirectory'), |
|
94 | - 'desc' => __('Show the right section of home page', 'geodirectory'), |
|
95 | - 'id' => 'geodir_show_home_right_section', |
|
96 | - 'type' => 'checkbox', |
|
97 | - 'std' => '1' // Default value to show home top section |
|
98 | - ), |
|
92 | + array( |
|
93 | + 'name' => __('Home right section', 'geodirectory'), |
|
94 | + 'desc' => __('Show the right section of home page', 'geodirectory'), |
|
95 | + 'id' => 'geodir_show_home_right_section', |
|
96 | + 'type' => 'checkbox', |
|
97 | + 'std' => '1' // Default value to show home top section |
|
98 | + ), |
|
99 | 99 | |
100 | - array( |
|
101 | - 'name' => __('Width of home right section', 'geodirectory'), |
|
102 | - 'desc' => __('Enter the width of right section of home page in %', 'geodirectory'), |
|
103 | - 'id' => 'geodir_width_home_right_section', |
|
104 | - 'type' => 'text', |
|
105 | - 'css' => 'min-width:300px;', |
|
106 | - 'std' => '30' // Default value to show home top section |
|
107 | - ), |
|
100 | + array( |
|
101 | + 'name' => __('Width of home right section', 'geodirectory'), |
|
102 | + 'desc' => __('Enter the width of right section of home page in %', 'geodirectory'), |
|
103 | + 'id' => 'geodir_width_home_right_section', |
|
104 | + 'type' => 'text', |
|
105 | + 'css' => 'min-width:300px;', |
|
106 | + 'std' => '30' // Default value to show home top section |
|
107 | + ), |
|
108 | 108 | |
109 | - array( |
|
110 | - 'name' => __('Home content section', 'geodirectory'), |
|
111 | - 'desc' => __('Show the content section of home page', 'geodirectory'), |
|
112 | - 'id' => 'geodir_show_home_contant_section', |
|
113 | - 'type' => 'checkbox', |
|
114 | - 'std' => '1' // Default value to show home top section |
|
115 | - ), |
|
109 | + array( |
|
110 | + 'name' => __('Home content section', 'geodirectory'), |
|
111 | + 'desc' => __('Show the content section of home page', 'geodirectory'), |
|
112 | + 'id' => 'geodir_show_home_contant_section', |
|
113 | + 'type' => 'checkbox', |
|
114 | + 'std' => '1' // Default value to show home top section |
|
115 | + ), |
|
116 | 116 | |
117 | - array( |
|
118 | - 'name' => __('Width of home content section', 'geodirectory'), |
|
119 | - 'desc' => __('Enter the width of content section of home page in %', 'geodirectory'), |
|
120 | - 'id' => 'geodir_width_home_contant_section', |
|
121 | - 'type' => 'text', |
|
122 | - 'css' => 'min-width:300px;', |
|
123 | - 'std' => '63' // Default value to show home top section |
|
124 | - ), |
|
117 | + array( |
|
118 | + 'name' => __('Width of home content section', 'geodirectory'), |
|
119 | + 'desc' => __('Enter the width of content section of home page in %', 'geodirectory'), |
|
120 | + 'id' => 'geodir_width_home_contant_section', |
|
121 | + 'type' => 'text', |
|
122 | + 'css' => 'min-width:300px;', |
|
123 | + 'std' => '63' // Default value to show home top section |
|
124 | + ), |
|
125 | 125 | |
126 | - array( |
|
127 | - 'name' => __('Home left section', 'geodirectory'), |
|
128 | - 'desc' => __('Show the left section of home page', 'geodirectory'), |
|
129 | - 'id' => 'geodir_show_home_left_section', |
|
130 | - 'type' => 'checkbox', |
|
131 | - 'std' => '0' // Default value to show home top section |
|
132 | - ), |
|
126 | + array( |
|
127 | + 'name' => __('Home left section', 'geodirectory'), |
|
128 | + 'desc' => __('Show the left section of home page', 'geodirectory'), |
|
129 | + 'id' => 'geodir_show_home_left_section', |
|
130 | + 'type' => 'checkbox', |
|
131 | + 'std' => '0' // Default value to show home top section |
|
132 | + ), |
|
133 | 133 | |
134 | - array( |
|
135 | - 'name' => __('Width of home left section', 'geodirectory'), |
|
136 | - 'desc' => __('Enter the width of left section of home page in %', 'geodirectory'), |
|
137 | - 'id' => 'geodir_width_home_left_section', |
|
138 | - 'type' => 'text', |
|
139 | - 'css' => 'min-width:300px;', |
|
140 | - 'std' => '30' // Default value to show home top section |
|
141 | - ), |
|
134 | + array( |
|
135 | + 'name' => __('Width of home left section', 'geodirectory'), |
|
136 | + 'desc' => __('Enter the width of left section of home page in %', 'geodirectory'), |
|
137 | + 'id' => 'geodir_width_home_left_section', |
|
138 | + 'type' => 'text', |
|
139 | + 'css' => 'min-width:300px;', |
|
140 | + 'std' => '30' // Default value to show home top section |
|
141 | + ), |
|
142 | 142 | |
143 | - array( |
|
144 | - 'name' => __('Home bottom section', 'geodirectory'), |
|
145 | - 'desc' => __('Show the bottom section of home page', 'geodirectory'), |
|
146 | - 'id' => 'geodir_show_home_bottom_section', |
|
147 | - 'type' => 'checkbox', |
|
148 | - 'std' => '0' // Default value to show home top section |
|
149 | - ), |
|
150 | - array( |
|
151 | - 'name' => __('Resize image large size', 'geodirectory'), |
|
152 | - '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')), |
|
153 | - 'id' => 'geodir_use_wp_media_large_size', |
|
154 | - 'type' => 'checkbox', |
|
155 | - 'std' => '0' |
|
156 | - ), |
|
143 | + array( |
|
144 | + 'name' => __('Home bottom section', 'geodirectory'), |
|
145 | + 'desc' => __('Show the bottom section of home page', 'geodirectory'), |
|
146 | + 'id' => 'geodir_show_home_bottom_section', |
|
147 | + 'type' => 'checkbox', |
|
148 | + 'std' => '0' // Default value to show home top section |
|
149 | + ), |
|
150 | + array( |
|
151 | + 'name' => __('Resize image large size', 'geodirectory'), |
|
152 | + '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')), |
|
153 | + 'id' => 'geodir_use_wp_media_large_size', |
|
154 | + 'type' => 'checkbox', |
|
155 | + 'std' => '0' |
|
156 | + ), |
|
157 | 157 | |
158 | - array('type' => 'sectionend', 'id' => 'geodir_home_layout'), |
|
158 | + array('type' => 'sectionend', 'id' => 'geodir_home_layout'), |
|
159 | 159 | |
160 | 160 | |
161 | - /* Home Layout Settings end */ |
|
161 | + /* Home Layout Settings end */ |
|
162 | 162 | |
163 | 163 | |
164 | - /* Listing Layout Settings end */ |
|
164 | + /* Listing Layout Settings end */ |
|
165 | 165 | |
166 | - array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '), |
|
166 | + array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '), |
|
167 | 167 | |
168 | 168 | |
169 | - array('name' => __('Listing Page Layout Settings', 'geodirectory'), |
|
170 | - 'type' => 'sectionstart', |
|
171 | - 'desc' => '', |
|
172 | - 'id' => 'geodir_listing_layout'), |
|
169 | + array('name' => __('Listing Page Layout Settings', 'geodirectory'), |
|
170 | + 'type' => 'sectionstart', |
|
171 | + 'desc' => '', |
|
172 | + 'id' => 'geodir_listing_layout'), |
|
173 | 173 | |
174 | - array( |
|
175 | - 'name' => __('Listing top section', 'geodirectory'), |
|
176 | - 'desc' => __('Show the top section of listing page', 'geodirectory'), |
|
177 | - 'id' => 'geodir_show_listing_top_section', |
|
178 | - 'type' => 'checkbox', |
|
179 | - 'std' => '1' // Default value to show home top section |
|
180 | - ), |
|
174 | + array( |
|
175 | + 'name' => __('Listing top section', 'geodirectory'), |
|
176 | + 'desc' => __('Show the top section of listing page', 'geodirectory'), |
|
177 | + 'id' => 'geodir_show_listing_top_section', |
|
178 | + 'type' => 'checkbox', |
|
179 | + 'std' => '1' // Default value to show home top section |
|
180 | + ), |
|
181 | 181 | |
182 | - array( |
|
183 | - 'name' => __('Listing right section', 'geodirectory'), |
|
184 | - 'desc' => __('Show the right section of listing page', 'geodirectory'), |
|
185 | - 'id' => 'geodir_show_listing_right_section', |
|
186 | - 'type' => 'checkbox', |
|
187 | - 'std' => '1' // Default value to show home top section |
|
188 | - ), |
|
182 | + array( |
|
183 | + 'name' => __('Listing right section', 'geodirectory'), |
|
184 | + 'desc' => __('Show the right section of listing page', 'geodirectory'), |
|
185 | + 'id' => 'geodir_show_listing_right_section', |
|
186 | + 'type' => 'checkbox', |
|
187 | + 'std' => '1' // Default value to show home top section |
|
188 | + ), |
|
189 | 189 | |
190 | - array( |
|
191 | - 'name' => __('Width of listing right section', 'geodirectory'), |
|
192 | - 'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'), |
|
193 | - 'id' => 'geodir_width_listing_right_section', |
|
194 | - 'type' => 'text', |
|
195 | - 'css' => 'min-width:300px;', |
|
196 | - 'std' => '30' // Default value to show home top section |
|
197 | - ), |
|
190 | + array( |
|
191 | + 'name' => __('Width of listing right section', 'geodirectory'), |
|
192 | + 'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'), |
|
193 | + 'id' => 'geodir_width_listing_right_section', |
|
194 | + 'type' => 'text', |
|
195 | + 'css' => 'min-width:300px;', |
|
196 | + 'std' => '30' // Default value to show home top section |
|
197 | + ), |
|
198 | 198 | |
199 | 199 | |
200 | - array( |
|
201 | - 'name' => __('Listing content section view', 'geodirectory'), |
|
202 | - 'desc' => __('Set the listing view of listing page', 'geodirectory'), |
|
203 | - 'id' => 'geodir_listing_view', |
|
204 | - 'css' => 'min-width:300px;', |
|
205 | - 'std' => 'gridview_onehalf', |
|
206 | - 'type' => 'select', |
|
207 | - 'class' => 'chosen_select', |
|
208 | - 'options' => array_unique(array( |
|
209 | - 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
210 | - 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
211 | - 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
212 | - 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
213 | - 'listview' => __('List view', 'geodirectory'), |
|
214 | - )) |
|
215 | - ), |
|
200 | + array( |
|
201 | + 'name' => __('Listing content section view', 'geodirectory'), |
|
202 | + 'desc' => __('Set the listing view of listing page', 'geodirectory'), |
|
203 | + 'id' => 'geodir_listing_view', |
|
204 | + 'css' => 'min-width:300px;', |
|
205 | + 'std' => 'gridview_onehalf', |
|
206 | + 'type' => 'select', |
|
207 | + 'class' => 'chosen_select', |
|
208 | + 'options' => array_unique(array( |
|
209 | + 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
210 | + 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
211 | + 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
212 | + 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
213 | + 'listview' => __('List view', 'geodirectory'), |
|
214 | + )) |
|
215 | + ), |
|
216 | 216 | |
217 | - array( |
|
218 | - 'name' => __('Width of listing content section', 'geodirectory'), |
|
219 | - 'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'), |
|
220 | - 'id' => 'geodir_width_listing_contant_section', |
|
221 | - 'type' => 'text', |
|
222 | - 'css' => 'min-width:300px;', |
|
223 | - 'std' => '63' // Default value to show home top section |
|
224 | - ), |
|
217 | + array( |
|
218 | + 'name' => __('Width of listing content section', 'geodirectory'), |
|
219 | + 'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'), |
|
220 | + 'id' => 'geodir_width_listing_contant_section', |
|
221 | + 'type' => 'text', |
|
222 | + 'css' => 'min-width:300px;', |
|
223 | + 'std' => '63' // Default value to show home top section |
|
224 | + ), |
|
225 | 225 | |
226 | - array( |
|
227 | - 'name' => __('Listing left section', 'geodirectory'), |
|
228 | - 'desc' => __('Show the left section of listing page', 'geodirectory'), |
|
229 | - 'id' => 'geodir_show_listing_left_section', |
|
230 | - 'type' => 'checkbox', |
|
231 | - 'std' => '0' // Default value to show home top section |
|
232 | - ), |
|
226 | + array( |
|
227 | + 'name' => __('Listing left section', 'geodirectory'), |
|
228 | + 'desc' => __('Show the left section of listing page', 'geodirectory'), |
|
229 | + 'id' => 'geodir_show_listing_left_section', |
|
230 | + 'type' => 'checkbox', |
|
231 | + 'std' => '0' // Default value to show home top section |
|
232 | + ), |
|
233 | 233 | |
234 | - array( |
|
235 | - 'name' => __('Width of listing left section', 'geodirectory'), |
|
236 | - 'desc' => __('Enter the width of left section of listing in %', 'geodirectory'), |
|
237 | - 'id' => 'geodir_width_listing_left_section', |
|
238 | - 'type' => 'text', |
|
239 | - 'css' => 'min-width:300px;', |
|
240 | - 'std' => '30' // Default value to show home top section |
|
241 | - ), |
|
234 | + array( |
|
235 | + 'name' => __('Width of listing left section', 'geodirectory'), |
|
236 | + 'desc' => __('Enter the width of left section of listing in %', 'geodirectory'), |
|
237 | + 'id' => 'geodir_width_listing_left_section', |
|
238 | + 'type' => 'text', |
|
239 | + 'css' => 'min-width:300px;', |
|
240 | + 'std' => '30' // Default value to show home top section |
|
241 | + ), |
|
242 | 242 | |
243 | - array( |
|
244 | - 'name' => __('Listing bottom section', 'geodirectory'), |
|
245 | - 'desc' => __('Show the bottom section of listing page', 'geodirectory'), |
|
246 | - 'id' => 'geodir_show_listing_bottom_section', |
|
247 | - 'type' => 'checkbox', |
|
248 | - 'std' => '0' // Default value to show home top section |
|
249 | - ), |
|
243 | + array( |
|
244 | + 'name' => __('Listing bottom section', 'geodirectory'), |
|
245 | + 'desc' => __('Show the bottom section of listing page', 'geodirectory'), |
|
246 | + 'id' => 'geodir_show_listing_bottom_section', |
|
247 | + 'type' => 'checkbox', |
|
248 | + 'std' => '0' // Default value to show home top section |
|
249 | + ), |
|
250 | 250 | |
251 | - array( |
|
252 | - 'name' => __('Upload listing no image', 'geodirectory'), |
|
253 | - 'desc' => '', |
|
254 | - 'id' => 'geodir_listing_no_img', |
|
255 | - 'type' => 'file', |
|
256 | - 'std' => '0' // Default value to show home top section |
|
257 | - ), |
|
251 | + array( |
|
252 | + 'name' => __('Upload listing no image', 'geodirectory'), |
|
253 | + 'desc' => '', |
|
254 | + 'id' => 'geodir_listing_no_img', |
|
255 | + 'type' => 'file', |
|
256 | + 'std' => '0' // Default value to show home top section |
|
257 | + ), |
|
258 | 258 | |
259 | - array( |
|
260 | - 'name' => __('Description word limit', 'geodirectory'), |
|
261 | - 'desc' => '', |
|
262 | - 'id' => 'geodir_desc_word_limit', |
|
263 | - 'type' => 'text', |
|
264 | - 'css' => 'min-width:300px;', |
|
265 | - 'std' => '50' // Default value to show home top section |
|
266 | - ), |
|
259 | + array( |
|
260 | + 'name' => __('Description word limit', 'geodirectory'), |
|
261 | + 'desc' => '', |
|
262 | + 'id' => 'geodir_desc_word_limit', |
|
263 | + 'type' => 'text', |
|
264 | + 'css' => 'min-width:300px;', |
|
265 | + 'std' => '50' // Default value to show home top section |
|
266 | + ), |
|
267 | 267 | |
268 | - array( |
|
269 | - 'name' => __('Hover listing map animation', 'geodirectory'), |
|
270 | - 'desc' => __('Bounce map pin if listing hovered', 'geodirectory'), |
|
271 | - 'id' => 'geodir_listing_hover_bounce_map_pin', |
|
272 | - 'type' => 'checkbox', |
|
273 | - 'std' => '1' // Default value to show home top section |
|
274 | - ), |
|
268 | + array( |
|
269 | + 'name' => __('Hover listing map animation', 'geodirectory'), |
|
270 | + 'desc' => __('Bounce map pin if listing hovered', 'geodirectory'), |
|
271 | + 'id' => 'geodir_listing_hover_bounce_map_pin', |
|
272 | + 'type' => 'checkbox', |
|
273 | + 'std' => '1' // Default value to show home top section |
|
274 | + ), |
|
275 | 275 | |
276 | - array('type' => 'sectionend', 'id' => 'geodir_listing_layout'), |
|
276 | + array('type' => 'sectionend', 'id' => 'geodir_listing_layout'), |
|
277 | 277 | |
278 | 278 | |
279 | - array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '), |
|
279 | + array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '), |
|
280 | 280 | |
281 | - array( |
|
282 | - 'name' => __('New listing default status', 'geodirectory'), |
|
283 | - 'desc' => __('Select new listing default status.', 'geodirectory'), |
|
284 | - 'tip' => '', |
|
285 | - 'id' => 'geodir_new_post_default_status', |
|
286 | - 'css' => 'min-width:300px;', |
|
287 | - 'std' => 'publish', |
|
288 | - 'type' => 'select', |
|
289 | - 'class' => 'chosen_select', |
|
290 | - 'options' => array_unique(array( |
|
291 | - 'publish' => __('publish', 'geodirectory'), |
|
292 | - 'draft' => __('draft', 'geodirectory'), |
|
293 | - )) |
|
294 | - ), |
|
281 | + array( |
|
282 | + 'name' => __('New listing default status', 'geodirectory'), |
|
283 | + 'desc' => __('Select new listing default status.', 'geodirectory'), |
|
284 | + 'tip' => '', |
|
285 | + 'id' => 'geodir_new_post_default_status', |
|
286 | + 'css' => 'min-width:300px;', |
|
287 | + 'std' => 'publish', |
|
288 | + 'type' => 'select', |
|
289 | + 'class' => 'chosen_select', |
|
290 | + 'options' => array_unique(array( |
|
291 | + 'publish' => __('publish', 'geodirectory'), |
|
292 | + 'draft' => __('draft', 'geodirectory'), |
|
293 | + )) |
|
294 | + ), |
|
295 | 295 | |
296 | - array( |
|
297 | - 'name' => __('New listings settings', 'geodirectory'), |
|
298 | - 'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'), |
|
299 | - 'id' => 'geodir_listing_new_days', |
|
300 | - 'type' => 'text', |
|
301 | - 'css' => 'min-width:300px;', |
|
302 | - 'std' => '30' // Default value for the page title - changed in settings |
|
303 | - ), |
|
296 | + array( |
|
297 | + 'name' => __('New listings settings', 'geodirectory'), |
|
298 | + 'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'), |
|
299 | + 'id' => 'geodir_listing_new_days', |
|
300 | + 'type' => 'text', |
|
301 | + 'css' => 'min-width:300px;', |
|
302 | + 'std' => '30' // Default value for the page title - changed in settings |
|
303 | + ), |
|
304 | 304 | |
305 | - array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'), |
|
305 | + array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'), |
|
306 | 306 | |
307 | 307 | |
308 | - array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'), |
|
308 | + array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'), |
|
309 | 309 | |
310 | - array( |
|
311 | - 'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'), |
|
312 | - 'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'), |
|
313 | - 'id' => 'geodir_accept_term_condition', |
|
314 | - 'type' => 'checkbox', |
|
315 | - 'std' => '1' // Default value to show home top section |
|
316 | - ), |
|
310 | + array( |
|
311 | + 'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'), |
|
312 | + 'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'), |
|
313 | + 'id' => 'geodir_accept_term_condition', |
|
314 | + 'type' => 'checkbox', |
|
315 | + 'std' => '1' // Default value to show home top section |
|
316 | + ), |
|
317 | 317 | |
318 | 318 | |
319 | - array( |
|
320 | - 'name' => __('Show description field as editor', 'geodirectory'), |
|
321 | - 'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'), |
|
322 | - 'tip' => '', |
|
323 | - 'id' => 'geodir_tiny_editor_on_add_listing', |
|
324 | - 'css' => 'min-width:300px;', |
|
325 | - 'std' => array(), |
|
326 | - 'type' => 'multiselect', |
|
327 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
328 | - 'class' => 'chosen_select', |
|
329 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
330 | - ), |
|
319 | + array( |
|
320 | + 'name' => __('Show description field as editor', 'geodirectory'), |
|
321 | + 'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'), |
|
322 | + 'tip' => '', |
|
323 | + 'id' => 'geodir_tiny_editor_on_add_listing', |
|
324 | + 'css' => 'min-width:300px;', |
|
325 | + 'std' => array(), |
|
326 | + 'type' => 'multiselect', |
|
327 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
328 | + 'class' => 'chosen_select', |
|
329 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
330 | + ), |
|
331 | 331 | |
332 | - array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'), |
|
333 | - /* Listing Layout Settings end */ |
|
332 | + array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'), |
|
333 | + /* Listing Layout Settings end */ |
|
334 | 334 | |
335 | 335 | |
336 | - /* Search Layout Settings end */ |
|
336 | + /* Search Layout Settings end */ |
|
337 | 337 | |
338 | - array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '), |
|
338 | + array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '), |
|
339 | 339 | |
340 | 340 | |
341 | - array('name' => __('Search Page Layout Settings', 'geodirectory'), |
|
342 | - 'type' => 'sectionstart', |
|
343 | - 'desc' => '', |
|
344 | - 'id' => 'geodir_search_layout'), |
|
341 | + array('name' => __('Search Page Layout Settings', 'geodirectory'), |
|
342 | + 'type' => 'sectionstart', |
|
343 | + 'desc' => '', |
|
344 | + 'id' => 'geodir_search_layout'), |
|
345 | 345 | |
346 | - array( |
|
347 | - 'name' => __('Search top section', 'geodirectory'), |
|
348 | - 'desc' => __('Show the top section of search page', 'geodirectory'), |
|
349 | - 'id' => 'geodir_show_search_top_section', |
|
350 | - 'type' => 'checkbox', |
|
351 | - 'std' => '1' // Default value to show home top section |
|
352 | - ), |
|
346 | + array( |
|
347 | + 'name' => __('Search top section', 'geodirectory'), |
|
348 | + 'desc' => __('Show the top section of search page', 'geodirectory'), |
|
349 | + 'id' => 'geodir_show_search_top_section', |
|
350 | + 'type' => 'checkbox', |
|
351 | + 'std' => '1' // Default value to show home top section |
|
352 | + ), |
|
353 | 353 | |
354 | - array( |
|
355 | - 'name' => __('Search right section', 'geodirectory'), |
|
356 | - 'desc' => __('Show the right section of search page', 'geodirectory'), |
|
357 | - 'id' => 'geodir_show_search_right_section', |
|
358 | - 'type' => 'checkbox', |
|
359 | - 'std' => '1' // Default value to show home top section |
|
360 | - ), |
|
354 | + array( |
|
355 | + 'name' => __('Search right section', 'geodirectory'), |
|
356 | + 'desc' => __('Show the right section of search page', 'geodirectory'), |
|
357 | + 'id' => 'geodir_show_search_right_section', |
|
358 | + 'type' => 'checkbox', |
|
359 | + 'std' => '1' // Default value to show home top section |
|
360 | + ), |
|
361 | 361 | |
362 | - array( |
|
363 | - 'name' => __('Width of search right section', 'geodirectory'), |
|
364 | - 'desc' => __('Enter the width of right section of search page in %', 'geodirectory'), |
|
365 | - 'id' => 'geodir_width_search_right_section', |
|
366 | - 'type' => 'text', |
|
367 | - 'css' => 'min-width:300px;', |
|
368 | - 'std' => '30' // Default value to show home top section |
|
369 | - ), |
|
362 | + array( |
|
363 | + 'name' => __('Width of search right section', 'geodirectory'), |
|
364 | + 'desc' => __('Enter the width of right section of search page in %', 'geodirectory'), |
|
365 | + 'id' => 'geodir_width_search_right_section', |
|
366 | + 'type' => 'text', |
|
367 | + 'css' => 'min-width:300px;', |
|
368 | + 'std' => '30' // Default value to show home top section |
|
369 | + ), |
|
370 | 370 | |
371 | 371 | |
372 | - array( |
|
373 | - 'name' => __('Search content section view', 'geodirectory'), |
|
374 | - 'desc' => __('Set the listing view of search page', 'geodirectory'), |
|
375 | - 'id' => 'geodir_search_view', |
|
376 | - 'css' => 'min-width:300px;', |
|
377 | - 'std' => 'gridview_onehalf', |
|
378 | - 'type' => 'select', |
|
379 | - 'class' => 'chosen_select', |
|
380 | - 'options' => array_unique(array( |
|
381 | - 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
382 | - 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
383 | - 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
384 | - 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
385 | - 'listview' => __('List view', 'geodirectory'), |
|
386 | - )) |
|
387 | - ), |
|
372 | + array( |
|
373 | + 'name' => __('Search content section view', 'geodirectory'), |
|
374 | + 'desc' => __('Set the listing view of search page', 'geodirectory'), |
|
375 | + 'id' => 'geodir_search_view', |
|
376 | + 'css' => 'min-width:300px;', |
|
377 | + 'std' => 'gridview_onehalf', |
|
378 | + 'type' => 'select', |
|
379 | + 'class' => 'chosen_select', |
|
380 | + 'options' => array_unique(array( |
|
381 | + 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
382 | + 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
383 | + 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
384 | + 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
385 | + 'listview' => __('List view', 'geodirectory'), |
|
386 | + )) |
|
387 | + ), |
|
388 | 388 | |
389 | - array( |
|
390 | - 'name' => __('Width of search content section', 'geodirectory'), |
|
391 | - 'desc' => __('Enter the width of content section of search page in %', 'geodirectory'), |
|
392 | - 'id' => 'geodir_width_search_contant_section', |
|
393 | - 'type' => 'text', |
|
394 | - 'css' => 'min-width:300px;', |
|
395 | - 'std' => '63' // Default value to show home top section |
|
396 | - ), |
|
389 | + array( |
|
390 | + 'name' => __('Width of search content section', 'geodirectory'), |
|
391 | + 'desc' => __('Enter the width of content section of search page in %', 'geodirectory'), |
|
392 | + 'id' => 'geodir_width_search_contant_section', |
|
393 | + 'type' => 'text', |
|
394 | + 'css' => 'min-width:300px;', |
|
395 | + 'std' => '63' // Default value to show home top section |
|
396 | + ), |
|
397 | 397 | |
398 | - array( |
|
399 | - 'name' => __('Search left section', 'geodirectory'), |
|
400 | - 'desc' => __('Show the left section of search page', 'geodirectory'), |
|
401 | - 'id' => 'geodir_show_search_left_section', |
|
402 | - 'type' => 'checkbox', |
|
403 | - 'std' => '0' // Default value to show home top section |
|
404 | - ), |
|
398 | + array( |
|
399 | + 'name' => __('Search left section', 'geodirectory'), |
|
400 | + 'desc' => __('Show the left section of search page', 'geodirectory'), |
|
401 | + 'id' => 'geodir_show_search_left_section', |
|
402 | + 'type' => 'checkbox', |
|
403 | + 'std' => '0' // Default value to show home top section |
|
404 | + ), |
|
405 | 405 | |
406 | - array( |
|
407 | - 'name' => __('Width of search left section', 'geodirectory'), |
|
408 | - 'desc' => __('Enter the width of left section of search in %', 'geodirectory'), |
|
409 | - 'id' => 'geodir_width_search_left_section', |
|
410 | - 'type' => 'text', |
|
411 | - 'css' => 'min-width:300px;', |
|
412 | - 'std' => '30' // Default value to show home top section |
|
413 | - ), |
|
406 | + array( |
|
407 | + 'name' => __('Width of search left section', 'geodirectory'), |
|
408 | + 'desc' => __('Enter the width of left section of search in %', 'geodirectory'), |
|
409 | + 'id' => 'geodir_width_search_left_section', |
|
410 | + 'type' => 'text', |
|
411 | + 'css' => 'min-width:300px;', |
|
412 | + 'std' => '30' // Default value to show home top section |
|
413 | + ), |
|
414 | 414 | |
415 | - array( |
|
416 | - 'name' => __('Search bottom section', 'geodirectory'), |
|
417 | - 'desc' => __('Show the bottom section of search page', 'geodirectory'), |
|
418 | - 'id' => 'geodir_show_search_bottom_section', |
|
419 | - 'type' => 'checkbox', |
|
420 | - 'std' => '0' // Default value to show home top section |
|
421 | - ), |
|
415 | + array( |
|
416 | + 'name' => __('Search bottom section', 'geodirectory'), |
|
417 | + 'desc' => __('Show the bottom section of search page', 'geodirectory'), |
|
418 | + 'id' => 'geodir_show_search_bottom_section', |
|
419 | + 'type' => 'checkbox', |
|
420 | + 'std' => '0' // Default value to show home top section |
|
421 | + ), |
|
422 | 422 | |
423 | 423 | array( |
424 | - 'name' => __('Show advanced pagination details', 'geodirectory'), |
|
425 | - 'desc' => __('This will add extra pagination info like "Showing listings x-y of z" after/before pagination.', 'geodirectory'), |
|
426 | - 'id' => 'geodir_pagination_advance_info', |
|
427 | - 'css' => 'min-width:300px;', |
|
428 | - 'std' => '', |
|
429 | - 'type' => 'select', |
|
430 | - 'class' => 'chosen_select', |
|
431 | - 'options' => array( |
|
424 | + 'name' => __('Show advanced pagination details', 'geodirectory'), |
|
425 | + 'desc' => __('This will add extra pagination info like "Showing listings x-y of z" after/before pagination.', 'geodirectory'), |
|
426 | + 'id' => 'geodir_pagination_advance_info', |
|
427 | + 'css' => 'min-width:300px;', |
|
428 | + 'std' => '', |
|
429 | + 'type' => 'select', |
|
430 | + 'class' => 'chosen_select', |
|
431 | + 'options' => array( |
|
432 | 432 | '' => __('Never Display', 'geodirectory'), |
433 | 433 | 'after' => __('After Pagination', 'geodirectory'), |
434 | 434 | 'before' => __('Before Pagination', 'geodirectory') |
435 | 435 | ) |
436 | - ), |
|
436 | + ), |
|
437 | 437 | |
438 | - array('type' => 'sectionend', 'id' => 'geodir_search_layout'), |
|
438 | + array('type' => 'sectionend', 'id' => 'geodir_search_layout'), |
|
439 | 439 | |
440 | 440 | |
441 | - array('name' => __('Search form default text settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'), |
|
441 | + array('name' => __('Search form default text settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'), |
|
442 | 442 | |
443 | - array( |
|
444 | - 'name' => __('Search field default value', 'geodirectory'), |
|
445 | - 'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'), |
|
446 | - 'id' => 'geodir_search_field_default_text', |
|
447 | - 'type' => 'text', |
|
448 | - 'css' => 'min-width:300px;', |
|
449 | - 'std' => 'Search for' // show on the listing page. |
|
450 | - ), |
|
443 | + array( |
|
444 | + 'name' => __('Search field default value', 'geodirectory'), |
|
445 | + 'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'), |
|
446 | + 'id' => 'geodir_search_field_default_text', |
|
447 | + 'type' => 'text', |
|
448 | + 'css' => 'min-width:300px;', |
|
449 | + 'std' => 'Search for' // show on the listing page. |
|
450 | + ), |
|
451 | 451 | |
452 | - array( |
|
453 | - 'name' => __('Near field default value', 'geodirectory'), |
|
454 | - 'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'), |
|
455 | - 'id' => 'geodir_near_field_default_text', |
|
456 | - 'type' => 'text', |
|
457 | - 'css' => 'min-width:300px;', |
|
458 | - 'std' => 'Near' // show on the listing page. |
|
459 | - ), |
|
452 | + array( |
|
453 | + 'name' => __('Near field default value', 'geodirectory'), |
|
454 | + 'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'), |
|
455 | + 'id' => 'geodir_near_field_default_text', |
|
456 | + 'type' => 'text', |
|
457 | + 'css' => 'min-width:300px;', |
|
458 | + 'std' => 'Near' // show on the listing page. |
|
459 | + ), |
|
460 | 460 | |
461 | - array( |
|
462 | - 'name' => __('Search button label', 'geodirectory'), |
|
463 | - 'desc' => __('Show the search button label on search form.', 'geodirectory'), |
|
464 | - 'id' => 'geodir_search_button_label', |
|
465 | - 'type' => 'text', |
|
466 | - 'css' => 'min-width:300px;', |
|
467 | - 'std' => 'Search' // show on the listing page. |
|
468 | - ), |
|
461 | + array( |
|
462 | + 'name' => __('Search button label', 'geodirectory'), |
|
463 | + 'desc' => __('Show the search button label on search form.', 'geodirectory'), |
|
464 | + 'id' => 'geodir_search_button_label', |
|
465 | + 'type' => 'text', |
|
466 | + 'css' => 'min-width:300px;', |
|
467 | + 'std' => 'Search' // show on the listing page. |
|
468 | + ), |
|
469 | 469 | |
470 | - array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'), |
|
470 | + array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'), |
|
471 | 471 | |
472 | - /* Listing Layout Settings end */ |
|
472 | + /* Listing Layout Settings end */ |
|
473 | 473 | |
474 | 474 | |
475 | - /* Detail Layout Settings end */ |
|
475 | + /* Detail Layout Settings end */ |
|
476 | 476 | |
477 | - array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '), |
|
477 | + array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '), |
|
478 | 478 | |
479 | - array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '), |
|
479 | + array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '), |
|
480 | 480 | |
481 | - array( |
|
482 | - 'name' => __('Detail top section', 'geodirectory'), |
|
483 | - 'desc' => __('Show the top section of listing page', 'geodirectory'), |
|
484 | - 'id' => 'geodir_show_detail_top_section', |
|
485 | - 'type' => 'checkbox', |
|
486 | - 'std' => '1' // Default value to show home top section |
|
487 | - ), |
|
481 | + array( |
|
482 | + 'name' => __('Detail top section', 'geodirectory'), |
|
483 | + 'desc' => __('Show the top section of listing page', 'geodirectory'), |
|
484 | + 'id' => 'geodir_show_detail_top_section', |
|
485 | + 'type' => 'checkbox', |
|
486 | + 'std' => '1' // Default value to show home top section |
|
487 | + ), |
|
488 | 488 | |
489 | - array( |
|
490 | - 'name' => __('Detail bottom section', 'geodirectory'), |
|
491 | - 'desc' => __('Show the bottom section of listing page', 'geodirectory'), |
|
492 | - 'id' => 'geodir_show_detail_bottom_section', |
|
493 | - 'type' => 'checkbox', |
|
494 | - 'std' => '1' // Default value to show home top section |
|
495 | - ), |
|
496 | - array( |
|
497 | - 'name' => __('Detail sidebar section on left side', 'geodirectory'), |
|
498 | - 'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'), |
|
499 | - 'id' => 'geodir_detail_sidebar_left_section', |
|
500 | - 'type' => 'checkbox', |
|
501 | - 'std' => '0' |
|
502 | - ), |
|
503 | - array( |
|
504 | - 'name' => __('Disable GD modal', 'geodirectory'), |
|
505 | - 'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'), |
|
506 | - 'id' => 'geodir_disable_gb_modal', |
|
507 | - 'type' => 'checkbox', |
|
508 | - 'std' => '0' |
|
509 | - ), |
|
510 | - array( |
|
511 | - 'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'), |
|
512 | - 'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'), |
|
513 | - 'id' => 'geodir_disable_tfg_buttons_section', |
|
514 | - 'type' => 'checkbox', |
|
515 | - 'std' => '0' |
|
516 | - ), |
|
517 | - array( |
|
518 | - 'name' => __('Disable share this button section', 'geodirectory'), |
|
519 | - 'desc' => __('Disable share this button section that displays on Detail page sidebar', 'geodirectory'), |
|
520 | - 'id' => 'geodir_disable_sharethis_button_section', |
|
521 | - 'type' => 'checkbox', |
|
522 | - 'std' => '0' |
|
523 | - ), |
|
524 | - array( |
|
525 | - 'name' => __('Disable Google Analytics section', 'geodirectory'), |
|
526 | - 'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'), |
|
527 | - 'id' => 'geodir_disable_google_analytics_section', |
|
528 | - 'type' => 'checkbox', |
|
529 | - 'std' => '0' |
|
530 | - ), |
|
531 | - array( |
|
532 | - 'name' => __('Disable User Links section', 'geodirectory'), |
|
533 | - 'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'), |
|
534 | - 'id' => 'geodir_disable_user_links_section', |
|
535 | - 'type' => 'checkbox', |
|
536 | - 'std' => '0' |
|
537 | - ), |
|
538 | - array( |
|
539 | - 'name' => __('Disable Rating Info section', 'geodirectory'), |
|
540 | - 'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'), |
|
541 | - 'id' => 'geodir_disable_rating_info_section', |
|
542 | - 'type' => 'checkbox', |
|
543 | - 'std' => '0' |
|
544 | - ), |
|
545 | - array( |
|
546 | - 'name' => __('Disable Listing Info section', 'geodirectory'), |
|
547 | - 'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'), |
|
548 | - 'id' => 'geodir_disable_listing_info_section', |
|
549 | - 'type' => 'checkbox', |
|
550 | - 'std' => '0' |
|
551 | - ), |
|
489 | + array( |
|
490 | + 'name' => __('Detail bottom section', 'geodirectory'), |
|
491 | + 'desc' => __('Show the bottom section of listing page', 'geodirectory'), |
|
492 | + 'id' => 'geodir_show_detail_bottom_section', |
|
493 | + 'type' => 'checkbox', |
|
494 | + 'std' => '1' // Default value to show home top section |
|
495 | + ), |
|
496 | + array( |
|
497 | + 'name' => __('Detail sidebar section on left side', 'geodirectory'), |
|
498 | + 'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'), |
|
499 | + 'id' => 'geodir_detail_sidebar_left_section', |
|
500 | + 'type' => 'checkbox', |
|
501 | + 'std' => '0' |
|
502 | + ), |
|
503 | + array( |
|
504 | + 'name' => __('Disable GD modal', 'geodirectory'), |
|
505 | + 'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'), |
|
506 | + 'id' => 'geodir_disable_gb_modal', |
|
507 | + 'type' => 'checkbox', |
|
508 | + 'std' => '0' |
|
509 | + ), |
|
510 | + array( |
|
511 | + 'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'), |
|
512 | + 'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'), |
|
513 | + 'id' => 'geodir_disable_tfg_buttons_section', |
|
514 | + 'type' => 'checkbox', |
|
515 | + 'std' => '0' |
|
516 | + ), |
|
517 | + array( |
|
518 | + 'name' => __('Disable share this button section', 'geodirectory'), |
|
519 | + 'desc' => __('Disable share this button section that displays on Detail page sidebar', 'geodirectory'), |
|
520 | + 'id' => 'geodir_disable_sharethis_button_section', |
|
521 | + 'type' => 'checkbox', |
|
522 | + 'std' => '0' |
|
523 | + ), |
|
524 | + array( |
|
525 | + 'name' => __('Disable Google Analytics section', 'geodirectory'), |
|
526 | + 'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'), |
|
527 | + 'id' => 'geodir_disable_google_analytics_section', |
|
528 | + 'type' => 'checkbox', |
|
529 | + 'std' => '0' |
|
530 | + ), |
|
531 | + array( |
|
532 | + 'name' => __('Disable User Links section', 'geodirectory'), |
|
533 | + 'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'), |
|
534 | + 'id' => 'geodir_disable_user_links_section', |
|
535 | + 'type' => 'checkbox', |
|
536 | + 'std' => '0' |
|
537 | + ), |
|
538 | + array( |
|
539 | + 'name' => __('Disable Rating Info section', 'geodirectory'), |
|
540 | + 'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'), |
|
541 | + 'id' => 'geodir_disable_rating_info_section', |
|
542 | + 'type' => 'checkbox', |
|
543 | + 'std' => '0' |
|
544 | + ), |
|
545 | + array( |
|
546 | + 'name' => __('Disable Listing Info section', 'geodirectory'), |
|
547 | + 'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'), |
|
548 | + 'id' => 'geodir_disable_listing_info_section', |
|
549 | + 'type' => 'checkbox', |
|
550 | + 'std' => '0' |
|
551 | + ), |
|
552 | 552 | |
553 | - array('type' => 'sectionend', 'id' => 'detail_page_settings'), |
|
553 | + array('type' => 'sectionend', 'id' => 'detail_page_settings'), |
|
554 | 554 | |
555 | 555 | |
556 | - /* ---------- DETAIL PAGE TAB SETTING START*/ |
|
556 | + /* ---------- DETAIL PAGE TAB SETTING START*/ |
|
557 | 557 | |
558 | - array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '), |
|
558 | + array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '), |
|
559 | 559 | |
560 | - array( |
|
561 | - 'name' => __('Exclude selected tabs from detail page', 'geodirectory'), |
|
562 | - 'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'), |
|
563 | - 'tip' => '', |
|
564 | - 'id' => 'geodir_detail_page_tabs_excluded', |
|
565 | - 'css' => 'min-width:300px;', |
|
566 | - 'std' => geodir_get_posttypes(), |
|
567 | - 'type' => 'multiselect', |
|
568 | - 'placeholder_text' => __('Select tabs', 'geodirectory'), |
|
569 | - 'class' => 'chosen_select', |
|
570 | - 'options' => array_unique(geodir_detail_page_tabs_key_value_array()) |
|
571 | - ), |
|
560 | + array( |
|
561 | + 'name' => __('Exclude selected tabs from detail page', 'geodirectory'), |
|
562 | + 'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'), |
|
563 | + 'tip' => '', |
|
564 | + 'id' => 'geodir_detail_page_tabs_excluded', |
|
565 | + 'css' => 'min-width:300px;', |
|
566 | + 'std' => geodir_get_posttypes(), |
|
567 | + 'type' => 'multiselect', |
|
568 | + 'placeholder_text' => __('Select tabs', 'geodirectory'), |
|
569 | + 'class' => 'chosen_select', |
|
570 | + 'options' => array_unique(geodir_detail_page_tabs_key_value_array()) |
|
571 | + ), |
|
572 | 572 | |
573 | - array( |
|
574 | - 'name' => __('Show as list', 'geodirectory'), |
|
575 | - 'desc' => __('Show as list instead of tabs', 'geodirectory'), |
|
576 | - 'id' => 'geodir_disable_tabs', |
|
577 | - 'type' => 'checkbox', |
|
578 | - 'std' => '0' |
|
579 | - ), |
|
573 | + array( |
|
574 | + 'name' => __('Show as list', 'geodirectory'), |
|
575 | + 'desc' => __('Show as list instead of tabs', 'geodirectory'), |
|
576 | + 'id' => 'geodir_disable_tabs', |
|
577 | + 'type' => 'checkbox', |
|
578 | + 'std' => '0' |
|
579 | + ), |
|
580 | 580 | |
581 | - array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'), |
|
582 | - /* ---------- DETAIL PAGE TAB SETTING END*/ |
|
581 | + array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'), |
|
582 | + /* ---------- DETAIL PAGE TAB SETTING END*/ |
|
583 | 583 | |
584 | - /* START DEFAULT STAR IMAGE*/ |
|
585 | - array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '), |
|
584 | + /* START DEFAULT STAR IMAGE*/ |
|
585 | + array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '), |
|
586 | 586 | |
587 | - array( |
|
588 | - 'name' => __('Upload default rating star icon', 'geodirectory'), |
|
589 | - 'desc' => '', |
|
590 | - 'id' => 'geodir_default_rating_star_icon', |
|
591 | - 'type' => 'file', |
|
592 | - 'std' => '0', |
|
593 | - 'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section |
|
594 | - ), |
|
587 | + array( |
|
588 | + 'name' => __('Upload default rating star icon', 'geodirectory'), |
|
589 | + 'desc' => '', |
|
590 | + 'id' => 'geodir_default_rating_star_icon', |
|
591 | + 'type' => 'file', |
|
592 | + 'std' => '0', |
|
593 | + 'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section |
|
594 | + ), |
|
595 | 595 | array( |
596 | 596 | 'name' => __('Enable Font Awesome', 'geodirectory'), |
597 | 597 | 'desc' => __('When enabled all rating images will be using font awesome rating icons as images.', 'geodirectory' ), |
@@ -607,369 +607,369 @@ discard block |
||
607 | 607 | 'std' => '#757575' |
608 | 608 | ), |
609 | 609 | |
610 | - array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'), |
|
610 | + array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'), |
|
611 | 611 | |
612 | - /* END DEFAULT STAR IMAGE*/ |
|
612 | + /* END DEFAULT STAR IMAGE*/ |
|
613 | 613 | |
614 | - /* Detail related post settings start */ |
|
614 | + /* Detail related post settings start */ |
|
615 | 615 | |
616 | - array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '), |
|
616 | + array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '), |
|
617 | 617 | |
618 | - array( |
|
619 | - 'name' => __('Show related post listing on', 'geodirectory'), |
|
620 | - 'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'), |
|
621 | - 'tip' => '', |
|
622 | - 'id' => 'geodir_add_related_listing_posttypes', |
|
623 | - 'css' => 'min-width:300px;', |
|
624 | - 'std' => geodir_get_posttypes(), |
|
625 | - 'type' => 'multiselect', |
|
626 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
627 | - 'class' => 'chosen_select', |
|
628 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
629 | - ), |
|
618 | + array( |
|
619 | + 'name' => __('Show related post listing on', 'geodirectory'), |
|
620 | + 'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'), |
|
621 | + 'tip' => '', |
|
622 | + 'id' => 'geodir_add_related_listing_posttypes', |
|
623 | + 'css' => 'min-width:300px;', |
|
624 | + 'std' => geodir_get_posttypes(), |
|
625 | + 'type' => 'multiselect', |
|
626 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
627 | + 'class' => 'chosen_select', |
|
628 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
629 | + ), |
|
630 | 630 | |
631 | - array( |
|
632 | - 'name' => __('Relate to', 'geodirectory'), |
|
633 | - 'desc' => __('Set the relation between current post to related posts.', 'geodirectory'), |
|
634 | - 'id' => 'geodir_related_post_relate_to', |
|
635 | - 'css' => 'min-width:300px;', |
|
636 | - 'std' => 'category', |
|
637 | - 'type' => 'select', |
|
638 | - 'class' => 'chosen_select', |
|
639 | - 'options' => array_unique(array( |
|
640 | - 'category' => __('Categories', 'geodirectory'), |
|
641 | - 'tags' => __('Tags', 'geodirectory'), |
|
642 | - )) |
|
643 | - ), |
|
631 | + array( |
|
632 | + 'name' => __('Relate to', 'geodirectory'), |
|
633 | + 'desc' => __('Set the relation between current post to related posts.', 'geodirectory'), |
|
634 | + 'id' => 'geodir_related_post_relate_to', |
|
635 | + 'css' => 'min-width:300px;', |
|
636 | + 'std' => 'category', |
|
637 | + 'type' => 'select', |
|
638 | + 'class' => 'chosen_select', |
|
639 | + 'options' => array_unique(array( |
|
640 | + 'category' => __('Categories', 'geodirectory'), |
|
641 | + 'tags' => __('Tags', 'geodirectory'), |
|
642 | + )) |
|
643 | + ), |
|
644 | 644 | |
645 | - array( |
|
646 | - 'name' => __('Layout', 'geodirectory'), |
|
647 | - 'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'), |
|
648 | - 'id' => 'geodir_related_post_listing_view', |
|
649 | - 'css' => 'min-width:300px;', |
|
650 | - 'std' => 'gridview_onehalf', |
|
651 | - 'type' => 'select', |
|
652 | - 'class' => 'chosen_select', |
|
653 | - 'options' => array_unique(array( |
|
654 | - 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
655 | - 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
656 | - 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
657 | - 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
658 | - 'listview' => __('List view', 'geodirectory'), |
|
659 | - )) |
|
660 | - ), |
|
645 | + array( |
|
646 | + 'name' => __('Layout', 'geodirectory'), |
|
647 | + 'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'), |
|
648 | + 'id' => 'geodir_related_post_listing_view', |
|
649 | + 'css' => 'min-width:300px;', |
|
650 | + 'std' => 'gridview_onehalf', |
|
651 | + 'type' => 'select', |
|
652 | + 'class' => 'chosen_select', |
|
653 | + 'options' => array_unique(array( |
|
654 | + 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
655 | + 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
656 | + 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
657 | + 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
658 | + 'listview' => __('List view', 'geodirectory'), |
|
659 | + )) |
|
660 | + ), |
|
661 | 661 | |
662 | - array( |
|
663 | - 'name' => __('Sort by', 'geodirectory'), |
|
664 | - 'desc' => __('Set the related post listing sort by view', 'geodirectory'), |
|
665 | - 'id' => 'geodir_related_post_sortby', |
|
666 | - 'css' => 'min-width:300px;', |
|
667 | - 'std' => 'latest', |
|
668 | - 'type' => 'select', |
|
669 | - 'class' => 'chosen_select', |
|
670 | - 'options' => array_unique(array( |
|
671 | - 'latest' => __('Latest', 'geodirectory'), |
|
672 | - 'featured' => __('Featured', 'geodirectory'), |
|
673 | - 'high_review' => __('Review', 'geodirectory'), |
|
674 | - 'high_rating' => __('Rating', 'geodirectory'), |
|
675 | - 'random' => __('Random', 'geodirectory'), |
|
676 | - 'nearest' => __('Nearest', 'geodirectory'), |
|
677 | - )) |
|
678 | - ), |
|
662 | + array( |
|
663 | + 'name' => __('Sort by', 'geodirectory'), |
|
664 | + 'desc' => __('Set the related post listing sort by view', 'geodirectory'), |
|
665 | + 'id' => 'geodir_related_post_sortby', |
|
666 | + 'css' => 'min-width:300px;', |
|
667 | + 'std' => 'latest', |
|
668 | + 'type' => 'select', |
|
669 | + 'class' => 'chosen_select', |
|
670 | + 'options' => array_unique(array( |
|
671 | + 'latest' => __('Latest', 'geodirectory'), |
|
672 | + 'featured' => __('Featured', 'geodirectory'), |
|
673 | + 'high_review' => __('Review', 'geodirectory'), |
|
674 | + 'high_rating' => __('Rating', 'geodirectory'), |
|
675 | + 'random' => __('Random', 'geodirectory'), |
|
676 | + 'nearest' => __('Nearest', 'geodirectory'), |
|
677 | + )) |
|
678 | + ), |
|
679 | 679 | |
680 | - array( |
|
681 | - 'name' => __('Number of posts:', 'geodirectory'), |
|
682 | - 'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'), |
|
683 | - 'id' => 'geodir_related_post_count', |
|
684 | - 'type' => 'text', |
|
685 | - 'css' => 'min-width:300px;', |
|
686 | - 'std' => '5' // Default value to show home top section |
|
687 | - ), |
|
680 | + array( |
|
681 | + 'name' => __('Number of posts:', 'geodirectory'), |
|
682 | + 'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'), |
|
683 | + 'id' => 'geodir_related_post_count', |
|
684 | + 'type' => 'text', |
|
685 | + 'css' => 'min-width:300px;', |
|
686 | + 'std' => '5' // Default value to show home top section |
|
687 | + ), |
|
688 | 688 | |
689 | - array( |
|
690 | - 'name' => __('Post excerpt', 'geodirectory'), |
|
691 | - 'desc' => __('Post content excerpt character count', 'geodirectory'), |
|
692 | - 'id' => 'geodir_related_post_excerpt', |
|
693 | - 'type' => 'text', |
|
694 | - 'css' => 'min-width:300px;', |
|
695 | - 'std' => '20' // Default value to show home top section |
|
696 | - ), |
|
689 | + array( |
|
690 | + 'name' => __('Post excerpt', 'geodirectory'), |
|
691 | + 'desc' => __('Post content excerpt character count', 'geodirectory'), |
|
692 | + 'id' => 'geodir_related_post_excerpt', |
|
693 | + 'type' => 'text', |
|
694 | + 'css' => 'min-width:300px;', |
|
695 | + 'std' => '20' // Default value to show home top section |
|
696 | + ), |
|
697 | 697 | |
698 | 698 | |
699 | - array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'), |
|
700 | - /* Detail Layout Settings end */ |
|
699 | + array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'), |
|
700 | + /* Detail Layout Settings end */ |
|
701 | 701 | |
702 | - /* Author Layout Settings Start */ |
|
702 | + /* Author Layout Settings Start */ |
|
703 | 703 | |
704 | - array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '), |
|
704 | + array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '), |
|
705 | 705 | |
706 | 706 | |
707 | - array('name' => __('Author Page Layout Settings', 'geodirectory'), |
|
708 | - 'type' => 'sectionstart', |
|
709 | - 'desc' => '', |
|
710 | - 'id' => 'geodir_author_layout'), |
|
707 | + array('name' => __('Author Page Layout Settings', 'geodirectory'), |
|
708 | + 'type' => 'sectionstart', |
|
709 | + 'desc' => '', |
|
710 | + 'id' => 'geodir_author_layout'), |
|
711 | 711 | |
712 | - array( |
|
713 | - 'name' => __('Author top section', 'geodirectory'), |
|
714 | - 'desc' => __('Show the top section of author page', 'geodirectory'), |
|
715 | - 'id' => 'geodir_show_author_top_section', |
|
716 | - 'type' => 'checkbox', |
|
717 | - 'std' => '1' // Default value to show home top section |
|
718 | - ), |
|
712 | + array( |
|
713 | + 'name' => __('Author top section', 'geodirectory'), |
|
714 | + 'desc' => __('Show the top section of author page', 'geodirectory'), |
|
715 | + 'id' => 'geodir_show_author_top_section', |
|
716 | + 'type' => 'checkbox', |
|
717 | + 'std' => '1' // Default value to show home top section |
|
718 | + ), |
|
719 | 719 | |
720 | - array( |
|
721 | - 'name' => __('Author right section', 'geodirectory'), |
|
722 | - 'desc' => __('Show the right section of author page', 'geodirectory'), |
|
723 | - 'id' => 'geodir_show_author_right_section', |
|
724 | - 'type' => 'checkbox', |
|
725 | - 'std' => '1' // Default value to show home top section |
|
726 | - ), |
|
720 | + array( |
|
721 | + 'name' => __('Author right section', 'geodirectory'), |
|
722 | + 'desc' => __('Show the right section of author page', 'geodirectory'), |
|
723 | + 'id' => 'geodir_show_author_right_section', |
|
724 | + 'type' => 'checkbox', |
|
725 | + 'std' => '1' // Default value to show home top section |
|
726 | + ), |
|
727 | 727 | |
728 | - array( |
|
729 | - 'name' => __('Width of author right section', 'geodirectory'), |
|
730 | - 'desc' => __('Enter the width of right section of author page in %', 'geodirectory'), |
|
731 | - 'id' => 'geodir_width_author_right_section', |
|
732 | - 'type' => 'text', |
|
733 | - 'css' => 'min-width:300px;', |
|
734 | - 'std' => '30' // Default value to show home top section |
|
735 | - ), |
|
728 | + array( |
|
729 | + 'name' => __('Width of author right section', 'geodirectory'), |
|
730 | + 'desc' => __('Enter the width of right section of author page in %', 'geodirectory'), |
|
731 | + 'id' => 'geodir_width_author_right_section', |
|
732 | + 'type' => 'text', |
|
733 | + 'css' => 'min-width:300px;', |
|
734 | + 'std' => '30' // Default value to show home top section |
|
735 | + ), |
|
736 | 736 | |
737 | - array( |
|
738 | - 'name' => __('Author content section view', 'geodirectory'), |
|
739 | - 'desc' => __('Set the listing view of author page', 'geodirectory'), |
|
740 | - 'id' => 'geodir_author_view', |
|
741 | - 'css' => 'min-width:300px;', |
|
742 | - 'std' => 'gridview_onehalf', |
|
743 | - 'type' => 'select', |
|
744 | - 'class' => 'chosen_select', |
|
745 | - 'options' => array_unique(array( |
|
746 | - 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
747 | - 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
748 | - 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
749 | - 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
750 | - 'listview' => __('List view', 'geodirectory'), |
|
751 | - )) |
|
752 | - ), |
|
737 | + array( |
|
738 | + 'name' => __('Author content section view', 'geodirectory'), |
|
739 | + 'desc' => __('Set the listing view of author page', 'geodirectory'), |
|
740 | + 'id' => 'geodir_author_view', |
|
741 | + 'css' => 'min-width:300px;', |
|
742 | + 'std' => 'gridview_onehalf', |
|
743 | + 'type' => 'select', |
|
744 | + 'class' => 'chosen_select', |
|
745 | + 'options' => array_unique(array( |
|
746 | + 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
747 | + 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
748 | + 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
749 | + 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
750 | + 'listview' => __('List view', 'geodirectory'), |
|
751 | + )) |
|
752 | + ), |
|
753 | 753 | |
754 | - array( |
|
755 | - 'name' => __('Width of author content section', 'geodirectory'), |
|
756 | - 'desc' => __('Enter the width of content section of author page in %', 'geodirectory'), |
|
757 | - 'id' => 'geodir_width_author_contant_section', |
|
758 | - 'type' => 'text', |
|
759 | - 'css' => 'min-width:300px;', |
|
760 | - 'std' => '63' // Default value to show home top section |
|
761 | - ), |
|
754 | + array( |
|
755 | + 'name' => __('Width of author content section', 'geodirectory'), |
|
756 | + 'desc' => __('Enter the width of content section of author page in %', 'geodirectory'), |
|
757 | + 'id' => 'geodir_width_author_contant_section', |
|
758 | + 'type' => 'text', |
|
759 | + 'css' => 'min-width:300px;', |
|
760 | + 'std' => '63' // Default value to show home top section |
|
761 | + ), |
|
762 | 762 | |
763 | - array( |
|
764 | - 'name' => __('Author left section', 'geodirectory'), |
|
765 | - 'desc' => __('Show the left section of author page', 'geodirectory'), |
|
766 | - 'id' => 'geodir_show_author_left_section', |
|
767 | - 'type' => 'checkbox', |
|
768 | - 'std' => '0' // Default value to show home top section |
|
769 | - ), |
|
763 | + array( |
|
764 | + 'name' => __('Author left section', 'geodirectory'), |
|
765 | + 'desc' => __('Show the left section of author page', 'geodirectory'), |
|
766 | + 'id' => 'geodir_show_author_left_section', |
|
767 | + 'type' => 'checkbox', |
|
768 | + 'std' => '0' // Default value to show home top section |
|
769 | + ), |
|
770 | 770 | |
771 | - array( |
|
772 | - 'name' => __('Width of author left section', 'geodirectory'), |
|
773 | - 'desc' => __('Enter the width of left section of home page in %', 'geodirectory'), |
|
774 | - 'id' => 'geodir_width_author_left_section', |
|
775 | - 'type' => 'text', |
|
776 | - 'css' => 'min-width:300px;', |
|
777 | - 'std' => '30' // Default value to show home top section |
|
778 | - ), |
|
771 | + array( |
|
772 | + 'name' => __('Width of author left section', 'geodirectory'), |
|
773 | + 'desc' => __('Enter the width of left section of home page in %', 'geodirectory'), |
|
774 | + 'id' => 'geodir_width_author_left_section', |
|
775 | + 'type' => 'text', |
|
776 | + 'css' => 'min-width:300px;', |
|
777 | + 'std' => '30' // Default value to show home top section |
|
778 | + ), |
|
779 | 779 | |
780 | - array( |
|
781 | - 'name' => __('Author bottom section', 'geodirectory'), |
|
782 | - 'desc' => __('Show the bottom section of author page', 'geodirectory'), |
|
783 | - 'id' => 'geodir_show_author_bottom_section', |
|
784 | - 'type' => 'checkbox', |
|
785 | - 'std' => '0' // Default value to show home top section |
|
786 | - ), |
|
780 | + array( |
|
781 | + 'name' => __('Author bottom section', 'geodirectory'), |
|
782 | + 'desc' => __('Show the bottom section of author page', 'geodirectory'), |
|
783 | + 'id' => 'geodir_show_author_bottom_section', |
|
784 | + 'type' => 'checkbox', |
|
785 | + 'std' => '0' // Default value to show home top section |
|
786 | + ), |
|
787 | 787 | |
788 | 788 | |
789 | - array( |
|
790 | - 'name' => __('Description word limit', 'geodirectory'), |
|
791 | - 'desc' => '', |
|
792 | - 'id' => 'geodir_author_desc_word_limit', |
|
793 | - 'type' => 'text', |
|
794 | - 'css' => 'min-width:300px;', |
|
795 | - 'std' => '50' // Default value to show home top section |
|
796 | - ), |
|
789 | + array( |
|
790 | + 'name' => __('Description word limit', 'geodirectory'), |
|
791 | + 'desc' => '', |
|
792 | + 'id' => 'geodir_author_desc_word_limit', |
|
793 | + 'type' => 'text', |
|
794 | + 'css' => 'min-width:300px;', |
|
795 | + 'std' => '50' // Default value to show home top section |
|
796 | + ), |
|
797 | 797 | |
798 | - array('type' => 'sectionend', 'id' => 'geodir_author_layout'), |
|
799 | - /* Author Layout Settings end */ |
|
798 | + array('type' => 'sectionend', 'id' => 'geodir_author_layout'), |
|
799 | + /* Author Layout Settings end */ |
|
800 | 800 | |
801 | 801 | |
802 | - /* Post Type Navigation Settings Start */ |
|
803 | - array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'), |
|
802 | + /* Post Type Navigation Settings Start */ |
|
803 | + array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'), |
|
804 | 804 | |
805 | 805 | |
806 | - /* Post Type Navigation Settings Start */ |
|
806 | + /* Post Type Navigation Settings Start */ |
|
807 | 807 | |
808 | - array('name' => __('Navigation Locations', 'geodirectory'), |
|
809 | - 'type' => 'sectionstart', |
|
810 | - 'desc' => '', |
|
811 | - 'id' => 'geodir_navigation_locations'), |
|
808 | + array('name' => __('Navigation Locations', 'geodirectory'), |
|
809 | + 'type' => 'sectionstart', |
|
810 | + 'desc' => '', |
|
811 | + 'id' => 'geodir_navigation_locations'), |
|
812 | 812 | |
813 | - array( |
|
814 | - 'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'), |
|
815 | - 'desc' => '', |
|
816 | - 'tip' => '', |
|
817 | - 'id' => 'geodir_theme_location_nav', |
|
818 | - 'css' => 'min-width:300px;', |
|
819 | - 'std' => array(), |
|
820 | - 'type' => 'multiselect', |
|
821 | - 'placeholder_text' => __('Select menu locations', 'geodirectory'), |
|
822 | - 'class' => 'chosen_select', |
|
823 | - 'options' => array_unique(geodir_theme_location_setting_fun()) |
|
824 | - ), |
|
825 | - array('type' => 'sectionend', 'id' => 'geodir_navigation_options'), |
|
826 | - |
|
827 | - |
|
828 | - array('name' => __('Navigation Settings', 'geodirectory'), |
|
829 | - 'type' => 'sectionstart', |
|
830 | - 'desc' => '', |
|
831 | - 'id' => 'geodir_navigation_options'), |
|
813 | + array( |
|
814 | + 'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'), |
|
815 | + 'desc' => '', |
|
816 | + 'tip' => '', |
|
817 | + 'id' => 'geodir_theme_location_nav', |
|
818 | + 'css' => 'min-width:300px;', |
|
819 | + 'std' => array(), |
|
820 | + 'type' => 'multiselect', |
|
821 | + 'placeholder_text' => __('Select menu locations', 'geodirectory'), |
|
822 | + 'class' => 'chosen_select', |
|
823 | + 'options' => array_unique(geodir_theme_location_setting_fun()) |
|
824 | + ), |
|
825 | + array('type' => 'sectionend', 'id' => 'geodir_navigation_options'), |
|
832 | 826 | |
833 | 827 | |
834 | - array( |
|
835 | - 'name' => __('Show add listing navigation in menu', 'geodirectory'), |
|
836 | - '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')), |
|
837 | - 'id' => 'geodir_show_addlisting_nav', |
|
838 | - 'std' => '1', |
|
839 | - 'type' => 'checkbox' |
|
840 | - ), |
|
828 | + array('name' => __('Navigation Settings', 'geodirectory'), |
|
829 | + 'type' => 'sectionstart', |
|
830 | + 'desc' => '', |
|
831 | + 'id' => 'geodir_navigation_options'), |
|
841 | 832 | |
842 | - array( |
|
843 | - 'name' => __('Show listings navigation in menu', 'geodirectory'), |
|
844 | - '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')), |
|
845 | - 'id' => 'geodir_show_listing_nav', |
|
846 | - 'std' => '1', |
|
847 | - 'type' => 'checkbox' |
|
848 | - ), |
|
849 | 833 | |
850 | - array('type' => 'sectionend', 'id' => 'geodir_navigation_options'), |
|
834 | + array( |
|
835 | + 'name' => __('Show add listing navigation in menu', 'geodirectory'), |
|
836 | + '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')), |
|
837 | + 'id' => 'geodir_show_addlisting_nav', |
|
838 | + 'std' => '1', |
|
839 | + 'type' => 'checkbox' |
|
840 | + ), |
|
851 | 841 | |
842 | + array( |
|
843 | + 'name' => __('Show listings navigation in menu', 'geodirectory'), |
|
844 | + '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')), |
|
845 | + 'id' => 'geodir_show_listing_nav', |
|
846 | + 'std' => '1', |
|
847 | + 'type' => 'checkbox' |
|
848 | + ), |
|
852 | 849 | |
853 | - array('name' => __('Post Type Navigation Settings', 'geodirectory'), |
|
854 | - 'type' => 'sectionstart', |
|
855 | - 'desc' => '', |
|
856 | - 'id' => 'geodir_post_type_navigation_layout'), |
|
857 | - array( |
|
858 | - 'name' => __('Show listing link in main navigation', 'geodirectory'), |
|
859 | - 'desc' => '', |
|
860 | - 'tip' => '', |
|
861 | - 'id' => 'geodir_add_posttype_in_main_nav', |
|
862 | - 'css' => 'min-width:300px;', |
|
863 | - 'std' => array(), |
|
864 | - 'type' => 'multiselect', |
|
865 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
866 | - 'class' => 'chosen_select', |
|
867 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
868 | - ), |
|
850 | + array('type' => 'sectionend', 'id' => 'geodir_navigation_options'), |
|
869 | 851 | |
870 | - array( |
|
871 | - 'name' => __('Show listing link in listing navigation', 'geodirectory'), |
|
872 | - 'desc' => '', |
|
873 | - 'tip' => '', |
|
874 | - 'id' => 'geodir_add_posttype_in_listing_nav', |
|
875 | - 'css' => 'min-width:300px;', |
|
876 | - 'std' => geodir_get_posttypes(), |
|
877 | - 'type' => 'multiselect', |
|
878 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
879 | - 'class' => 'chosen_select', |
|
880 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
881 | - ), |
|
882 | 852 | |
883 | - array( |
|
884 | - 'name' => __('Allow post type to add from frontend', 'geodirectory'), |
|
885 | - 'desc' => '', |
|
886 | - 'tip' => '', |
|
887 | - 'id' => 'geodir_allow_posttype_frontend', |
|
888 | - 'css' => 'min-width:300px;', |
|
889 | - 'std' => geodir_get_posttypes(), |
|
890 | - 'type' => 'multiselect', |
|
891 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
892 | - 'class' => 'chosen_select', |
|
893 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
894 | - ), |
|
853 | + array('name' => __('Post Type Navigation Settings', 'geodirectory'), |
|
854 | + 'type' => 'sectionstart', |
|
855 | + 'desc' => '', |
|
856 | + 'id' => 'geodir_post_type_navigation_layout'), |
|
857 | + array( |
|
858 | + 'name' => __('Show listing link in main navigation', 'geodirectory'), |
|
859 | + 'desc' => '', |
|
860 | + 'tip' => '', |
|
861 | + 'id' => 'geodir_add_posttype_in_main_nav', |
|
862 | + 'css' => 'min-width:300px;', |
|
863 | + 'std' => array(), |
|
864 | + 'type' => 'multiselect', |
|
865 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
866 | + 'class' => 'chosen_select', |
|
867 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
868 | + ), |
|
895 | 869 | |
896 | - array( |
|
897 | - 'name' => __('Show add listing link in main navigation', 'geodirectory'), |
|
898 | - 'desc' => '', |
|
899 | - 'tip' => '', |
|
900 | - 'id' => 'geodir_add_listing_link_main_nav', |
|
901 | - 'css' => 'min-width:300px;', |
|
902 | - 'std' => array(), |
|
903 | - 'type' => 'multiselect', |
|
904 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
905 | - 'class' => 'chosen_select', |
|
906 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
907 | - ), |
|
870 | + array( |
|
871 | + 'name' => __('Show listing link in listing navigation', 'geodirectory'), |
|
872 | + 'desc' => '', |
|
873 | + 'tip' => '', |
|
874 | + 'id' => 'geodir_add_posttype_in_listing_nav', |
|
875 | + 'css' => 'min-width:300px;', |
|
876 | + 'std' => geodir_get_posttypes(), |
|
877 | + 'type' => 'multiselect', |
|
878 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
879 | + 'class' => 'chosen_select', |
|
880 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
881 | + ), |
|
908 | 882 | |
909 | - array( |
|
910 | - 'name' => __('Show add listing link in add listing navigation', 'geodirectory'), |
|
911 | - 'desc' => '', |
|
912 | - 'tip' => '', |
|
913 | - 'id' => 'geodir_add_listing_link_add_listing_nav', |
|
914 | - 'css' => 'min-width:300px;', |
|
915 | - 'std' => geodir_get_posttypes(), |
|
916 | - 'type' => 'multiselect', |
|
917 | - 'class' => 'chosen_select', |
|
918 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
919 | - ), |
|
883 | + array( |
|
884 | + 'name' => __('Allow post type to add from frontend', 'geodirectory'), |
|
885 | + 'desc' => '', |
|
886 | + 'tip' => '', |
|
887 | + 'id' => 'geodir_allow_posttype_frontend', |
|
888 | + 'css' => 'min-width:300px;', |
|
889 | + 'std' => geodir_get_posttypes(), |
|
890 | + 'type' => 'multiselect', |
|
891 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
892 | + 'class' => 'chosen_select', |
|
893 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
894 | + ), |
|
920 | 895 | |
921 | - array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'), |
|
896 | + array( |
|
897 | + 'name' => __('Show add listing link in main navigation', 'geodirectory'), |
|
898 | + 'desc' => '', |
|
899 | + 'tip' => '', |
|
900 | + 'id' => 'geodir_add_listing_link_main_nav', |
|
901 | + 'css' => 'min-width:300px;', |
|
902 | + 'std' => array(), |
|
903 | + 'type' => 'multiselect', |
|
904 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
905 | + 'class' => 'chosen_select', |
|
906 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
907 | + ), |
|
922 | 908 | |
909 | + array( |
|
910 | + 'name' => __('Show add listing link in add listing navigation', 'geodirectory'), |
|
911 | + 'desc' => '', |
|
912 | + 'tip' => '', |
|
913 | + 'id' => 'geodir_add_listing_link_add_listing_nav', |
|
914 | + 'css' => 'min-width:300px;', |
|
915 | + 'std' => geodir_get_posttypes(), |
|
916 | + 'type' => 'multiselect', |
|
917 | + 'class' => 'chosen_select', |
|
918 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
919 | + ), |
|
923 | 920 | |
924 | - array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '), |
|
921 | + array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'), |
|
925 | 922 | |
926 | 923 | |
927 | - array( |
|
928 | - 'name' => __('Show add listing link in user dashboard', 'geodirectory'), |
|
929 | - 'desc' => '', |
|
930 | - 'tip' => '', |
|
931 | - 'id' => 'geodir_add_listing_link_user_dashboard', |
|
932 | - 'css' => 'min-width:300px;', |
|
933 | - 'std' => geodir_get_posttypes(), |
|
934 | - 'type' => 'multiselect', |
|
935 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
936 | - 'class' => 'chosen_select', |
|
937 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
938 | - ), |
|
924 | + array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '), |
|
939 | 925 | |
940 | - array( |
|
941 | - 'name' => __('Show favorite link in user dashboard', 'geodirectory'), |
|
942 | - 'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'), |
|
943 | - 'tip' => '', |
|
944 | - 'id' => 'geodir_favorite_link_user_dashboard', |
|
945 | - 'css' => 'min-width:300px;', |
|
946 | - 'std' => geodir_get_posttypes(), |
|
947 | - 'type' => 'multiselect', |
|
948 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
949 | - 'class' => 'chosen_select', |
|
950 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
951 | - ), |
|
952 | 926 | |
953 | - array( |
|
954 | - 'name' => __('Show listing link in user dashboard', 'geodirectory'), |
|
955 | - 'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'), |
|
956 | - 'tip' => '', |
|
957 | - 'id' => 'geodir_listing_link_user_dashboard', |
|
958 | - 'css' => 'min-width:300px;', |
|
959 | - 'std' => geodir_get_posttypes(), |
|
960 | - 'type' => 'multiselect', |
|
961 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
962 | - 'class' => 'chosen_select', |
|
963 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
964 | - ), |
|
965 | - |
|
966 | - array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'), |
|
967 | - /* Post Type Navigation Settings End */ |
|
968 | - |
|
969 | - /* Script Settings Start */ |
|
970 | - array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '), |
|
971 | - |
|
972 | - /* |
|
927 | + array( |
|
928 | + 'name' => __('Show add listing link in user dashboard', 'geodirectory'), |
|
929 | + 'desc' => '', |
|
930 | + 'tip' => '', |
|
931 | + 'id' => 'geodir_add_listing_link_user_dashboard', |
|
932 | + 'css' => 'min-width:300px;', |
|
933 | + 'std' => geodir_get_posttypes(), |
|
934 | + 'type' => 'multiselect', |
|
935 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
936 | + 'class' => 'chosen_select', |
|
937 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
938 | + ), |
|
939 | + |
|
940 | + array( |
|
941 | + 'name' => __('Show favorite link in user dashboard', 'geodirectory'), |
|
942 | + 'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'), |
|
943 | + 'tip' => '', |
|
944 | + 'id' => 'geodir_favorite_link_user_dashboard', |
|
945 | + 'css' => 'min-width:300px;', |
|
946 | + 'std' => geodir_get_posttypes(), |
|
947 | + 'type' => 'multiselect', |
|
948 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
949 | + 'class' => 'chosen_select', |
|
950 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
951 | + ), |
|
952 | + |
|
953 | + array( |
|
954 | + 'name' => __('Show listing link in user dashboard', 'geodirectory'), |
|
955 | + 'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'), |
|
956 | + 'tip' => '', |
|
957 | + 'id' => 'geodir_listing_link_user_dashboard', |
|
958 | + 'css' => 'min-width:300px;', |
|
959 | + 'std' => geodir_get_posttypes(), |
|
960 | + 'type' => 'multiselect', |
|
961 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
962 | + 'class' => 'chosen_select', |
|
963 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
964 | + ), |
|
965 | + |
|
966 | + array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'), |
|
967 | + /* Post Type Navigation Settings End */ |
|
968 | + |
|
969 | + /* Script Settings Start */ |
|
970 | + array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '), |
|
971 | + |
|
972 | + /* |
|
973 | 973 | array( 'name' => __( 'Add/Remove Scripts', 'geodirectory' ), |
974 | 974 | 'type' => 'sectionstart', |
975 | 975 | 'desc' => '', |
@@ -995,190 +995,190 @@ discard block |
||
995 | 995 | |
996 | 996 | */ |
997 | 997 | |
998 | - array('name' => __('GD Lazy Load Images', 'geodirectory'), |
|
999 | - 'type' => 'sectionstart', |
|
1000 | - 'desc' => '', |
|
1001 | - 'id' => 'geodir_gdll_settings'), |
|
998 | + array('name' => __('GD Lazy Load Images', 'geodirectory'), |
|
999 | + 'type' => 'sectionstart', |
|
1000 | + 'desc' => '', |
|
1001 | + 'id' => 'geodir_gdll_settings'), |
|
1002 | 1002 | |
1003 | - array( |
|
1004 | - 'name' => __('Enable lazy load images?', 'geodirectory'), |
|
1005 | - 'desc' => __('GD images will be loaded only when visible on the page', 'geodirectory'), |
|
1006 | - 'id' => 'geodir_lazy_load', |
|
1007 | - 'type' => 'checkbox', |
|
1008 | - 'std' => '1' // Default value to show home top section |
|
1009 | - ), |
|
1010 | - array('type' => 'sectionend', 'id' => 'geodir_gdll_settings'), |
|
1003 | + array( |
|
1004 | + 'name' => __('Enable lazy load images?', 'geodirectory'), |
|
1005 | + 'desc' => __('GD images will be loaded only when visible on the page', 'geodirectory'), |
|
1006 | + 'id' => 'geodir_lazy_load', |
|
1007 | + 'type' => 'checkbox', |
|
1008 | + 'std' => '1' // Default value to show home top section |
|
1009 | + ), |
|
1010 | + array('type' => 'sectionend', 'id' => 'geodir_gdll_settings'), |
|
1011 | 1011 | |
1012 | 1012 | |
1013 | - array('name' => __('Script Settings', 'geodirectory'), |
|
1014 | - 'type' => 'sectionstart', |
|
1015 | - 'desc' => '', |
|
1016 | - 'id' => 'geodir_script_settings'), |
|
1013 | + array('name' => __('Script Settings', 'geodirectory'), |
|
1014 | + 'type' => 'sectionstart', |
|
1015 | + 'desc' => '', |
|
1016 | + 'id' => 'geodir_script_settings'), |
|
1017 | 1017 | |
1018 | - array( |
|
1019 | - 'name' => __('Custom style css code', 'geodirectory'), |
|
1020 | - 'desc' => '', |
|
1021 | - 'id' => 'geodir_coustem_css', |
|
1022 | - 'type' => 'textarea', |
|
1023 | - 'css' => 'min-width:300px;', |
|
1024 | - 'std' => '' // Default value for the page title - changed in settings |
|
1025 | - ), |
|
1018 | + array( |
|
1019 | + 'name' => __('Custom style css code', 'geodirectory'), |
|
1020 | + 'desc' => '', |
|
1021 | + 'id' => 'geodir_coustem_css', |
|
1022 | + 'type' => 'textarea', |
|
1023 | + 'css' => 'min-width:300px;', |
|
1024 | + 'std' => '' // Default value for the page title - changed in settings |
|
1025 | + ), |
|
1026 | 1026 | |
1027 | - array( |
|
1028 | - 'name' => __('Header script code', 'geodirectory'), |
|
1029 | - 'desc' => '', |
|
1030 | - 'id' => 'geodir_header_scripts', |
|
1031 | - 'type' => 'textarea', |
|
1032 | - 'css' => 'min-width:300px;', |
|
1033 | - 'std' => '' // Default value for the page title - changed in settings |
|
1034 | - ), |
|
1027 | + array( |
|
1028 | + 'name' => __('Header script code', 'geodirectory'), |
|
1029 | + 'desc' => '', |
|
1030 | + 'id' => 'geodir_header_scripts', |
|
1031 | + 'type' => 'textarea', |
|
1032 | + 'css' => 'min-width:300px;', |
|
1033 | + 'std' => '' // Default value for the page title - changed in settings |
|
1034 | + ), |
|
1035 | 1035 | |
1036 | - array( |
|
1037 | - 'name' => __('Footer script code', 'geodirectory'), |
|
1038 | - 'desc' => '', |
|
1039 | - 'id' => 'geodir_footer_scripts', |
|
1040 | - 'type' => 'textarea', |
|
1041 | - 'css' => 'min-width:300px;', |
|
1042 | - 'std' => '' // Default value for the page title - changed in settings |
|
1043 | - ), |
|
1036 | + array( |
|
1037 | + 'name' => __('Footer script code', 'geodirectory'), |
|
1038 | + 'desc' => '', |
|
1039 | + 'id' => 'geodir_footer_scripts', |
|
1040 | + 'type' => 'textarea', |
|
1041 | + 'css' => 'min-width:300px;', |
|
1042 | + 'std' => '' // Default value for the page title - changed in settings |
|
1043 | + ), |
|
1044 | 1044 | |
1045 | - array('type' => 'sectionend', 'id' => 'geodir_script_settings'), |
|
1046 | - /* Script Settings End */ |
|
1045 | + array('type' => 'sectionend', 'id' => 'geodir_script_settings'), |
|
1046 | + /* Script Settings End */ |
|
1047 | 1047 | |
1048 | - /* Map Settings Start */ |
|
1049 | - array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '), |
|
1048 | + /* Map Settings Start */ |
|
1049 | + array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '), |
|
1050 | 1050 | |
1051 | 1051 | |
1052 | - // Google API key |
|
1053 | - array( |
|
1054 | - 'name' => __('Google Maps API KEY', 'geodirectory'), |
|
1055 | - 'type' => 'sectionstart', |
|
1056 | - 'desc' => '', |
|
1057 | - 'id' => 'geodir_google_api_key' |
|
1058 | - ), |
|
1059 | - array( |
|
1060 | - 'name' => __('Google Maps API KEY', 'geodirectory'), |
|
1061 | - 'desc' => sprintf( |
|
1062 | - __('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'), |
|
1063 | - 'https://console.developers.google.com/flows/enableapi?apiid=maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend&keyType=CLIENT_SIDE&reusekey=true','https://wpgeodirectory.com/docs/add-google-api-key/' ), |
|
1064 | - 'tip' => '', |
|
1065 | - 'id' => 'geodir_google_api_key', |
|
1066 | - 'css' => 'min-width:300px;', |
|
1067 | - 'std' => '', |
|
1068 | - 'type' => 'text', |
|
1069 | - ), |
|
1070 | - array( |
|
1071 | - 'type' => 'sectionend', |
|
1072 | - 'id' => 'geodir_google_api_key' |
|
1073 | - ), |
|
1052 | + // Google API key |
|
1053 | + array( |
|
1054 | + 'name' => __('Google Maps API KEY', 'geodirectory'), |
|
1055 | + 'type' => 'sectionstart', |
|
1056 | + 'desc' => '', |
|
1057 | + 'id' => 'geodir_google_api_key' |
|
1058 | + ), |
|
1059 | + array( |
|
1060 | + 'name' => __('Google Maps API KEY', 'geodirectory'), |
|
1061 | + 'desc' => sprintf( |
|
1062 | + __('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'), |
|
1063 | + 'https://console.developers.google.com/flows/enableapi?apiid=maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend&keyType=CLIENT_SIDE&reusekey=true','https://wpgeodirectory.com/docs/add-google-api-key/' ), |
|
1064 | + 'tip' => '', |
|
1065 | + 'id' => 'geodir_google_api_key', |
|
1066 | + 'css' => 'min-width:300px;', |
|
1067 | + 'std' => '', |
|
1068 | + 'type' => 'text', |
|
1069 | + ), |
|
1070 | + array( |
|
1071 | + 'type' => 'sectionend', |
|
1072 | + 'id' => 'geodir_google_api_key' |
|
1073 | + ), |
|
1074 | 1074 | |
1075 | - /* Untick the category by default on home map */ |
|
1076 | - array( |
|
1077 | - 'name' => __('Home Map Settings', 'geodirectory'), |
|
1078 | - 'type' => 'sectionstart', |
|
1079 | - 'desc' => '', |
|
1080 | - 'id' => 'geodir_home_map_section' |
|
1081 | - ), |
|
1082 | - array( |
|
1083 | - 'name' => __('Select category to untick by default on map', 'geodirectory'), |
|
1084 | - 'desc' => __('Select category to untick by default on the home map.', 'geodirectory'), |
|
1085 | - 'tip' => '', |
|
1086 | - 'id' => 'geodir_home_map_untick', |
|
1087 | - 'css' => 'min-width:300px;', |
|
1088 | - 'std' => '', |
|
1089 | - 'type' => 'multiselect', |
|
1090 | - 'placeholder_text' => __('Select category', 'geodirectory'), |
|
1091 | - 'class' => 'chosen_select', |
|
1092 | - 'options' => geodir_home_map_cats_key_value_array() |
|
1093 | - ), |
|
1094 | - array( |
|
1095 | - 'type' => 'sectionend', |
|
1096 | - 'id' => 'geodir_home_map_section' |
|
1097 | - ), |
|
1075 | + /* Untick the category by default on home map */ |
|
1076 | + array( |
|
1077 | + 'name' => __('Home Map Settings', 'geodirectory'), |
|
1078 | + 'type' => 'sectionstart', |
|
1079 | + 'desc' => '', |
|
1080 | + 'id' => 'geodir_home_map_section' |
|
1081 | + ), |
|
1082 | + array( |
|
1083 | + 'name' => __('Select category to untick by default on map', 'geodirectory'), |
|
1084 | + 'desc' => __('Select category to untick by default on the home map.', 'geodirectory'), |
|
1085 | + 'tip' => '', |
|
1086 | + 'id' => 'geodir_home_map_untick', |
|
1087 | + 'css' => 'min-width:300px;', |
|
1088 | + 'std' => '', |
|
1089 | + 'type' => 'multiselect', |
|
1090 | + 'placeholder_text' => __('Select category', 'geodirectory'), |
|
1091 | + 'class' => 'chosen_select', |
|
1092 | + 'options' => geodir_home_map_cats_key_value_array() |
|
1093 | + ), |
|
1094 | + array( |
|
1095 | + 'type' => 'sectionend', |
|
1096 | + 'id' => 'geodir_home_map_section' |
|
1097 | + ), |
|
1098 | 1098 | |
1099 | - array( |
|
1100 | - 'name' => __('Add Listing Map Settings', 'geodirectory'), |
|
1101 | - 'type' => 'sectionstart', |
|
1102 | - 'desc' => '', |
|
1103 | - 'id' => 'geodir_add_listing_map_section' |
|
1104 | - ), |
|
1105 | - array( |
|
1106 | - 'name' => __('Disable mouse scroll on details page map tab', 'geodirectory'), |
|
1107 | - 'desc' => __('Stops the mouse scroll zooming the map (home and listings settings set from widget)', 'geodirectory'), |
|
1108 | - 'id' => 'geodir_add_listing_mouse_scroll', |
|
1109 | - 'type' => 'checkbox', |
|
1110 | - 'std' => '0' // Default value to show home top section |
|
1111 | - ), |
|
1112 | - array( |
|
1113 | - 'type' => 'sectionend', |
|
1114 | - 'id' => 'geodir_add_listing_map_section' |
|
1115 | - ), |
|
1099 | + array( |
|
1100 | + 'name' => __('Add Listing Map Settings', 'geodirectory'), |
|
1101 | + 'type' => 'sectionstart', |
|
1102 | + 'desc' => '', |
|
1103 | + 'id' => 'geodir_add_listing_map_section' |
|
1104 | + ), |
|
1105 | + array( |
|
1106 | + 'name' => __('Disable mouse scroll on details page map tab', 'geodirectory'), |
|
1107 | + 'desc' => __('Stops the mouse scroll zooming the map (home and listings settings set from widget)', 'geodirectory'), |
|
1108 | + 'id' => 'geodir_add_listing_mouse_scroll', |
|
1109 | + 'type' => 'checkbox', |
|
1110 | + 'std' => '0' // Default value to show home top section |
|
1111 | + ), |
|
1112 | + array( |
|
1113 | + 'type' => 'sectionend', |
|
1114 | + 'id' => 'geodir_add_listing_map_section' |
|
1115 | + ), |
|
1116 | 1116 | |
1117 | 1117 | |
1118 | - array('name' => __('Default map settings', 'geodirectory'), |
|
1119 | - 'type' => 'sectionstart', |
|
1120 | - 'desc' => '', |
|
1121 | - 'id' => 'geodir_map_default_settings'), |
|
1118 | + array('name' => __('Default map settings', 'geodirectory'), |
|
1119 | + 'type' => 'sectionstart', |
|
1120 | + 'desc' => '', |
|
1121 | + 'id' => 'geodir_map_default_settings'), |
|
1122 | 1122 | |
1123 | - array( |
|
1124 | - 'name' => '', |
|
1125 | - 'desc' => '', |
|
1126 | - 'id' => 'map_default_settings', |
|
1127 | - 'type' => 'map_default_settings', |
|
1128 | - 'css' => 'min-width:300px;', |
|
1129 | - 'std' => '' // Default value for the page title - changed in settings |
|
1130 | - ), |
|
1123 | + array( |
|
1124 | + 'name' => '', |
|
1125 | + 'desc' => '', |
|
1126 | + 'id' => 'map_default_settings', |
|
1127 | + 'type' => 'map_default_settings', |
|
1128 | + 'css' => 'min-width:300px;', |
|
1129 | + 'std' => '' // Default value for the page title - changed in settings |
|
1130 | + ), |
|
1131 | 1131 | |
1132 | - array( |
|
1133 | - 'name' => __('Upload map default marker icon', 'geodirectory'), |
|
1134 | - 'desc' => '', |
|
1135 | - 'id' => 'geodir_default_marker_icon', |
|
1136 | - 'type' => 'file', |
|
1137 | - 'std' => '0', |
|
1138 | - 'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section |
|
1139 | - ), |
|
1140 | - // add option that allows enable/disable map dragging to phone devices |
|
1141 | - array( |
|
1142 | - 'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'), |
|
1143 | - 'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'), |
|
1144 | - 'id' => 'geodir_map_onoff_dragging', |
|
1145 | - 'type' => 'checkbox', |
|
1146 | - 'std' => '0' // Default value to show home top section |
|
1147 | - ), |
|
1148 | - array( |
|
1149 | - 'name' => __('Select Maps API', 'geodirectory'), |
|
1150 | - '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'), |
|
1151 | - 'tip' => '', |
|
1152 | - 'id' => 'geodir_load_map', |
|
1153 | - 'css' => 'min-width:300px;', |
|
1154 | - 'std' => 'auto', |
|
1155 | - 'type' => 'select', |
|
1156 | - 'placeholder_text' => __('Select Map', 'geodirectory'), |
|
1157 | - 'options' => array( |
|
1158 | - 'auto' => __('Load Automatic', 'geodirectory'), |
|
1159 | - 'google' => __('Load Google Maps API', 'geodirectory'), |
|
1160 | - 'osm' => __('Load OpenStreetMap API', 'geodirectory'), |
|
1161 | - 'none' => __('Disable Maps', 'geodirectory') |
|
1162 | - ) |
|
1163 | - ), |
|
1164 | - |
|
1165 | - array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'), |
|
1166 | - |
|
1167 | - array('name' => __('Show / hide post type and category on map', 'geodirectory'), |
|
1168 | - 'type' => 'sectionstart', |
|
1169 | - 'desc' => '', |
|
1170 | - 'id' => 'geodir_map_settings'), |
|
1132 | + array( |
|
1133 | + 'name' => __('Upload map default marker icon', 'geodirectory'), |
|
1134 | + 'desc' => '', |
|
1135 | + 'id' => 'geodir_default_marker_icon', |
|
1136 | + 'type' => 'file', |
|
1137 | + 'std' => '0', |
|
1138 | + 'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section |
|
1139 | + ), |
|
1140 | + // add option that allows enable/disable map dragging to phone devices |
|
1141 | + array( |
|
1142 | + 'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'), |
|
1143 | + 'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'), |
|
1144 | + 'id' => 'geodir_map_onoff_dragging', |
|
1145 | + 'type' => 'checkbox', |
|
1146 | + 'std' => '0' // Default value to show home top section |
|
1147 | + ), |
|
1148 | + array( |
|
1149 | + 'name' => __('Select Maps API', 'geodirectory'), |
|
1150 | + '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'), |
|
1151 | + 'tip' => '', |
|
1152 | + 'id' => 'geodir_load_map', |
|
1153 | + 'css' => 'min-width:300px;', |
|
1154 | + 'std' => 'auto', |
|
1155 | + 'type' => 'select', |
|
1156 | + 'placeholder_text' => __('Select Map', 'geodirectory'), |
|
1157 | + 'options' => array( |
|
1158 | + 'auto' => __('Load Automatic', 'geodirectory'), |
|
1159 | + 'google' => __('Load Google Maps API', 'geodirectory'), |
|
1160 | + 'osm' => __('Load OpenStreetMap API', 'geodirectory'), |
|
1161 | + 'none' => __('Disable Maps', 'geodirectory') |
|
1162 | + ) |
|
1163 | + ), |
|
1171 | 1164 | |
1172 | - array( |
|
1173 | - 'name' => __('Select Map Category', 'geodirectory'), |
|
1174 | - 'desc' => '', |
|
1175 | - 'id' => 'geodir_map_settings', |
|
1176 | - 'type' => 'map', |
|
1177 | - 'css' => 'min-width:300px;', |
|
1178 | - 'std' => '' // Default value for the page title - changed in settings |
|
1179 | - ), |
|
1180 | - |
|
1181 | - array('type' => 'sectionend', 'id' => 'geodir_map_settings'), |
|
1182 | - /* Map Settings End */ |
|
1165 | + array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'), |
|
1166 | + |
|
1167 | + array('name' => __('Show / hide post type and category on map', 'geodirectory'), |
|
1168 | + 'type' => 'sectionstart', |
|
1169 | + 'desc' => '', |
|
1170 | + 'id' => 'geodir_map_settings'), |
|
1171 | + |
|
1172 | + array( |
|
1173 | + 'name' => __('Select Map Category', 'geodirectory'), |
|
1174 | + 'desc' => '', |
|
1175 | + 'id' => 'geodir_map_settings', |
|
1176 | + 'type' => 'map', |
|
1177 | + 'css' => 'min-width:300px;', |
|
1178 | + 'std' => '' // Default value for the page title - changed in settings |
|
1179 | + ), |
|
1180 | + |
|
1181 | + array('type' => 'sectionend', 'id' => 'geodir_map_settings'), |
|
1182 | + /* Map Settings End */ |
|
1183 | 1183 | |
1184 | 1184 | )); // End Design settings |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | 'id' => 'geodir_post_submited_success_email_subject_admin', |
130 | 130 | 'type' => 'text', |
131 | 131 | 'css' => 'min-width:300px;', |
132 | - 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
132 | + 'std' => __('Post Submitted Successfully', 'geodirectory') // Default value for the page title - changed in settings |
|
133 | 133 | ), |
134 | 134 | array( |
135 | 135 | 'name' => '', |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | 'id' => 'geodir_post_submited_success_email_content_admin', |
138 | 138 | 'css' => 'width:500px; height: 150px;', |
139 | 139 | 'type' => 'textarea', |
140 | - 'std' => __('<p>Dear Admin,</p><p>A new listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory') |
|
140 | + 'std' => __('<p>Dear Admin,</p><p>A new listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>', 'geodirectory') |
|
141 | 141 | ), |
142 | 142 | |
143 | 143 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | 'id' => 'geodir_post_submited_success_email_subject', |
155 | 155 | 'type' => 'text', |
156 | 156 | 'css' => 'min-width:300px;', |
157 | - 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
157 | + 'std' => __('Post Submitted Successfully', 'geodirectory') // Default value for the page title - changed in settings |
|
158 | 158 | ), |
159 | 159 | array( |
160 | 160 | 'name' => '', |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | 'id' => 'geodir_post_submited_success_email_content', |
163 | 163 | 'css' => 'width:500px; height: 150px;', |
164 | 164 | 'type' => 'textarea', |
165 | - 'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory') |
|
165 | + 'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>', 'geodirectory') |
|
166 | 166 | ), |
167 | 167 | |
168 | 168 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | 'id' => 'geodir_forgot_password_content', |
181 | 181 | 'css' => 'width:500px; height: 150px;', |
182 | 182 | 'type' => 'textarea', |
183 | - 'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
183 | + 'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>", 'geodirectory') |
|
184 | 184 | ), |
185 | 185 | |
186 | 186 | array( |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | 'id' => 'geodir_registration_success_email_content', |
198 | 198 | 'css' => 'width:500px; height: 150px;', |
199 | 199 | 'type' => 'textarea', |
200 | - 'std' => __("<p>Dear [#client_name#],</p><p>You can log in with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
200 | + 'std' => __("<p>Dear [#client_name#],</p><p>You can log in with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>", 'geodirectory') |
|
201 | 201 | ), |
202 | 202 | array( |
203 | 203 | 'name' => __('Listing published email', 'geodirectory'), |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | 'id' => 'geodir_email_friend_content', |
237 | 237 | 'css' => 'width:500px; height: 150px;', |
238 | 238 | 'type' => 'textarea', |
239 | - 'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory') |
|
239 | + 'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>", 'geodirectory') |
|
240 | 240 | ), |
241 | 241 | |
242 | 242 | array( |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | 'id' => 'geodir_email_enquiry_content', |
254 | 254 | 'css' => 'width:500px; height: 150px;', |
255 | 255 | 'type' => 'textarea', |
256 | - 'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
256 | + 'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>", 'geodirectory') |
|
257 | 257 | ), |
258 | 258 | |
259 | 259 | array('type' => 'sectionend', 'id' => 'other_emails'), |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | 'id' => 'geodir_post_added_success_msg_content', |
270 | 270 | 'css' => 'width:500px; height: 150px;', |
271 | 271 | 'type' => 'textarea', |
272 | - 'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information »</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory') |
|
272 | + 'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information »</a></p><p>Thank you for visiting us at [#site_name#].</p>', 'geodirectory') |
|
273 | 273 | ), |
274 | 274 | |
275 | 275 |
@@ -17,296 +17,296 @@ |
||
17 | 17 | $geodir_settings['notifications_settings'] = apply_filters('geodir_notifications_settings', array( |
18 | 18 | |
19 | 19 | |
20 | - array('name' => __('Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'notification_options'), |
|
21 | - |
|
22 | - |
|
23 | - array('name' => __('Notification Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'notification_options'), |
|
24 | - |
|
25 | - array( |
|
26 | - 'name' => __('List of usable shortcodes', 'geodirectory'), |
|
27 | - 'desc' => __('[#client_name#],[#listing_link#],[#posted_date#],[#number_of_days#],[#number_of_grace_days#],[#login_url#],[#username#],[#user_email#],[#site_name_url#],[#renew_link#],[#post_id#],[#site_name#],[#from_email#](in most cases this will be the admin email, except for popup forms)', 'geodirectory'), |
|
28 | - 'id' => 'geodir_list_of_usable_shordcodes', |
|
29 | - 'type' => 'html_content', |
|
30 | - 'css' => 'min-width:300px;', |
|
31 | - 'std' => 'All Places' // Default value for the page title - changed in settings |
|
32 | - ), |
|
33 | - |
|
34 | - array( |
|
35 | - 'name' => __('Use advanced editor? (slow loading)', 'geodirectory'), |
|
36 | - 'desc' => __('Yes', 'geodirectory'), |
|
37 | - 'id' => 'geodir_tiny_editor', |
|
38 | - 'std' => 'yes', |
|
39 | - 'type' => 'radio', |
|
40 | - 'value' => '1', |
|
41 | - 'radiogroup' => 'start' |
|
42 | - ), |
|
43 | - array( |
|
44 | - 'name' => __('Use advanced editor?(slow loading)', 'geodirectory'), |
|
45 | - 'desc' => __('No', 'geodirectory'), |
|
46 | - 'id' => 'geodir_tiny_editor', |
|
47 | - 'std' => 'yes', |
|
48 | - 'type' => 'radio', |
|
49 | - 'value' => '0', |
|
50 | - 'radiogroup' => 'end' |
|
51 | - ), |
|
52 | - |
|
53 | - |
|
54 | - array('type' => 'sectionend', 'id' => 'notification_options'), |
|
55 | - |
|
56 | - |
|
57 | - array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'site_bcc_options'), |
|
58 | - |
|
59 | - array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'site_bcc_options'), |
|
60 | - |
|
61 | - array( |
|
62 | - 'name' => __('New user registration', 'geodirectory'), |
|
63 | - 'desc' => __('Yes', 'geodirectory'), |
|
64 | - 'id' => 'geodir_bcc_new_user', |
|
65 | - 'std' => 'yes', |
|
66 | - 'type' => 'radio', |
|
67 | - 'value' => '1', |
|
68 | - 'radiogroup' => 'start' |
|
69 | - ), |
|
70 | - array( |
|
71 | - 'name' => __('New user registration', 'geodirectory'), |
|
72 | - 'desc' => __('No', 'geodirectory'), |
|
73 | - 'id' => 'geodir_bcc_new_user', |
|
74 | - 'std' => 'yes', |
|
75 | - 'type' => 'radio', |
|
76 | - 'value' => '0', |
|
77 | - 'radiogroup' => 'end' |
|
78 | - ), |
|
79 | - |
|
80 | - array( |
|
81 | - 'name' => __('Send to friend', 'geodirectory'), |
|
82 | - 'desc' => __('Yes', 'geodirectory'), |
|
83 | - 'id' => 'geodir_bcc_friend', |
|
84 | - 'std' => 'yes', |
|
85 | - 'type' => 'radio', |
|
86 | - 'value' => '1', |
|
87 | - 'radiogroup' => 'start' |
|
88 | - ), |
|
89 | - array( |
|
90 | - 'name' => __('Send to friend', 'geodirectory'), |
|
91 | - 'desc' => __('No', 'geodirectory'), |
|
92 | - 'id' => 'geodir_bcc_friend', |
|
93 | - 'std' => 'yes', |
|
94 | - 'type' => 'radio', |
|
95 | - 'value' => '0', |
|
96 | - 'radiogroup' => 'end' |
|
97 | - ), |
|
98 | - |
|
99 | - array( |
|
100 | - 'name' => __('Send enquiry', 'geodirectory'), |
|
101 | - 'desc' => __('Yes', 'geodirectory'), |
|
102 | - 'id' => 'geodir_bcc_enquiry', |
|
103 | - 'std' => 'yes', |
|
104 | - 'type' => 'radio', |
|
105 | - 'value' => '1', |
|
106 | - 'radiogroup' => 'start' |
|
107 | - ), |
|
108 | - array( |
|
109 | - 'name' => __('Send enquiry', 'geodirectory'), |
|
110 | - 'desc' => __('No', 'geodirectory'), |
|
111 | - 'id' => 'geodir_bcc_enquiry', |
|
112 | - 'std' => 'yes', |
|
113 | - 'type' => 'radio', |
|
114 | - 'value' => '0', |
|
115 | - 'radiogroup' => 'end' |
|
116 | - ), |
|
117 | - |
|
118 | - |
|
119 | - array('type' => 'sectionend', 'id' => 'site_bcc_options'), |
|
120 | - |
|
121 | - |
|
122 | - array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'admin_emails'), |
|
123 | - |
|
124 | - array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'admin_emails'), |
|
125 | - |
|
126 | - array( |
|
127 | - 'name' => __('Post submit success to admin email', 'geodirectory'), |
|
128 | - 'desc' => '', |
|
129 | - 'id' => 'geodir_post_submited_success_email_subject_admin', |
|
130 | - 'type' => 'text', |
|
131 | - 'css' => 'min-width:300px;', |
|
132 | - 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
133 | - ), |
|
134 | - array( |
|
135 | - 'name' => '', |
|
136 | - 'desc' => '', |
|
137 | - 'id' => 'geodir_post_submited_success_email_content_admin', |
|
138 | - 'css' => 'width:500px; height: 150px;', |
|
139 | - 'type' => 'textarea', |
|
140 | - 'std' => __('<p>Dear Admin,</p><p>A new listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory') |
|
141 | - ), |
|
142 | - array( |
|
143 | - 'name' => __('Notify Admin when listing edited by Author', 'geodirectory'), |
|
144 | - 'desc' => __('Yes', 'geodirectory'), |
|
145 | - 'id' => 'geodir_notify_post_edited', |
|
146 | - 'std' => '0', |
|
147 | - 'type' => 'radio', |
|
148 | - 'value' => '1', |
|
149 | - 'radiogroup' => 'start' |
|
150 | - ), |
|
151 | - array( |
|
152 | - 'name' => __('Notify Admin when listing edited by Author', 'geodirectory'), |
|
153 | - 'desc' => __('No', 'geodirectory'), |
|
154 | - 'id' => 'geodir_notify_post_edited', |
|
155 | - 'std' => '0', |
|
156 | - 'type' => 'radio', |
|
157 | - 'value' => '0', |
|
158 | - 'radiogroup' => 'end' |
|
159 | - ), |
|
160 | - array( |
|
161 | - 'name' => __('Listing edited by Author', 'geodirectory'), |
|
162 | - 'desc' => '', |
|
163 | - 'id' => 'geodir_post_edited_email_subject_admin', |
|
164 | - 'type' => 'text', |
|
165 | - 'css' => 'min-width:300px;', |
|
166 | - 'std' => __('[[#site_name#]] Listing edited by Author', 'geodirectory') |
|
167 | - ), |
|
168 | - array( |
|
169 | - 'name' => '', |
|
170 | - 'desc' => '', |
|
171 | - 'id' => 'geodir_post_edited_email_content_admin', |
|
172 | - 'css' => 'width:500px; height: 150px;', |
|
173 | - 'type' => 'textarea', |
|
174 | - 'std' => __('<p>Dear Admin,</p><p>A listing [#listing_link#] has been edited by it\'s author [#post_author_name#].</p><br><p><b>Listing Details:</b></p><p>Listing ID: [#post_id#]</p><p>Listing URL: [#listing_link#]</p><p>Date: [#current_date#]</p><br><p>This email is just for your information.</p><p>[#site_name#]</p>', 'geodirectory') |
|
175 | - ), |
|
176 | - |
|
177 | - |
|
178 | - array('type' => 'sectionend', 'id' => 'admin_emails'), |
|
179 | - |
|
180 | - |
|
181 | - array('name' => __('Client Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'client_emails'), |
|
182 | - |
|
183 | - array('name' => __('Client Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'client_emails'), |
|
184 | - |
|
185 | - array( |
|
186 | - 'name' => __('Post submit success to client email', 'geodirectory'), |
|
187 | - 'desc' => '', |
|
188 | - 'id' => 'geodir_post_submited_success_email_subject', |
|
189 | - 'type' => 'text', |
|
190 | - 'css' => 'min-width:300px;', |
|
191 | - 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
192 | - ), |
|
193 | - array( |
|
194 | - 'name' => '', |
|
195 | - 'desc' => '', |
|
196 | - 'id' => 'geodir_post_submited_success_email_content', |
|
197 | - 'css' => 'width:500px; height: 150px;', |
|
198 | - 'type' => 'textarea', |
|
199 | - 'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory') |
|
200 | - ), |
|
201 | - |
|
202 | - |
|
203 | - array( |
|
204 | - 'name' => __('User forgot password email', 'geodirectory'), |
|
205 | - 'desc' => '', |
|
206 | - 'id' => 'geodir_forgot_password_subject', |
|
207 | - 'type' => 'text', |
|
208 | - 'css' => 'min-width:300px;', |
|
209 | - 'std' => __('[#site_name#] - Your new password', 'geodirectory') // Default value for the page title - changed in settings |
|
210 | - ), |
|
211 | - array( |
|
212 | - 'name' => '', |
|
213 | - 'desc' => '', |
|
214 | - 'id' => 'geodir_forgot_password_content', |
|
215 | - 'css' => 'width:500px; height: 150px;', |
|
216 | - 'type' => 'textarea', |
|
217 | - 'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
218 | - ), |
|
219 | - |
|
220 | - array( |
|
221 | - 'name' => __('Registration success email', 'geodirectory'), |
|
222 | - 'desc' => '', |
|
223 | - 'id' => 'geodir_registration_success_email_subject', |
|
224 | - 'type' => 'text', |
|
225 | - 'css' => 'min-width:300px;', |
|
226 | - 'std' => __('Your Log In Details', 'geodirectory') // Default value for the page title - changed in settings |
|
227 | - ), |
|
228 | - array( |
|
229 | - 'name' => '', |
|
230 | - 'desc' => '', |
|
231 | - 'id' => 'geodir_registration_success_email_content', |
|
232 | - 'css' => 'width:500px; height: 150px;', |
|
233 | - 'type' => 'textarea', |
|
234 | - 'std' => __("<p>Dear [#client_name#],</p><p>You can log in with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
235 | - ), |
|
236 | - array( |
|
237 | - 'name' => __('Listing published email', 'geodirectory'), |
|
238 | - 'desc' => '', |
|
239 | - 'id' => 'geodir_post_published_email_subject', |
|
240 | - 'type' => 'text', |
|
241 | - 'css' => 'min-width:300px;', |
|
242 | - 'std' => __('Listing Published Successfully', 'geodirectory') // Default value for the page title - changed in settings |
|
243 | - ), |
|
244 | - array( |
|
245 | - 'name' => '', |
|
246 | - 'desc' => '', |
|
247 | - 'id' => 'geodir_post_published_email_content', |
|
248 | - 'css' => 'width:500px; height: 150px;', |
|
249 | - 'type' => 'textarea', |
|
250 | - 'std' => __("<p>Dear [#client_name#],</p><p>Your listing [#listing_link#] has been published. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>", 'geodirectory') |
|
251 | - ), |
|
252 | - |
|
253 | - array('type' => 'sectionend', 'id' => 'client_emails'), |
|
254 | - |
|
255 | - array('name' => __('Other Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'other_emails'), |
|
256 | - |
|
257 | - array('name' => __('Other Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'other_emails'), |
|
258 | - |
|
259 | - array( |
|
260 | - 'name' => __('Send to friend', 'geodirectory'), |
|
261 | - 'desc' => '', |
|
262 | - 'id' => 'geodir_email_friend_subject', |
|
263 | - 'type' => 'text', |
|
264 | - 'css' => 'min-width:300px;', |
|
265 | - 'std' => __('[#from_name#] thought you might be interested in..', 'geodirectory') |
|
266 | - ), |
|
267 | - array( |
|
268 | - 'name' => '', |
|
269 | - 'desc' => '', |
|
270 | - 'id' => 'geodir_email_friend_content', |
|
271 | - 'css' => 'width:500px; height: 150px;', |
|
272 | - 'type' => 'textarea', |
|
273 | - 'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory') |
|
274 | - ), |
|
275 | - |
|
276 | - array( |
|
277 | - 'name' => __('Email enquiry', 'geodirectory'), |
|
278 | - 'desc' => '', |
|
279 | - 'id' => 'geodir_email_enquiry_subject', |
|
280 | - 'type' => 'text', |
|
281 | - 'css' => 'min-width:300px;', |
|
282 | - 'std' => __('Website Enquiry', 'geodirectory') |
|
283 | - ), |
|
284 | - array( |
|
285 | - 'name' => '', |
|
286 | - 'desc' => '', |
|
287 | - 'id' => 'geodir_email_enquiry_content', |
|
288 | - 'css' => 'width:500px; height: 150px;', |
|
289 | - 'type' => 'textarea', |
|
290 | - 'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
291 | - ), |
|
292 | - |
|
293 | - array('type' => 'sectionend', 'id' => 'other_emails'), |
|
294 | - |
|
295 | - |
|
296 | - array('name' => __('Messages', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'messages'), |
|
297 | - |
|
298 | - array('name' => __('Messages', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'messages'), |
|
299 | - |
|
300 | - array( |
|
301 | - 'name' => __('Post submitted success', 'geodirectory'), |
|
302 | - 'desc' => '', |
|
303 | - 'id' => 'geodir_post_added_success_msg_content', |
|
304 | - 'css' => 'width:500px; height: 150px;', |
|
305 | - 'type' => 'textarea', |
|
306 | - 'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information »</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory') |
|
307 | - ), |
|
308 | - |
|
309 | - |
|
310 | - array('type' => 'sectionend', 'id' => 'messages'), |
|
20 | + array('name' => __('Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'notification_options'), |
|
21 | + |
|
22 | + |
|
23 | + array('name' => __('Notification Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'notification_options'), |
|
24 | + |
|
25 | + array( |
|
26 | + 'name' => __('List of usable shortcodes', 'geodirectory'), |
|
27 | + 'desc' => __('[#client_name#],[#listing_link#],[#posted_date#],[#number_of_days#],[#number_of_grace_days#],[#login_url#],[#username#],[#user_email#],[#site_name_url#],[#renew_link#],[#post_id#],[#site_name#],[#from_email#](in most cases this will be the admin email, except for popup forms)', 'geodirectory'), |
|
28 | + 'id' => 'geodir_list_of_usable_shordcodes', |
|
29 | + 'type' => 'html_content', |
|
30 | + 'css' => 'min-width:300px;', |
|
31 | + 'std' => 'All Places' // Default value for the page title - changed in settings |
|
32 | + ), |
|
33 | + |
|
34 | + array( |
|
35 | + 'name' => __('Use advanced editor? (slow loading)', 'geodirectory'), |
|
36 | + 'desc' => __('Yes', 'geodirectory'), |
|
37 | + 'id' => 'geodir_tiny_editor', |
|
38 | + 'std' => 'yes', |
|
39 | + 'type' => 'radio', |
|
40 | + 'value' => '1', |
|
41 | + 'radiogroup' => 'start' |
|
42 | + ), |
|
43 | + array( |
|
44 | + 'name' => __('Use advanced editor?(slow loading)', 'geodirectory'), |
|
45 | + 'desc' => __('No', 'geodirectory'), |
|
46 | + 'id' => 'geodir_tiny_editor', |
|
47 | + 'std' => 'yes', |
|
48 | + 'type' => 'radio', |
|
49 | + 'value' => '0', |
|
50 | + 'radiogroup' => 'end' |
|
51 | + ), |
|
52 | + |
|
53 | + |
|
54 | + array('type' => 'sectionend', 'id' => 'notification_options'), |
|
55 | + |
|
56 | + |
|
57 | + array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'site_bcc_options'), |
|
58 | + |
|
59 | + array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'site_bcc_options'), |
|
60 | + |
|
61 | + array( |
|
62 | + 'name' => __('New user registration', 'geodirectory'), |
|
63 | + 'desc' => __('Yes', 'geodirectory'), |
|
64 | + 'id' => 'geodir_bcc_new_user', |
|
65 | + 'std' => 'yes', |
|
66 | + 'type' => 'radio', |
|
67 | + 'value' => '1', |
|
68 | + 'radiogroup' => 'start' |
|
69 | + ), |
|
70 | + array( |
|
71 | + 'name' => __('New user registration', 'geodirectory'), |
|
72 | + 'desc' => __('No', 'geodirectory'), |
|
73 | + 'id' => 'geodir_bcc_new_user', |
|
74 | + 'std' => 'yes', |
|
75 | + 'type' => 'radio', |
|
76 | + 'value' => '0', |
|
77 | + 'radiogroup' => 'end' |
|
78 | + ), |
|
79 | + |
|
80 | + array( |
|
81 | + 'name' => __('Send to friend', 'geodirectory'), |
|
82 | + 'desc' => __('Yes', 'geodirectory'), |
|
83 | + 'id' => 'geodir_bcc_friend', |
|
84 | + 'std' => 'yes', |
|
85 | + 'type' => 'radio', |
|
86 | + 'value' => '1', |
|
87 | + 'radiogroup' => 'start' |
|
88 | + ), |
|
89 | + array( |
|
90 | + 'name' => __('Send to friend', 'geodirectory'), |
|
91 | + 'desc' => __('No', 'geodirectory'), |
|
92 | + 'id' => 'geodir_bcc_friend', |
|
93 | + 'std' => 'yes', |
|
94 | + 'type' => 'radio', |
|
95 | + 'value' => '0', |
|
96 | + 'radiogroup' => 'end' |
|
97 | + ), |
|
98 | + |
|
99 | + array( |
|
100 | + 'name' => __('Send enquiry', 'geodirectory'), |
|
101 | + 'desc' => __('Yes', 'geodirectory'), |
|
102 | + 'id' => 'geodir_bcc_enquiry', |
|
103 | + 'std' => 'yes', |
|
104 | + 'type' => 'radio', |
|
105 | + 'value' => '1', |
|
106 | + 'radiogroup' => 'start' |
|
107 | + ), |
|
108 | + array( |
|
109 | + 'name' => __('Send enquiry', 'geodirectory'), |
|
110 | + 'desc' => __('No', 'geodirectory'), |
|
111 | + 'id' => 'geodir_bcc_enquiry', |
|
112 | + 'std' => 'yes', |
|
113 | + 'type' => 'radio', |
|
114 | + 'value' => '0', |
|
115 | + 'radiogroup' => 'end' |
|
116 | + ), |
|
117 | + |
|
118 | + |
|
119 | + array('type' => 'sectionend', 'id' => 'site_bcc_options'), |
|
120 | + |
|
121 | + |
|
122 | + array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'admin_emails'), |
|
123 | + |
|
124 | + array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'admin_emails'), |
|
125 | + |
|
126 | + array( |
|
127 | + 'name' => __('Post submit success to admin email', 'geodirectory'), |
|
128 | + 'desc' => '', |
|
129 | + 'id' => 'geodir_post_submited_success_email_subject_admin', |
|
130 | + 'type' => 'text', |
|
131 | + 'css' => 'min-width:300px;', |
|
132 | + 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
133 | + ), |
|
134 | + array( |
|
135 | + 'name' => '', |
|
136 | + 'desc' => '', |
|
137 | + 'id' => 'geodir_post_submited_success_email_content_admin', |
|
138 | + 'css' => 'width:500px; height: 150px;', |
|
139 | + 'type' => 'textarea', |
|
140 | + 'std' => __('<p>Dear Admin,</p><p>A new listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory') |
|
141 | + ), |
|
142 | + array( |
|
143 | + 'name' => __('Notify Admin when listing edited by Author', 'geodirectory'), |
|
144 | + 'desc' => __('Yes', 'geodirectory'), |
|
145 | + 'id' => 'geodir_notify_post_edited', |
|
146 | + 'std' => '0', |
|
147 | + 'type' => 'radio', |
|
148 | + 'value' => '1', |
|
149 | + 'radiogroup' => 'start' |
|
150 | + ), |
|
151 | + array( |
|
152 | + 'name' => __('Notify Admin when listing edited by Author', 'geodirectory'), |
|
153 | + 'desc' => __('No', 'geodirectory'), |
|
154 | + 'id' => 'geodir_notify_post_edited', |
|
155 | + 'std' => '0', |
|
156 | + 'type' => 'radio', |
|
157 | + 'value' => '0', |
|
158 | + 'radiogroup' => 'end' |
|
159 | + ), |
|
160 | + array( |
|
161 | + 'name' => __('Listing edited by Author', 'geodirectory'), |
|
162 | + 'desc' => '', |
|
163 | + 'id' => 'geodir_post_edited_email_subject_admin', |
|
164 | + 'type' => 'text', |
|
165 | + 'css' => 'min-width:300px;', |
|
166 | + 'std' => __('[[#site_name#]] Listing edited by Author', 'geodirectory') |
|
167 | + ), |
|
168 | + array( |
|
169 | + 'name' => '', |
|
170 | + 'desc' => '', |
|
171 | + 'id' => 'geodir_post_edited_email_content_admin', |
|
172 | + 'css' => 'width:500px; height: 150px;', |
|
173 | + 'type' => 'textarea', |
|
174 | + 'std' => __('<p>Dear Admin,</p><p>A listing [#listing_link#] has been edited by it\'s author [#post_author_name#].</p><br><p><b>Listing Details:</b></p><p>Listing ID: [#post_id#]</p><p>Listing URL: [#listing_link#]</p><p>Date: [#current_date#]</p><br><p>This email is just for your information.</p><p>[#site_name#]</p>', 'geodirectory') |
|
175 | + ), |
|
176 | + |
|
177 | + |
|
178 | + array('type' => 'sectionend', 'id' => 'admin_emails'), |
|
179 | + |
|
180 | + |
|
181 | + array('name' => __('Client Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'client_emails'), |
|
182 | + |
|
183 | + array('name' => __('Client Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'client_emails'), |
|
184 | + |
|
185 | + array( |
|
186 | + 'name' => __('Post submit success to client email', 'geodirectory'), |
|
187 | + 'desc' => '', |
|
188 | + 'id' => 'geodir_post_submited_success_email_subject', |
|
189 | + 'type' => 'text', |
|
190 | + 'css' => 'min-width:300px;', |
|
191 | + 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
192 | + ), |
|
193 | + array( |
|
194 | + 'name' => '', |
|
195 | + 'desc' => '', |
|
196 | + 'id' => 'geodir_post_submited_success_email_content', |
|
197 | + 'css' => 'width:500px; height: 150px;', |
|
198 | + 'type' => 'textarea', |
|
199 | + 'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory') |
|
200 | + ), |
|
201 | + |
|
202 | + |
|
203 | + array( |
|
204 | + 'name' => __('User forgot password email', 'geodirectory'), |
|
205 | + 'desc' => '', |
|
206 | + 'id' => 'geodir_forgot_password_subject', |
|
207 | + 'type' => 'text', |
|
208 | + 'css' => 'min-width:300px;', |
|
209 | + 'std' => __('[#site_name#] - Your new password', 'geodirectory') // Default value for the page title - changed in settings |
|
210 | + ), |
|
211 | + array( |
|
212 | + 'name' => '', |
|
213 | + 'desc' => '', |
|
214 | + 'id' => 'geodir_forgot_password_content', |
|
215 | + 'css' => 'width:500px; height: 150px;', |
|
216 | + 'type' => 'textarea', |
|
217 | + 'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
218 | + ), |
|
219 | + |
|
220 | + array( |
|
221 | + 'name' => __('Registration success email', 'geodirectory'), |
|
222 | + 'desc' => '', |
|
223 | + 'id' => 'geodir_registration_success_email_subject', |
|
224 | + 'type' => 'text', |
|
225 | + 'css' => 'min-width:300px;', |
|
226 | + 'std' => __('Your Log In Details', 'geodirectory') // Default value for the page title - changed in settings |
|
227 | + ), |
|
228 | + array( |
|
229 | + 'name' => '', |
|
230 | + 'desc' => '', |
|
231 | + 'id' => 'geodir_registration_success_email_content', |
|
232 | + 'css' => 'width:500px; height: 150px;', |
|
233 | + 'type' => 'textarea', |
|
234 | + 'std' => __("<p>Dear [#client_name#],</p><p>You can log in with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
235 | + ), |
|
236 | + array( |
|
237 | + 'name' => __('Listing published email', 'geodirectory'), |
|
238 | + 'desc' => '', |
|
239 | + 'id' => 'geodir_post_published_email_subject', |
|
240 | + 'type' => 'text', |
|
241 | + 'css' => 'min-width:300px;', |
|
242 | + 'std' => __('Listing Published Successfully', 'geodirectory') // Default value for the page title - changed in settings |
|
243 | + ), |
|
244 | + array( |
|
245 | + 'name' => '', |
|
246 | + 'desc' => '', |
|
247 | + 'id' => 'geodir_post_published_email_content', |
|
248 | + 'css' => 'width:500px; height: 150px;', |
|
249 | + 'type' => 'textarea', |
|
250 | + 'std' => __("<p>Dear [#client_name#],</p><p>Your listing [#listing_link#] has been published. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>", 'geodirectory') |
|
251 | + ), |
|
252 | + |
|
253 | + array('type' => 'sectionend', 'id' => 'client_emails'), |
|
254 | + |
|
255 | + array('name' => __('Other Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'other_emails'), |
|
256 | + |
|
257 | + array('name' => __('Other Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'other_emails'), |
|
258 | + |
|
259 | + array( |
|
260 | + 'name' => __('Send to friend', 'geodirectory'), |
|
261 | + 'desc' => '', |
|
262 | + 'id' => 'geodir_email_friend_subject', |
|
263 | + 'type' => 'text', |
|
264 | + 'css' => 'min-width:300px;', |
|
265 | + 'std' => __('[#from_name#] thought you might be interested in..', 'geodirectory') |
|
266 | + ), |
|
267 | + array( |
|
268 | + 'name' => '', |
|
269 | + 'desc' => '', |
|
270 | + 'id' => 'geodir_email_friend_content', |
|
271 | + 'css' => 'width:500px; height: 150px;', |
|
272 | + 'type' => 'textarea', |
|
273 | + 'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory') |
|
274 | + ), |
|
275 | + |
|
276 | + array( |
|
277 | + 'name' => __('Email enquiry', 'geodirectory'), |
|
278 | + 'desc' => '', |
|
279 | + 'id' => 'geodir_email_enquiry_subject', |
|
280 | + 'type' => 'text', |
|
281 | + 'css' => 'min-width:300px;', |
|
282 | + 'std' => __('Website Enquiry', 'geodirectory') |
|
283 | + ), |
|
284 | + array( |
|
285 | + 'name' => '', |
|
286 | + 'desc' => '', |
|
287 | + 'id' => 'geodir_email_enquiry_content', |
|
288 | + 'css' => 'width:500px; height: 150px;', |
|
289 | + 'type' => 'textarea', |
|
290 | + 'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
291 | + ), |
|
292 | + |
|
293 | + array('type' => 'sectionend', 'id' => 'other_emails'), |
|
294 | + |
|
295 | + |
|
296 | + array('name' => __('Messages', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'messages'), |
|
297 | + |
|
298 | + array('name' => __('Messages', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'messages'), |
|
299 | + |
|
300 | + array( |
|
301 | + 'name' => __('Post submitted success', 'geodirectory'), |
|
302 | + 'desc' => '', |
|
303 | + 'id' => 'geodir_post_added_success_msg_content', |
|
304 | + 'css' => 'width:500px; height: 150px;', |
|
305 | + 'type' => 'textarea', |
|
306 | + 'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information »</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory') |
|
307 | + ), |
|
308 | + |
|
309 | + |
|
310 | + array('type' => 'sectionend', 'id' => 'messages'), |
|
311 | 311 | |
312 | 312 | )); // End Manage NOtifications settings |
@@ -204,8 +204,9 @@ discard block |
||
204 | 204 | ############################################################# |
205 | 205 | function manage_category_custom_fields($deprecated, $column_name, $term_id) |
206 | 206 | { |
207 | - if ($column_name == 'cat_ID_num') |
|
208 | - echo $term_id; |
|
207 | + if ($column_name == 'cat_ID_num') { |
|
208 | + echo $term_id; |
|
209 | + } |
|
209 | 210 | |
210 | 211 | if ($column_name == 'cat_icon') { |
211 | 212 | $term_icon_url = get_tax_meta($term_id, 'ct_cat_icon'); |
@@ -214,9 +215,9 @@ discard block |
||
214 | 215 | |
215 | 216 | $file_info = pathinfo($term_icon_url['src']); |
216 | 217 | |
217 | - if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
218 | - $sub_dir = $file_info['dirname']; |
|
219 | - else{$sub_dir = '';} |
|
218 | + if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') { |
|
219 | + $sub_dir = $file_info['dirname']; |
|
220 | + } else{$sub_dir = '';} |
|
220 | 221 | |
221 | 222 | $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
222 | 223 | $uploads_baseurl = $uploads['baseurl']; |
@@ -236,8 +237,9 @@ discard block |
||
236 | 237 | |
237 | 238 | if ($column_name == 'cat_default_img') { |
238 | 239 | $cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img'); |
239 | - if ($cat_default_img != '') |
|
240 | - echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>'; |
|
240 | + if ($cat_default_img != '') { |
|
241 | + echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>'; |
|
242 | + } |
|
241 | 243 | |
242 | 244 | } |
243 | 245 | } |
@@ -245,11 +247,12 @@ discard block |
||
245 | 247 | function geodir_get_default_catimage($term_id, $post_type = 'gd_place') |
246 | 248 | { |
247 | 249 | |
248 | - if ($cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type)) |
|
249 | - return $cat_default_img; |
|
250 | - else |
|
251 | - return false; |
|
252 | -} |
|
250 | + if ($cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type)) { |
|
251 | + return $cat_default_img; |
|
252 | + } else { |
|
253 | + return false; |
|
254 | + } |
|
255 | + } |
|
253 | 256 | |
254 | 257 | //Clear custom fields |
255 | 258 | add_action('in_admin_footer', 'geodir_tax_meta_clear_custom_field'); |
@@ -24,12 +24,12 @@ discard block |
||
24 | 24 | */ |
25 | 25 | |
26 | 26 | $config = array( |
27 | - 'id' => 'demo_meta_box', // meta box id, unique per meta box |
|
28 | - 'title' => __('Demo Meta Box', 'geodirectory'), // meta box title |
|
29 | - 'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies |
|
30 | - 'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional |
|
31 | - 'fields' => array(), // list of meta fields (can be added by field arrays) |
|
32 | - 'local_images' => false, // Use local or hosted images (meta box images for add/remove) |
|
27 | + 'id' => 'demo_meta_box', // meta box id, unique per meta box |
|
28 | + 'title' => __('Demo Meta Box', 'geodirectory'), // meta box title |
|
29 | + 'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies |
|
30 | + 'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional |
|
31 | + 'fields' => array(), // list of meta fields (can be added by field arrays) |
|
32 | + 'local_images' => false, // Use local or hosted images (meta box images for add/remove) |
|
33 | 33 | 'use_with_theme' => true //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false). |
34 | 34 | ); |
35 | 35 | |
@@ -38,18 +38,18 @@ discard block |
||
38 | 38 | * Initiate your meta box |
39 | 39 | */ |
40 | 40 | $my_meta = new Tax_Meta_Class($config); |
41 | - $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory'))); |
|
42 | - $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory'))); |
|
43 | - $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty')); |
|
41 | + $my_meta->addWysiwyg($prefix.'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory'))); |
|
42 | + $my_meta->addImage($prefix.'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory'))); |
|
43 | + $my_meta->addImage($prefix.'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty')); |
|
44 | 44 | /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML |
45 | 45 | |
46 | - $my_meta->addSelect($prefix . 'cat_schema', |
|
46 | + $my_meta->addSelect($prefix.'cat_schema', |
|
47 | 47 | /* |
48 | 48 | * Allows you to add/filter the cat schema types. |
49 | 49 | * |
50 | 50 | * @since 1.5.7 |
51 | 51 | */ |
52 | - apply_filters('geodir_cat_schemas',array( |
|
52 | + apply_filters('geodir_cat_schemas', array( |
|
53 | 53 | '' => __('Default (LocalBusiness)', 'geodirectory'), |
54 | 54 | 'AccountingService' => 'AccountingService', |
55 | 55 | 'Attorney' => 'Attorney', |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | 'WholesaleStore' => 'WholesaleStore', |
142 | 142 | 'Winery' => 'Winery' |
143 | 143 | )), |
144 | - array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2'))); |
|
144 | + array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory')."", 'std' => array('selectkey2'))); |
|
145 | 145 | |
146 | 146 | /*$my_meta->addSelect($prefix.'cat_sort',array(''=>__('Default' , 'geodirectory'), |
147 | 147 | 'random'=>__('Random','geodirectory'), |
@@ -179,8 +179,8 @@ discard block |
||
179 | 179 | if (!empty($gd_taxonomies)) { |
180 | 180 | foreach ($gd_taxonomies as $gd_taxonomy) { |
181 | 181 | |
182 | - add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2); |
|
183 | - add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3); |
|
182 | + add_filter('manage_edit-'.$gd_taxonomy.'_columns', 'addCat_column', 10, 2); |
|
183 | + add_action('manage_'.$gd_taxonomy.'_custom_column', 'manage_category_custom_fields', 10, 3); |
|
184 | 184 | |
185 | 185 | } |
186 | 186 | } |
@@ -214,9 +214,9 @@ discard block |
||
214 | 214 | |
215 | 215 | $file_info = pathinfo($term_icon_url['src']); |
216 | 216 | |
217 | - if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
217 | + if (isset($file_info['dirname']) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
218 | 218 | $sub_dir = $file_info['dirname']; |
219 | - else{$sub_dir = '';} |
|
219 | + else {$sub_dir = ''; } |
|
220 | 220 | |
221 | 221 | $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
222 | 222 | $uploads_baseurl = $uploads['baseurl']; |
@@ -226,10 +226,10 @@ discard block |
||
226 | 226 | |
227 | 227 | $sub_dir = str_replace($uploads_baseurl, '', $sub_dir); |
228 | 228 | |
229 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
229 | + $uploads_url = $uploads_baseurl.$sub_dir; |
|
230 | 230 | |
231 | - $term_icon_url['src'] = $uploads_url . '/' . $file_name; |
|
232 | - echo '<img src="' . $term_icon_url['src'] . '" />'; |
|
231 | + $term_icon_url['src'] = $uploads_url.'/'.$file_name; |
|
232 | + echo '<img src="'.$term_icon_url['src'].'" />'; |
|
233 | 233 | |
234 | 234 | } |
235 | 235 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | if ($column_name == 'cat_default_img') { |
238 | 238 | $cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img'); |
239 | 239 | if ($cat_default_img != '') |
240 | - echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>'; |
|
240 | + echo '<img src="'.$cat_default_img['src'].'" style="max-height:60px;max-width:60px;"/>'; |
|
241 | 241 | |
242 | 242 | } |
243 | 243 | } |
@@ -268,8 +268,8 @@ discard block |
||
268 | 268 | jQuery("#addtag iframe").contents().find("body").html(''); |
269 | 269 | jQuery('#addtag [rel="ct_cat_default_img"]').removeClass('at-delete_image_button').addClass('at-upload_image_button'); |
270 | 270 | jQuery('#addtag [rel="ct_cat_icon"]').removeClass('at-delete_image_button').addClass('at-upload_image_button'); |
271 | - jQuery('#addtag [rel="ct_cat_default_img"]').val('<?php _e('Upload Image','geodirectory');?>'); |
|
272 | - jQuery('#addtag [rel="ct_cat_icon"]').val('<?php _e('Upload Image','geodirectory');?>'); |
|
271 | + jQuery('#addtag [rel="ct_cat_default_img"]').val('<?php _e('Upload Image', 'geodirectory'); ?>'); |
|
272 | + jQuery('#addtag [rel="ct_cat_icon"]').val('<?php _e('Upload Image', 'geodirectory'); ?>'); |
|
273 | 273 | } |
274 | 274 | }, 1000); |
275 | 275 |
@@ -11,142 +11,142 @@ discard block |
||
11 | 11 | //include the main class file |
12 | 12 | require_once("Tax-meta-class.php"); |
13 | 13 | if (is_admin()) { |
14 | - /* |
|
14 | + /* |
|
15 | 15 | * prefix of meta keys, optional |
16 | 16 | * use underscore (_) at the beginning to make keys hidden, for example $prefix = '_ba_'; |
17 | 17 | * you also can make prefix empty to disable it |
18 | 18 | * |
19 | 19 | */ |
20 | 20 | |
21 | - $prefix = 'ct_'; |
|
22 | - /* |
|
21 | + $prefix = 'ct_'; |
|
22 | + /* |
|
23 | 23 | * configure your meta box |
24 | 24 | */ |
25 | 25 | |
26 | - $config = array( |
|
27 | - 'id' => 'demo_meta_box', // meta box id, unique per meta box |
|
28 | - 'title' => __('Demo Meta Box', 'geodirectory'), // meta box title |
|
29 | - 'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies |
|
30 | - 'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional |
|
31 | - 'fields' => array(), // list of meta fields (can be added by field arrays) |
|
32 | - 'local_images' => false, // Use local or hosted images (meta box images for add/remove) |
|
33 | - 'use_with_theme' => true //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false). |
|
34 | - ); |
|
26 | + $config = array( |
|
27 | + 'id' => 'demo_meta_box', // meta box id, unique per meta box |
|
28 | + 'title' => __('Demo Meta Box', 'geodirectory'), // meta box title |
|
29 | + 'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies |
|
30 | + 'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional |
|
31 | + 'fields' => array(), // list of meta fields (can be added by field arrays) |
|
32 | + 'local_images' => false, // Use local or hosted images (meta box images for add/remove) |
|
33 | + 'use_with_theme' => true //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false). |
|
34 | + ); |
|
35 | 35 | |
36 | 36 | |
37 | - /* |
|
37 | + /* |
|
38 | 38 | * Initiate your meta box |
39 | 39 | */ |
40 | - $my_meta = new Tax_Meta_Class($config); |
|
41 | - $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory'))); |
|
42 | - $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory'))); |
|
43 | - $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty')); |
|
44 | - /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML |
|
45 | - |
|
46 | - $my_meta->addSelect($prefix . 'cat_schema', |
|
47 | - /* |
|
40 | + $my_meta = new Tax_Meta_Class($config); |
|
41 | + $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory'))); |
|
42 | + $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory'))); |
|
43 | + $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty')); |
|
44 | + /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML |
|
45 | + |
|
46 | + $my_meta->addSelect($prefix . 'cat_schema', |
|
47 | + /* |
|
48 | 48 | * Allows you to add/filter the cat schema types. |
49 | 49 | * |
50 | 50 | * @since 1.5.7 |
51 | 51 | */ |
52 | - apply_filters('geodir_cat_schemas',array( |
|
53 | - '' => __('Default (LocalBusiness)', 'geodirectory'), |
|
54 | - 'AccountingService' => 'AccountingService', |
|
55 | - 'Attorney' => 'Attorney', |
|
56 | - 'AutoBodyShop' => 'AutoBodyShop', |
|
57 | - 'AutoDealer' => 'AutoDealer', |
|
58 | - 'AutoPartsStore' => 'AutoPartsStore', |
|
59 | - 'AutoRental' => 'AutoRental', |
|
60 | - 'AutoRepair' => 'AutoRepair', |
|
61 | - 'AutoWash' => 'AutoWash', |
|
62 | - 'Bakery' => 'Bakery', |
|
63 | - 'BarOrPub' => 'BarOrPub', |
|
64 | - 'BeautySalon' => 'BeautySalon', |
|
65 | - 'BedAndBreakfast' => 'BedAndBreakfast', |
|
66 | - 'BikeStore' => 'BikeStore', |
|
67 | - 'BookStore' => 'BookStore', |
|
68 | - 'CafeOrCoffeeShop' => 'CafeOrCoffeeShop', |
|
69 | - 'Campground' => 'Campground', |
|
70 | - 'ChildCare' => 'ChildCare', |
|
71 | - 'ClothingStore' => 'ClothingStore', |
|
72 | - 'ComputerStore' => 'ComputerStore', |
|
73 | - 'DaySpa' => 'DaySpa', |
|
74 | - 'Dentist' => 'Dentist', |
|
75 | - 'DryCleaningOrLaundry' => 'DryCleaningOrLaundry', |
|
76 | - 'Electrician' => 'Electrician', |
|
77 | - 'ElectronicsStore' => 'ElectronicsStore', |
|
78 | - 'EmergencyService' => 'EmergencyService', |
|
79 | - 'EntertainmentBusiness' => 'EntertainmentBusiness', |
|
80 | - 'Event' => 'Event', |
|
81 | - 'EventVenue' => 'EventVenue', |
|
82 | - 'ExerciseGym' => 'ExerciseGym', |
|
83 | - 'FinancialService' => 'FinancialService', |
|
84 | - 'Florist' => 'Florist', |
|
85 | - 'FoodEstablishment' => 'FoodEstablishment', |
|
86 | - 'FurnitureStore' => 'FurnitureStore', |
|
87 | - 'GardenStore' => 'GardenStore', |
|
88 | - 'GeneralContractor' => 'GeneralContractor', |
|
89 | - 'GolfCourse' => 'GolfCourse', |
|
90 | - 'HairSalon' => 'HairSalon', |
|
91 | - 'HardwareStore' => 'HardwareStore', |
|
92 | - 'HealthAndBeautyBusiness' => 'HealthAndBeautyBusiness', |
|
93 | - 'HobbyShop' => 'HobbyShop', |
|
94 | - 'HomeAndConstructionBusiness' => 'HomeAndConstructionBusiness', |
|
95 | - 'HomeGoodsStore' => 'HomeGoodsStore', |
|
96 | - 'Hospital' => 'Hospital', |
|
97 | - 'Hostel' => 'Hostel', |
|
98 | - 'Hotel' => 'Hotel', |
|
99 | - 'HousePainter' => 'HousePainter', |
|
100 | - 'HVACBusiness' => 'HVACBusiness', |
|
101 | - 'InsuranceAgency' => 'InsuranceAgency', |
|
102 | - 'JewelryStore' => 'JewelryStore', |
|
103 | - 'LiquorStore' => 'LiquorStore', |
|
104 | - 'Locksmith' => 'Locksmith', |
|
105 | - 'LodgingBusiness' => 'LodgingBusiness', |
|
106 | - 'MedicalClinic' => 'MedicalClinic', |
|
107 | - 'MensClothingStore' => 'MensClothingStore', |
|
108 | - 'MobilePhoneStore' => 'MobilePhoneStore', |
|
109 | - 'Motel' => 'Motel', |
|
110 | - 'MotorcycleDealer' => 'MotorcycleDealer', |
|
111 | - 'MotorcycleRepair' => 'MotorcycleRepair', |
|
112 | - 'MovingCompany' => 'MovingCompany', |
|
113 | - 'MusicStore' => 'MusicStore', |
|
114 | - 'NailSalon' => 'NailSalon', |
|
115 | - 'NightClub' => 'NightClub', |
|
116 | - 'Notary' => 'Notary', |
|
117 | - 'OfficeEquipmentStore' => 'OfficeEquipmentStore', |
|
118 | - 'Optician' => 'Optician', |
|
119 | - 'PetStore' => 'PetStore', |
|
120 | - 'Physician' => 'Physician', |
|
121 | - 'Plumber' => 'Plumber', |
|
122 | - 'ProfessionalService' => 'ProfessionalService', |
|
123 | - 'RealEstateAgent' => 'RealEstateAgent', |
|
124 | - 'Residence' => 'Residence', |
|
125 | - 'Restaurant' => 'Restaurant', |
|
126 | - 'RoofingContractor' => 'RoofingContractor', |
|
127 | - 'RVPark' => 'RVPark', |
|
128 | - 'School' => 'School', |
|
129 | - 'SelfStorage' => 'SelfStorage', |
|
130 | - 'ShoeStore' => 'ShoeStore', |
|
131 | - 'SkiResort' => 'SkiResort', |
|
132 | - 'SportingGoodsStore' => 'SportingGoodsStore', |
|
133 | - 'SportsClub' => 'SportsClub', |
|
134 | - 'Store' => 'Store', |
|
135 | - 'TattooParlor' => 'TattooParlor', |
|
136 | - 'Taxi' => 'Taxi', |
|
137 | - 'TennisComplex' => 'TennisComplex', |
|
138 | - 'TireShop' => 'TireShop', |
|
139 | - 'TouristAttraction' => 'TouristAttraction', |
|
140 | - 'ToyStore' => 'ToyStore', |
|
141 | - 'TravelAgency' => 'TravelAgency', |
|
142 | - //'VacationRentals' => 'VacationRentals', // Not recognised by google yet |
|
143 | - 'VeterinaryCare' => 'VeterinaryCare', |
|
144 | - 'WholesaleStore' => 'WholesaleStore', |
|
145 | - 'Winery' => 'Winery' |
|
146 | - )), |
|
147 | - array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2'))); |
|
148 | - |
|
149 | - /*$my_meta->addSelect($prefix.'cat_sort',array(''=>__('Default' , 'geodirectory'), |
|
52 | + apply_filters('geodir_cat_schemas',array( |
|
53 | + '' => __('Default (LocalBusiness)', 'geodirectory'), |
|
54 | + 'AccountingService' => 'AccountingService', |
|
55 | + 'Attorney' => 'Attorney', |
|
56 | + 'AutoBodyShop' => 'AutoBodyShop', |
|
57 | + 'AutoDealer' => 'AutoDealer', |
|
58 | + 'AutoPartsStore' => 'AutoPartsStore', |
|
59 | + 'AutoRental' => 'AutoRental', |
|
60 | + 'AutoRepair' => 'AutoRepair', |
|
61 | + 'AutoWash' => 'AutoWash', |
|
62 | + 'Bakery' => 'Bakery', |
|
63 | + 'BarOrPub' => 'BarOrPub', |
|
64 | + 'BeautySalon' => 'BeautySalon', |
|
65 | + 'BedAndBreakfast' => 'BedAndBreakfast', |
|
66 | + 'BikeStore' => 'BikeStore', |
|
67 | + 'BookStore' => 'BookStore', |
|
68 | + 'CafeOrCoffeeShop' => 'CafeOrCoffeeShop', |
|
69 | + 'Campground' => 'Campground', |
|
70 | + 'ChildCare' => 'ChildCare', |
|
71 | + 'ClothingStore' => 'ClothingStore', |
|
72 | + 'ComputerStore' => 'ComputerStore', |
|
73 | + 'DaySpa' => 'DaySpa', |
|
74 | + 'Dentist' => 'Dentist', |
|
75 | + 'DryCleaningOrLaundry' => 'DryCleaningOrLaundry', |
|
76 | + 'Electrician' => 'Electrician', |
|
77 | + 'ElectronicsStore' => 'ElectronicsStore', |
|
78 | + 'EmergencyService' => 'EmergencyService', |
|
79 | + 'EntertainmentBusiness' => 'EntertainmentBusiness', |
|
80 | + 'Event' => 'Event', |
|
81 | + 'EventVenue' => 'EventVenue', |
|
82 | + 'ExerciseGym' => 'ExerciseGym', |
|
83 | + 'FinancialService' => 'FinancialService', |
|
84 | + 'Florist' => 'Florist', |
|
85 | + 'FoodEstablishment' => 'FoodEstablishment', |
|
86 | + 'FurnitureStore' => 'FurnitureStore', |
|
87 | + 'GardenStore' => 'GardenStore', |
|
88 | + 'GeneralContractor' => 'GeneralContractor', |
|
89 | + 'GolfCourse' => 'GolfCourse', |
|
90 | + 'HairSalon' => 'HairSalon', |
|
91 | + 'HardwareStore' => 'HardwareStore', |
|
92 | + 'HealthAndBeautyBusiness' => 'HealthAndBeautyBusiness', |
|
93 | + 'HobbyShop' => 'HobbyShop', |
|
94 | + 'HomeAndConstructionBusiness' => 'HomeAndConstructionBusiness', |
|
95 | + 'HomeGoodsStore' => 'HomeGoodsStore', |
|
96 | + 'Hospital' => 'Hospital', |
|
97 | + 'Hostel' => 'Hostel', |
|
98 | + 'Hotel' => 'Hotel', |
|
99 | + 'HousePainter' => 'HousePainter', |
|
100 | + 'HVACBusiness' => 'HVACBusiness', |
|
101 | + 'InsuranceAgency' => 'InsuranceAgency', |
|
102 | + 'JewelryStore' => 'JewelryStore', |
|
103 | + 'LiquorStore' => 'LiquorStore', |
|
104 | + 'Locksmith' => 'Locksmith', |
|
105 | + 'LodgingBusiness' => 'LodgingBusiness', |
|
106 | + 'MedicalClinic' => 'MedicalClinic', |
|
107 | + 'MensClothingStore' => 'MensClothingStore', |
|
108 | + 'MobilePhoneStore' => 'MobilePhoneStore', |
|
109 | + 'Motel' => 'Motel', |
|
110 | + 'MotorcycleDealer' => 'MotorcycleDealer', |
|
111 | + 'MotorcycleRepair' => 'MotorcycleRepair', |
|
112 | + 'MovingCompany' => 'MovingCompany', |
|
113 | + 'MusicStore' => 'MusicStore', |
|
114 | + 'NailSalon' => 'NailSalon', |
|
115 | + 'NightClub' => 'NightClub', |
|
116 | + 'Notary' => 'Notary', |
|
117 | + 'OfficeEquipmentStore' => 'OfficeEquipmentStore', |
|
118 | + 'Optician' => 'Optician', |
|
119 | + 'PetStore' => 'PetStore', |
|
120 | + 'Physician' => 'Physician', |
|
121 | + 'Plumber' => 'Plumber', |
|
122 | + 'ProfessionalService' => 'ProfessionalService', |
|
123 | + 'RealEstateAgent' => 'RealEstateAgent', |
|
124 | + 'Residence' => 'Residence', |
|
125 | + 'Restaurant' => 'Restaurant', |
|
126 | + 'RoofingContractor' => 'RoofingContractor', |
|
127 | + 'RVPark' => 'RVPark', |
|
128 | + 'School' => 'School', |
|
129 | + 'SelfStorage' => 'SelfStorage', |
|
130 | + 'ShoeStore' => 'ShoeStore', |
|
131 | + 'SkiResort' => 'SkiResort', |
|
132 | + 'SportingGoodsStore' => 'SportingGoodsStore', |
|
133 | + 'SportsClub' => 'SportsClub', |
|
134 | + 'Store' => 'Store', |
|
135 | + 'TattooParlor' => 'TattooParlor', |
|
136 | + 'Taxi' => 'Taxi', |
|
137 | + 'TennisComplex' => 'TennisComplex', |
|
138 | + 'TireShop' => 'TireShop', |
|
139 | + 'TouristAttraction' => 'TouristAttraction', |
|
140 | + 'ToyStore' => 'ToyStore', |
|
141 | + 'TravelAgency' => 'TravelAgency', |
|
142 | + //'VacationRentals' => 'VacationRentals', // Not recognised by google yet |
|
143 | + 'VeterinaryCare' => 'VeterinaryCare', |
|
144 | + 'WholesaleStore' => 'WholesaleStore', |
|
145 | + 'Winery' => 'Winery' |
|
146 | + )), |
|
147 | + array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2'))); |
|
148 | + |
|
149 | + /*$my_meta->addSelect($prefix.'cat_sort',array(''=>__('Default' , 'geodirectory'), |
|
150 | 150 | 'random'=>__('Random','geodirectory'), |
151 | 151 | 'az'=>__('Alphabetical' , 'geodirectory'), |
152 | 152 | 'newest'=>__('Newest','geodirectory'), |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | 'low_review'=>__('Lowest Reviews','geodirectory')), |
158 | 158 | array('name'=> __('Sort By','geodirectory'),'desc' => __('Select the default sort option.' ,'geodirectory'), 'std'=> array('selectkey2')));*/ |
159 | 159 | |
160 | - // Show options for placecategories only |
|
161 | - /* if(isset($_REQUEST['taxonomy']) && in_array($_REQUEST['taxonomy'],$config['pages']) ){ |
|
160 | + // Show options for placecategories only |
|
161 | + /* if(isset($_REQUEST['taxonomy']) && in_array($_REQUEST['taxonomy'],$config['pages']) ){ |
|
162 | 162 | // Exclude sort options |
163 | 163 | $my_meta->addCheckbox($prefix.'cat_exclude_rating',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'))); |
164 | 164 | $my_meta->addCheckbox($prefix.'cat_exclude_reviews',array('name'=> __('<b>Exclude</b> Reviews sort option','geodirectory'))); |
@@ -170,8 +170,8 @@ discard block |
||
170 | 170 | |
171 | 171 | }*/ |
172 | 172 | |
173 | - //Finish Meta Box Declaration |
|
174 | - $my_meta->Finish(); |
|
173 | + //Finish Meta Box Declaration |
|
174 | + $my_meta->Finish(); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | |
@@ -180,82 +180,82 @@ discard block |
||
180 | 180 | ############################################################## |
181 | 181 | $gd_taxonomies = geodir_get_taxonomies(); |
182 | 182 | if (!empty($gd_taxonomies)) { |
183 | - foreach ($gd_taxonomies as $gd_taxonomy) { |
|
183 | + foreach ($gd_taxonomies as $gd_taxonomy) { |
|
184 | 184 | |
185 | - add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2); |
|
186 | - add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3); |
|
185 | + add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2); |
|
186 | + add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3); |
|
187 | 187 | |
188 | - } |
|
188 | + } |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | function addCat_column($columns) |
192 | 192 | { |
193 | - if (isset($columns['description']) && $posts = $columns['description']) { |
|
194 | - unset($columns['description']); |
|
195 | - } |
|
196 | - |
|
197 | - $columns['cat_icon'] = 'Icon'; |
|
198 | - $columns['cat_default_img'] = __('Default Image', 'geodirectory'); |
|
199 | - $columns['cat_ID_num'] = __('Cat ID', 'geodirectory'); |
|
200 | - return $columns; |
|
193 | + if (isset($columns['description']) && $posts = $columns['description']) { |
|
194 | + unset($columns['description']); |
|
195 | + } |
|
196 | + |
|
197 | + $columns['cat_icon'] = 'Icon'; |
|
198 | + $columns['cat_default_img'] = __('Default Image', 'geodirectory'); |
|
199 | + $columns['cat_ID_num'] = __('Cat ID', 'geodirectory'); |
|
200 | + return $columns; |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | ############################################################# |
204 | 204 | function manage_category_custom_fields($deprecated, $column_name, $term_id) |
205 | 205 | { |
206 | - if ($column_name == 'cat_ID_num') |
|
207 | - echo $term_id; |
|
206 | + if ($column_name == 'cat_ID_num') |
|
207 | + echo $term_id; |
|
208 | 208 | |
209 | - if ($column_name == 'cat_icon') { |
|
210 | - $term_icon_url = get_tax_meta($term_id, 'ct_cat_icon'); |
|
209 | + if ($column_name == 'cat_icon') { |
|
210 | + $term_icon_url = get_tax_meta($term_id, 'ct_cat_icon'); |
|
211 | 211 | |
212 | - if ($term_icon_url != '') { |
|
212 | + if ($term_icon_url != '') { |
|
213 | 213 | |
214 | - $file_info = pathinfo($term_icon_url['src']); |
|
214 | + $file_info = pathinfo($term_icon_url['src']); |
|
215 | 215 | |
216 | - if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
217 | - $sub_dir = $file_info['dirname']; |
|
218 | - else{$sub_dir = '';} |
|
216 | + if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
217 | + $sub_dir = $file_info['dirname']; |
|
218 | + else{$sub_dir = '';} |
|
219 | 219 | |
220 | - $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
221 | - $uploads_baseurl = $uploads['baseurl']; |
|
222 | - $uploads_path = $uploads['path']; |
|
220 | + $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
221 | + $uploads_baseurl = $uploads['baseurl']; |
|
222 | + $uploads_path = $uploads['path']; |
|
223 | 223 | |
224 | - $file_name = $file_info['basename']; |
|
224 | + $file_name = $file_info['basename']; |
|
225 | 225 | |
226 | - $sub_dir = str_replace($uploads_baseurl, '', $sub_dir); |
|
226 | + $sub_dir = str_replace($uploads_baseurl, '', $sub_dir); |
|
227 | 227 | |
228 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
228 | + $uploads_url = $uploads_baseurl . $sub_dir; |
|
229 | 229 | |
230 | - $term_icon_url['src'] = $uploads_url . '/' . $file_name; |
|
231 | - echo '<img src="' . $term_icon_url['src'] . '" />'; |
|
230 | + $term_icon_url['src'] = $uploads_url . '/' . $file_name; |
|
231 | + echo '<img src="' . $term_icon_url['src'] . '" />'; |
|
232 | 232 | |
233 | - } |
|
234 | - } |
|
233 | + } |
|
234 | + } |
|
235 | 235 | |
236 | - if ($column_name == 'cat_default_img') { |
|
237 | - $cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img'); |
|
238 | - if ($cat_default_img != '') |
|
239 | - echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>'; |
|
236 | + if ($column_name == 'cat_default_img') { |
|
237 | + $cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img'); |
|
238 | + if ($cat_default_img != '') |
|
239 | + echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>'; |
|
240 | 240 | |
241 | - } |
|
241 | + } |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | function geodir_get_default_catimage($term_id, $post_type = 'gd_place') |
245 | 245 | { |
246 | 246 | |
247 | - if ($cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type)) |
|
248 | - return $cat_default_img; |
|
249 | - else |
|
250 | - return false; |
|
247 | + if ($cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type)) |
|
248 | + return $cat_default_img; |
|
249 | + else |
|
250 | + return false; |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | //Clear custom fields |
254 | 254 | add_action('in_admin_footer', 'geodir_tax_meta_clear_custom_field'); |
255 | 255 | function geodir_tax_meta_clear_custom_field() |
256 | 256 | { |
257 | - if (isset($_REQUEST['taxonomy']) && !empty($_REQUEST['taxonomy'])): |
|
258 | - ?> |
|
257 | + if (isset($_REQUEST['taxonomy']) && !empty($_REQUEST['taxonomy'])): |
|
258 | + ?> |
|
259 | 259 | <script type="text/javascript"> |
260 | 260 | jQuery(document).ready(function () { |
261 | 261 | jQuery('#addtag #submit').click(function () { |
@@ -276,5 +276,5 @@ discard block |
||
276 | 276 | }); |
277 | 277 | </script> |
278 | 278 | <?php |
279 | - endif; |
|
279 | + endif; |
|
280 | 280 | } |
@@ -248,8 +248,9 @@ discard block |
||
248 | 248 | |
249 | 249 | $post_id = isset($comment_info->comment_post_ID) ? $comment_info->comment_post_ID : ''; |
250 | 250 | |
251 | - if (!empty($comment_info)) |
|
252 | - $status = $comment_info->comment_approved; |
|
251 | + if (!empty($comment_info)) { |
|
252 | + $status = $comment_info->comment_approved; |
|
253 | + } |
|
253 | 254 | |
254 | 255 | if ($status == 'approve' || $status == 1) { |
255 | 256 | $status = 1; |
@@ -381,12 +382,14 @@ discard block |
||
381 | 382 | function geodir_wrap_comment_text($content, $comment = '') |
382 | 383 | { |
383 | 384 | $rating = 0; |
384 | - if (!empty($comment)) |
|
385 | - $rating = geodir_get_commentoverall($comment->comment_ID); |
|
385 | + if (!empty($comment)) { |
|
386 | + $rating = geodir_get_commentoverall($comment->comment_ID); |
|
387 | + } |
|
386 | 388 | if ($rating != 0 && !is_admin()) { |
387 | 389 | return '<div><div class="gd-rating-text">' . __('Overall Rating', 'geodirectory') . ': <div class="rating">' . $rating . '</div></div>' . geodir_get_rating_stars($rating, $comment->comment_ID) . '</div><div class="description">' . $content . '</div>'; |
388 | - } else |
|
389 | - return $content; |
|
390 | + } else { |
|
391 | + return $content; |
|
392 | + } |
|
390 | 393 | |
391 | 394 | } |
392 | 395 | |
@@ -475,11 +478,12 @@ discard block |
||
475 | 478 | $post_ratings = get_post_meta($post_id, 'overall_rating'); |
476 | 479 | } |
477 | 480 | |
478 | - if ($post_ratings) |
|
479 | - return $post_ratings; |
|
480 | - else |
|
481 | - return false; |
|
482 | -} |
|
481 | + if ($post_ratings) { |
|
482 | + return $post_ratings; |
|
483 | + } else { |
|
484 | + return false; |
|
485 | + } |
|
486 | + } |
|
483 | 487 | |
484 | 488 | |
485 | 489 | /** |
@@ -504,11 +508,12 @@ discard block |
||
504 | 508 | ) |
505 | 509 | ); |
506 | 510 | |
507 | - if (!empty($reatings)) |
|
508 | - return $reatings; |
|
509 | - else |
|
510 | - return false; |
|
511 | -} |
|
511 | + if (!empty($reatings)) { |
|
512 | + return $reatings; |
|
513 | + } else { |
|
514 | + return false; |
|
515 | + } |
|
516 | + } |
|
512 | 517 | |
513 | 518 | /** |
514 | 519 | * Get review total of a Post. |
@@ -532,11 +537,12 @@ discard block |
||
532 | 537 | ) |
533 | 538 | ); |
534 | 539 | |
535 | - if (!empty($results)) |
|
536 | - return $results; |
|
537 | - else |
|
538 | - return false; |
|
539 | -} |
|
540 | + if (!empty($results)) { |
|
541 | + return $results; |
|
542 | + } else { |
|
543 | + return false; |
|
544 | + } |
|
545 | + } |
|
540 | 546 | |
541 | 547 | /** |
542 | 548 | * Get review count by user ID. |
@@ -559,11 +565,12 @@ discard block |
||
559 | 565 | ) |
560 | 566 | ); |
561 | 567 | |
562 | - if (!empty($results)) |
|
563 | - return $results; |
|
564 | - else |
|
565 | - return false; |
|
566 | -} |
|
568 | + if (!empty($results)) { |
|
569 | + return $results; |
|
570 | + } else { |
|
571 | + return false; |
|
572 | + } |
|
573 | + } |
|
567 | 574 | |
568 | 575 | /** |
569 | 576 | * Get average overall rating of a Post. |
@@ -597,11 +604,12 @@ discard block |
||
597 | 604 | ) |
598 | 605 | ); |
599 | 606 | |
600 | - if (!empty($results)) |
|
601 | - return $results; |
|
602 | - else |
|
603 | - return false; |
|
604 | -} |
|
607 | + if (!empty($results)) { |
|
608 | + return $results; |
|
609 | + } else { |
|
610 | + return false; |
|
611 | + } |
|
612 | + } |
|
605 | 613 | |
606 | 614 | /** |
607 | 615 | * Get review count of a Post. |
@@ -625,11 +633,12 @@ discard block |
||
625 | 633 | ) |
626 | 634 | ); |
627 | 635 | |
628 | - if (!empty($results)) |
|
629 | - return $results; |
|
630 | - else |
|
631 | - return false; |
|
632 | -} |
|
636 | + if (!empty($results)) { |
|
637 | + return $results; |
|
638 | + } else { |
|
639 | + return false; |
|
640 | + } |
|
641 | + } |
|
633 | 642 | |
634 | 643 | /** |
635 | 644 | * Get comments count of a Post. |
@@ -655,11 +664,12 @@ discard block |
||
655 | 664 | ); |
656 | 665 | |
657 | 666 | |
658 | - if (!empty($results)) |
|
659 | - return $results; |
|
660 | - else |
|
661 | - return false; |
|
662 | -} |
|
667 | + if (!empty($results)) { |
|
668 | + return $results; |
|
669 | + } else { |
|
670 | + return false; |
|
671 | + } |
|
672 | + } |
|
663 | 673 | |
664 | 674 | /** |
665 | 675 | * Get overall rating of a comment. |
@@ -683,11 +693,12 @@ discard block |
||
683 | 693 | ) |
684 | 694 | ); |
685 | 695 | |
686 | - if ($reatings) |
|
687 | - return $reatings; |
|
688 | - else |
|
689 | - return false; |
|
690 | -} |
|
696 | + if ($reatings) { |
|
697 | + return $reatings; |
|
698 | + } else { |
|
699 | + return false; |
|
700 | + } |
|
701 | + } |
|
691 | 702 | |
692 | 703 | /** |
693 | 704 | * Returns average overall rating of a Post. Depreciated since ver 1.3.6. |
@@ -930,8 +941,9 @@ discard block |
||
930 | 941 | $active_tabs = get_option('geodir_detail_page_tabs_excluded'); |
931 | 942 | |
932 | 943 | $is_display = true; |
933 | - if (!empty($active_tabs) && in_array('reviews', $active_tabs)) |
|
934 | - $is_display = false; |
|
944 | + if (!empty($active_tabs) && in_array('reviews', $active_tabs)) { |
|
945 | + $is_display = false; |
|
946 | + } |
|
935 | 947 | |
936 | 948 | /** |
937 | 949 | * Filter to change display value. |
@@ -31,14 +31,14 @@ discard block |
||
31 | 31 | */ |
32 | 32 | function geodir_comment_meta_row_action($a) |
33 | 33 | { |
34 | - global $comment; |
|
35 | - |
|
36 | - $rating = geodir_get_commentoverall($comment->comment_ID); |
|
37 | - if ($rating != 0) { |
|
38 | - //echo '<div class="gd_rating_show" data-average="'.$rating.'" data-id="'.$comment->comment_ID.'"></div>'; |
|
39 | - echo geodir_get_rating_stars($rating, $comment->comment_ID); |
|
40 | - } |
|
41 | - return $a; |
|
34 | + global $comment; |
|
35 | + |
|
36 | + $rating = geodir_get_commentoverall($comment->comment_ID); |
|
37 | + if ($rating != 0) { |
|
38 | + //echo '<div class="gd_rating_show" data-average="'.$rating.'" data-id="'.$comment->comment_ID.'"></div>'; |
|
39 | + echo geodir_get_rating_stars($rating, $comment->comment_ID); |
|
40 | + } |
|
41 | + return $a; |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | add_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box'); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | function geodir_comment_add_meta_box($comment) |
55 | 55 | { |
56 | - add_meta_box('gd-comment-rating', __('Comment Rating', 'geodirectory'), 'geodir_comment_rating_meta', 'comment', 'normal', 'high'); |
|
56 | + add_meta_box('gd-comment-rating', __('Comment Rating', 'geodirectory'), 'geodir_comment_rating_meta', 'comment', 'normal', 'high'); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | */ |
68 | 68 | function geodir_comment_rating_meta($comment) |
69 | 69 | { |
70 | - $post_type = get_post_type($comment->comment_post_ID); |
|
70 | + $post_type = get_post_type($comment->comment_post_ID); |
|
71 | 71 | if (in_array($post_type, (array)geodir_get_posttypes()) && (int)$comment->comment_parent == 0) { |
72 | 72 | $rating = geodir_get_commentoverall($comment->comment_ID); |
73 | 73 | |
@@ -107,12 +107,12 @@ discard block |
||
107 | 107 | */ |
108 | 108 | function geodir_comment_rating_fields() |
109 | 109 | { |
110 | - global $post; |
|
110 | + global $post; |
|
111 | 111 | |
112 | - $post_types = geodir_get_posttypes(); |
|
112 | + $post_types = geodir_get_posttypes(); |
|
113 | 113 | |
114 | - if (in_array($post->post_type, $post_types)) { |
|
115 | - $star_texts = array(); |
|
114 | + if (in_array($post->post_type, $post_types)) { |
|
115 | + $star_texts = array(); |
|
116 | 116 | $star_texts[] = __('Terrible', 'geodirectory'); |
117 | 117 | $star_texts[] = __('Poor', 'geodirectory'); |
118 | 118 | $star_texts[] = __('Average', 'geodirectory'); |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | $star_texts[] = __('Excellent', 'geodirectory'); |
121 | 121 | |
122 | 122 | $gd_rating_html = apply_filters('gd_rating_form_html', '<div class="gd_rating" data-average="0" data-id="5"></div>', $star_texts); |
123 | - echo $gd_rating_html; |
|
124 | - ?> |
|
123 | + echo $gd_rating_html; |
|
124 | + ?> |
|
125 | 125 | <input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="0"/><?php |
126 | - } |
|
126 | + } |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | |
@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | function geodir_comment_replaylink($link) |
140 | 140 | { |
141 | 141 | |
142 | - $link = '<div class="gd_comment_replaylink">' . $link . '</div>'; |
|
142 | + $link = '<div class="gd_comment_replaylink">' . $link . '</div>'; |
|
143 | 143 | |
144 | - return $link; |
|
144 | + return $link; |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | add_filter('cancel_comment_reply_link', 'geodir_cancle_replaylink'); |
@@ -156,9 +156,9 @@ discard block |
||
156 | 156 | function geodir_cancle_replaylink($link) |
157 | 157 | { |
158 | 158 | |
159 | - $link = '<span class="gd-cancel-replaylink">' . $link . '</span>'; |
|
159 | + $link = '<span class="gd-cancel-replaylink">' . $link . '</span>'; |
|
160 | 160 | |
161 | - return $link; |
|
161 | + return $link; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | add_action('comment_post', 'geodir_save_rating'); |
@@ -174,29 +174,29 @@ discard block |
||
174 | 174 | */ |
175 | 175 | function geodir_save_rating($comment = 0) |
176 | 176 | { |
177 | - global $wpdb, $user_ID, $plugin_prefix; |
|
177 | + global $wpdb, $user_ID, $plugin_prefix; |
|
178 | 178 | |
179 | - $comment_info = get_comment($comment); |
|
179 | + $comment_info = get_comment($comment); |
|
180 | 180 | |
181 | - $post_id = $comment_info->comment_post_ID; |
|
182 | - $status = $comment_info->comment_approved; |
|
183 | - $rating_ip = getenv("REMOTE_ADDR"); |
|
181 | + $post_id = $comment_info->comment_post_ID; |
|
182 | + $status = $comment_info->comment_approved; |
|
183 | + $rating_ip = getenv("REMOTE_ADDR"); |
|
184 | 184 | |
185 | - $post = geodir_get_post_info($post_id); |
|
185 | + $post = geodir_get_post_info($post_id); |
|
186 | 186 | |
187 | - if ($post->post_status == 'publish') { |
|
188 | - $post_status = '1'; |
|
189 | - } else { |
|
190 | - $post_status = '0'; |
|
191 | - } |
|
187 | + if ($post->post_status == 'publish') { |
|
188 | + $post_status = '1'; |
|
189 | + } else { |
|
190 | + $post_status = '0'; |
|
191 | + } |
|
192 | 192 | |
193 | - if (isset($_REQUEST['geodir_overallrating'])) { |
|
194 | - $overall_rating = $_REQUEST['geodir_overallrating']; |
|
193 | + if (isset($_REQUEST['geodir_overallrating'])) { |
|
194 | + $overall_rating = $_REQUEST['geodir_overallrating']; |
|
195 | 195 | |
196 | 196 | if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) { |
197 | - $overall_rating = $overall_rating > 0 ? $overall_rating : '0'; |
|
197 | + $overall_rating = $overall_rating > 0 ? $overall_rating : '0'; |
|
198 | 198 | |
199 | - $sqlqry = $wpdb->prepare("INSERT INTO " . GEODIR_REVIEW_TABLE . " SET |
|
199 | + $sqlqry = $wpdb->prepare("INSERT INTO " . GEODIR_REVIEW_TABLE . " SET |
|
200 | 200 | post_id = %d, |
201 | 201 | post_type = %s, |
202 | 202 | post_title = %s, |
@@ -214,35 +214,35 @@ discard block |
||
214 | 214 | post_latitude = %s, |
215 | 215 | comment_content = %s |
216 | 216 | ", |
217 | - array($post_id, $post->post_type, $post->post_title, $user_ID, $comment, $rating_ip, $overall_rating, $status, $post_status, date_i18n('Y-m-d H:i:s', current_time('timestamp')), $post->post_city, $post->post_region, $post->post_country, $post->post_latitude, $post->post_longitude, $comment_info->comment_content) |
|
218 | - ); |
|
219 | - |
|
220 | - $wpdb->query($sqlqry); |
|
221 | - |
|
222 | - /** |
|
223 | - * Called after saving the comment. |
|
224 | - * |
|
225 | - * @since 1.0.0 |
|
226 | - * @package GeoDirectory |
|
227 | - * @param array $_REQUEST { |
|
228 | - * Attributes of the $_REQUEST variable. |
|
229 | - * |
|
230 | - * @type string $geodir_overallrating Overall rating. |
|
231 | - * @type string $comment Comment text. |
|
232 | - * @type string $submit Submit button text. |
|
233 | - * @type string $comment_post_ID Comment post ID. |
|
234 | - * @type string $comment_parent Comment Parent ID. |
|
235 | - * @type string $_wp_unfiltered_html_comment Unfiltered html comment string. |
|
236 | - * |
|
237 | - * } |
|
238 | - */ |
|
239 | - do_action('geodir_after_save_comment', $_REQUEST, 'Comment Your Post'); |
|
240 | - |
|
241 | - if ($status) { |
|
242 | - geodir_update_postrating($post_id); |
|
243 | - } |
|
244 | - } |
|
245 | - } |
|
217 | + array($post_id, $post->post_type, $post->post_title, $user_ID, $comment, $rating_ip, $overall_rating, $status, $post_status, date_i18n('Y-m-d H:i:s', current_time('timestamp')), $post->post_city, $post->post_region, $post->post_country, $post->post_latitude, $post->post_longitude, $comment_info->comment_content) |
|
218 | + ); |
|
219 | + |
|
220 | + $wpdb->query($sqlqry); |
|
221 | + |
|
222 | + /** |
|
223 | + * Called after saving the comment. |
|
224 | + * |
|
225 | + * @since 1.0.0 |
|
226 | + * @package GeoDirectory |
|
227 | + * @param array $_REQUEST { |
|
228 | + * Attributes of the $_REQUEST variable. |
|
229 | + * |
|
230 | + * @type string $geodir_overallrating Overall rating. |
|
231 | + * @type string $comment Comment text. |
|
232 | + * @type string $submit Submit button text. |
|
233 | + * @type string $comment_post_ID Comment post ID. |
|
234 | + * @type string $comment_parent Comment Parent ID. |
|
235 | + * @type string $_wp_unfiltered_html_comment Unfiltered html comment string. |
|
236 | + * |
|
237 | + * } |
|
238 | + */ |
|
239 | + do_action('geodir_after_save_comment', $_REQUEST, 'Comment Your Post'); |
|
240 | + |
|
241 | + if ($status) { |
|
242 | + geodir_update_postrating($post_id); |
|
243 | + } |
|
244 | + } |
|
245 | + } |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | |
@@ -260,51 +260,51 @@ discard block |
||
260 | 260 | */ |
261 | 261 | function geodir_update_rating_status_change($comment_id, $status) |
262 | 262 | { |
263 | - if ($status == 'delete') { |
|
264 | - return; |
|
265 | - } |
|
266 | - global $wpdb, $plugin_prefix, $user_ID; |
|
263 | + if ($status == 'delete') { |
|
264 | + return; |
|
265 | + } |
|
266 | + global $wpdb, $plugin_prefix, $user_ID; |
|
267 | 267 | |
268 | - $comment_info = get_comment($comment_id); |
|
268 | + $comment_info = get_comment($comment_id); |
|
269 | 269 | |
270 | - $post_id = isset($comment_info->comment_post_ID) ? $comment_info->comment_post_ID : ''; |
|
270 | + $post_id = isset($comment_info->comment_post_ID) ? $comment_info->comment_post_ID : ''; |
|
271 | 271 | |
272 | - if (!empty($comment_info)) |
|
273 | - $status = $comment_info->comment_approved; |
|
272 | + if (!empty($comment_info)) |
|
273 | + $status = $comment_info->comment_approved; |
|
274 | 274 | |
275 | - if ($status == 'approve' || $status == 1) { |
|
276 | - $status = 1; |
|
277 | - } else { |
|
278 | - $status = 0; |
|
279 | - } |
|
275 | + if ($status == 'approve' || $status == 1) { |
|
276 | + $status = 1; |
|
277 | + } else { |
|
278 | + $status = 0; |
|
279 | + } |
|
280 | 280 | |
281 | - $comment_info_ID = isset($comment_info->comment_ID) ? $comment_info->comment_ID : ''; |
|
282 | - $old_rating = geodir_get_commentoverall($comment_info_ID); |
|
281 | + $comment_info_ID = isset($comment_info->comment_ID) ? $comment_info->comment_ID : ''; |
|
282 | + $old_rating = geodir_get_commentoverall($comment_info_ID); |
|
283 | 283 | |
284 | - $post_type = get_post_type($post_id); |
|
284 | + $post_type = get_post_type($post_id); |
|
285 | 285 | |
286 | - $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
286 | + $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
287 | 287 | |
288 | - if ($comment_id) { |
|
288 | + if ($comment_id) { |
|
289 | 289 | |
290 | - $overall_rating = $old_rating; |
|
290 | + $overall_rating = $old_rating; |
|
291 | 291 | |
292 | - if (isset($old_rating)) { |
|
292 | + if (isset($old_rating)) { |
|
293 | 293 | |
294 | - $sqlqry = $wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET |
|
294 | + $sqlqry = $wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET |
|
295 | 295 | overall_rating = %f, |
296 | 296 | status = %s, |
297 | 297 | comment_content = %s |
298 | 298 | WHERE comment_id = %d ", array($overall_rating, $status, $comment_info->comment_content, $comment_id)); |
299 | 299 | |
300 | - $wpdb->query($sqlqry); |
|
300 | + $wpdb->query($sqlqry); |
|
301 | 301 | |
302 | - //update rating |
|
303 | - geodir_update_postrating($post_id, $post_type); |
|
302 | + //update rating |
|
303 | + geodir_update_postrating($post_id, $post_type); |
|
304 | 304 | |
305 | - } |
|
305 | + } |
|
306 | 306 | |
307 | - } |
|
307 | + } |
|
308 | 308 | |
309 | 309 | } |
310 | 310 | |
@@ -323,41 +323,41 @@ discard block |
||
323 | 323 | function geodir_update_rating($comment_id = 0) |
324 | 324 | { |
325 | 325 | |
326 | - global $wpdb, $plugin_prefix, $user_ID; |
|
326 | + global $wpdb, $plugin_prefix, $user_ID; |
|
327 | 327 | |
328 | - $comment_info = get_comment($comment_id); |
|
328 | + $comment_info = get_comment($comment_id); |
|
329 | 329 | |
330 | - $post_id = $comment_info->comment_post_ID; |
|
331 | - $status = $comment_info->comment_approved; |
|
332 | - $old_rating = geodir_get_commentoverall($comment_info->comment_ID); |
|
330 | + $post_id = $comment_info->comment_post_ID; |
|
331 | + $status = $comment_info->comment_approved; |
|
332 | + $old_rating = geodir_get_commentoverall($comment_info->comment_ID); |
|
333 | 333 | |
334 | - $post_type = get_post_type($post_id); |
|
334 | + $post_type = get_post_type($post_id); |
|
335 | 335 | |
336 | - $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
336 | + $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
337 | 337 | |
338 | - if (isset($_REQUEST['geodir_overallrating'])) { |
|
338 | + if (isset($_REQUEST['geodir_overallrating'])) { |
|
339 | 339 | |
340 | - $overall_rating = $_REQUEST['geodir_overallrating']; |
|
340 | + $overall_rating = $_REQUEST['geodir_overallrating']; |
|
341 | 341 | |
342 | - if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) { |
|
343 | - $overall_rating = $overall_rating > 0 ? $overall_rating : '0'; |
|
342 | + if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) { |
|
343 | + $overall_rating = $overall_rating > 0 ? $overall_rating : '0'; |
|
344 | 344 | |
345 | - if (isset($old_rating)) { |
|
345 | + if (isset($old_rating)) { |
|
346 | 346 | |
347 | - $sqlqry = $wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET |
|
347 | + $sqlqry = $wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET |
|
348 | 348 | overall_rating = %f, |
349 | 349 | status = %s, |
350 | 350 | comment_content = %s |
351 | 351 | WHERE comment_id = %d ", array($overall_rating, $status, $comment_info->comment_content, $comment_id)); |
352 | 352 | |
353 | - $wpdb->query($sqlqry); |
|
353 | + $wpdb->query($sqlqry); |
|
354 | 354 | |
355 | - //update rating |
|
356 | - geodir_update_postrating($post_id, $post_type); |
|
355 | + //update rating |
|
356 | + geodir_update_postrating($post_id, $post_type); |
|
357 | 357 | |
358 | - } |
|
359 | - } |
|
360 | - } |
|
358 | + } |
|
359 | + } |
|
360 | + } |
|
361 | 361 | |
362 | 362 | |
363 | 363 | } |
@@ -373,19 +373,19 @@ discard block |
||
373 | 373 | */ |
374 | 374 | function geodir_comment_delete_comment($comment_id) |
375 | 375 | { |
376 | - global $wpdb; |
|
376 | + global $wpdb; |
|
377 | 377 | |
378 | - $review_info = geodir_get_review($comment_id); |
|
379 | - if ($review_info) { |
|
380 | - geodir_update_postrating($review_info->post_id); |
|
381 | - } |
|
378 | + $review_info = geodir_get_review($comment_id); |
|
379 | + if ($review_info) { |
|
380 | + geodir_update_postrating($review_info->post_id); |
|
381 | + } |
|
382 | 382 | |
383 | - $wpdb->query( |
|
384 | - $wpdb->prepare( |
|
385 | - "DELETE FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d", |
|
386 | - array($comment_id) |
|
387 | - ) |
|
388 | - ); |
|
383 | + $wpdb->query( |
|
384 | + $wpdb->prepare( |
|
385 | + "DELETE FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d", |
|
386 | + array($comment_id) |
|
387 | + ) |
|
388 | + ); |
|
389 | 389 | |
390 | 390 | } |
391 | 391 | |
@@ -401,13 +401,13 @@ discard block |
||
401 | 401 | */ |
402 | 402 | function geodir_wrap_comment_text($content, $comment = '') |
403 | 403 | { |
404 | - $rating = 0; |
|
405 | - if (!empty($comment)) |
|
406 | - $rating = geodir_get_commentoverall($comment->comment_ID); |
|
407 | - if ($rating != 0 && !is_admin()) { |
|
408 | - return '<div><div class="gd-rating-text">' . __('Overall Rating', 'geodirectory') . ': <div class="rating">' . $rating . '</div></div>' . geodir_get_rating_stars($rating, $comment->comment_ID) . '</div><div class="description">' . $content . '</div>'; |
|
409 | - } else |
|
410 | - return $content; |
|
404 | + $rating = 0; |
|
405 | + if (!empty($comment)) |
|
406 | + $rating = geodir_get_commentoverall($comment->comment_ID); |
|
407 | + if ($rating != 0 && !is_admin()) { |
|
408 | + return '<div><div class="gd-rating-text">' . __('Overall Rating', 'geodirectory') . ': <div class="rating">' . $rating . '</div></div>' . geodir_get_rating_stars($rating, $comment->comment_ID) . '</div><div class="description">' . $content . '</div>'; |
|
409 | + } else |
|
410 | + return $content; |
|
411 | 411 | |
412 | 412 | } |
413 | 413 | |
@@ -425,41 +425,41 @@ discard block |
||
425 | 425 | */ |
426 | 426 | function geodir_update_postrating($post_id = 0, $post_type = '', $delete = false) |
427 | 427 | { |
428 | - global $wpdb, $plugin_prefix, $comment; |
|
429 | - if (!$post_type) { |
|
430 | - $post_type = get_post_type($post_id); |
|
431 | - } |
|
432 | - $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
433 | - $post_newrating = geodir_get_post_rating($post_id, 1); |
|
434 | - $post_newrating_count = geodir_get_review_count_total($post_id); |
|
428 | + global $wpdb, $plugin_prefix, $comment; |
|
429 | + if (!$post_type) { |
|
430 | + $post_type = get_post_type($post_id); |
|
431 | + } |
|
432 | + $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
433 | + $post_newrating = geodir_get_post_rating($post_id, 1); |
|
434 | + $post_newrating_count = geodir_get_review_count_total($post_id); |
|
435 | 435 | |
436 | 436 | |
437 | - //$post_newrating = ( (float)$post_oldrating - (float)$old_rating ) + (float)$overall_rating ; |
|
437 | + //$post_newrating = ( (float)$post_oldrating - (float)$old_rating ) + (float)$overall_rating ; |
|
438 | 438 | |
439 | - if ($wpdb->get_var("SHOW TABLES LIKE '" . $detail_table . "'") == $detail_table) { |
|
439 | + if ($wpdb->get_var("SHOW TABLES LIKE '" . $detail_table . "'") == $detail_table) { |
|
440 | 440 | |
441 | - $wpdb->query( |
|
442 | - $wpdb->prepare( |
|
443 | - "UPDATE " . $detail_table . " SET |
|
441 | + $wpdb->query( |
|
442 | + $wpdb->prepare( |
|
443 | + "UPDATE " . $detail_table . " SET |
|
444 | 444 | overall_rating = %f, |
445 | 445 | rating_count = %f |
446 | 446 | where post_id = %d", |
447 | - array($post_newrating, $post_newrating_count, $post_id) |
|
448 | - ) |
|
449 | - ); |
|
450 | - |
|
451 | - update_post_meta($post_id, 'overall_rating', $post_newrating); |
|
452 | - update_post_meta($post_id, 'rating_count', $post_newrating_count); |
|
453 | - } |
|
454 | - /** |
|
455 | - * Called after Updating post overall rating and rating count. |
|
456 | - * |
|
457 | - * @since 1.0.0 |
|
458 | - * @since 1.4.3 Added `$post_id` param. |
|
459 | - * @package GeoDirectory |
|
460 | - * @param int $post_id The post ID. |
|
461 | - */ |
|
462 | - do_action('geodir_update_postrating',$post_id); |
|
447 | + array($post_newrating, $post_newrating_count, $post_id) |
|
448 | + ) |
|
449 | + ); |
|
450 | + |
|
451 | + update_post_meta($post_id, 'overall_rating', $post_newrating); |
|
452 | + update_post_meta($post_id, 'rating_count', $post_newrating_count); |
|
453 | + } |
|
454 | + /** |
|
455 | + * Called after Updating post overall rating and rating count. |
|
456 | + * |
|
457 | + * @since 1.0.0 |
|
458 | + * @since 1.4.3 Added `$post_id` param. |
|
459 | + * @package GeoDirectory |
|
460 | + * @param int $post_id The post ID. |
|
461 | + */ |
|
462 | + do_action('geodir_update_postrating',$post_id); |
|
463 | 463 | |
464 | 464 | } |
465 | 465 | |
@@ -477,29 +477,29 @@ discard block |
||
477 | 477 | */ |
478 | 478 | function geodir_get_postoverall($post_id = 0) |
479 | 479 | { |
480 | - global $wpdb, $plugin_prefix; |
|
480 | + global $wpdb, $plugin_prefix; |
|
481 | 481 | |
482 | - $post_type = get_post_type($post_id); |
|
483 | - $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
482 | + $post_type = get_post_type($post_id); |
|
483 | + $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
484 | 484 | |
485 | - if ($wpdb->get_var("SHOW TABLES LIKE '" . $detail_table . "'") == $detail_table) { |
|
485 | + if ($wpdb->get_var("SHOW TABLES LIKE '" . $detail_table . "'") == $detail_table) { |
|
486 | 486 | |
487 | - $post_ratings = $wpdb->get_var( |
|
488 | - $wpdb->prepare( |
|
489 | - "SELECT overall_rating FROM " . $detail_table . " WHERE post_id = %d", |
|
490 | - array($post_id) |
|
491 | - ) |
|
492 | - ); |
|
487 | + $post_ratings = $wpdb->get_var( |
|
488 | + $wpdb->prepare( |
|
489 | + "SELECT overall_rating FROM " . $detail_table . " WHERE post_id = %d", |
|
490 | + array($post_id) |
|
491 | + ) |
|
492 | + ); |
|
493 | 493 | |
494 | 494 | |
495 | - } else { |
|
496 | - $post_ratings = get_post_meta($post_id, 'overall_rating'); |
|
497 | - } |
|
495 | + } else { |
|
496 | + $post_ratings = get_post_meta($post_id, 'overall_rating'); |
|
497 | + } |
|
498 | 498 | |
499 | - if ($post_ratings) |
|
500 | - return $post_ratings; |
|
501 | - else |
|
502 | - return false; |
|
499 | + if ($post_ratings) |
|
500 | + return $post_ratings; |
|
501 | + else |
|
502 | + return false; |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | |
@@ -516,19 +516,19 @@ discard block |
||
516 | 516 | */ |
517 | 517 | function geodir_get_review($comment_id = 0) |
518 | 518 | { |
519 | - global $wpdb; |
|
520 | - |
|
521 | - $reatings = $wpdb->get_row( |
|
522 | - $wpdb->prepare( |
|
523 | - "SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id = %d", |
|
524 | - array($comment_id) |
|
525 | - ) |
|
526 | - ); |
|
527 | - |
|
528 | - if (!empty($reatings)) |
|
529 | - return $reatings; |
|
530 | - else |
|
531 | - return false; |
|
519 | + global $wpdb; |
|
520 | + |
|
521 | + $reatings = $wpdb->get_row( |
|
522 | + $wpdb->prepare( |
|
523 | + "SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id = %d", |
|
524 | + array($comment_id) |
|
525 | + ) |
|
526 | + ); |
|
527 | + |
|
528 | + if (!empty($reatings)) |
|
529 | + return $reatings; |
|
530 | + else |
|
531 | + return false; |
|
532 | 532 | } |
533 | 533 | |
534 | 534 | /** |
@@ -544,19 +544,19 @@ discard block |
||
544 | 544 | */ |
545 | 545 | function geodir_get_review_total($post_id = 0) |
546 | 546 | { |
547 | - global $wpdb; |
|
548 | - |
|
549 | - $results = $wpdb->get_var( |
|
550 | - $wpdb->prepare( |
|
551 | - "SELECT SUM(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
552 | - array($post_id) |
|
553 | - ) |
|
554 | - ); |
|
555 | - |
|
556 | - if (!empty($results)) |
|
557 | - return $results; |
|
558 | - else |
|
559 | - return false; |
|
547 | + global $wpdb; |
|
548 | + |
|
549 | + $results = $wpdb->get_var( |
|
550 | + $wpdb->prepare( |
|
551 | + "SELECT SUM(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
552 | + array($post_id) |
|
553 | + ) |
|
554 | + ); |
|
555 | + |
|
556 | + if (!empty($results)) |
|
557 | + return $results; |
|
558 | + else |
|
559 | + return false; |
|
560 | 560 | } |
561 | 561 | |
562 | 562 | /** |
@@ -572,18 +572,18 @@ discard block |
||
572 | 572 | */ |
573 | 573 | function geodir_get_review_count_by_user_id($user_id = 0) |
574 | 574 | { |
575 | - global $wpdb; |
|
576 | - $results = $wpdb->get_var( |
|
577 | - $wpdb->prepare( |
|
578 | - "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE user_id = %d AND status=1 AND overall_rating>0", |
|
579 | - array($user_id) |
|
580 | - ) |
|
581 | - ); |
|
582 | - |
|
583 | - if (!empty($results)) |
|
584 | - return $results; |
|
585 | - else |
|
586 | - return false; |
|
575 | + global $wpdb; |
|
576 | + $results = $wpdb->get_var( |
|
577 | + $wpdb->prepare( |
|
578 | + "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE user_id = %d AND status=1 AND overall_rating>0", |
|
579 | + array($user_id) |
|
580 | + ) |
|
581 | + ); |
|
582 | + |
|
583 | + if (!empty($results)) |
|
584 | + return $results; |
|
585 | + else |
|
586 | + return false; |
|
587 | 587 | } |
588 | 588 | |
589 | 589 | /** |
@@ -601,27 +601,27 @@ discard block |
||
601 | 601 | */ |
602 | 602 | function geodir_get_post_rating($post_id = 0, $force_query = 0) |
603 | 603 | { |
604 | - global $wpdb, $post; |
|
605 | - |
|
606 | - if (isset($post->ID) && $post->ID == $post_id && !$force_query) { |
|
607 | - if (isset($post->rating_count) && $post->rating_count > 0 && isset($post->overall_rating) && $post->overall_rating > 0) { |
|
608 | - return $post->overall_rating; |
|
609 | - } else { |
|
610 | - return 0; |
|
611 | - } |
|
612 | - } |
|
613 | - |
|
614 | - $results = $wpdb->get_var( |
|
615 | - $wpdb->prepare( |
|
616 | - "SELECT COALESCE(avg(overall_rating),0) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
617 | - array($post_id) |
|
618 | - ) |
|
619 | - ); |
|
620 | - |
|
621 | - if (!empty($results)) |
|
622 | - return $results; |
|
623 | - else |
|
624 | - return false; |
|
604 | + global $wpdb, $post; |
|
605 | + |
|
606 | + if (isset($post->ID) && $post->ID == $post_id && !$force_query) { |
|
607 | + if (isset($post->rating_count) && $post->rating_count > 0 && isset($post->overall_rating) && $post->overall_rating > 0) { |
|
608 | + return $post->overall_rating; |
|
609 | + } else { |
|
610 | + return 0; |
|
611 | + } |
|
612 | + } |
|
613 | + |
|
614 | + $results = $wpdb->get_var( |
|
615 | + $wpdb->prepare( |
|
616 | + "SELECT COALESCE(avg(overall_rating),0) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
617 | + array($post_id) |
|
618 | + ) |
|
619 | + ); |
|
620 | + |
|
621 | + if (!empty($results)) |
|
622 | + return $results; |
|
623 | + else |
|
624 | + return false; |
|
625 | 625 | } |
626 | 626 | |
627 | 627 | /** |
@@ -637,19 +637,19 @@ discard block |
||
637 | 637 | */ |
638 | 638 | function geodir_get_review_count_total($post_id = 0) |
639 | 639 | { |
640 | - global $wpdb; |
|
641 | - |
|
642 | - $results = $wpdb->get_var( |
|
643 | - $wpdb->prepare( |
|
644 | - "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
645 | - array($post_id) |
|
646 | - ) |
|
647 | - ); |
|
648 | - |
|
649 | - if (!empty($results)) |
|
650 | - return $results; |
|
651 | - else |
|
652 | - return false; |
|
640 | + global $wpdb; |
|
641 | + |
|
642 | + $results = $wpdb->get_var( |
|
643 | + $wpdb->prepare( |
|
644 | + "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
645 | + array($post_id) |
|
646 | + ) |
|
647 | + ); |
|
648 | + |
|
649 | + if (!empty($results)) |
|
650 | + return $results; |
|
651 | + else |
|
652 | + return false; |
|
653 | 653 | } |
654 | 654 | |
655 | 655 | /** |
@@ -666,20 +666,20 @@ discard block |
||
666 | 666 | */ |
667 | 667 | function geodir_get_comments_number($post_id = 0) |
668 | 668 | { |
669 | - global $wpdb; |
|
669 | + global $wpdb; |
|
670 | 670 | |
671 | - $results = $wpdb->get_var( |
|
672 | - $wpdb->prepare( |
|
673 | - "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
674 | - array($post_id) |
|
675 | - ) |
|
676 | - ); |
|
671 | + $results = $wpdb->get_var( |
|
672 | + $wpdb->prepare( |
|
673 | + "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
674 | + array($post_id) |
|
675 | + ) |
|
676 | + ); |
|
677 | 677 | |
678 | 678 | |
679 | - if (!empty($results)) |
|
680 | - return $results; |
|
681 | - else |
|
682 | - return false; |
|
679 | + if (!empty($results)) |
|
680 | + return $results; |
|
681 | + else |
|
682 | + return false; |
|
683 | 683 | } |
684 | 684 | |
685 | 685 | /** |
@@ -695,19 +695,19 @@ discard block |
||
695 | 695 | */ |
696 | 696 | function geodir_get_commentoverall($comment_id = 0) |
697 | 697 | { |
698 | - global $wpdb; |
|
699 | - |
|
700 | - $reatings = $wpdb->get_var( |
|
701 | - $wpdb->prepare( |
|
702 | - "SELECT overall_rating FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id = %d", |
|
703 | - array($comment_id) |
|
704 | - ) |
|
705 | - ); |
|
706 | - |
|
707 | - if ($reatings) |
|
708 | - return $reatings; |
|
709 | - else |
|
710 | - return false; |
|
698 | + global $wpdb; |
|
699 | + |
|
700 | + $reatings = $wpdb->get_var( |
|
701 | + $wpdb->prepare( |
|
702 | + "SELECT overall_rating FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id = %d", |
|
703 | + array($comment_id) |
|
704 | + ) |
|
705 | + ); |
|
706 | + |
|
707 | + if ($reatings) |
|
708 | + return $reatings; |
|
709 | + else |
|
710 | + return false; |
|
711 | 711 | } |
712 | 712 | |
713 | 713 | /** |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | */ |
722 | 722 | function geodir_get_commentoverall_number($post_id = 0) |
723 | 723 | { |
724 | - return geodir_get_post_rating($post_id); |
|
724 | + return geodir_get_post_rating($post_id); |
|
725 | 725 | } |
726 | 726 | |
727 | 727 | |
@@ -739,98 +739,98 @@ discard block |
||
739 | 739 | */ |
740 | 740 | function geodir_comment_template($comment_template) |
741 | 741 | { |
742 | - global $post; |
|
743 | - |
|
744 | - $post_types = geodir_get_posttypes(); |
|
745 | - |
|
746 | - if (!(is_singular() && (have_comments() || (isset($post->comment_status) && 'open' == $post->comment_status)))) { |
|
747 | - return; |
|
748 | - } |
|
749 | - if (in_array($post->post_type, $post_types)) { // assuming there is a post type called business |
|
750 | - $template = locate_template(array("geodirectory/reviews.php")); // Use theme template if available |
|
751 | - if (!$template) { |
|
752 | - $template = dirname(__FILE__) . '/reviews.php'; |
|
753 | - } |
|
754 | - return $template; |
|
755 | - } |
|
742 | + global $post; |
|
743 | + |
|
744 | + $post_types = geodir_get_posttypes(); |
|
745 | + |
|
746 | + if (!(is_singular() && (have_comments() || (isset($post->comment_status) && 'open' == $post->comment_status)))) { |
|
747 | + return; |
|
748 | + } |
|
749 | + if (in_array($post->post_type, $post_types)) { // assuming there is a post type called business |
|
750 | + $template = locate_template(array("geodirectory/reviews.php")); // Use theme template if available |
|
751 | + if (!$template) { |
|
752 | + $template = dirname(__FILE__) . '/reviews.php'; |
|
753 | + } |
|
754 | + return $template; |
|
755 | + } |
|
756 | 756 | } |
757 | 757 | |
758 | 758 | add_filter("comments_template", "geodir_comment_template"); |
759 | 759 | |
760 | 760 | |
761 | 761 | if (!function_exists('geodir_comment')) { |
762 | - /** |
|
763 | - * Comment HTML markup. |
|
764 | - * |
|
765 | - * @since 1.0.0 |
|
766 | - * @package GeoDirectory |
|
767 | - * @global object $post The current post object. |
|
768 | - * @param object $comment The comment object. |
|
769 | - * @param string|array $args { |
|
770 | - * Optional. Formatting options. |
|
771 | - * |
|
772 | - * @type object $walker Instance of a Walker class to list comments. Default null. |
|
773 | - * @type int $max_depth The maximum comments depth. Default empty. |
|
774 | - * @type string $style The style of list ordering. Default 'ul'. Accepts 'ul', 'ol'. |
|
775 | - * @type string $callback Callback function to use. Default null. |
|
776 | - * @type string $end-callback Callback function to use at the end. Default null. |
|
777 | - * @type string $type Type of comments to list. |
|
778 | - * Default 'all'. Accepts 'all', 'comment', 'pingback', 'trackback', 'pings'. |
|
779 | - * @type int $page Page ID to list comments for. Default empty. |
|
780 | - * @type int $per_page Number of comments to list per page. Default empty. |
|
781 | - * @type int $avatar_size Height and width dimensions of the avatar size. Default 32. |
|
782 | - * @type string $reverse_top_level Ordering of the listed comments. Default null. Accepts 'desc', 'asc'. |
|
783 | - * @type bool $reverse_children Whether to reverse child comments in the list. Default null. |
|
784 | - * @type string $format How to format the comments list. |
|
785 | - * Default 'html5' if the theme supports it. Accepts 'html5', 'xhtml'. |
|
786 | - * @type bool $short_ping Whether to output short pings. Default false. |
|
787 | - * @type bool $echo Whether to echo the output or return it. Default true. |
|
788 | - * } |
|
789 | - * @param int $depth Depth of comment. |
|
790 | - */ |
|
791 | - function geodir_comment($comment, $args, $depth) |
|
792 | - { |
|
793 | - $GLOBALS['comment'] = $comment; |
|
794 | - switch ($comment->comment_type) : |
|
795 | - case 'pingback' : |
|
796 | - case 'trackback' : |
|
797 | - // Display trackbacks differently than normal comments. |
|
798 | - ?> |
|
762 | + /** |
|
763 | + * Comment HTML markup. |
|
764 | + * |
|
765 | + * @since 1.0.0 |
|
766 | + * @package GeoDirectory |
|
767 | + * @global object $post The current post object. |
|
768 | + * @param object $comment The comment object. |
|
769 | + * @param string|array $args { |
|
770 | + * Optional. Formatting options. |
|
771 | + * |
|
772 | + * @type object $walker Instance of a Walker class to list comments. Default null. |
|
773 | + * @type int $max_depth The maximum comments depth. Default empty. |
|
774 | + * @type string $style The style of list ordering. Default 'ul'. Accepts 'ul', 'ol'. |
|
775 | + * @type string $callback Callback function to use. Default null. |
|
776 | + * @type string $end-callback Callback function to use at the end. Default null. |
|
777 | + * @type string $type Type of comments to list. |
|
778 | + * Default 'all'. Accepts 'all', 'comment', 'pingback', 'trackback', 'pings'. |
|
779 | + * @type int $page Page ID to list comments for. Default empty. |
|
780 | + * @type int $per_page Number of comments to list per page. Default empty. |
|
781 | + * @type int $avatar_size Height and width dimensions of the avatar size. Default 32. |
|
782 | + * @type string $reverse_top_level Ordering of the listed comments. Default null. Accepts 'desc', 'asc'. |
|
783 | + * @type bool $reverse_children Whether to reverse child comments in the list. Default null. |
|
784 | + * @type string $format How to format the comments list. |
|
785 | + * Default 'html5' if the theme supports it. Accepts 'html5', 'xhtml'. |
|
786 | + * @type bool $short_ping Whether to output short pings. Default false. |
|
787 | + * @type bool $echo Whether to echo the output or return it. Default true. |
|
788 | + * } |
|
789 | + * @param int $depth Depth of comment. |
|
790 | + */ |
|
791 | + function geodir_comment($comment, $args, $depth) |
|
792 | + { |
|
793 | + $GLOBALS['comment'] = $comment; |
|
794 | + switch ($comment->comment_type) : |
|
795 | + case 'pingback' : |
|
796 | + case 'trackback' : |
|
797 | + // Display trackbacks differently than normal comments. |
|
798 | + ?> |
|
799 | 799 | <li <?php comment_class('geodir-comment'); ?> id="comment-<?php comment_ID(); ?>"> |
800 | 800 | <p><?php _e('Pingback:', 'geodirectory'); ?> <?php comment_author_link(); ?> <?php edit_comment_link(__('(Edit)', 'geodirectory'), '<span class="edit-link">', '</span>'); ?></p> |
801 | 801 | <?php |
802 | - break; |
|
803 | - default : |
|
804 | - // Proceed with normal comments. |
|
805 | - global $post; |
|
806 | - ?> |
|
802 | + break; |
|
803 | + default : |
|
804 | + // Proceed with normal comments. |
|
805 | + global $post; |
|
806 | + ?> |
|
807 | 807 | <li <?php comment_class('geodir-comment'); ?> id="li-comment-<?php comment_ID(); ?>"> |
808 | 808 | <article id="comment-<?php comment_ID(); ?>" class="comment hreview"> |
809 | 809 | <header class="comment-meta comment-author vcard"> |
810 | 810 | <?php |
811 | - /** |
|
812 | - * Filter to modify comment avatar size |
|
813 | - * |
|
814 | - * You can use this filter to change comment avatar size. |
|
815 | - * |
|
816 | - * @since 1.0.0 |
|
817 | - * @package GeoDirectory |
|
818 | - */ |
|
819 | - $avatar_size = apply_filters('geodir_comment_avatar_size', 44); |
|
820 | - echo get_avatar($comment, $avatar_size); |
|
821 | - printf('<cite><b class="reviewer">%1$s</b> %2$s</cite>', |
|
822 | - get_comment_author_link(), |
|
823 | - // If current post author is also comment author, make it known visually. |
|
824 | - ($comment->user_id === $post->post_author) ? '<span>' . __('Post author', 'geodirectory') . '</span>' : '' |
|
825 | - ); |
|
826 | - echo "<span class='item'><small><span class='fn'>$post->post_title</span></small></span>"; |
|
827 | - printf('<a href="%1$s"><time datetime="%2$s" class="dtreviewed">%3$s<span class="value-title" title="%2$s"></span></time></a>', |
|
828 | - esc_url(get_comment_link($comment->comment_ID)), |
|
829 | - get_comment_time('c'), |
|
830 | - /* translators: 1: date, 2: time */ |
|
831 | - sprintf(__('%1$s at %2$s', 'geodirectory'), get_comment_date(), get_comment_time()) |
|
832 | - ); |
|
833 | - ?> |
|
811 | + /** |
|
812 | + * Filter to modify comment avatar size |
|
813 | + * |
|
814 | + * You can use this filter to change comment avatar size. |
|
815 | + * |
|
816 | + * @since 1.0.0 |
|
817 | + * @package GeoDirectory |
|
818 | + */ |
|
819 | + $avatar_size = apply_filters('geodir_comment_avatar_size', 44); |
|
820 | + echo get_avatar($comment, $avatar_size); |
|
821 | + printf('<cite><b class="reviewer">%1$s</b> %2$s</cite>', |
|
822 | + get_comment_author_link(), |
|
823 | + // If current post author is also comment author, make it known visually. |
|
824 | + ($comment->user_id === $post->post_author) ? '<span>' . __('Post author', 'geodirectory') . '</span>' : '' |
|
825 | + ); |
|
826 | + echo "<span class='item'><small><span class='fn'>$post->post_title</span></small></span>"; |
|
827 | + printf('<a href="%1$s"><time datetime="%2$s" class="dtreviewed">%3$s<span class="value-title" title="%2$s"></span></time></a>', |
|
828 | + esc_url(get_comment_link($comment->comment_ID)), |
|
829 | + get_comment_time('c'), |
|
830 | + /* translators: 1: date, 2: time */ |
|
831 | + sprintf(__('%1$s at %2$s', 'geodirectory'), get_comment_date(), get_comment_time()) |
|
832 | + ); |
|
833 | + ?> |
|
834 | 834 | </header> |
835 | 835 | <!-- .comment-meta --> |
836 | 836 | |
@@ -854,47 +854,47 @@ discard block |
||
854 | 854 | </article> |
855 | 855 | <!-- #comment-## --> |
856 | 856 | <?php |
857 | - break; |
|
858 | - endswitch; // end comment_type check |
|
859 | - } |
|
857 | + break; |
|
858 | + endswitch; // end comment_type check |
|
859 | + } |
|
860 | 860 | } |
861 | 861 | |
862 | 862 | |
863 | 863 | add_filter('get_comments_number', 'geodir_fix_comment_count', 10, 2); |
864 | 864 | if (!function_exists('geodir_fix_comment_count')) { |
865 | - /** |
|
866 | - * Fix comment count by not listing replies as reviews |
|
867 | - * |
|
868 | - * @since 1.0.0 |
|
869 | - * @package GeoDirectory |
|
870 | - * @global object $post The current post object. |
|
871 | - * @param int $count The comment count. |
|
872 | - * @param int $post_id The post ID. |
|
873 | - * @todo $post is unreachable since the function return the count before that variable. |
|
874 | - * @return bool|null|string The comment count. |
|
875 | - */ |
|
876 | - function geodir_fix_comment_count($count, $post_id) |
|
877 | - { |
|
878 | - if (!is_admin() || strpos($_SERVER['REQUEST_URI'], 'admin-ajax.php')) { |
|
879 | - global $post; |
|
880 | - $post_types = geodir_get_posttypes(); |
|
881 | - |
|
882 | - if (in_array(get_post_type($post_id), $post_types)) { |
|
883 | - $review_count = geodir_get_review_count_total($post_id); |
|
884 | - return $review_count; |
|
885 | - |
|
886 | - if ($post && isset($post->rating_count)) { |
|
887 | - return $post->rating_count; |
|
888 | - } else { |
|
889 | - return geodir_get_comments_number($post_id); |
|
890 | - } |
|
891 | - } else { |
|
892 | - return $count; |
|
893 | - } |
|
894 | - } else { |
|
895 | - return $count; |
|
896 | - } |
|
897 | - } |
|
865 | + /** |
|
866 | + * Fix comment count by not listing replies as reviews |
|
867 | + * |
|
868 | + * @since 1.0.0 |
|
869 | + * @package GeoDirectory |
|
870 | + * @global object $post The current post object. |
|
871 | + * @param int $count The comment count. |
|
872 | + * @param int $post_id The post ID. |
|
873 | + * @todo $post is unreachable since the function return the count before that variable. |
|
874 | + * @return bool|null|string The comment count. |
|
875 | + */ |
|
876 | + function geodir_fix_comment_count($count, $post_id) |
|
877 | + { |
|
878 | + if (!is_admin() || strpos($_SERVER['REQUEST_URI'], 'admin-ajax.php')) { |
|
879 | + global $post; |
|
880 | + $post_types = geodir_get_posttypes(); |
|
881 | + |
|
882 | + if (in_array(get_post_type($post_id), $post_types)) { |
|
883 | + $review_count = geodir_get_review_count_total($post_id); |
|
884 | + return $review_count; |
|
885 | + |
|
886 | + if ($post && isset($post->rating_count)) { |
|
887 | + return $post->rating_count; |
|
888 | + } else { |
|
889 | + return geodir_get_comments_number($post_id); |
|
890 | + } |
|
891 | + } else { |
|
892 | + return $count; |
|
893 | + } |
|
894 | + } else { |
|
895 | + return $count; |
|
896 | + } |
|
897 | + } |
|
898 | 898 | } |
899 | 899 | |
900 | 900 | /** |
@@ -911,11 +911,11 @@ discard block |
||
911 | 911 | */ |
912 | 912 | function geodir_get_rating_stars($rating, $post_id, $small = false) |
913 | 913 | { |
914 | - $a_rating = $rating / 5 * 100; |
|
914 | + $a_rating = $rating / 5 * 100; |
|
915 | 915 | |
916 | - if ($small) { |
|
917 | - $r_html = '<div class="rating"><div class="gd_rating_map" data-average="' . $rating . '" data-id="' . $post_id . '"><div class="geodir_RatingColor" ></div><div class="geodir_RatingAverage_small" style="width: ' . $a_rating . '%;"></div><div class="geodir_Star_small"></div></div></div>'; |
|
918 | - } else { |
|
916 | + if ($small) { |
|
917 | + $r_html = '<div class="rating"><div class="gd_rating_map" data-average="' . $rating . '" data-id="' . $post_id . '"><div class="geodir_RatingColor" ></div><div class="geodir_RatingAverage_small" style="width: ' . $a_rating . '%;"></div><div class="geodir_Star_small"></div></div></div>'; |
|
918 | + } else { |
|
919 | 919 | if (function_exists('geodir_reviewrating_draw_overall_rating')) { |
920 | 920 | // Show rating stars from review rating manager |
921 | 921 | $r_html = geodir_reviewrating_draw_overall_rating($rating); |
@@ -933,8 +933,8 @@ discard block |
||
933 | 933 | } |
934 | 934 | $r_html = '<div class="geodir-rating" style="' . $attach_style . '"><div class="gd_rating_show" data-average="' . $rating . '" data-id="' . $post_id . '"><div class="geodir_RatingAverage" style="width: ' . $a_rating . '%;"></div><div class="geodir_Star">' . $rating_img . $rating_img . $rating_img . $rating_img . $rating_img . '</div></div></div>'; |
935 | 935 | } |
936 | - } |
|
937 | - return apply_filters('geodir_get_rating_stars_html', $r_html, $rating, 5); |
|
936 | + } |
|
937 | + return apply_filters('geodir_get_rating_stars_html', $r_html, $rating, 5); |
|
938 | 938 | } |
939 | 939 | |
940 | 940 | /** |
@@ -948,23 +948,23 @@ discard block |
||
948 | 948 | function geodir_is_reviews_show($pageview = '') |
949 | 949 | { |
950 | 950 | |
951 | - $active_tabs = get_option('geodir_detail_page_tabs_excluded'); |
|
952 | - |
|
953 | - $is_display = true; |
|
954 | - if (!empty($active_tabs) && in_array('reviews', $active_tabs)) |
|
955 | - $is_display = false; |
|
956 | - |
|
957 | - /** |
|
958 | - * Filter to change display value. |
|
959 | - * |
|
960 | - * You can use this filter to change the is_display value. |
|
961 | - * |
|
962 | - * @since 1.0.0 |
|
963 | - * @package GeoDirectory |
|
964 | - * @param bool $is_display Display ratings when set to true. |
|
965 | - * @param string $pageview The view template. Ex: listview, gridview etc. |
|
966 | - */ |
|
967 | - return apply_filters('geodir_is_reviews_show', $is_display, $pageview); |
|
951 | + $active_tabs = get_option('geodir_detail_page_tabs_excluded'); |
|
952 | + |
|
953 | + $is_display = true; |
|
954 | + if (!empty($active_tabs) && in_array('reviews', $active_tabs)) |
|
955 | + $is_display = false; |
|
956 | + |
|
957 | + /** |
|
958 | + * Filter to change display value. |
|
959 | + * |
|
960 | + * You can use this filter to change the is_display value. |
|
961 | + * |
|
962 | + * @since 1.0.0 |
|
963 | + * @package GeoDirectory |
|
964 | + * @param bool $is_display Display ratings when set to true. |
|
965 | + * @param string $pageview The view template. Ex: listview, gridview etc. |
|
966 | + */ |
|
967 | + return apply_filters('geodir_is_reviews_show', $is_display, $pageview); |
|
968 | 968 | } |
969 | 969 | |
970 | 970 | |
@@ -972,9 +972,9 @@ discard block |
||
972 | 972 | * If Disqus plugin is active, do some fixes to show on blogs but no on GD post types |
973 | 973 | */ |
974 | 974 | if(function_exists('dsq_can_replace')) { |
975 | - remove_filter('comments_template', 'dsq_comments_template'); |
|
976 | - add_filter('comments_template', 'dsq_comments_template', 100); |
|
977 | - add_filter('pre_option_disqus_active', 'geodir_option_disqus_active',10,1); |
|
975 | + remove_filter('comments_template', 'dsq_comments_template'); |
|
976 | + add_filter('comments_template', 'dsq_comments_template', 100); |
|
977 | + add_filter('pre_option_disqus_active', 'geodir_option_disqus_active',10,1); |
|
978 | 978 | } |
979 | 979 | |
980 | 980 | |
@@ -988,13 +988,13 @@ discard block |
||
988 | 988 | * @return string `1` if active `0` if disabled. |
989 | 989 | */ |
990 | 990 | function geodir_option_disqus_active($disqus_active){ |
991 | - global $post; |
|
992 | - $all_postypes = geodir_get_posttypes(); |
|
991 | + global $post; |
|
992 | + $all_postypes = geodir_get_posttypes(); |
|
993 | 993 | |
994 | - if(isset($post->post_type) && is_array($all_postypes) && in_array($post->post_type,$all_postypes)){ |
|
995 | - $disqus_active = '0'; |
|
996 | - } |
|
994 | + if(isset($post->post_type) && is_array($all_postypes) && in_array($post->post_type,$all_postypes)){ |
|
995 | + $disqus_active = '0'; |
|
996 | + } |
|
997 | 997 | |
998 | - return $disqus_active; |
|
998 | + return $disqus_active; |
|
999 | 999 | } |
1000 | 1000 |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | function geodir_comment_rating_meta($comment) |
69 | 69 | { |
70 | 70 | $post_type = get_post_type($comment->comment_post_ID); |
71 | - if (in_array($post_type, (array)geodir_get_posttypes()) && (int)$comment->comment_parent == 0) { |
|
71 | + if (in_array($post_type, (array) geodir_get_posttypes()) && (int) $comment->comment_parent == 0) { |
|
72 | 72 | $rating = geodir_get_commentoverall($comment->comment_ID); |
73 | 73 | |
74 | - if ((int)get_option('geodir_reviewrating_enable_font_awesome') == 1) { |
|
74 | + if ((int) get_option('geodir_reviewrating_enable_font_awesome') == 1) { |
|
75 | 75 | $star_texts = array(); |
76 | 76 | $star_texts[] = __('Terrible', 'geodirectory'); |
77 | 77 | $star_texts[] = __('Poor', 'geodirectory'); |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | echo geodir_font_awesome_rating_form_html('', $star_texts, $rating); |
83 | 83 | } else { |
84 | 84 | if ($rating) { |
85 | - echo '<div class="gd_rating" data-average="' . $rating . '" data-id="5">'; |
|
85 | + echo '<div class="gd_rating" data-average="'.$rating.'" data-id="5">'; |
|
86 | 86 | |
87 | 87 | } else { |
88 | 88 | echo '<div class="gd_rating" data-average="0" data-id="5"></div>'; |
89 | 89 | } |
90 | 90 | } |
91 | - echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="' . $rating . '" />'; |
|
91 | + echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="'.$rating.'" />'; |
|
92 | 92 | } |
93 | 93 | } |
94 | 94 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | function geodir_comment_replaylink($link) |
140 | 140 | { |
141 | 141 | |
142 | - $link = '<div class="gd_comment_replaylink">' . $link . '</div>'; |
|
142 | + $link = '<div class="gd_comment_replaylink">'.$link.'</div>'; |
|
143 | 143 | |
144 | 144 | return $link; |
145 | 145 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | function geodir_cancle_replaylink($link) |
157 | 157 | { |
158 | 158 | |
159 | - $link = '<span class="gd-cancel-replaylink">' . $link . '</span>'; |
|
159 | + $link = '<span class="gd-cancel-replaylink">'.$link.'</span>'; |
|
160 | 160 | |
161 | 161 | return $link; |
162 | 162 | } |
@@ -193,10 +193,10 @@ discard block |
||
193 | 193 | if (isset($_REQUEST['geodir_overallrating'])) { |
194 | 194 | $overall_rating = $_REQUEST['geodir_overallrating']; |
195 | 195 | |
196 | - if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) { |
|
196 | + if (isset($comment_info->comment_parent) && (int) $comment_info->comment_parent == 0) { |
|
197 | 197 | $overall_rating = $overall_rating > 0 ? $overall_rating : '0'; |
198 | 198 | |
199 | - $sqlqry = $wpdb->prepare("INSERT INTO " . GEODIR_REVIEW_TABLE . " SET |
|
199 | + $sqlqry = $wpdb->prepare("INSERT INTO ".GEODIR_REVIEW_TABLE." SET |
|
200 | 200 | post_id = %d, |
201 | 201 | post_type = %s, |
202 | 202 | post_title = %s, |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | |
284 | 284 | $post_type = get_post_type($post_id); |
285 | 285 | |
286 | - $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
286 | + $detail_table = $plugin_prefix.$post_type.'_detail'; |
|
287 | 287 | |
288 | 288 | if ($comment_id) { |
289 | 289 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | |
292 | 292 | if (isset($old_rating)) { |
293 | 293 | |
294 | - $sqlqry = $wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET |
|
294 | + $sqlqry = $wpdb->prepare("UPDATE ".GEODIR_REVIEW_TABLE." SET |
|
295 | 295 | overall_rating = %f, |
296 | 296 | status = %s, |
297 | 297 | comment_content = %s |
@@ -333,18 +333,18 @@ discard block |
||
333 | 333 | |
334 | 334 | $post_type = get_post_type($post_id); |
335 | 335 | |
336 | - $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
336 | + $detail_table = $plugin_prefix.$post_type.'_detail'; |
|
337 | 337 | |
338 | 338 | if (isset($_REQUEST['geodir_overallrating'])) { |
339 | 339 | |
340 | 340 | $overall_rating = $_REQUEST['geodir_overallrating']; |
341 | 341 | |
342 | - if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) { |
|
342 | + if (isset($comment_info->comment_parent) && (int) $comment_info->comment_parent == 0) { |
|
343 | 343 | $overall_rating = $overall_rating > 0 ? $overall_rating : '0'; |
344 | 344 | |
345 | 345 | if (isset($old_rating)) { |
346 | 346 | |
347 | - $sqlqry = $wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET |
|
347 | + $sqlqry = $wpdb->prepare("UPDATE ".GEODIR_REVIEW_TABLE." SET |
|
348 | 348 | overall_rating = %f, |
349 | 349 | status = %s, |
350 | 350 | comment_content = %s |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | |
383 | 383 | $wpdb->query( |
384 | 384 | $wpdb->prepare( |
385 | - "DELETE FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d", |
|
385 | + "DELETE FROM ".GEODIR_REVIEW_TABLE." WHERE comment_id=%d", |
|
386 | 386 | array($comment_id) |
387 | 387 | ) |
388 | 388 | ); |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | if (!empty($comment)) |
406 | 406 | $rating = geodir_get_commentoverall($comment->comment_ID); |
407 | 407 | if ($rating != 0 && !is_admin()) { |
408 | - return '<div><div class="gd-rating-text">' . __('Overall Rating', 'geodirectory') . ': <div class="rating">' . $rating . '</div></div>' . geodir_get_rating_stars($rating, $comment->comment_ID) . '</div><div class="description">' . $content . '</div>'; |
|
408 | + return '<div><div class="gd-rating-text">'.__('Overall Rating', 'geodirectory').': <div class="rating">'.$rating.'</div></div>'.geodir_get_rating_stars($rating, $comment->comment_ID).'</div><div class="description">'.$content.'</div>'; |
|
409 | 409 | } else |
410 | 410 | return $content; |
411 | 411 | |
@@ -429,18 +429,18 @@ discard block |
||
429 | 429 | if (!$post_type) { |
430 | 430 | $post_type = get_post_type($post_id); |
431 | 431 | } |
432 | - $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
432 | + $detail_table = $plugin_prefix.$post_type.'_detail'; |
|
433 | 433 | $post_newrating = geodir_get_post_rating($post_id, 1); |
434 | 434 | $post_newrating_count = geodir_get_review_count_total($post_id); |
435 | 435 | |
436 | 436 | |
437 | 437 | //$post_newrating = ( (float)$post_oldrating - (float)$old_rating ) + (float)$overall_rating ; |
438 | 438 | |
439 | - if ($wpdb->get_var("SHOW TABLES LIKE '" . $detail_table . "'") == $detail_table) { |
|
439 | + if ($wpdb->get_var("SHOW TABLES LIKE '".$detail_table."'") == $detail_table) { |
|
440 | 440 | |
441 | 441 | $wpdb->query( |
442 | 442 | $wpdb->prepare( |
443 | - "UPDATE " . $detail_table . " SET |
|
443 | + "UPDATE ".$detail_table." SET |
|
444 | 444 | overall_rating = %f, |
445 | 445 | rating_count = %f |
446 | 446 | where post_id = %d", |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | * @package GeoDirectory |
460 | 460 | * @param int $post_id The post ID. |
461 | 461 | */ |
462 | - do_action('geodir_update_postrating',$post_id); |
|
462 | + do_action('geodir_update_postrating', $post_id); |
|
463 | 463 | |
464 | 464 | } |
465 | 465 | |
@@ -480,13 +480,13 @@ discard block |
||
480 | 480 | global $wpdb, $plugin_prefix; |
481 | 481 | |
482 | 482 | $post_type = get_post_type($post_id); |
483 | - $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
483 | + $detail_table = $plugin_prefix.$post_type.'_detail'; |
|
484 | 484 | |
485 | - if ($wpdb->get_var("SHOW TABLES LIKE '" . $detail_table . "'") == $detail_table) { |
|
485 | + if ($wpdb->get_var("SHOW TABLES LIKE '".$detail_table."'") == $detail_table) { |
|
486 | 486 | |
487 | 487 | $post_ratings = $wpdb->get_var( |
488 | 488 | $wpdb->prepare( |
489 | - "SELECT overall_rating FROM " . $detail_table . " WHERE post_id = %d", |
|
489 | + "SELECT overall_rating FROM ".$detail_table." WHERE post_id = %d", |
|
490 | 490 | array($post_id) |
491 | 491 | ) |
492 | 492 | ); |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | |
521 | 521 | $reatings = $wpdb->get_row( |
522 | 522 | $wpdb->prepare( |
523 | - "SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id = %d", |
|
523 | + "SELECT * FROM ".GEODIR_REVIEW_TABLE." WHERE comment_id = %d", |
|
524 | 524 | array($comment_id) |
525 | 525 | ) |
526 | 526 | ); |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | |
549 | 549 | $results = $wpdb->get_var( |
550 | 550 | $wpdb->prepare( |
551 | - "SELECT SUM(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
551 | + "SELECT SUM(overall_rating) FROM ".GEODIR_REVIEW_TABLE." WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
552 | 552 | array($post_id) |
553 | 553 | ) |
554 | 554 | ); |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | global $wpdb; |
576 | 576 | $results = $wpdb->get_var( |
577 | 577 | $wpdb->prepare( |
578 | - "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE user_id = %d AND status=1 AND overall_rating>0", |
|
578 | + "SELECT COUNT(overall_rating) FROM ".GEODIR_REVIEW_TABLE." WHERE user_id = %d AND status=1 AND overall_rating>0", |
|
579 | 579 | array($user_id) |
580 | 580 | ) |
581 | 581 | ); |
@@ -613,7 +613,7 @@ discard block |
||
613 | 613 | |
614 | 614 | $results = $wpdb->get_var( |
615 | 615 | $wpdb->prepare( |
616 | - "SELECT COALESCE(avg(overall_rating),0) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
616 | + "SELECT COALESCE(avg(overall_rating),0) FROM ".GEODIR_REVIEW_TABLE." WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
617 | 617 | array($post_id) |
618 | 618 | ) |
619 | 619 | ); |
@@ -641,7 +641,7 @@ discard block |
||
641 | 641 | |
642 | 642 | $results = $wpdb->get_var( |
643 | 643 | $wpdb->prepare( |
644 | - "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
644 | + "SELECT COUNT(overall_rating) FROM ".GEODIR_REVIEW_TABLE." WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
645 | 645 | array($post_id) |
646 | 646 | ) |
647 | 647 | ); |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | |
671 | 671 | $results = $wpdb->get_var( |
672 | 672 | $wpdb->prepare( |
673 | - "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
673 | + "SELECT COUNT(overall_rating) FROM ".GEODIR_REVIEW_TABLE." WHERE post_id = %d AND status=1 AND overall_rating>0", |
|
674 | 674 | array($post_id) |
675 | 675 | ) |
676 | 676 | ); |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | |
700 | 700 | $reatings = $wpdb->get_var( |
701 | 701 | $wpdb->prepare( |
702 | - "SELECT overall_rating FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id = %d", |
|
702 | + "SELECT overall_rating FROM ".GEODIR_REVIEW_TABLE." WHERE comment_id = %d", |
|
703 | 703 | array($comment_id) |
704 | 704 | ) |
705 | 705 | ); |
@@ -749,7 +749,7 @@ discard block |
||
749 | 749 | if (in_array($post->post_type, $post_types)) { // assuming there is a post type called business |
750 | 750 | $template = locate_template(array("geodirectory/reviews.php")); // Use theme template if available |
751 | 751 | if (!$template) { |
752 | - $template = dirname(__FILE__) . '/reviews.php'; |
|
752 | + $template = dirname(__FILE__).'/reviews.php'; |
|
753 | 753 | } |
754 | 754 | return $template; |
755 | 755 | } |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | printf('<cite><b class="reviewer">%1$s</b> %2$s</cite>', |
822 | 822 | get_comment_author_link(), |
823 | 823 | // If current post author is also comment author, make it known visually. |
824 | - ($comment->user_id === $post->post_author) ? '<span>' . __('Post author', 'geodirectory') . '</span>' : '' |
|
824 | + ($comment->user_id === $post->post_author) ? '<span>'.__('Post author', 'geodirectory').'</span>' : '' |
|
825 | 825 | ); |
826 | 826 | echo "<span class='item'><small><span class='fn'>$post->post_title</span></small></span>"; |
827 | 827 | printf('<a href="%1$s"><time datetime="%2$s" class="dtreviewed">%3$s<span class="value-title" title="%2$s"></span></time></a>', |
@@ -914,24 +914,24 @@ discard block |
||
914 | 914 | $a_rating = $rating / 5 * 100; |
915 | 915 | |
916 | 916 | if ($small) { |
917 | - $r_html = '<div class="rating"><div class="gd_rating_map" data-average="' . $rating . '" data-id="' . $post_id . '"><div class="geodir_RatingColor" ></div><div class="geodir_RatingAverage_small" style="width: ' . $a_rating . '%;"></div><div class="geodir_Star_small"></div></div></div>'; |
|
917 | + $r_html = '<div class="rating"><div class="gd_rating_map" data-average="'.$rating.'" data-id="'.$post_id.'"><div class="geodir_RatingColor" ></div><div class="geodir_RatingAverage_small" style="width: '.$a_rating.'%;"></div><div class="geodir_Star_small"></div></div></div>'; |
|
918 | 918 | } else { |
919 | 919 | if (function_exists('geodir_reviewrating_draw_overall_rating')) { |
920 | 920 | // Show rating stars from review rating manager |
921 | 921 | $r_html = geodir_reviewrating_draw_overall_rating($rating); |
922 | 922 | } else { |
923 | - $rating_img = '<img alt="rating icon" src="' . get_option('geodir_default_rating_star_icon') . '" />'; |
|
923 | + $rating_img = '<img alt="rating icon" src="'.get_option('geodir_default_rating_star_icon').'" />'; |
|
924 | 924 | |
925 | 925 | /* fix rating star for safari */ |
926 | 926 | $star_width = 23 * 5; |
927 | 927 | //global $is_safari, $is_iphone, $ios, $is_chrome; |
928 | 928 | //$attach_style = ( $is_safari || $is_iphone || $ios || $is_chrome ) && $star_width > 0 ? 'width:' . $star_width . 'px;max-width:none' : ''; |
929 | 929 | if ($star_width > 0) { |
930 | - $attach_style = 'max-width:' . $star_width . 'px'; |
|
930 | + $attach_style = 'max-width:'.$star_width.'px'; |
|
931 | 931 | } else { |
932 | 932 | $attach_style = ''; |
933 | 933 | } |
934 | - $r_html = '<div class="geodir-rating" style="' . $attach_style . '"><div class="gd_rating_show" data-average="' . $rating . '" data-id="' . $post_id . '"><div class="geodir_RatingAverage" style="width: ' . $a_rating . '%;"></div><div class="geodir_Star">' . $rating_img . $rating_img . $rating_img . $rating_img . $rating_img . '</div></div></div>'; |
|
934 | + $r_html = '<div class="geodir-rating" style="'.$attach_style.'"><div class="gd_rating_show" data-average="'.$rating.'" data-id="'.$post_id.'"><div class="geodir_RatingAverage" style="width: '.$a_rating.'%;"></div><div class="geodir_Star">'.$rating_img.$rating_img.$rating_img.$rating_img.$rating_img.'</div></div></div>'; |
|
935 | 935 | } |
936 | 936 | } |
937 | 937 | return apply_filters('geodir_get_rating_stars_html', $r_html, $rating, 5); |
@@ -971,10 +971,10 @@ discard block |
||
971 | 971 | /* |
972 | 972 | * If Disqus plugin is active, do some fixes to show on blogs but no on GD post types |
973 | 973 | */ |
974 | -if(function_exists('dsq_can_replace')) { |
|
974 | +if (function_exists('dsq_can_replace')) { |
|
975 | 975 | remove_filter('comments_template', 'dsq_comments_template'); |
976 | 976 | add_filter('comments_template', 'dsq_comments_template', 100); |
977 | - add_filter('pre_option_disqus_active', 'geodir_option_disqus_active',10,1); |
|
977 | + add_filter('pre_option_disqus_active', 'geodir_option_disqus_active', 10, 1); |
|
978 | 978 | } |
979 | 979 | |
980 | 980 | |
@@ -987,11 +987,11 @@ discard block |
||
987 | 987 | * @param string $disqus_active Hook called before DB call for option so this is empty. |
988 | 988 | * @return string `1` if active `0` if disabled. |
989 | 989 | */ |
990 | -function geodir_option_disqus_active($disqus_active){ |
|
990 | +function geodir_option_disqus_active($disqus_active) { |
|
991 | 991 | global $post; |
992 | 992 | $all_postypes = geodir_get_posttypes(); |
993 | 993 | |
994 | - if(isset($post->post_type) && is_array($all_postypes) && in_array($post->post_type,$all_postypes)){ |
|
994 | + if (isset($post->post_type) && is_array($all_postypes) && in_array($post->post_type, $all_postypes)) { |
|
995 | 995 | $disqus_active = '0'; |
996 | 996 | } |
997 | 997 |
@@ -76,22 +76,19 @@ discard block |
||
76 | 76 | if(!$ga_start){$ga_start = date('Y-m-d', strtotime("-6 day"));} |
77 | 77 | if(!$ga_end){$ga_end = date('Y-m-d');} |
78 | 78 | $dimensions = "&dimensions=ga:date,ga:nthDay"; |
79 | - }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastweek'){ |
|
79 | + } elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastweek'){ |
|
80 | 80 | if(!$ga_start){$ga_start = date('Y-m-d', strtotime("-13 day"));} |
81 | 81 | if(!$ga_end){$ga_end = date('Y-m-d', strtotime("-7 day"));} |
82 | 82 | $dimensions = "&dimensions=ga:date,ga:nthDay"; |
83 | - } |
|
84 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisyear'){ |
|
83 | + } elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisyear'){ |
|
85 | 84 | if(!$ga_start){$ga_start = date('Y')."-01-01";} |
86 | 85 | if(!$ga_end){$ga_end = date('Y-m-d');} |
87 | 86 | $dimensions = "&dimensions=ga:month,ga:nthMonth"; |
88 | - } |
|
89 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastyear'){ |
|
87 | + } elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastyear'){ |
|
90 | 88 | if(!$ga_start){$ga_start = date('Y', strtotime("-1 year"))."-01-01";} |
91 | 89 | if(!$ga_end){$ga_end = date('Y', strtotime("-1 year"))."-12-31";} |
92 | 90 | $dimensions = "&dimensions=ga:month,ga:nthMonth"; |
93 | - } |
|
94 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){ |
|
91 | + } elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){ |
|
95 | 92 | if(!$ga_start){$ga_start = "14daysAgo";} |
96 | 93 | if(!$ga_end){$ga_end = "yesterday";} |
97 | 94 | $dimensions = "&dimensions=ga:country&sort=-ga:pageviews&max-results=5"; |
@@ -144,7 +141,7 @@ discard block |
||
144 | 141 | if(!empty($response['response']['code']) && $response['response']['code']==200) {//access token is valid |
145 | 142 | |
146 | 143 | return $at; |
147 | - }else{//else get new access token |
|
144 | + } else{//else get new access token |
|
148 | 145 | |
149 | 146 | $refresh_at = get_option('gd_ga_refresh_token'); |
150 | 147 | if(!$refresh_at){ |
@@ -167,7 +164,7 @@ discard block |
||
167 | 164 | update_option('gd_ga_access_token', $parts->access_token); |
168 | 165 | return $parts->access_token; |
169 | 166 | |
170 | - }else{ |
|
167 | + } else{ |
|
171 | 168 | echo json_encode(array('error'=>__('Login failed', 'geodirectory')));exit; |
172 | 169 | } |
173 | 170 |
@@ -17,34 +17,34 @@ discard block |
||
17 | 17 | */ |
18 | 18 | function geodir_sec2hms($sec, $padHours = false) |
19 | 19 | { |
20 | - // holds formatted string |
|
21 | - $hms = ""; |
|
22 | - // there are 3600 seconds in an hour, so if we |
|
23 | - // divide total seconds by 3600 and throw away |
|
24 | - // the remainder, we've got the number of hours |
|
25 | - $hours = intval(intval($sec) / 3600); |
|
26 | - |
|
27 | - // add to $hms, with a leading 0 if asked for |
|
28 | - $hms .= ($padHours) ? str_pad($hours, 2, "0", STR_PAD_LEFT) . ':' : $hours . ':'; |
|
29 | - |
|
30 | - // dividing the total seconds by 60 will give us |
|
31 | - // the number of minutes, but we're interested in |
|
32 | - // minutes past the hour: to get that, we need to |
|
33 | - // divide by 60 again and keep the remainder |
|
34 | - $minutes = intval(($sec / 60) % 60); |
|
35 | - |
|
36 | - // then add to $hms (with a leading 0 if needed) |
|
37 | - $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT) . ':'; |
|
38 | - |
|
39 | - // seconds are simple - just divide the total |
|
40 | - // seconds by 60 and keep the remainder |
|
41 | - $seconds = intval($sec % 60); |
|
42 | - |
|
43 | - // add to $hms, again with a leading 0 if needed |
|
44 | - $hms .= str_pad($seconds, 2, "0", STR_PAD_LEFT); |
|
45 | - |
|
46 | - // done! |
|
47 | - return $hms; |
|
20 | + // holds formatted string |
|
21 | + $hms = ""; |
|
22 | + // there are 3600 seconds in an hour, so if we |
|
23 | + // divide total seconds by 3600 and throw away |
|
24 | + // the remainder, we've got the number of hours |
|
25 | + $hours = intval(intval($sec) / 3600); |
|
26 | + |
|
27 | + // add to $hms, with a leading 0 if asked for |
|
28 | + $hms .= ($padHours) ? str_pad($hours, 2, "0", STR_PAD_LEFT) . ':' : $hours . ':'; |
|
29 | + |
|
30 | + // dividing the total seconds by 60 will give us |
|
31 | + // the number of minutes, but we're interested in |
|
32 | + // minutes past the hour: to get that, we need to |
|
33 | + // divide by 60 again and keep the remainder |
|
34 | + $minutes = intval(($sec / 60) % 60); |
|
35 | + |
|
36 | + // then add to $hms (with a leading 0 if needed) |
|
37 | + $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT) . ':'; |
|
38 | + |
|
39 | + // seconds are simple - just divide the total |
|
40 | + // seconds by 60 and keep the remainder |
|
41 | + $seconds = intval($sec % 60); |
|
42 | + |
|
43 | + // add to $hms, again with a leading 0 if needed |
|
44 | + $hms .= str_pad($seconds, 2, "0", STR_PAD_LEFT); |
|
45 | + |
|
46 | + // done! |
|
47 | + return $hms; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -61,117 +61,117 @@ discard block |
||
61 | 61 | { |
62 | 62 | |
63 | 63 | |
64 | - // NOTE: the id is in the form ga:12345 and not just 12345 |
|
65 | - // if you do e.g. 12345 then no data will be returned |
|
66 | - // read http://www.electrictoolbox.com/get-id-for-google-analytics-api/ for info about how to get this id from the GA web interface |
|
67 | - // or load the accounts (see below) and get it from there |
|
68 | - // if you don't specify an id here, then you'll get the "Badly formatted request to the Google Analytics API..." error message |
|
69 | - $id = trim(get_option('geodir_ga_id')); |
|
70 | - |
|
71 | - $at = geodir_ga_get_token(); |
|
72 | - |
|
73 | - $start_date = ''; |
|
74 | - $end_date = ''; |
|
75 | - $dimensions = "&filters=ga:pagePath==" . $page; |
|
76 | - if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisweek'){ |
|
77 | - if(!$ga_start){$ga_start = date('Y-m-d', strtotime("-6 day"));} |
|
78 | - if(!$ga_end){$ga_end = date('Y-m-d');} |
|
79 | - $dimensions = "&dimensions=ga:date,ga:nthDay"; |
|
80 | - }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastweek'){ |
|
81 | - if(!$ga_start){$ga_start = date('Y-m-d', strtotime("-13 day"));} |
|
82 | - if(!$ga_end){$ga_end = date('Y-m-d', strtotime("-7 day"));} |
|
83 | - $dimensions = "&dimensions=ga:date,ga:nthDay"; |
|
84 | - } |
|
85 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisyear'){ |
|
86 | - if(!$ga_start){$ga_start = date('Y')."-01-01";} |
|
87 | - if(!$ga_end){$ga_end = date('Y-m-d');} |
|
88 | - $dimensions = "&dimensions=ga:month,ga:nthMonth"; |
|
89 | - } |
|
90 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastyear'){ |
|
91 | - if(!$ga_start){$ga_start = date('Y', strtotime("-1 year"))."-01-01";} |
|
92 | - if(!$ga_end){$ga_end = date('Y', strtotime("-1 year"))."-12-31";} |
|
93 | - $dimensions = "&dimensions=ga:month,ga:nthMonth"; |
|
94 | - } |
|
95 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){ |
|
96 | - if(!$ga_start){$ga_start = "14daysAgo";} |
|
97 | - if(!$ga_end){$ga_end = "yesterday";} |
|
98 | - $dimensions = "&dimensions=ga:country&sort=-ga:pageviews&max-results=5"; |
|
99 | - } |
|
100 | - |
|
101 | - $APIURL = "https://www.googleapis.com/analytics/v3/data/ga?"; |
|
102 | - $ids = "ids=".$id; |
|
103 | - if(!$start_date){$start_date = "&start-date=".$ga_start;} |
|
104 | - if(!$end_date){$end_date = "&end-date=".$ga_end;} |
|
105 | - $metrics = "&metrics=ga:pageviews"; |
|
106 | - $filters = "&filters=ga:pagePath==".$page; |
|
107 | - $access_token = "&access_token=".$at; |
|
108 | - |
|
109 | - $use_url = $APIURL.$ids.$start_date.$end_date.$dimensions.$metrics.$filters.$access_token; |
|
110 | - |
|
111 | - if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='realtime'){ |
|
112 | - $metrics = "&metrics=rt:activeUsers"; |
|
113 | - $dimensions = "&filters=ga:pagePath==".$page; |
|
114 | - |
|
115 | - $use_url = "https://www.googleapis.com/analytics/v3/data/realtime?".$ids.$access_token.$metrics.$dimensions; |
|
116 | - } |
|
117 | - |
|
118 | - $response = wp_remote_get($use_url,array('timeout' => 15)); |
|
119 | - |
|
120 | - // Make countries translatable |
|
121 | - if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){ |
|
122 | - $c_arr = json_decode($response['body']); |
|
123 | - if(is_array($c_arr->rows)){ |
|
124 | - $new_rows = array(); |
|
125 | - foreach($c_arr->rows as $wow){ |
|
126 | - $new_rows[] = array(__($wow[0],'geodirectory'),$wow[1]); |
|
127 | - } |
|
128 | - $c_arr->rows = $new_rows; |
|
129 | - } |
|
130 | - $response['body'] = json_encode($c_arr); |
|
131 | - } |
|
132 | - |
|
133 | - echo $response['body']; |
|
134 | - exit; |
|
64 | + // NOTE: the id is in the form ga:12345 and not just 12345 |
|
65 | + // if you do e.g. 12345 then no data will be returned |
|
66 | + // read http://www.electrictoolbox.com/get-id-for-google-analytics-api/ for info about how to get this id from the GA web interface |
|
67 | + // or load the accounts (see below) and get it from there |
|
68 | + // if you don't specify an id here, then you'll get the "Badly formatted request to the Google Analytics API..." error message |
|
69 | + $id = trim(get_option('geodir_ga_id')); |
|
70 | + |
|
71 | + $at = geodir_ga_get_token(); |
|
72 | + |
|
73 | + $start_date = ''; |
|
74 | + $end_date = ''; |
|
75 | + $dimensions = "&filters=ga:pagePath==" . $page; |
|
76 | + if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisweek'){ |
|
77 | + if(!$ga_start){$ga_start = date('Y-m-d', strtotime("-6 day"));} |
|
78 | + if(!$ga_end){$ga_end = date('Y-m-d');} |
|
79 | + $dimensions = "&dimensions=ga:date,ga:nthDay"; |
|
80 | + }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastweek'){ |
|
81 | + if(!$ga_start){$ga_start = date('Y-m-d', strtotime("-13 day"));} |
|
82 | + if(!$ga_end){$ga_end = date('Y-m-d', strtotime("-7 day"));} |
|
83 | + $dimensions = "&dimensions=ga:date,ga:nthDay"; |
|
84 | + } |
|
85 | + elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisyear'){ |
|
86 | + if(!$ga_start){$ga_start = date('Y')."-01-01";} |
|
87 | + if(!$ga_end){$ga_end = date('Y-m-d');} |
|
88 | + $dimensions = "&dimensions=ga:month,ga:nthMonth"; |
|
89 | + } |
|
90 | + elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastyear'){ |
|
91 | + if(!$ga_start){$ga_start = date('Y', strtotime("-1 year"))."-01-01";} |
|
92 | + if(!$ga_end){$ga_end = date('Y', strtotime("-1 year"))."-12-31";} |
|
93 | + $dimensions = "&dimensions=ga:month,ga:nthMonth"; |
|
94 | + } |
|
95 | + elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){ |
|
96 | + if(!$ga_start){$ga_start = "14daysAgo";} |
|
97 | + if(!$ga_end){$ga_end = "yesterday";} |
|
98 | + $dimensions = "&dimensions=ga:country&sort=-ga:pageviews&max-results=5"; |
|
99 | + } |
|
100 | + |
|
101 | + $APIURL = "https://www.googleapis.com/analytics/v3/data/ga?"; |
|
102 | + $ids = "ids=".$id; |
|
103 | + if(!$start_date){$start_date = "&start-date=".$ga_start;} |
|
104 | + if(!$end_date){$end_date = "&end-date=".$ga_end;} |
|
105 | + $metrics = "&metrics=ga:pageviews"; |
|
106 | + $filters = "&filters=ga:pagePath==".$page; |
|
107 | + $access_token = "&access_token=".$at; |
|
108 | + |
|
109 | + $use_url = $APIURL.$ids.$start_date.$end_date.$dimensions.$metrics.$filters.$access_token; |
|
110 | + |
|
111 | + if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='realtime'){ |
|
112 | + $metrics = "&metrics=rt:activeUsers"; |
|
113 | + $dimensions = "&filters=ga:pagePath==".$page; |
|
114 | + |
|
115 | + $use_url = "https://www.googleapis.com/analytics/v3/data/realtime?".$ids.$access_token.$metrics.$dimensions; |
|
116 | + } |
|
117 | + |
|
118 | + $response = wp_remote_get($use_url,array('timeout' => 15)); |
|
119 | + |
|
120 | + // Make countries translatable |
|
121 | + if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){ |
|
122 | + $c_arr = json_decode($response['body']); |
|
123 | + if(is_array($c_arr->rows)){ |
|
124 | + $new_rows = array(); |
|
125 | + foreach($c_arr->rows as $wow){ |
|
126 | + $new_rows[] = array(__($wow[0],'geodirectory'),$wow[1]); |
|
127 | + } |
|
128 | + $c_arr->rows = $new_rows; |
|
129 | + } |
|
130 | + $response['body'] = json_encode($c_arr); |
|
131 | + } |
|
132 | + |
|
133 | + echo $response['body']; |
|
134 | + exit; |
|
135 | 135 | |
136 | 136 | }// end GA function |
137 | 137 | |
138 | 138 | |
139 | 139 | function geodir_ga_get_token(){ |
140 | - $at = get_option('gd_ga_access_token'); |
|
141 | - $use_url = "https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=".$at; |
|
142 | - $response = wp_remote_get($use_url,array('timeout' => 15)); |
|
140 | + $at = get_option('gd_ga_access_token'); |
|
141 | + $use_url = "https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=".$at; |
|
142 | + $response = wp_remote_get($use_url,array('timeout' => 15)); |
|
143 | 143 | |
144 | - if(!empty($response['response']['code']) && $response['response']['code']==200) {//access token is valid |
|
144 | + if(!empty($response['response']['code']) && $response['response']['code']==200) {//access token is valid |
|
145 | 145 | |
146 | - return $at; |
|
147 | - }else{//else get new access token |
|
146 | + return $at; |
|
147 | + }else{//else get new access token |
|
148 | 148 | |
149 | - $refresh_at = get_option('gd_ga_refresh_token'); |
|
150 | - if(!$refresh_at){ |
|
151 | - echo json_encode(array('error'=>__('Not authorized, please click authorized in GD > Google analytic settings.', 'geodirectory')));exit; |
|
152 | - } |
|
149 | + $refresh_at = get_option('gd_ga_refresh_token'); |
|
150 | + if(!$refresh_at){ |
|
151 | + echo json_encode(array('error'=>__('Not authorized, please click authorized in GD > Google analytic settings.', 'geodirectory')));exit; |
|
152 | + } |
|
153 | 153 | |
154 | - $rat_url = "https://www.googleapis.com/oauth2/v3/token?"; |
|
155 | - $client_id = "client_id=".get_option('geodir_ga_client_id'); |
|
156 | - $client_secret = "&client_secret=".get_option('geodir_ga_client_secret'); |
|
157 | - $refresh_token = "&refresh_token=".$refresh_at; |
|
158 | - $grant_type = "&grant_type=refresh_token"; |
|
154 | + $rat_url = "https://www.googleapis.com/oauth2/v3/token?"; |
|
155 | + $client_id = "client_id=".get_option('geodir_ga_client_id'); |
|
156 | + $client_secret = "&client_secret=".get_option('geodir_ga_client_secret'); |
|
157 | + $refresh_token = "&refresh_token=".$refresh_at; |
|
158 | + $grant_type = "&grant_type=refresh_token"; |
|
159 | 159 | |
160 | - $rat_url_use = $rat_url.$client_id.$client_secret.$refresh_token.$grant_type; |
|
160 | + $rat_url_use = $rat_url.$client_id.$client_secret.$refresh_token.$grant_type; |
|
161 | 161 | |
162 | - $rat_response = wp_remote_post($rat_url_use,array('timeout' => 15)); |
|
163 | - if(!empty($rat_response['response']['code']) && $rat_response['response']['code']==200) { |
|
164 | - $parts = json_decode($rat_response['body']); |
|
162 | + $rat_response = wp_remote_post($rat_url_use,array('timeout' => 15)); |
|
163 | + if(!empty($rat_response['response']['code']) && $rat_response['response']['code']==200) { |
|
164 | + $parts = json_decode($rat_response['body']); |
|
165 | 165 | |
166 | 166 | |
167 | - update_option('gd_ga_access_token', $parts->access_token); |
|
168 | - return $parts->access_token; |
|
167 | + update_option('gd_ga_access_token', $parts->access_token); |
|
168 | + return $parts->access_token; |
|
169 | 169 | |
170 | - }else{ |
|
171 | - echo json_encode(array('error'=>__('Login failed', 'geodirectory')));exit; |
|
172 | - } |
|
170 | + }else{ |
|
171 | + echo json_encode(array('error'=>__('Login failed', 'geodirectory')));exit; |
|
172 | + } |
|
173 | 173 | |
174 | 174 | |
175 | - } |
|
175 | + } |
|
176 | 176 | |
177 | 177 | } |
178 | 178 | \ No newline at end of file |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $hours = intval(intval($sec) / 3600); |
26 | 26 | |
27 | 27 | // add to $hms, with a leading 0 if asked for |
28 | - $hms .= ($padHours) ? str_pad($hours, 2, "0", STR_PAD_LEFT) . ':' : $hours . ':'; |
|
28 | + $hms .= ($padHours) ? str_pad($hours, 2, "0", STR_PAD_LEFT).':' : $hours.':'; |
|
29 | 29 | |
30 | 30 | // dividing the total seconds by 60 will give us |
31 | 31 | // the number of minutes, but we're interested in |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | $minutes = intval(($sec / 60) % 60); |
35 | 35 | |
36 | 36 | // then add to $hms (with a leading 0 if needed) |
37 | - $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT) . ':'; |
|
37 | + $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT).':'; |
|
38 | 38 | |
39 | 39 | // seconds are simple - just divide the total |
40 | 40 | // seconds by 60 and keep the remainder |
@@ -72,58 +72,58 @@ discard block |
||
72 | 72 | |
73 | 73 | $start_date = ''; |
74 | 74 | $end_date = ''; |
75 | - $dimensions = "&filters=ga:pagePath==" . $page; |
|
76 | - if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisweek'){ |
|
77 | - if(!$ga_start){$ga_start = date('Y-m-d', strtotime("-6 day"));} |
|
78 | - if(!$ga_end){$ga_end = date('Y-m-d');} |
|
75 | + $dimensions = "&filters=ga:pagePath==".$page; |
|
76 | + if (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'thisweek') { |
|
77 | + if (!$ga_start) {$ga_start = date('Y-m-d', strtotime("-6 day")); } |
|
78 | + if (!$ga_end) {$ga_end = date('Y-m-d'); } |
|
79 | 79 | $dimensions = "&dimensions=ga:date,ga:nthDay"; |
80 | - }elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastweek'){ |
|
81 | - if(!$ga_start){$ga_start = date('Y-m-d', strtotime("-13 day"));} |
|
82 | - if(!$ga_end){$ga_end = date('Y-m-d', strtotime("-7 day"));} |
|
80 | + }elseif (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'lastweek') { |
|
81 | + if (!$ga_start) {$ga_start = date('Y-m-d', strtotime("-13 day")); } |
|
82 | + if (!$ga_end) {$ga_end = date('Y-m-d', strtotime("-7 day")); } |
|
83 | 83 | $dimensions = "&dimensions=ga:date,ga:nthDay"; |
84 | 84 | } |
85 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='thisyear'){ |
|
86 | - if(!$ga_start){$ga_start = date('Y')."-01-01";} |
|
87 | - if(!$ga_end){$ga_end = date('Y-m-d');} |
|
85 | + elseif (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'thisyear') { |
|
86 | + if (!$ga_start) {$ga_start = date('Y')."-01-01"; } |
|
87 | + if (!$ga_end) {$ga_end = date('Y-m-d'); } |
|
88 | 88 | $dimensions = "&dimensions=ga:month,ga:nthMonth"; |
89 | 89 | } |
90 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='lastyear'){ |
|
91 | - if(!$ga_start){$ga_start = date('Y', strtotime("-1 year"))."-01-01";} |
|
92 | - if(!$ga_end){$ga_end = date('Y', strtotime("-1 year"))."-12-31";} |
|
90 | + elseif (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'lastyear') { |
|
91 | + if (!$ga_start) {$ga_start = date('Y', strtotime("-1 year"))."-01-01"; } |
|
92 | + if (!$ga_end) {$ga_end = date('Y', strtotime("-1 year"))."-12-31"; } |
|
93 | 93 | $dimensions = "&dimensions=ga:month,ga:nthMonth"; |
94 | 94 | } |
95 | - elseif(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){ |
|
96 | - if(!$ga_start){$ga_start = "14daysAgo";} |
|
97 | - if(!$ga_end){$ga_end = "yesterday";} |
|
95 | + elseif (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'country') { |
|
96 | + if (!$ga_start) {$ga_start = "14daysAgo"; } |
|
97 | + if (!$ga_end) {$ga_end = "yesterday"; } |
|
98 | 98 | $dimensions = "&dimensions=ga:country&sort=-ga:pageviews&max-results=5"; |
99 | 99 | } |
100 | 100 | |
101 | 101 | $APIURL = "https://www.googleapis.com/analytics/v3/data/ga?"; |
102 | 102 | $ids = "ids=".$id; |
103 | - if(!$start_date){$start_date = "&start-date=".$ga_start;} |
|
104 | - if(!$end_date){$end_date = "&end-date=".$ga_end;} |
|
103 | + if (!$start_date) {$start_date = "&start-date=".$ga_start; } |
|
104 | + if (!$end_date) {$end_date = "&end-date=".$ga_end; } |
|
105 | 105 | $metrics = "&metrics=ga:pageviews"; |
106 | 106 | $filters = "&filters=ga:pagePath==".$page; |
107 | 107 | $access_token = "&access_token=".$at; |
108 | 108 | |
109 | 109 | $use_url = $APIURL.$ids.$start_date.$end_date.$dimensions.$metrics.$filters.$access_token; |
110 | 110 | |
111 | - if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='realtime'){ |
|
111 | + if (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'realtime') { |
|
112 | 112 | $metrics = "&metrics=rt:activeUsers"; |
113 | 113 | $dimensions = "&filters=ga:pagePath==".$page; |
114 | 114 | |
115 | 115 | $use_url = "https://www.googleapis.com/analytics/v3/data/realtime?".$ids.$access_token.$metrics.$dimensions; |
116 | 116 | } |
117 | 117 | |
118 | - $response = wp_remote_get($use_url,array('timeout' => 15)); |
|
118 | + $response = wp_remote_get($use_url, array('timeout' => 15)); |
|
119 | 119 | |
120 | 120 | // Make countries translatable |
121 | - if(isset($_REQUEST['ga_type']) && $_REQUEST['ga_type']=='country'){ |
|
121 | + if (isset($_REQUEST['ga_type']) && $_REQUEST['ga_type'] == 'country') { |
|
122 | 122 | $c_arr = json_decode($response['body']); |
123 | - if(is_array($c_arr->rows)){ |
|
123 | + if (is_array($c_arr->rows)) { |
|
124 | 124 | $new_rows = array(); |
125 | - foreach($c_arr->rows as $wow){ |
|
126 | - $new_rows[] = array(__($wow[0],'geodirectory'),$wow[1]); |
|
125 | + foreach ($c_arr->rows as $wow) { |
|
126 | + $new_rows[] = array(__($wow[0], 'geodirectory'), $wow[1]); |
|
127 | 127 | } |
128 | 128 | $c_arr->rows = $new_rows; |
129 | 129 | } |
@@ -136,19 +136,19 @@ discard block |
||
136 | 136 | }// end GA function |
137 | 137 | |
138 | 138 | |
139 | -function geodir_ga_get_token(){ |
|
139 | +function geodir_ga_get_token() { |
|
140 | 140 | $at = get_option('gd_ga_access_token'); |
141 | 141 | $use_url = "https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=".$at; |
142 | - $response = wp_remote_get($use_url,array('timeout' => 15)); |
|
142 | + $response = wp_remote_get($use_url, array('timeout' => 15)); |
|
143 | 143 | |
144 | - if(!empty($response['response']['code']) && $response['response']['code']==200) {//access token is valid |
|
144 | + if (!empty($response['response']['code']) && $response['response']['code'] == 200) {//access token is valid |
|
145 | 145 | |
146 | 146 | return $at; |
147 | - }else{//else get new access token |
|
147 | + } else {//else get new access token |
|
148 | 148 | |
149 | 149 | $refresh_at = get_option('gd_ga_refresh_token'); |
150 | - if(!$refresh_at){ |
|
151 | - echo json_encode(array('error'=>__('Not authorized, please click authorized in GD > Google analytic settings.', 'geodirectory')));exit; |
|
150 | + if (!$refresh_at) { |
|
151 | + echo json_encode(array('error'=>__('Not authorized, please click authorized in GD > Google analytic settings.', 'geodirectory'))); exit; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | $rat_url = "https://www.googleapis.com/oauth2/v3/token?"; |
@@ -159,16 +159,16 @@ discard block |
||
159 | 159 | |
160 | 160 | $rat_url_use = $rat_url.$client_id.$client_secret.$refresh_token.$grant_type; |
161 | 161 | |
162 | - $rat_response = wp_remote_post($rat_url_use,array('timeout' => 15)); |
|
163 | - if(!empty($rat_response['response']['code']) && $rat_response['response']['code']==200) { |
|
162 | + $rat_response = wp_remote_post($rat_url_use, array('timeout' => 15)); |
|
163 | + if (!empty($rat_response['response']['code']) && $rat_response['response']['code'] == 200) { |
|
164 | 164 | $parts = json_decode($rat_response['body']); |
165 | 165 | |
166 | 166 | |
167 | 167 | update_option('gd_ga_access_token', $parts->access_token); |
168 | 168 | return $parts->access_token; |
169 | 169 | |
170 | - }else{ |
|
171 | - echo json_encode(array('error'=>__('Login failed', 'geodirectory')));exit; |
|
170 | + } else { |
|
171 | + echo json_encode(array('error'=>__('Login failed', 'geodirectory'))); exit; |
|
172 | 172 | } |
173 | 173 | |
174 | 174 |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $slug = $post->post_name; |
154 | 154 | //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors |
155 | 155 | $login_url = trailingslashit($home_url)."$slug/"; |
156 | - }else{ |
|
156 | + } else{ |
|
157 | 157 | $login_url = trailingslashit($home_url)."?geodir_signup=true"; |
158 | 158 | } |
159 | 159 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | $slug = $post->post_name; |
203 | 203 | //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors |
204 | 204 | $info_url = trailingslashit($home_url)."$slug/"; |
205 | - }else{ |
|
205 | + } else{ |
|
206 | 206 | $info_url = trailingslashit($home_url); |
207 | 207 | } |
208 | 208 |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | * @return int|null Return the page ID if present or null if not. |
15 | 15 | */ |
16 | 16 | function geodir_add_listing_page_id(){ |
17 | - $gd_page_id = get_option('geodir_add_listing_page'); |
|
17 | + $gd_page_id = get_option('geodir_add_listing_page'); |
|
18 | 18 | |
19 | - if (function_exists('icl_object_id')) { |
|
20 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
21 | - } |
|
19 | + if (function_exists('icl_object_id')) { |
|
20 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
21 | + } |
|
22 | 22 | |
23 | - return $gd_page_id; |
|
23 | + return $gd_page_id; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -31,13 +31,13 @@ discard block |
||
31 | 31 | * @return int|null Return the page ID if present or null if not. |
32 | 32 | */ |
33 | 33 | function geodir_preview_page_id(){ |
34 | - $gd_page_id = get_option('geodir_preview_page'); |
|
34 | + $gd_page_id = get_option('geodir_preview_page'); |
|
35 | 35 | |
36 | - if (function_exists('icl_object_id')) { |
|
37 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
38 | - } |
|
36 | + if (function_exists('icl_object_id')) { |
|
37 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
38 | + } |
|
39 | 39 | |
40 | - return $gd_page_id; |
|
40 | + return $gd_page_id; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -48,13 +48,13 @@ discard block |
||
48 | 48 | * @return int|null Return the page ID if present or null if not. |
49 | 49 | */ |
50 | 50 | function geodir_success_page_id(){ |
51 | - $gd_page_id = get_option('geodir_success_page'); |
|
51 | + $gd_page_id = get_option('geodir_success_page'); |
|
52 | 52 | |
53 | - if (function_exists('icl_object_id')) { |
|
54 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
55 | - } |
|
53 | + if (function_exists('icl_object_id')) { |
|
54 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
55 | + } |
|
56 | 56 | |
57 | - return $gd_page_id; |
|
57 | + return $gd_page_id; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | * @return int|null Return the page ID if present or null if not. |
66 | 66 | */ |
67 | 67 | function geodir_location_page_id(){ |
68 | - $gd_page_id = get_option('geodir_location_page'); |
|
68 | + $gd_page_id = get_option('geodir_location_page'); |
|
69 | 69 | |
70 | - if (function_exists('icl_object_id')) { |
|
71 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
72 | - } |
|
70 | + if (function_exists('icl_object_id')) { |
|
71 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
72 | + } |
|
73 | 73 | |
74 | - return $gd_page_id; |
|
74 | + return $gd_page_id; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | * @return int|null Return the page ID if present or null if not. |
83 | 83 | */ |
84 | 84 | function geodir_home_page_id(){ |
85 | - $gd_page_id = get_option('geodir_home_page'); |
|
85 | + $gd_page_id = get_option('geodir_home_page'); |
|
86 | 86 | |
87 | - if (function_exists('icl_object_id')) { |
|
88 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
89 | - } |
|
87 | + if (function_exists('icl_object_id')) { |
|
88 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
89 | + } |
|
90 | 90 | |
91 | - return $gd_page_id; |
|
91 | + return $gd_page_id; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | * @return int|null Return the page ID if present or null if not. |
100 | 100 | */ |
101 | 101 | function geodir_info_page_id(){ |
102 | - $gd_page_id = get_option('geodir_info_page'); |
|
102 | + $gd_page_id = get_option('geodir_info_page'); |
|
103 | 103 | |
104 | - if (function_exists('icl_object_id')) { |
|
105 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
106 | - } |
|
104 | + if (function_exists('icl_object_id')) { |
|
105 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
106 | + } |
|
107 | 107 | |
108 | - return $gd_page_id; |
|
108 | + return $gd_page_id; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | /** |
@@ -116,13 +116,13 @@ discard block |
||
116 | 116 | * @return int|null Return the page ID if present or null if not. |
117 | 117 | */ |
118 | 118 | function geodir_login_page_id(){ |
119 | - $gd_page_id = get_option('geodir_login_page'); |
|
119 | + $gd_page_id = get_option('geodir_login_page'); |
|
120 | 120 | |
121 | - if (function_exists('icl_object_id')) { |
|
122 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
123 | - } |
|
121 | + if (function_exists('icl_object_id')) { |
|
122 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
123 | + } |
|
124 | 124 | |
125 | - return $gd_page_id; |
|
125 | + return $gd_page_id; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | |
@@ -134,45 +134,45 @@ discard block |
||
134 | 134 | * @return int|null Return the page ID if present or null if not. |
135 | 135 | */ |
136 | 136 | function geodir_login_url($args=array()){ |
137 | - $gd_page_id = get_option('geodir_login_page'); |
|
138 | - |
|
139 | - if (function_exists('icl_object_id')) { |
|
140 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
141 | - } |
|
142 | - |
|
143 | - if (function_exists('geodir_location_geo_home_link')) { |
|
144 | - remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
145 | - } |
|
146 | - $home_url = get_home_url(); |
|
147 | - if (function_exists('geodir_location_geo_home_link')) { |
|
148 | - add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
149 | - } |
|
150 | - |
|
151 | - if($gd_page_id){ |
|
152 | - $post = get_post($gd_page_id); |
|
153 | - $slug = $post->post_name; |
|
154 | - //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors |
|
155 | - $login_url = trailingslashit($home_url)."$slug/"; |
|
156 | - }else{ |
|
157 | - $login_url = trailingslashit($home_url)."?geodir_signup=true"; |
|
158 | - } |
|
159 | - |
|
160 | - if($args){ |
|
161 | - $login_url = add_query_arg($args,$login_url ); |
|
162 | - } |
|
163 | - |
|
164 | - /** |
|
165 | - * Filter the GeoDirectory login page url. |
|
166 | - * |
|
167 | - * This filter can be used to change the GeoDirectory page url. |
|
168 | - * |
|
169 | - * @since 1.5.3 |
|
170 | - * @package GeoDirectory |
|
171 | - * @param string $login_url The url of the login page. |
|
172 | - * @param array $args The array of query args used. |
|
173 | - * @param int $gd_page_id The page id of the GD login page. |
|
174 | - */ |
|
175 | - return apply_filters('geodir_login_url',$login_url,$args,$gd_page_id); |
|
137 | + $gd_page_id = get_option('geodir_login_page'); |
|
138 | + |
|
139 | + if (function_exists('icl_object_id')) { |
|
140 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
141 | + } |
|
142 | + |
|
143 | + if (function_exists('geodir_location_geo_home_link')) { |
|
144 | + remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
145 | + } |
|
146 | + $home_url = get_home_url(); |
|
147 | + if (function_exists('geodir_location_geo_home_link')) { |
|
148 | + add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
149 | + } |
|
150 | + |
|
151 | + if($gd_page_id){ |
|
152 | + $post = get_post($gd_page_id); |
|
153 | + $slug = $post->post_name; |
|
154 | + //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors |
|
155 | + $login_url = trailingslashit($home_url)."$slug/"; |
|
156 | + }else{ |
|
157 | + $login_url = trailingslashit($home_url)."?geodir_signup=true"; |
|
158 | + } |
|
159 | + |
|
160 | + if($args){ |
|
161 | + $login_url = add_query_arg($args,$login_url ); |
|
162 | + } |
|
163 | + |
|
164 | + /** |
|
165 | + * Filter the GeoDirectory login page url. |
|
166 | + * |
|
167 | + * This filter can be used to change the GeoDirectory page url. |
|
168 | + * |
|
169 | + * @since 1.5.3 |
|
170 | + * @package GeoDirectory |
|
171 | + * @param string $login_url The url of the login page. |
|
172 | + * @param array $args The array of query args used. |
|
173 | + * @param int $gd_page_id The page id of the GD login page. |
|
174 | + */ |
|
175 | + return apply_filters('geodir_login_url',$login_url,$args,$gd_page_id); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
@@ -183,34 +183,34 @@ discard block |
||
183 | 183 | * @return string Info page url. |
184 | 184 | */ |
185 | 185 | function geodir_info_url($args=array()){ |
186 | - $gd_page_id = get_option('geodir_info_page'); |
|
187 | - |
|
188 | - if (function_exists('icl_object_id')) { |
|
189 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
190 | - } |
|
191 | - |
|
192 | - if (function_exists('geodir_location_geo_home_link')) { |
|
193 | - remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
194 | - } |
|
195 | - $home_url = get_home_url(); |
|
196 | - if (function_exists('geodir_location_geo_home_link')) { |
|
197 | - add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
198 | - } |
|
199 | - |
|
200 | - if($gd_page_id){ |
|
201 | - $post = get_post($gd_page_id); |
|
202 | - $slug = $post->post_name; |
|
203 | - //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors |
|
204 | - $info_url = trailingslashit($home_url)."$slug/"; |
|
205 | - }else{ |
|
206 | - $info_url = trailingslashit($home_url); |
|
207 | - } |
|
208 | - |
|
209 | - if($args){ |
|
210 | - $info_url = add_query_arg($args,$info_url ); |
|
211 | - } |
|
212 | - |
|
213 | - return $info_url; |
|
186 | + $gd_page_id = get_option('geodir_info_page'); |
|
187 | + |
|
188 | + if (function_exists('icl_object_id')) { |
|
189 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
190 | + } |
|
191 | + |
|
192 | + if (function_exists('geodir_location_geo_home_link')) { |
|
193 | + remove_filter('home_url', 'geodir_location_geo_home_link', 100000); |
|
194 | + } |
|
195 | + $home_url = get_home_url(); |
|
196 | + if (function_exists('geodir_location_geo_home_link')) { |
|
197 | + add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
|
198 | + } |
|
199 | + |
|
200 | + if($gd_page_id){ |
|
201 | + $post = get_post($gd_page_id); |
|
202 | + $slug = $post->post_name; |
|
203 | + //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors |
|
204 | + $info_url = trailingslashit($home_url)."$slug/"; |
|
205 | + }else{ |
|
206 | + $info_url = trailingslashit($home_url); |
|
207 | + } |
|
208 | + |
|
209 | + if($args){ |
|
210 | + $info_url = add_query_arg($args,$info_url ); |
|
211 | + } |
|
212 | + |
|
213 | + return $info_url; |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
@@ -226,11 +226,11 @@ discard block |
||
226 | 226 | * @return string Returns converted string. |
227 | 227 | */ |
228 | 228 | function geodir_ucwords($string, $charset='UTF-8') { |
229 | - if (function_exists('mb_convert_case')) { |
|
230 | - return mb_convert_case($string, MB_CASE_TITLE, $charset); |
|
231 | - } else { |
|
232 | - return ucwords($string); |
|
233 | - } |
|
229 | + if (function_exists('mb_convert_case')) { |
|
230 | + return mb_convert_case($string, MB_CASE_TITLE, $charset); |
|
231 | + } else { |
|
232 | + return ucwords($string); |
|
233 | + } |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | /** |
@@ -246,11 +246,11 @@ discard block |
||
246 | 246 | * @return string Returns converted string. |
247 | 247 | */ |
248 | 248 | function geodir_strtolower($string, $charset='UTF-8') { |
249 | - if (function_exists('mb_convert_case')) { |
|
250 | - return mb_convert_case($string, MB_CASE_LOWER, $charset); |
|
251 | - } else { |
|
252 | - return strtolower($string); |
|
253 | - } |
|
249 | + if (function_exists('mb_convert_case')) { |
|
250 | + return mb_convert_case($string, MB_CASE_LOWER, $charset); |
|
251 | + } else { |
|
252 | + return strtolower($string); |
|
253 | + } |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | /** |
@@ -266,11 +266,11 @@ discard block |
||
266 | 266 | * @return string Returns converted string. |
267 | 267 | */ |
268 | 268 | function geodir_strtoupper($string, $charset='UTF-8') { |
269 | - if (function_exists('mb_convert_case')) { |
|
270 | - return mb_convert_case($string, MB_CASE_UPPER, $charset); |
|
271 | - } else { |
|
272 | - return strtoupper($string); |
|
273 | - } |
|
269 | + if (function_exists('mb_convert_case')) { |
|
270 | + return mb_convert_case($string, MB_CASE_UPPER, $charset); |
|
271 | + } else { |
|
272 | + return strtoupper($string); |
|
273 | + } |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | /** |
@@ -449,11 +449,11 @@ discard block |
||
449 | 449 | * @package GeoDirectory |
450 | 450 | */ |
451 | 451 | function _gd_die_handler() { |
452 | - if ( defined( 'GD_TESTING_MODE' ) ) { |
|
453 | - return '_gd_die_handler'; |
|
454 | - } else { |
|
455 | - die(); |
|
456 | - } |
|
452 | + if ( defined( 'GD_TESTING_MODE' ) ) { |
|
453 | + return '_gd_die_handler'; |
|
454 | + } else { |
|
455 | + die(); |
|
456 | + } |
|
457 | 457 | } |
458 | 458 | |
459 | 459 | /** |
@@ -468,9 +468,9 @@ discard block |
||
468 | 468 | * @param int $status Optional. Status code. |
469 | 469 | */ |
470 | 470 | function gd_die( $message = '', $title = '', $status = 400 ) { |
471 | - add_filter( 'wp_die_ajax_handler', '_gd_die_handler', 10, 3 ); |
|
472 | - add_filter( 'wp_die_handler', '_gd_die_handler', 10, 3 ); |
|
473 | - wp_die( $message, $title, array( 'response' => $status )); |
|
471 | + add_filter( 'wp_die_ajax_handler', '_gd_die_handler', 10, 3 ); |
|
472 | + add_filter( 'wp_die_handler', '_gd_die_handler', 10, 3 ); |
|
473 | + wp_die( $message, $title, array( 'response' => $status )); |
|
474 | 474 | } |
475 | 475 | |
476 | 476 | /* |
@@ -13,11 +13,11 @@ discard block |
||
13 | 13 | * @since 1.4.6 |
14 | 14 | * @return int|null Return the page ID if present or null if not. |
15 | 15 | */ |
16 | -function geodir_add_listing_page_id(){ |
|
16 | +function geodir_add_listing_page_id() { |
|
17 | 17 | $gd_page_id = get_option('geodir_add_listing_page'); |
18 | 18 | |
19 | 19 | if (function_exists('icl_object_id')) { |
20 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
20 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | return $gd_page_id; |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | * @since 1.4.6 |
31 | 31 | * @return int|null Return the page ID if present or null if not. |
32 | 32 | */ |
33 | -function geodir_preview_page_id(){ |
|
33 | +function geodir_preview_page_id() { |
|
34 | 34 | $gd_page_id = get_option('geodir_preview_page'); |
35 | 35 | |
36 | 36 | if (function_exists('icl_object_id')) { |
37 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
37 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | return $gd_page_id; |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | * @since 1.4.6 |
48 | 48 | * @return int|null Return the page ID if present or null if not. |
49 | 49 | */ |
50 | -function geodir_success_page_id(){ |
|
50 | +function geodir_success_page_id() { |
|
51 | 51 | $gd_page_id = get_option('geodir_success_page'); |
52 | 52 | |
53 | 53 | if (function_exists('icl_object_id')) { |
54 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
54 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | return $gd_page_id; |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | * @since 1.4.6 |
65 | 65 | * @return int|null Return the page ID if present or null if not. |
66 | 66 | */ |
67 | -function geodir_location_page_id(){ |
|
67 | +function geodir_location_page_id() { |
|
68 | 68 | $gd_page_id = get_option('geodir_location_page'); |
69 | 69 | |
70 | 70 | if (function_exists('icl_object_id')) { |
71 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
71 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | return $gd_page_id; |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | * @since 1.5.4 |
82 | 82 | * @return int|null Return the page ID if present or null if not. |
83 | 83 | */ |
84 | -function geodir_home_page_id(){ |
|
84 | +function geodir_home_page_id() { |
|
85 | 85 | $gd_page_id = get_option('geodir_home_page'); |
86 | 86 | |
87 | 87 | if (function_exists('icl_object_id')) { |
88 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
88 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | return $gd_page_id; |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | * @since 1.5.3 |
99 | 99 | * @return int|null Return the page ID if present or null if not. |
100 | 100 | */ |
101 | -function geodir_info_page_id(){ |
|
101 | +function geodir_info_page_id() { |
|
102 | 102 | $gd_page_id = get_option('geodir_info_page'); |
103 | 103 | |
104 | 104 | if (function_exists('icl_object_id')) { |
105 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
105 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | return $gd_page_id; |
@@ -115,11 +115,11 @@ discard block |
||
115 | 115 | * @since 1.5.3 |
116 | 116 | * @return int|null Return the page ID if present or null if not. |
117 | 117 | */ |
118 | -function geodir_login_page_id(){ |
|
118 | +function geodir_login_page_id() { |
|
119 | 119 | $gd_page_id = get_option('geodir_login_page'); |
120 | 120 | |
121 | 121 | if (function_exists('icl_object_id')) { |
122 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
122 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | return $gd_page_id; |
@@ -133,11 +133,11 @@ discard block |
||
133 | 133 | * @since 1.5.3 |
134 | 134 | * @return int|null Return the page ID if present or null if not. |
135 | 135 | */ |
136 | -function geodir_login_url($args=array()){ |
|
136 | +function geodir_login_url($args = array()) { |
|
137 | 137 | $gd_page_id = get_option('geodir_login_page'); |
138 | 138 | |
139 | 139 | if (function_exists('icl_object_id')) { |
140 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
140 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | if (function_exists('geodir_location_geo_home_link')) { |
@@ -148,17 +148,17 @@ discard block |
||
148 | 148 | add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
149 | 149 | } |
150 | 150 | |
151 | - if($gd_page_id){ |
|
151 | + if ($gd_page_id) { |
|
152 | 152 | $post = get_post($gd_page_id); |
153 | 153 | $slug = $post->post_name; |
154 | 154 | //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors |
155 | 155 | $login_url = trailingslashit($home_url)."$slug/"; |
156 | - }else{ |
|
156 | + } else { |
|
157 | 157 | $login_url = trailingslashit($home_url)."?geodir_signup=true"; |
158 | 158 | } |
159 | 159 | |
160 | - if($args){ |
|
161 | - $login_url = add_query_arg($args,$login_url ); |
|
160 | + if ($args) { |
|
161 | + $login_url = add_query_arg($args, $login_url); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * @param array $args The array of query args used. |
173 | 173 | * @param int $gd_page_id The page id of the GD login page. |
174 | 174 | */ |
175 | - return apply_filters('geodir_login_url',$login_url,$args,$gd_page_id); |
|
175 | + return apply_filters('geodir_login_url', $login_url, $args, $gd_page_id); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | /** |
@@ -182,11 +182,11 @@ discard block |
||
182 | 182 | * @since 1.5.4 |
183 | 183 | * @return string Info page url. |
184 | 184 | */ |
185 | -function geodir_info_url($args=array()){ |
|
185 | +function geodir_info_url($args = array()) { |
|
186 | 186 | $gd_page_id = get_option('geodir_info_page'); |
187 | 187 | |
188 | 188 | if (function_exists('icl_object_id')) { |
189 | - $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
189 | + $gd_page_id = icl_object_id($gd_page_id, 'page', true); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | if (function_exists('geodir_location_geo_home_link')) { |
@@ -197,17 +197,17 @@ discard block |
||
197 | 197 | add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2); |
198 | 198 | } |
199 | 199 | |
200 | - if($gd_page_id){ |
|
200 | + if ($gd_page_id) { |
|
201 | 201 | $post = get_post($gd_page_id); |
202 | 202 | $slug = $post->post_name; |
203 | 203 | //$login_url = get_permalink($gd_page_id );// get_permalink can only be user after theme-Setup hook, any earlier and it errors |
204 | 204 | $info_url = trailingslashit($home_url)."$slug/"; |
205 | - }else{ |
|
205 | + } else { |
|
206 | 206 | $info_url = trailingslashit($home_url); |
207 | 207 | } |
208 | 208 | |
209 | - if($args){ |
|
210 | - $info_url = add_query_arg($args,$info_url ); |
|
209 | + if ($args) { |
|
210 | + $info_url = add_query_arg($args, $info_url); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | return $info_url; |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | * @param string $charset Character set to use for conversion. |
226 | 226 | * @return string Returns converted string. |
227 | 227 | */ |
228 | -function geodir_ucwords($string, $charset='UTF-8') { |
|
228 | +function geodir_ucwords($string, $charset = 'UTF-8') { |
|
229 | 229 | if (function_exists('mb_convert_case')) { |
230 | 230 | return mb_convert_case($string, MB_CASE_TITLE, $charset); |
231 | 231 | } else { |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * @param string $charset Character set to use for conversion. |
246 | 246 | * @return string Returns converted string. |
247 | 247 | */ |
248 | -function geodir_strtolower($string, $charset='UTF-8') { |
|
248 | +function geodir_strtolower($string, $charset = 'UTF-8') { |
|
249 | 249 | if (function_exists('mb_convert_case')) { |
250 | 250 | return mb_convert_case($string, MB_CASE_LOWER, $charset); |
251 | 251 | } else { |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | * @param string $charset Character set to use for conversion. |
266 | 266 | * @return string Returns converted string. |
267 | 267 | */ |
268 | -function geodir_strtoupper($string, $charset='UTF-8') { |
|
268 | +function geodir_strtoupper($string, $charset = 'UTF-8') { |
|
269 | 269 | if (function_exists('mb_convert_case')) { |
270 | 270 | return mb_convert_case($string, MB_CASE_UPPER, $charset); |
271 | 271 | } else { |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | |
297 | 297 | $url = trim($parts[0]); |
298 | 298 | if ($formatted && $url != '') { |
299 | - $url = str_replace( ' ', '%20', $url ); |
|
299 | + $url = str_replace(' ', '%20', $url); |
|
300 | 300 | $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url); |
301 | 301 | |
302 | 302 | if (0 !== stripos($url, 'mailto:')) { |
@@ -306,8 +306,8 @@ discard block |
||
306 | 306 | |
307 | 307 | $url = str_replace(';//', '://', $url); |
308 | 308 | |
309 | - if (strpos($url, ':') === false && ! in_array($url[0], array('/', '#', '?')) && !preg_match('/^[a-z0-9-]+?\.php/i', $url)) { |
|
310 | - $url = 'http://' . $url; |
|
309 | + if (strpos($url, ':') === false && !in_array($url[0], array('/', '#', '?')) && !preg_match('/^[a-z0-9-]+?\.php/i', $url)) { |
|
310 | + $url = 'http://'.$url; |
|
311 | 311 | } |
312 | 312 | |
313 | 313 | $url = wp_kses_normalize_entities($url); |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | * @package GeoDirectory |
450 | 450 | */ |
451 | 451 | function _gd_die_handler() { |
452 | - if ( defined( 'GD_TESTING_MODE' ) ) { |
|
452 | + if (defined('GD_TESTING_MODE')) { |
|
453 | 453 | return '_gd_die_handler'; |
454 | 454 | } else { |
455 | 455 | die(); |
@@ -467,10 +467,10 @@ discard block |
||
467 | 467 | * @param string $title Optional. Error title. |
468 | 468 | * @param int $status Optional. Status code. |
469 | 469 | */ |
470 | -function gd_die( $message = '', $title = '', $status = 400 ) { |
|
471 | - add_filter( 'wp_die_ajax_handler', '_gd_die_handler', 10, 3 ); |
|
472 | - add_filter( 'wp_die_handler', '_gd_die_handler', 10, 3 ); |
|
473 | - wp_die( $message, $title, array( 'response' => $status )); |
|
470 | +function gd_die($message = '', $title = '', $status = 400) { |
|
471 | + add_filter('wp_die_ajax_handler', '_gd_die_handler', 10, 3); |
|
472 | + add_filter('wp_die_handler', '_gd_die_handler', 10, 3); |
|
473 | + wp_die($message, $title, array('response' => $status)); |
|
474 | 474 | } |
475 | 475 | |
476 | 476 | /* |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | * @param string $php_format The PHP date format. |
481 | 481 | * @return string The jQuery format date string. |
482 | 482 | */ |
483 | -function geodir_date_format_php_to_jqueryui( $php_format ) { |
|
483 | +function geodir_date_format_php_to_jqueryui($php_format) { |
|
484 | 484 | $symbols = array( |
485 | 485 | // Day |
486 | 486 | 'd' => 'dd', |
@@ -520,27 +520,27 @@ discard block |
||
520 | 520 | $jqueryui_format = ""; |
521 | 521 | $escaping = false; |
522 | 522 | |
523 | - for ( $i = 0; $i < strlen( $php_format ); $i++ ) { |
|
523 | + for ($i = 0; $i < strlen($php_format); $i++) { |
|
524 | 524 | $char = $php_format[$i]; |
525 | 525 | |
526 | 526 | // PHP date format escaping character |
527 | - if ( $char === '\\' ) { |
|
527 | + if ($char === '\\') { |
|
528 | 528 | $i++; |
529 | 529 | |
530 | - if ( $escaping ) { |
|
530 | + if ($escaping) { |
|
531 | 531 | $jqueryui_format .= $php_format[$i]; |
532 | 532 | } else { |
533 | - $jqueryui_format .= '\'' . $php_format[$i]; |
|
533 | + $jqueryui_format .= '\''.$php_format[$i]; |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | $escaping = true; |
537 | 537 | } else { |
538 | - if ( $escaping ) { |
|
538 | + if ($escaping) { |
|
539 | 539 | $jqueryui_format .= "'"; |
540 | 540 | $escaping = false; |
541 | 541 | } |
542 | 542 | |
543 | - if ( isset( $symbols[$char] ) ) { |
|
543 | + if (isset($symbols[$char])) { |
|
544 | 544 | $jqueryui_format .= $symbols[$char]; |
545 | 545 | } else { |
546 | 546 | $jqueryui_format .= $char; |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | * @return string The untranslated date string. |
560 | 560 | * @since 1.6.5 |
561 | 561 | */ |
562 | -function geodir_maybe_untranslate_date($date){ |
|
562 | +function geodir_maybe_untranslate_date($date) { |
|
563 | 563 | $english_long_months = array( |
564 | 564 | 'January', |
565 | 565 | 'February', |
@@ -575,7 +575,7 @@ discard block |
||
575 | 575 | 'December', |
576 | 576 | ); |
577 | 577 | |
578 | - $non_english_long_months = array( |
|
578 | + $non_english_long_months = array( |
|
579 | 579 | __('January'), |
580 | 580 | __('February'), |
581 | 581 | __('March'), |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | __('November'), |
590 | 590 | __('December'), |
591 | 591 | ); |
592 | - $date = str_replace($non_english_long_months,$english_long_months,$date); |
|
592 | + $date = str_replace($non_english_long_months, $english_long_months, $date); |
|
593 | 593 | |
594 | 594 | |
595 | 595 | $english_short_months = array( |
@@ -608,21 +608,21 @@ discard block |
||
608 | 608 | ); |
609 | 609 | |
610 | 610 | $non_english_short_months = array( |
611 | - ' '._x( 'Jan', 'January abbreviation' ).' ', |
|
612 | - ' '._x( 'Feb', 'February abbreviation' ).' ', |
|
613 | - ' '._x( 'Mar', 'March abbreviation' ).' ', |
|
614 | - ' '._x( 'Apr', 'April abbreviation' ).' ', |
|
615 | - ' '._x( 'May', 'May abbreviation' ).' ', |
|
616 | - ' '._x( 'Jun', 'June abbreviation' ).' ', |
|
617 | - ' '._x( 'Jul', 'July abbreviation' ).' ', |
|
618 | - ' '._x( 'Aug', 'August abbreviation' ).' ', |
|
619 | - ' '._x( 'Sep', 'September abbreviation' ).' ', |
|
620 | - ' '._x( 'Oct', 'October abbreviation' ).' ', |
|
621 | - ' '._x( 'Nov', 'November abbreviation' ).' ', |
|
622 | - ' '._x( 'Dec', 'December abbreviation' ).' ', |
|
611 | + ' '._x('Jan', 'January abbreviation').' ', |
|
612 | + ' '._x('Feb', 'February abbreviation').' ', |
|
613 | + ' '._x('Mar', 'March abbreviation').' ', |
|
614 | + ' '._x('Apr', 'April abbreviation').' ', |
|
615 | + ' '._x('May', 'May abbreviation').' ', |
|
616 | + ' '._x('Jun', 'June abbreviation').' ', |
|
617 | + ' '._x('Jul', 'July abbreviation').' ', |
|
618 | + ' '._x('Aug', 'August abbreviation').' ', |
|
619 | + ' '._x('Sep', 'September abbreviation').' ', |
|
620 | + ' '._x('Oct', 'October abbreviation').' ', |
|
621 | + ' '._x('Nov', 'November abbreviation').' ', |
|
622 | + ' '._x('Dec', 'December abbreviation').' ', |
|
623 | 623 | ); |
624 | 624 | |
625 | - $date = str_replace($non_english_short_months,$english_short_months,$date); |
|
625 | + $date = str_replace($non_english_short_months, $english_short_months, $date); |
|
626 | 626 | |
627 | 627 | |
628 | 628 | return $date; |