@@ -13,8 +13,8 @@ |
||
| 13 | 13 | * If user is not signed in, redirect home. |
| 14 | 14 | */ |
| 15 | 15 | if (get_current_user_id()) { |
| 16 | - wp_redirect(home_url(), 302); |
|
| 17 | - exit; |
|
| 16 | + wp_redirect(home_url(), 302); |
|
| 17 | + exit; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | // call header |
@@ -33,12 +33,12 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | ###### SIDEBAR ON LEFT ###### |
| 35 | 35 | if (get_option('geodir_detail_sidebar_left_section')) {
|
| 36 | - /** |
|
| 37 | - * Adds the details page sidebar to the details template page. |
|
| 38 | - * |
|
| 39 | - * @since 1.1.0 |
|
| 40 | - */ |
|
| 41 | - do_action('geodir_detail_sidebar');
|
|
| 36 | + /** |
|
| 37 | + * Adds the details page sidebar to the details template page. |
|
| 38 | + * |
|
| 39 | + * @since 1.1.0 |
|
| 40 | + */ |
|
| 41 | + do_action('geodir_detail_sidebar');
|
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | ###### MAIN CONTENT WRAPPERS OPEN ###### |
@@ -63,26 +63,26 @@ discard block |
||
| 63 | 63 | ###### MAIN CONTENT ###### |
| 64 | 64 | // this call the main page content |
| 65 | 65 | if (have_posts() && !$preview) {
|
| 66 | - the_post(); |
|
| 67 | - global $post, $post_images; |
|
| 68 | - /** |
|
| 69 | - * Calls the details page main content on the details template page. |
|
| 70 | - * |
|
| 71 | - * @since 1.1.0 |
|
| 72 | - * @param object $post The current post object. |
|
| 73 | - */ |
|
| 74 | - do_action('geodir_details_main_content', $post);
|
|
| 66 | + the_post(); |
|
| 67 | + global $post, $post_images; |
|
| 68 | + /** |
|
| 69 | + * Calls the details page main content on the details template page. |
|
| 70 | + * |
|
| 71 | + * @since 1.1.0 |
|
| 72 | + * @param object $post The current post object. |
|
| 73 | + */ |
|
| 74 | + do_action('geodir_details_main_content', $post);
|
|
| 75 | 75 | } elseif ($preview) {
|
| 76 | - /** |
|
| 77 | - * Called on the details page if the page is being previewed. |
|
| 78 | - * |
|
| 79 | - * This sets the value of `$post` to the preview values before the main content is called. |
|
| 80 | - * |
|
| 81 | - * @since 1.1.0 |
|
| 82 | - */ |
|
| 83 | - do_action('geodir_action_geodir_set_preview_post'); // set the $post to the preview values
|
|
| 84 | - /** This action is documented in geodirectory-templates/listing-detail.php */ |
|
| 85 | - do_action('geodir_details_main_content', $post);
|
|
| 76 | + /** |
|
| 77 | + * Called on the details page if the page is being previewed. |
|
| 78 | + * |
|
| 79 | + * This sets the value of `$post` to the preview values before the main content is called. |
|
| 80 | + * |
|
| 81 | + * @since 1.1.0 |
|
| 82 | + */ |
|
| 83 | + do_action('geodir_action_geodir_set_preview_post'); // set the $post to the preview values
|
|
| 84 | + /** This action is documented in geodirectory-templates/listing-detail.php */ |
|
| 85 | + do_action('geodir_details_main_content', $post);
|
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
@@ -104,8 +104,8 @@ discard block |
||
| 104 | 104 | |
| 105 | 105 | ###### SIDEBAR ON RIGHT ###### |
| 106 | 106 | if (!get_option('geodir_detail_sidebar_left_section')) {
|
| 107 | - /** This action is documented in geodirectory-templates/listing-detail.php */ |
|
| 108 | - do_action('geodir_detail_sidebar');
|
|
| 107 | + /** This action is documented in geodirectory-templates/listing-detail.php */ |
|
| 108 | + do_action('geodir_detail_sidebar');
|
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
@@ -1,13 +1,13 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Template for the success page after submitting a listing |
|
| 4 | - * |
|
| 5 | - * You can make most changes via hooks or see the link below for info on how to replace the template in your theme. |
|
| 6 | - * |
|
| 7 | - * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/ |
|
| 8 | - * @since 1.0.0 |
|
| 9 | - * @package GeoDirectory |
|
| 10 | - */ |
|
| 3 | + * Template for the success page after submitting a listing |
|
| 4 | + * |
|
| 5 | + * You can make most changes via hooks or see the link below for info on how to replace the template in your theme. |
|
| 6 | + * |
|
| 7 | + * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/ |
|
| 8 | + * @since 1.0.0 |
|
| 9 | + * @package GeoDirectory |
|
| 10 | + */ |
|
| 11 | 11 | |
| 12 | 12 | // call header |
| 13 | 13 | get_header(); |
@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Template for the success page after submitting a listing |
|
| 4 | - * |
|
| 5 | - * You can make most changes via hooks or see the link below for info on how to replace the template in your theme. |
|
| 6 | - * |
|
| 7 | - * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/ |
|
| 8 | - * @since 1.0.0 |
|
| 9 | - * @package GeoDirectory |
|
| 10 | - * @deprecated 1.4.2 listing-success.php |
|
| 11 | - */ |
|
| 3 | + * Template for the success page after submitting a listing |
|
| 4 | + * |
|
| 5 | + * You can make most changes via hooks or see the link below for info on how to replace the template in your theme. |
|
| 6 | + * |
|
| 7 | + * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/ |
|
| 8 | + * @since 1.0.0 |
|
| 9 | + * @package GeoDirectory |
|
| 10 | + * @deprecated 1.4.2 listing-success.php |
|
| 11 | + */ |
|
| 12 | 12 | get_header(); |
| 13 | 13 | |
| 14 | 14 | /** |
@@ -1,21 +1,21 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Template for the register for box on the register/signin page |
|
| 4 | - * |
|
| 5 | - * You can make most changes via hooks or see the link below for info on how to replace the template in your theme. |
|
| 6 | - * |
|
| 7 | - * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/ |
|
| 8 | - * @since 1.0.0 |
|
| 9 | - * @package GeoDirectory |
|
| 10 | - */ |
|
| 3 | + * Template for the register for box on the register/signin page |
|
| 4 | + * |
|
| 5 | + * You can make most changes via hooks or see the link below for info on how to replace the template in your theme. |
|
| 6 | + * |
|
| 7 | + * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/ |
|
| 8 | + * @since 1.0.0 |
|
| 9 | + * @package GeoDirectory |
|
| 10 | + */ |
|
| 11 | 11 | if (isset($_GET['redirect_to']) && $_GET['redirect_to'] != '') {
|
| 12 | - $redirect_to = $_GET['redirect_to']; |
|
| 12 | + $redirect_to = $_GET['redirect_to']; |
|
| 13 | 13 | } else {
|
| 14 | - //echo $_SERVER['HTTP_HOST'] ; |
|
| 15 | - $redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; |
|
| 16 | - if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
|
|
| 17 | - $redirect_to = home_url(); |
|
| 18 | - } |
|
| 14 | + //echo $_SERVER['HTTP_HOST'] ; |
|
| 15 | + $redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; |
|
| 16 | + if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
|
|
| 17 | + $redirect_to = home_url(); |
|
| 18 | + } |
|
| 19 | 19 | } |
| 20 | 20 | ?> |
| 21 | 21 | <div id="sign_up"> |
@@ -26,28 +26,28 @@ discard block |
||
| 26 | 26 | <h4> |
| 27 | 27 | <?php |
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * Filter the `REGISTRATION_NOW_TEXT` title text on the register form template. |
|
| 31 | - * |
|
| 32 | - * @since 1.0.0 |
|
| 33 | - */ |
|
| 34 | - echo apply_filters('geodir_registration_page_title', REGISTRATION_NOW_TEXT);
|
|
| 29 | + /** |
|
| 30 | + * Filter the `REGISTRATION_NOW_TEXT` title text on the register form template. |
|
| 31 | + * |
|
| 32 | + * @since 1.0.0 |
|
| 33 | + */ |
|
| 34 | + echo apply_filters('geodir_registration_page_title', REGISTRATION_NOW_TEXT);
|
|
| 35 | 35 | |
| 36 | - ?> |
|
| 36 | + ?> |
|
| 37 | 37 | </h4> |
| 38 | 38 | <?php |
| 39 | - global $geodir_signup_error; |
|
| 40 | - if ($geodir_signup_error != '') {
|
|
| 41 | - echo '<p class="error_msg">' . $geodir_signup_error . '</p>'; |
|
| 42 | - unset($geodir_signup_error); |
|
| 43 | - } else {
|
|
| 44 | - if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) {
|
|
| 45 | - echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>'; |
|
| 46 | - } else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') {
|
|
| 47 | - echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>'; |
|
| 48 | - } |
|
| 49 | - } |
|
| 50 | - ?> |
|
| 39 | + global $geodir_signup_error; |
|
| 40 | + if ($geodir_signup_error != '') {
|
|
| 41 | + echo '<p class="error_msg">' . $geodir_signup_error . '</p>'; |
|
| 42 | + unset($geodir_signup_error); |
|
| 43 | + } else {
|
|
| 44 | + if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) {
|
|
| 45 | + echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>'; |
|
| 46 | + } else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') {
|
|
| 47 | + echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>'; |
|
| 48 | + } |
|
| 49 | + } |
|
| 50 | + ?> |
|
| 51 | 51 | |
| 52 | 52 | <form name="cus_registerform" id="cus_registerform" |
| 53 | 53 | action="<?php echo htmlspecialchars(geodir_curPageURL()); ?>" method="post"> |
@@ -57,10 +57,10 @@ discard block |
||
| 57 | 57 | <div class="form_row clearfix"> |
| 58 | 58 | <input placeholder='<?php echo EMAIL_TEXT; ?>' type="text" name="user_email" id="user_email" |
| 59 | 59 | class="textfield" value="<?php global $user_email; |
| 60 | - if (!isset($user_email)) {
|
|
| 61 | - $user_email = ''; |
|
| 62 | - } |
|
| 63 | - echo esc_attr(stripslashes($user_email)); ?>" size="25"/> |
|
| 60 | + if (!isset($user_email)) {
|
|
| 61 | + $user_email = ''; |
|
| 62 | + } |
|
| 63 | + echo esc_attr(stripslashes($user_email)); ?>" size="25"/> |
|
| 64 | 64 | |
| 65 | 65 | <?php if (!get_option('geodir_allow_cpass')) { ?>
|
| 66 | 66 | <div id="reg_passmail"> |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | <div class="form_row clearfix"> |
| 75 | 75 | <input placeholder='<?php echo FIRST_NAME_TEXT; ?>' type="text" name="user_fname" id="user_fname" |
| 76 | 76 | class="textfield" value="<?php if (isset($user_fname)) {
|
| 77 | - echo esc_attr(stripslashes($user_fname)); |
|
| 78 | - } ?>" size="25"/> |
|
| 77 | + echo esc_attr(stripslashes($user_fname)); |
|
| 78 | + } ?>" size="25"/> |
|
| 79 | 79 | <span id="user_fnameInfo"></span> |
| 80 | 80 | </div> |
| 81 | 81 | </div> |
@@ -101,14 +101,14 @@ discard block |
||
| 101 | 101 | <?php } ?> |
| 102 | 102 | |
| 103 | 103 | <?php |
| 104 | - /** |
|
| 105 | - * Called just before the register new user button on the register form template. |
|
| 106 | - * |
|
| 107 | - * Also used by other plugins to add social connect buttons. |
|
| 108 | - * |
|
| 109 | - * @since 1.0.0 |
|
| 110 | - */ |
|
| 111 | - do_action('social_connect_form'); ?>
|
|
| 104 | + /** |
|
| 105 | + * Called just before the register new user button on the register form template. |
|
| 106 | + * |
|
| 107 | + * Also used by other plugins to add social connect buttons. |
|
| 108 | + * |
|
| 109 | + * @since 1.0.0 |
|
| 110 | + */ |
|
| 111 | + do_action('social_connect_form'); ?>
|
|
| 112 | 112 | <input type="submit" name="registernow" value="<?php echo REGISTER_NOW_TEXT; ?>" class="geodir_button"/> |
| 113 | 113 | </form> |
| 114 | 114 | </div> |
@@ -3,117 +3,117 @@ discard block |
||
| 3 | 3 | class Geodir_Features_Widget extends WP_Widget |
| 4 | 4 | { |
| 5 | 5 | |
| 6 | - /** |
|
| 7 | - * Class constructor. |
|
| 8 | - */ |
|
| 9 | - public function __construct() |
|
| 10 | - { |
|
| 11 | - $widget_ops = array( |
|
| 12 | - 'description' => __('Displays "GD Features" widget', 'geodirectory'), |
|
| 13 | - 'classname' => 'widget_gd_features', |
|
| 14 | - ); |
|
| 15 | - parent::__construct(false, $name = _x('GD > Features', 'widget name', 'geodirectory'), $widget_ops); |
|
| 16 | - |
|
| 17 | - } |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * Display the widget. |
|
| 21 | - * |
|
| 22 | - * @param array $args Widget arguments. |
|
| 23 | - * @param array $instance The widget settings, as saved by the user. |
|
| 24 | - */ |
|
| 25 | - public function widget($args, $instance) |
|
| 26 | - { |
|
| 27 | - extract($args); |
|
| 28 | - |
|
| 29 | - $title = empty($instance['title']) ? '' : apply_filters('gd_features_widget_title', __($instance['title'], 'geodirectory')); |
|
| 30 | - $icon_color = $instance['icon_color']; |
|
| 31 | - |
|
| 32 | - echo $before_widget; |
|
| 33 | - ?> |
|
| 6 | + /** |
|
| 7 | + * Class constructor. |
|
| 8 | + */ |
|
| 9 | + public function __construct() |
|
| 10 | + { |
|
| 11 | + $widget_ops = array( |
|
| 12 | + 'description' => __('Displays "GD Features" widget', 'geodirectory'), |
|
| 13 | + 'classname' => 'widget_gd_features', |
|
| 14 | + ); |
|
| 15 | + parent::__construct(false, $name = _x('GD > Features', 'widget name', 'geodirectory'), $widget_ops); |
|
| 16 | + |
|
| 17 | + } |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * Display the widget. |
|
| 21 | + * |
|
| 22 | + * @param array $args Widget arguments. |
|
| 23 | + * @param array $instance The widget settings, as saved by the user. |
|
| 24 | + */ |
|
| 25 | + public function widget($args, $instance) |
|
| 26 | + { |
|
| 27 | + extract($args); |
|
| 28 | + |
|
| 29 | + $title = empty($instance['title']) ? '' : apply_filters('gd_features_widget_title', __($instance['title'], 'geodirectory')); |
|
| 30 | + $icon_color = $instance['icon_color']; |
|
| 31 | + |
|
| 32 | + echo $before_widget; |
|
| 33 | + ?> |
|
| 34 | 34 | <?php if ($title) { |
| 35 | - echo '<div class="geodir_list_heading clearfix">'; |
|
| 36 | - echo $before_title . $title . $after_title; |
|
| 37 | - echo '</div>'; |
|
| 38 | - } ?> |
|
| 35 | + echo '<div class="geodir_list_heading clearfix">'; |
|
| 36 | + echo $before_title . $title . $after_title; |
|
| 37 | + echo '</div>'; |
|
| 38 | + } ?> |
|
| 39 | 39 | <?php |
| 40 | - echo "<ul class='gd-features'>"; |
|
| 41 | - |
|
| 42 | - $i = 1; |
|
| 43 | - while ($i < 100) { |
|
| 44 | - |
|
| 45 | - if (isset($instance['title' . $i]) || isset($instance['image' . $i]) || isset($instance['desc' . $i])) { |
|
| 46 | - echo "<li>"; |
|
| 47 | - if ($instance['title' . $i]) { |
|
| 48 | - echo "<h3 class='gd-fe-title'>" . $instance['title' . $i] . "</h3>"; |
|
| 49 | - } |
|
| 50 | - if ($instance['image' . $i]) { |
|
| 51 | - echo "<div class='gd-fe-image'>" . gd_features_parse_image($instance['image' . $i], $icon_color) . "</div>"; |
|
| 52 | - } |
|
| 53 | - if ($instance['desc' . $i]) { |
|
| 54 | - echo "<div class='gd-fe-desc'>" . gd_features_parse_desc($instance['desc' . $i]) . "</div>"; |
|
| 55 | - } |
|
| 56 | - echo "</li>"; |
|
| 57 | - } else { |
|
| 58 | - break; |
|
| 59 | - } |
|
| 60 | - |
|
| 61 | - $i++; |
|
| 62 | - } |
|
| 63 | - |
|
| 64 | - echo "</ul>"; |
|
| 65 | - ?> |
|
| 40 | + echo "<ul class='gd-features'>"; |
|
| 41 | + |
|
| 42 | + $i = 1; |
|
| 43 | + while ($i < 100) { |
|
| 44 | + |
|
| 45 | + if (isset($instance['title' . $i]) || isset($instance['image' . $i]) || isset($instance['desc' . $i])) { |
|
| 46 | + echo "<li>"; |
|
| 47 | + if ($instance['title' . $i]) { |
|
| 48 | + echo "<h3 class='gd-fe-title'>" . $instance['title' . $i] . "</h3>"; |
|
| 49 | + } |
|
| 50 | + if ($instance['image' . $i]) { |
|
| 51 | + echo "<div class='gd-fe-image'>" . gd_features_parse_image($instance['image' . $i], $icon_color) . "</div>"; |
|
| 52 | + } |
|
| 53 | + if ($instance['desc' . $i]) { |
|
| 54 | + echo "<div class='gd-fe-desc'>" . gd_features_parse_desc($instance['desc' . $i]) . "</div>"; |
|
| 55 | + } |
|
| 56 | + echo "</li>"; |
|
| 57 | + } else { |
|
| 58 | + break; |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + $i++; |
|
| 62 | + } |
|
| 63 | + |
|
| 64 | + echo "</ul>"; |
|
| 65 | + ?> |
|
| 66 | 66 | <?php echo $after_widget; ?> |
| 67 | 67 | <?php |
| 68 | - } |
|
| 69 | - |
|
| 70 | - public function update($new_instance, $old_instance) |
|
| 71 | - { |
|
| 72 | - //save the widget |
|
| 73 | - $instance = $old_instance; |
|
| 74 | - |
|
| 75 | - $instance['title'] = strip_tags($new_instance['title']); |
|
| 76 | - $instance['icon_color'] = strip_tags($new_instance['icon_color']); |
|
| 77 | - |
|
| 78 | - $i = 1; |
|
| 79 | - while ($i < 100) { |
|
| 80 | - |
|
| 81 | - if (isset($new_instance['title' . $i]) || isset($new_instance['image' . $i]) || isset($new_instance['desc' . $i])) { |
|
| 82 | - if ($new_instance['title' . $i]) { |
|
| 83 | - $instance['title' . $i] = $new_instance['title' . $i]; |
|
| 84 | - } |
|
| 85 | - if ($new_instance['image' . $i]) { |
|
| 86 | - $instance['image' . $i] = $new_instance['image' . $i]; |
|
| 87 | - } |
|
| 88 | - if ($new_instance['desc' . $i]) { |
|
| 89 | - $instance['desc' . $i] = $new_instance['desc' . $i]; |
|
| 90 | - } |
|
| 91 | - } else { |
|
| 92 | - break; |
|
| 93 | - } |
|
| 94 | - |
|
| 95 | - $i++; |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - return $instance; |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - public function form($instance) |
|
| 102 | - { |
|
| 103 | - //widgetform in backend |
|
| 104 | - $instance = wp_parse_args((array)$instance, array( |
|
| 105 | - 'title' => '', |
|
| 106 | - 'icon_color' => '#757575', |
|
| 107 | - 'title1' => '', |
|
| 108 | - 'image1' => '', |
|
| 109 | - 'desc1' => '', |
|
| 110 | - )); |
|
| 111 | - |
|
| 112 | - |
|
| 113 | - $title = strip_tags($instance['title']); |
|
| 114 | - $icon_color = strip_tags($instance['icon_color']); |
|
| 115 | - |
|
| 116 | - ?> |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + public function update($new_instance, $old_instance) |
|
| 71 | + { |
|
| 72 | + //save the widget |
|
| 73 | + $instance = $old_instance; |
|
| 74 | + |
|
| 75 | + $instance['title'] = strip_tags($new_instance['title']); |
|
| 76 | + $instance['icon_color'] = strip_tags($new_instance['icon_color']); |
|
| 77 | + |
|
| 78 | + $i = 1; |
|
| 79 | + while ($i < 100) { |
|
| 80 | + |
|
| 81 | + if (isset($new_instance['title' . $i]) || isset($new_instance['image' . $i]) || isset($new_instance['desc' . $i])) { |
|
| 82 | + if ($new_instance['title' . $i]) { |
|
| 83 | + $instance['title' . $i] = $new_instance['title' . $i]; |
|
| 84 | + } |
|
| 85 | + if ($new_instance['image' . $i]) { |
|
| 86 | + $instance['image' . $i] = $new_instance['image' . $i]; |
|
| 87 | + } |
|
| 88 | + if ($new_instance['desc' . $i]) { |
|
| 89 | + $instance['desc' . $i] = $new_instance['desc' . $i]; |
|
| 90 | + } |
|
| 91 | + } else { |
|
| 92 | + break; |
|
| 93 | + } |
|
| 94 | + |
|
| 95 | + $i++; |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + return $instance; |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + public function form($instance) |
|
| 102 | + { |
|
| 103 | + //widgetform in backend |
|
| 104 | + $instance = wp_parse_args((array)$instance, array( |
|
| 105 | + 'title' => '', |
|
| 106 | + 'icon_color' => '#757575', |
|
| 107 | + 'title1' => '', |
|
| 108 | + 'image1' => '', |
|
| 109 | + 'desc1' => '', |
|
| 110 | + )); |
|
| 111 | + |
|
| 112 | + |
|
| 113 | + $title = strip_tags($instance['title']); |
|
| 114 | + $icon_color = strip_tags($instance['icon_color']); |
|
| 115 | + |
|
| 116 | + ?> |
|
| 117 | 117 | <p> |
| 118 | 118 | <b>Heads Up!</b> If you don't have enough content, You can keep some boxes blank. |
| 119 | 119 | </p> |
@@ -141,11 +141,11 @@ discard block |
||
| 141 | 141 | <div class="gd-fet-rep-<?php echo $this->get_field_id('xxx');?>"> |
| 142 | 142 | <?php |
| 143 | 143 | |
| 144 | - $i = 1; |
|
| 145 | - while ($i < 100) { |
|
| 144 | + $i = 1; |
|
| 145 | + while ($i < 100) { |
|
| 146 | 146 | |
| 147 | - if ((isset($instance['title' . $i]) || isset($instance['image' . $i]) || isset($instance['desc' . $i])) && ($instance['title' . $i] || $instance['image' . $i] || $instance['desc' . $i])) { |
|
| 148 | - ?> |
|
| 147 | + if ((isset($instance['title' . $i]) || isset($instance['image' . $i]) || isset($instance['desc' . $i])) && ($instance['title' . $i] || $instance['image' . $i] || $instance['desc' . $i])) { |
|
| 148 | + ?> |
|
| 149 | 149 | <div class="gdrep<?php echo $i;?>"> |
| 150 | 150 | <p class="features-title"> |
| 151 | 151 | <label |
@@ -170,14 +170,14 @@ discard block |
||
| 170 | 170 | </p> |
| 171 | 171 | </div> |
| 172 | 172 | <?php |
| 173 | - } else { |
|
| 174 | - break; |
|
| 175 | - } |
|
| 173 | + } else { |
|
| 174 | + break; |
|
| 175 | + } |
|
| 176 | 176 | |
| 177 | - $i++; |
|
| 178 | - } |
|
| 177 | + $i++; |
|
| 178 | + } |
|
| 179 | 179 | |
| 180 | - ?> |
|
| 180 | + ?> |
|
| 181 | 181 | <input class="button button-primary left" |
| 182 | 182 | onclick="gd_featured_widget_repeat('gd-fet-rep-<?php echo $this->get_field_id('xxx');?>','<?php echo $this->get_field_name('xxx');?>')" |
| 183 | 183 | type="button" value="<?php _e('Add item', 'geodirectory');?>"/> |
@@ -185,25 +185,25 @@ discard block |
||
| 185 | 185 | |
| 186 | 186 | |
| 187 | 187 | <?php |
| 188 | - } |
|
| 188 | + } |
|
| 189 | 189 | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | register_widget("Geodir_Features_Widget"); |
| 193 | 193 | function gd_features_parse_image($image, $icon_color) |
| 194 | 194 | { |
| 195 | - if (substr($image, 0, 4) === "http") { |
|
| 196 | - $image = '<img src="' . $image . '" />'; |
|
| 197 | - } elseif (substr($image, 0, 3) === "fa-") { |
|
| 198 | - if (empty($icon_color)) { |
|
| 199 | - $icon_color = '#757575'; |
|
| 200 | - } |
|
| 201 | - $image = '<i style="color:' . $icon_color . '" class="fa ' . $image . '"></i>'; |
|
| 202 | - } |
|
| 203 | - return $image; |
|
| 195 | + if (substr($image, 0, 4) === "http") { |
|
| 196 | + $image = '<img src="' . $image . '" />'; |
|
| 197 | + } elseif (substr($image, 0, 3) === "fa-") { |
|
| 198 | + if (empty($icon_color)) { |
|
| 199 | + $icon_color = '#757575'; |
|
| 200 | + } |
|
| 201 | + $image = '<i style="color:' . $icon_color . '" class="fa ' . $image . '"></i>'; |
|
| 202 | + } |
|
| 203 | + return $image; |
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | function gd_features_parse_desc($desc) |
| 207 | 207 | { |
| 208 | - return $desc; |
|
| 208 | + return $desc; |
|
| 209 | 209 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | public function form($instance) |
| 102 | 102 | { |
| 103 | 103 | //widgetform in backend |
| 104 | - $instance = wp_parse_args((array)$instance, array( |
|
| 104 | + $instance = wp_parse_args((array) $instance, array( |
|
| 105 | 105 | 'title' => '', |
| 106 | 106 | 'icon_color' => '#757575', |
| 107 | 107 | 'title1' => '', |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | </p> |
| 139 | 139 | |
| 140 | 140 | |
| 141 | - <div class="gd-fet-rep-<?php echo $this->get_field_id('xxx');?>"> |
|
| 141 | + <div class="gd-fet-rep-<?php echo $this->get_field_id('xxx'); ?>"> |
|
| 142 | 142 | <?php |
| 143 | 143 | |
| 144 | 144 | $i = 1; |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | if ((isset($instance['title' . $i]) || isset($instance['image' . $i]) || isset($instance['desc' . $i])) && ($instance['title' . $i] || $instance['image' . $i] || $instance['desc' . $i])) { |
| 148 | 148 | ?> |
| 149 | - <div class="gdrep<?php echo $i;?>"> |
|
| 149 | + <div class="gdrep<?php echo $i; ?>"> |
|
| 150 | 150 | <p class="features-title"> |
| 151 | 151 | <label |
| 152 | 152 | data-gdrep-title-num="1"><?php printf(__('Title %d:', 'geodirectory'), $i); ?></label> |
@@ -179,8 +179,8 @@ discard block |
||
| 179 | 179 | |
| 180 | 180 | ?> |
| 181 | 181 | <input class="button button-primary left" |
| 182 | - onclick="gd_featured_widget_repeat('gd-fet-rep-<?php echo $this->get_field_id('xxx');?>','<?php echo $this->get_field_name('xxx');?>')" |
|
| 183 | - type="button" value="<?php _e('Add item', 'geodirectory');?>"/> |
|
| 182 | + onclick="gd_featured_widget_repeat('gd-fet-rep-<?php echo $this->get_field_id('xxx'); ?>','<?php echo $this->get_field_name('xxx'); ?>')" |
|
| 183 | + type="button" value="<?php _e('Add item', 'geodirectory'); ?>"/> |
|
| 184 | 184 | </div> |
| 185 | 185 | |
| 186 | 186 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | public function form($instance) |
| 302 | 302 | {
|
| 303 | 303 | //widgetform in backend |
| 304 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
|
|
| 304 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
|
|
| 305 | 305 | $title = strip_tags($instance['title']); |
| 306 | 306 | |
| 307 | 307 | ?> |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | ?> |
| 374 | 374 | |
| 375 | 375 | <a href="http://twitter.com/share" |
| 376 | - class="twitter-share-button"><?php _e('Tweet', 'geodirectory');?></a>
|
|
| 376 | + class="twitter-share-button"><?php _e('Tweet', 'geodirectory'); ?></a>
|
|
| 377 | 377 | |
| 378 | 378 | <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script> |
| 379 | 379 | |
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | public function form($instance) |
| 444 | 444 | {
|
| 445 | 445 | //widgetform in backend |
| 446 | - $instance = wp_parse_args((array)$instance, array('title' => ''));
|
|
| 446 | + $instance = wp_parse_args((array) $instance, array('title' => ''));
|
|
| 447 | 447 | $title = strip_tags($instance['title']); |
| 448 | 448 | ?> |
| 449 | 449 | <p>No settings for this widget</p> |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | echo 'http://feeds2.feedburner.com/' . $id; |
| 520 | 520 | } else {
|
| 521 | 521 | bloginfo('rss_url');
|
| 522 | - } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title;?> |
|
| 522 | + } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title; ?> |
|
| 523 | 523 | |
| 524 | 524 | <?php if ($text <> "") { ?>
|
| 525 | 525 | |
@@ -584,7 +584,7 @@ discard block |
||
| 584 | 584 | public function form($instance) |
| 585 | 585 | {
|
| 586 | 586 | //widgetform in backend |
| 587 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => ''));
|
|
| 587 | + $instance = wp_parse_args((array) $instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => ''));
|
|
| 588 | 588 | |
| 589 | 589 | $id = strip_tags($instance['id']); |
| 590 | 590 | |
@@ -596,19 +596,19 @@ discard block |
||
| 596 | 596 | |
| 597 | 597 | ?> |
| 598 | 598 | <p><label |
| 599 | - for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'geodirectory');?>:
|
|
| 599 | + for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'geodirectory'); ?>:
|
|
| 600 | 600 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
|
| 601 | 601 | name="<?php echo $this->get_field_name('title'); ?>" type="text"
|
| 602 | 602 | value="<?php echo esc_attr($title); ?>"/></label></p> |
| 603 | 603 | |
| 604 | 604 | <p><label |
| 605 | - for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Feedburner ID (ex :- geotheme)', 'geodirectory');?>
|
|
| 605 | + for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Feedburner ID (ex :- geotheme)', 'geodirectory'); ?>
|
|
| 606 | 606 | : <input class="widefat" id="<?php echo $this->get_field_id('id'); ?>"
|
| 607 | 607 | name="<?php echo $this->get_field_name('id'); ?>" type="text"
|
| 608 | 608 | value="<?php echo esc_attr($id); ?>"/></label></p> |
| 609 | 609 | |
| 610 | 610 | <p><label |
| 611 | - for="<?php echo $this->get_field_id('text'); ?>"><?php _e('Short Description', 'geodirectory');?>
|
|
| 611 | + for="<?php echo $this->get_field_id('text'); ?>"><?php _e('Short Description', 'geodirectory'); ?>
|
|
| 612 | 612 | <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('text'); ?>"
|
| 613 | 613 | name="<?php echo $this->get_field_name('text'); ?>"><?php echo esc_attr($text); ?></textarea></label>
|
| 614 | 614 | </p> |
@@ -704,12 +704,12 @@ discard block |
||
| 704 | 704 | public function form($instance) |
| 705 | 705 | {
|
| 706 | 706 | //widgetform in backend |
| 707 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
|
|
| 707 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
|
|
| 708 | 708 | |
| 709 | 709 | $desc1 = ($instance['desc1']); |
| 710 | 710 | ?> |
| 711 | 711 | <p><label |
| 712 | - for="<?php echo $this->get_field_id('desc1'); ?>"><?php _e('Your Advt code (ex.google adsense, etc.)', 'geodirectory');?>
|
|
| 712 | + for="<?php echo $this->get_field_id('desc1'); ?>"><?php _e('Your Advt code (ex.google adsense, etc.)', 'geodirectory'); ?>
|
|
| 713 | 713 | <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('desc1'); ?>"
|
| 714 | 714 | name="<?php echo $this->get_field_name('desc1'); ?>"><?php echo esc_attr($desc1); ?></textarea></label>
|
| 715 | 715 | </p> |
@@ -819,14 +819,14 @@ discard block |
||
| 819 | 819 | {
|
| 820 | 820 | |
| 821 | 821 | //widgetform in backend |
| 822 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'number' => ''));
|
|
| 822 | + $instance = wp_parse_args((array) $instance, array('title' => '', 'id' => '', 'number' => ''));
|
|
| 823 | 823 | $id = strip_tags($instance['id']); |
| 824 | 824 | $number = strip_tags($instance['number']); |
| 825 | 825 | ?> |
| 826 | 826 | |
| 827 | 827 | <p> |
| 828 | 828 | <label |
| 829 | - for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Flickr ID', 'geodirectory');?>
|
|
| 829 | + for="<?php echo $this->get_field_id('id'); ?>"><?php _e('Flickr ID', 'geodirectory'); ?>
|
|
| 830 | 830 | (<a href="http://www.idgettr.com">idGettr</a>): |
| 831 | 831 | <input class="widefat" id="<?php echo $this->get_field_id('id'); ?>"
|
| 832 | 832 | name="<?php echo $this->get_field_name('id'); ?>" type="text"
|
@@ -836,7 +836,7 @@ discard block |
||
| 836 | 836 | |
| 837 | 837 | <p> |
| 838 | 838 | <label |
| 839 | - for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of photos:', 'geodirectory');?>
|
|
| 839 | + for="<?php echo $this->get_field_id('number'); ?>"><?php _e('Number of photos:', 'geodirectory'); ?>
|
|
| 840 | 840 | <input class="widefat" id="<?php echo $this->get_field_id('number'); ?>"
|
| 841 | 841 | name="<?php echo $this->get_field_name('number'); ?>" type="text"
|
| 842 | 842 | value="<?php echo esc_attr($number); ?>"/> |
@@ -932,12 +932,12 @@ discard block |
||
| 932 | 932 | public function form($instance) |
| 933 | 933 | {
|
| 934 | 934 | //widgetform in backend |
| 935 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => ''));
|
|
| 935 | + $instance = wp_parse_args((array) $instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => ''));
|
|
| 936 | 936 | |
| 937 | 937 | $desc1 = ($instance['gd_tw_desc1']); |
| 938 | 938 | ?> |
| 939 | 939 | <p><label |
| 940 | - for="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"><?php _e('Your twitter code', 'geodirectory');?>
|
|
| 940 | + for="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"><?php _e('Your twitter code', 'geodirectory'); ?>
|
|
| 941 | 941 | <textarea class="widefat" rows="6" cols="20" |
| 942 | 942 | id="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"
|
| 943 | 943 | name="<?php echo $this->get_field_name('gd_tw_desc1'); ?>"><?php echo esc_attr($desc1); ?></textarea></label>
|
@@ -993,7 +993,7 @@ discard block |
||
| 993 | 993 | * @param array $args The widget arguments. |
| 994 | 994 | * @param array $instance The widget instance. |
| 995 | 995 | */ |
| 996 | - $args = apply_filters('widget_geodir_advance_search_args',$args,$instance);
|
|
| 996 | + $args = apply_filters('widget_geodir_advance_search_args', $args, $instance);
|
|
| 997 | 997 | |
| 998 | 998 | // prints the widget |
| 999 | 999 | extract($args, EXTR_SKIP); |
@@ -15,296 +15,296 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | function geodir_register_sidebar() |
| 17 | 17 | {
|
| 18 | - global $geodir_sidebars; |
|
| 19 | - |
|
| 20 | - if (function_exists('register_sidebar')) {
|
|
| 21 | - /*===========================*/ |
|
| 22 | - /* Home page sidebars start*/ |
|
| 23 | - /*===========================*/ |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * Filter the `$before_widget` widget opening HTML tag. |
|
| 27 | - * |
|
| 28 | - * @since 1.0.0 |
|
| 29 | - * @param string $var The HTML string to filter. Default = '<section id="%1$s" class="widget geodir-widget %2$s">'. |
|
| 30 | - * @see 'geodir_after_widget' |
|
| 31 | - */ |
|
| 32 | - $before_widget = apply_filters('geodir_before_widget', '<section id="%1$s" class="widget geodir-widget %2$s">');
|
|
| 33 | - /** |
|
| 34 | - * Filter the `$after_widget` widget closing HTML tag. |
|
| 35 | - * |
|
| 36 | - * @since 1.0.0 |
|
| 37 | - * @param string $var The HTML string to filter. Default = '</section>'. |
|
| 38 | - * @see 'geodir_before_widget' |
|
| 39 | - */ |
|
| 40 | - $after_widget = apply_filters('geodir_after_widget', '</section>');
|
|
| 41 | - /** |
|
| 42 | - * Filter the `$before_title` widget title opening HTML tag. |
|
| 43 | - * |
|
| 44 | - * @since 1.0.0 |
|
| 45 | - * @param string $var The HTML string to filter. Default = '<h3 class="widget-title">'. |
|
| 46 | - * @see 'geodir_after_title' |
|
| 47 | - */ |
|
| 48 | - $before_title = apply_filters('geodir_before_title', '<h3 class="widget-title">');
|
|
| 49 | - /** |
|
| 50 | - * Filter the `$after_title` widget title closing HTML tag. |
|
| 51 | - * |
|
| 52 | - * @since 1.0.0 |
|
| 53 | - * @param string $var The HTML string to filter. Default = '</h3>'. |
|
| 54 | - * @see 'geodir_before_title' |
|
| 55 | - */ |
|
| 56 | - $after_title = apply_filters('geodir_after_title', '</h3>');
|
|
| 57 | - |
|
| 58 | - if (get_option('geodir_show_home_top_section')) {
|
|
| 59 | - register_sidebars(1, array('id' => 'geodir_home_top', 'name' => __('GD Home Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 60 | - |
|
| 61 | - $geodir_sidebars[] = 'geodir_home_top'; |
|
| 62 | - } |
|
| 63 | - |
|
| 64 | - if (get_option('geodir_show_home_contant_section')) {
|
|
| 65 | - register_sidebars(1, array('id' => 'geodir_home_content', 'name' => __('GD Home Content Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 18 | + global $geodir_sidebars; |
|
| 66 | 19 | |
| 67 | - $geodir_sidebars[] = 'geodir_home_content'; |
|
| 68 | - } |
|
| 20 | + if (function_exists('register_sidebar')) {
|
|
| 21 | + /*===========================*/ |
|
| 22 | + /* Home page sidebars start*/ |
|
| 23 | + /*===========================*/ |
|
| 69 | 24 | |
| 70 | - if (get_option('geodir_show_home_right_section')) {
|
|
| 71 | - register_sidebars(1, array('id' => 'geodir_home_right', 'name' => __('GD Home Right Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 25 | + /** |
|
| 26 | + * Filter the `$before_widget` widget opening HTML tag. |
|
| 27 | + * |
|
| 28 | + * @since 1.0.0 |
|
| 29 | + * @param string $var The HTML string to filter. Default = '<section id="%1$s" class="widget geodir-widget %2$s">'. |
|
| 30 | + * @see 'geodir_after_widget' |
|
| 31 | + */ |
|
| 32 | + $before_widget = apply_filters('geodir_before_widget', '<section id="%1$s" class="widget geodir-widget %2$s">');
|
|
| 33 | + /** |
|
| 34 | + * Filter the `$after_widget` widget closing HTML tag. |
|
| 35 | + * |
|
| 36 | + * @since 1.0.0 |
|
| 37 | + * @param string $var The HTML string to filter. Default = '</section>'. |
|
| 38 | + * @see 'geodir_before_widget' |
|
| 39 | + */ |
|
| 40 | + $after_widget = apply_filters('geodir_after_widget', '</section>');
|
|
| 41 | + /** |
|
| 42 | + * Filter the `$before_title` widget title opening HTML tag. |
|
| 43 | + * |
|
| 44 | + * @since 1.0.0 |
|
| 45 | + * @param string $var The HTML string to filter. Default = '<h3 class="widget-title">'. |
|
| 46 | + * @see 'geodir_after_title' |
|
| 47 | + */ |
|
| 48 | + $before_title = apply_filters('geodir_before_title', '<h3 class="widget-title">');
|
|
| 49 | + /** |
|
| 50 | + * Filter the `$after_title` widget title closing HTML tag. |
|
| 51 | + * |
|
| 52 | + * @since 1.0.0 |
|
| 53 | + * @param string $var The HTML string to filter. Default = '</h3>'. |
|
| 54 | + * @see 'geodir_before_title' |
|
| 55 | + */ |
|
| 56 | + $after_title = apply_filters('geodir_after_title', '</h3>');
|
|
| 57 | + |
|
| 58 | + if (get_option('geodir_show_home_top_section')) {
|
|
| 59 | + register_sidebars(1, array('id' => 'geodir_home_top', 'name' => __('GD Home Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 72 | 60 | |
| 73 | - $geodir_sidebars[] = 'geodir_home_right'; |
|
| 74 | - } |
|
| 61 | + $geodir_sidebars[] = 'geodir_home_top'; |
|
| 62 | + } |
|
| 75 | 63 | |
| 76 | - if (get_option('geodir_show_home_left_section')) {
|
|
| 77 | - register_sidebars(1, array('id' => 'geodir_home_left', 'name' => __('GD Home Left Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 64 | + if (get_option('geodir_show_home_contant_section')) {
|
|
| 65 | + register_sidebars(1, array('id' => 'geodir_home_content', 'name' => __('GD Home Content Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 78 | 66 | |
| 79 | - $geodir_sidebars[] = 'geodir_home_left'; |
|
| 80 | - } |
|
| 67 | + $geodir_sidebars[] = 'geodir_home_content'; |
|
| 68 | + } |
|
| 81 | 69 | |
| 82 | - if (get_option('geodir_show_home_bottom_section')) {
|
|
| 83 | - register_sidebars(1, array('id' => 'geodir_home_bottom', 'name' => __('GD Home Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 70 | + if (get_option('geodir_show_home_right_section')) {
|
|
| 71 | + register_sidebars(1, array('id' => 'geodir_home_right', 'name' => __('GD Home Right Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 84 | 72 | |
| 85 | - $geodir_sidebars[] = 'geodir_home_bottom'; |
|
| 86 | - } |
|
| 73 | + $geodir_sidebars[] = 'geodir_home_right'; |
|
| 74 | + } |
|
| 87 | 75 | |
| 88 | - /*===========================*/ |
|
| 89 | - /* Home page sidebars end*/ |
|
| 90 | - /*===========================*/ |
|
| 76 | + if (get_option('geodir_show_home_left_section')) {
|
|
| 77 | + register_sidebars(1, array('id' => 'geodir_home_left', 'name' => __('GD Home Left Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 91 | 78 | |
| 92 | - /*===========================*/ |
|
| 93 | - /* Listing page sidebars start*/ |
|
| 94 | - /*===========================*/ |
|
| 79 | + $geodir_sidebars[] = 'geodir_home_left'; |
|
| 80 | + } |
|
| 95 | 81 | |
| 96 | - if (get_option('geodir_show_listing_top_section')) {
|
|
| 97 | - register_sidebars(1, array('id' => 'geodir_listing_top', 'name' => __('GD Listing Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 82 | + if (get_option('geodir_show_home_bottom_section')) {
|
|
| 83 | + register_sidebars(1, array('id' => 'geodir_home_bottom', 'name' => __('GD Home Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 98 | 84 | |
| 99 | - $geodir_sidebars[] = 'geodir_listing_top'; |
|
| 100 | - } |
|
| 85 | + $geodir_sidebars[] = 'geodir_home_bottom'; |
|
| 86 | + } |
|
| 101 | 87 | |
| 102 | - if (get_option('geodir_show_listing_left_section')) {
|
|
| 103 | - register_sidebars(1, array('id' => 'geodir_listing_left_sidebar', 'name' => __('GD Listing Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 88 | + /*===========================*/ |
|
| 89 | + /* Home page sidebars end*/ |
|
| 90 | + /*===========================*/ |
|
| 104 | 91 | |
| 105 | - $geodir_sidebars[] = 'geodir_listing_left_sidebar'; |
|
| 106 | - } |
|
| 92 | + /*===========================*/ |
|
| 93 | + /* Listing page sidebars start*/ |
|
| 94 | + /*===========================*/ |
|
| 107 | 95 | |
| 108 | - if (get_option('geodir_show_listing_right_section')) {
|
|
| 109 | - register_sidebars(1, array('id' => 'geodir_listing_right_sidebar', 'name' => __('GD Listing Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 96 | + if (get_option('geodir_show_listing_top_section')) {
|
|
| 97 | + register_sidebars(1, array('id' => 'geodir_listing_top', 'name' => __('GD Listing Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 110 | 98 | |
| 111 | - $geodir_sidebars[] = 'geodir_listing_right_sidebar'; |
|
| 112 | - } |
|
| 99 | + $geodir_sidebars[] = 'geodir_listing_top'; |
|
| 100 | + } |
|
| 113 | 101 | |
| 114 | - if (get_option('geodir_show_listing_bottom_section')) {
|
|
| 115 | - register_sidebars(1, array('id' => 'geodir_listing_bottom', 'name' => __('GD Listing Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 102 | + if (get_option('geodir_show_listing_left_section')) {
|
|
| 103 | + register_sidebars(1, array('id' => 'geodir_listing_left_sidebar', 'name' => __('GD Listing Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 116 | 104 | |
| 117 | - $geodir_sidebars[] = 'geodir_listing_bottom'; |
|
| 118 | - } |
|
| 105 | + $geodir_sidebars[] = 'geodir_listing_left_sidebar'; |
|
| 106 | + } |
|
| 119 | 107 | |
| 120 | - /*===========================*/ |
|
| 121 | - /* Listing page sidebars start*/ |
|
| 122 | - /*===========================*/ |
|
| 108 | + if (get_option('geodir_show_listing_right_section')) {
|
|
| 109 | + register_sidebars(1, array('id' => 'geodir_listing_right_sidebar', 'name' => __('GD Listing Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 123 | 110 | |
| 124 | - /*===========================*/ |
|
| 125 | - /* Search page sidebars start*/ |
|
| 126 | - /*===========================*/ |
|
| 111 | + $geodir_sidebars[] = 'geodir_listing_right_sidebar'; |
|
| 112 | + } |
|
| 127 | 113 | |
| 128 | - if (get_option('geodir_show_search_top_section')) {
|
|
| 129 | - register_sidebars(1, array('id' => 'geodir_search_top', 'name' => __('GD Search Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 114 | + if (get_option('geodir_show_listing_bottom_section')) {
|
|
| 115 | + register_sidebars(1, array('id' => 'geodir_listing_bottom', 'name' => __('GD Listing Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 130 | 116 | |
| 131 | - $geodir_sidebars[] = 'geodir_search_top'; |
|
| 132 | - } |
|
| 117 | + $geodir_sidebars[] = 'geodir_listing_bottom'; |
|
| 118 | + } |
|
| 133 | 119 | |
| 134 | - if (get_option('geodir_show_search_left_section')) {
|
|
| 135 | - register_sidebars(1, array('id' => 'geodir_search_left_sidebar', 'name' => __('GD Search Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 120 | + /*===========================*/ |
|
| 121 | + /* Listing page sidebars start*/ |
|
| 122 | + /*===========================*/ |
|
| 136 | 123 | |
| 137 | - $geodir_sidebars[] = 'geodir_search_left_sidebar'; |
|
| 138 | - } |
|
| 124 | + /*===========================*/ |
|
| 125 | + /* Search page sidebars start*/ |
|
| 126 | + /*===========================*/ |
|
| 139 | 127 | |
| 140 | - if (get_option('geodir_show_search_right_section')) {
|
|
| 141 | - register_sidebars(1, array('id' => 'geodir_search_right_sidebar', 'name' => __('GD Search Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 128 | + if (get_option('geodir_show_search_top_section')) {
|
|
| 129 | + register_sidebars(1, array('id' => 'geodir_search_top', 'name' => __('GD Search Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 142 | 130 | |
| 143 | - $geodir_sidebars[] = 'geodir_search_right_sidebar'; |
|
| 144 | - } |
|
| 131 | + $geodir_sidebars[] = 'geodir_search_top'; |
|
| 132 | + } |
|
| 145 | 133 | |
| 146 | - if (get_option('geodir_show_search_bottom_section')) {
|
|
| 147 | - register_sidebars(1, array('id' => 'geodir_search_bottom', 'name' => __('GD Search Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 134 | + if (get_option('geodir_show_search_left_section')) {
|
|
| 135 | + register_sidebars(1, array('id' => 'geodir_search_left_sidebar', 'name' => __('GD Search Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 148 | 136 | |
| 149 | - $geodir_sidebars[] = 'geodir_search_bottom'; |
|
| 150 | - } |
|
| 137 | + $geodir_sidebars[] = 'geodir_search_left_sidebar'; |
|
| 138 | + } |
|
| 151 | 139 | |
| 152 | - /*===========================*/ |
|
| 153 | - /* Search page sidebars end*/ |
|
| 154 | - /*===========================*/ |
|
| 140 | + if (get_option('geodir_show_search_right_section')) {
|
|
| 141 | + register_sidebars(1, array('id' => 'geodir_search_right_sidebar', 'name' => __('GD Search Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 155 | 142 | |
| 156 | - /*==================================*/ |
|
| 157 | - /* Detail/Single page sidebars start*/ |
|
| 158 | - /*==================================*/ |
|
| 159 | - if (get_option('geodir_show_detail_top_section')) {
|
|
| 160 | - register_sidebars(1, array('id' => 'geodir_detail_top', 'name' => __('GD Detail Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 143 | + $geodir_sidebars[] = 'geodir_search_right_sidebar'; |
|
| 144 | + } |
|
| 161 | 145 | |
| 162 | - $geodir_sidebars[] = 'geodir_detail_top'; |
|
| 163 | - } |
|
| 146 | + if (get_option('geodir_show_search_bottom_section')) {
|
|
| 147 | + register_sidebars(1, array('id' => 'geodir_search_bottom', 'name' => __('GD Search Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 164 | 148 | |
| 165 | - register_sidebars(1, array('id' => 'geodir_detail_sidebar', 'name' => __('GD Detail Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 149 | + $geodir_sidebars[] = 'geodir_search_bottom'; |
|
| 150 | + } |
|
| 166 | 151 | |
| 167 | - $geodir_sidebars[] = 'geodir_detail_sidebar'; |
|
| 152 | + /*===========================*/ |
|
| 153 | + /* Search page sidebars end*/ |
|
| 154 | + /*===========================*/ |
|
| 168 | 155 | |
| 169 | - if (get_option('geodir_show_detail_bottom_section')) {
|
|
| 170 | - register_sidebars(1, array('id' => 'geodir_detail_bottom', 'name' => __('GD Detail Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 156 | + /*==================================*/ |
|
| 157 | + /* Detail/Single page sidebars start*/ |
|
| 158 | + /*==================================*/ |
|
| 159 | + if (get_option('geodir_show_detail_top_section')) {
|
|
| 160 | + register_sidebars(1, array('id' => 'geodir_detail_top', 'name' => __('GD Detail Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 171 | 161 | |
| 172 | - $geodir_sidebars[] = 'geodir_detail_bottom'; |
|
| 173 | - } |
|
| 162 | + $geodir_sidebars[] = 'geodir_detail_top'; |
|
| 163 | + } |
|
| 174 | 164 | |
| 175 | - /*==================================*/ |
|
| 176 | - /* Detail/Single page sidebars end*/ |
|
| 177 | - /*==================================*/ |
|
| 165 | + register_sidebars(1, array('id' => 'geodir_detail_sidebar', 'name' => __('GD Detail Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 178 | 166 | |
| 179 | - /*==================================*/ |
|
| 180 | - /* Author page sidebars start */ |
|
| 181 | - /*==================================*/ |
|
| 167 | + $geodir_sidebars[] = 'geodir_detail_sidebar'; |
|
| 182 | 168 | |
| 183 | - if (get_option('geodir_show_author_top_section')) {
|
|
| 184 | - register_sidebars(1, array('id' => 'geodir_author_top', 'name' => __('GD Author Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 169 | + if (get_option('geodir_show_detail_bottom_section')) {
|
|
| 170 | + register_sidebars(1, array('id' => 'geodir_detail_bottom', 'name' => __('GD Detail Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 185 | 171 | |
| 186 | - $geodir_sidebars[] = 'geodir_author_top'; |
|
| 187 | - } |
|
| 172 | + $geodir_sidebars[] = 'geodir_detail_bottom'; |
|
| 173 | + } |
|
| 188 | 174 | |
| 189 | - if (get_option('geodir_show_author_left_section')) {
|
|
| 190 | - register_sidebars(1, array('id' => 'geodir_author_left_sidebar', 'name' => __('GD Author Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 175 | + /*==================================*/ |
|
| 176 | + /* Detail/Single page sidebars end*/ |
|
| 177 | + /*==================================*/ |
|
| 191 | 178 | |
| 192 | - $geodir_sidebars[] = 'geodir_author_left_sidebar'; |
|
| 193 | - } |
|
| 179 | + /*==================================*/ |
|
| 180 | + /* Author page sidebars start */ |
|
| 181 | + /*==================================*/ |
|
| 194 | 182 | |
| 195 | - if (get_option('geodir_show_author_right_section')) {
|
|
| 196 | - register_sidebars(1, array('id' => 'geodir_author_right_sidebar', 'name' => __('GD Author Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 183 | + if (get_option('geodir_show_author_top_section')) {
|
|
| 184 | + register_sidebars(1, array('id' => 'geodir_author_top', 'name' => __('GD Author Top Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 197 | 185 | |
| 198 | - $geodir_sidebars[] = 'geodir_author_right_sidebar'; |
|
| 199 | - } |
|
| 186 | + $geodir_sidebars[] = 'geodir_author_top'; |
|
| 187 | + } |
|
| 200 | 188 | |
| 201 | - if (get_option('geodir_show_author_bottom_section')) {
|
|
| 202 | - register_sidebars(1, array('id' => 'geodir_author_bottom', 'name' => __('GD Author Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 189 | + if (get_option('geodir_show_author_left_section')) {
|
|
| 190 | + register_sidebars(1, array('id' => 'geodir_author_left_sidebar', 'name' => __('GD Author Left Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 203 | 191 | |
| 204 | - $geodir_sidebars[] = 'geodir_author_bottom'; |
|
| 205 | - } |
|
| 192 | + $geodir_sidebars[] = 'geodir_author_left_sidebar'; |
|
| 193 | + } |
|
| 206 | 194 | |
| 207 | - /*==================================*/ |
|
| 208 | - /* Author page sidebars end */ |
|
| 209 | - /*==================================*/ |
|
| 195 | + if (get_option('geodir_show_author_right_section')) {
|
|
| 196 | + register_sidebars(1, array('id' => 'geodir_author_right_sidebar', 'name' => __('GD Author Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 210 | 197 | |
| 211 | - /*==================================*/ |
|
| 212 | - /* Add listing page sidebars start */ |
|
| 213 | - /*==================================*/ |
|
| 198 | + $geodir_sidebars[] = 'geodir_author_right_sidebar'; |
|
| 199 | + } |
|
| 214 | 200 | |
| 215 | - register_sidebars(1, array('id' => 'geodir_add_listing_sidebar', 'name' => __('GD Add Listing Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 201 | + if (get_option('geodir_show_author_bottom_section')) {
|
|
| 202 | + register_sidebars(1, array('id' => 'geodir_author_bottom', 'name' => __('GD Author Bottom Section', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 216 | 203 | |
| 217 | - $geodir_sidebars[] = 'geodir_add_listing_sidebar'; |
|
| 204 | + $geodir_sidebars[] = 'geodir_author_bottom'; |
|
| 205 | + } |
|
| 218 | 206 | |
| 219 | - /*==================================*/ |
|
| 220 | - /* Add listing page sidebars end */ |
|
| 221 | - /*==================================*/ |
|
| 207 | + /*==================================*/ |
|
| 208 | + /* Author page sidebars end */ |
|
| 209 | + /*==================================*/ |
|
| 222 | 210 | |
| 223 | - } |
|
| 211 | + /*==================================*/ |
|
| 212 | + /* Add listing page sidebars start */ |
|
| 213 | + /*==================================*/ |
|
| 214 | + |
|
| 215 | + register_sidebars(1, array('id' => 'geodir_add_listing_sidebar', 'name' => __('GD Add Listing Right Sidebar', 'geodirectory'), 'before_widget' => $before_widget, 'after_widget' => $after_widget, 'before_title' => $before_title, 'after_title' => $after_title));
|
|
| 216 | + |
|
| 217 | + $geodir_sidebars[] = 'geodir_add_listing_sidebar'; |
|
| 218 | + |
|
| 219 | + /*==================================*/ |
|
| 220 | + /* Add listing page sidebars end */ |
|
| 221 | + /*==================================*/ |
|
| 222 | + |
|
| 223 | + } |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | |
| 227 | 227 | if (!function_exists('register_geodir_widgets')) {
|
| 228 | - /** |
|
| 229 | - * Registers all Widgets. |
|
| 230 | - * |
|
| 231 | - * @since 1.0.0 |
|
| 232 | - * @package GeoDirectory |
|
| 233 | - */ |
|
| 234 | - function register_geodir_widgets() |
|
| 235 | - {
|
|
| 236 | - /** |
|
| 237 | - * Login Widget. |
|
| 238 | - * |
|
| 239 | - * @since 1.0.0 |
|
| 240 | - */ |
|
| 241 | - class geodir_loginwidget extends WP_Widget |
|
| 242 | - {
|
|
| 243 | - /** |
|
| 244 | - * Register the login widget with WordPress. |
|
| 245 | - * |
|
| 246 | - * @since 1.0.0 |
|
| 247 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 248 | - */ |
|
| 249 | - public function __construct() {
|
|
| 250 | - $widget_ops = array('classname' => 'geodir_loginbox', 'description' => __('Geodirectory Loginbox Widget', 'geodirectory'));
|
|
| 251 | - parent::__construct( |
|
| 252 | - 'geodir_loginbox', // Base ID |
|
| 253 | - __('GD > Loginbox', 'geodirectory'), // Name
|
|
| 254 | - $widget_ops// Args |
|
| 255 | - ); |
|
| 256 | - } |
|
| 257 | - |
|
| 258 | - /** |
|
| 259 | - * Front-end display content for login widget. |
|
| 260 | - * |
|
| 261 | - * @since 1.0.0 |
|
| 262 | - * @since 1.5.1 Declare function public. |
|
| 263 | - * |
|
| 264 | - * @param array $args Widget arguments. |
|
| 265 | - * @param array $instance Saved values from database. |
|
| 266 | - */ |
|
| 267 | - public function widget($args, $instance) |
|
| 268 | - {
|
|
| 269 | - geodir_loginwidget_output($args, $instance); |
|
| 270 | - } |
|
| 271 | - |
|
| 272 | - /** |
|
| 273 | - * Sanitize login widget form values as they are saved. |
|
| 274 | - * |
|
| 275 | - * @since 1.0.0 |
|
| 276 | - * @since 1.5.1 Declare function public. |
|
| 277 | - * |
|
| 278 | - * @param array $new_instance Values just sent to be saved. |
|
| 279 | - * @param array $old_instance Previously saved values from database. |
|
| 280 | - * |
|
| 281 | - * @return array Updated safe values to be saved. |
|
| 282 | - */ |
|
| 283 | - public function update($new_instance, $old_instance) |
|
| 284 | - {
|
|
| 285 | - //save the widget |
|
| 286 | - $instance = $old_instance; |
|
| 287 | - $instance['title'] = strip_tags($new_instance['title']); |
|
| 288 | - |
|
| 289 | - return $instance; |
|
| 290 | - } |
|
| 291 | - |
|
| 292 | - /** |
|
| 293 | - * Back-end login widget settings form. |
|
| 294 | - * |
|
| 295 | - * @since 1.0.0 |
|
| 296 | - * @since 1.5.1 Declare function public. |
|
| 297 | - * |
|
| 298 | - * @param array $instance Previously saved values from database. |
|
| 299 | - * @return string|void |
|
| 300 | - */ |
|
| 301 | - public function form($instance) |
|
| 302 | - {
|
|
| 303 | - //widgetform in backend |
|
| 304 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
|
|
| 305 | - $title = strip_tags($instance['title']); |
|
| 306 | - |
|
| 307 | - ?> |
|
| 228 | + /** |
|
| 229 | + * Registers all Widgets. |
|
| 230 | + * |
|
| 231 | + * @since 1.0.0 |
|
| 232 | + * @package GeoDirectory |
|
| 233 | + */ |
|
| 234 | + function register_geodir_widgets() |
|
| 235 | + {
|
|
| 236 | + /** |
|
| 237 | + * Login Widget. |
|
| 238 | + * |
|
| 239 | + * @since 1.0.0 |
|
| 240 | + */ |
|
| 241 | + class geodir_loginwidget extends WP_Widget |
|
| 242 | + {
|
|
| 243 | + /** |
|
| 244 | + * Register the login widget with WordPress. |
|
| 245 | + * |
|
| 246 | + * @since 1.0.0 |
|
| 247 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 248 | + */ |
|
| 249 | + public function __construct() {
|
|
| 250 | + $widget_ops = array('classname' => 'geodir_loginbox', 'description' => __('Geodirectory Loginbox Widget', 'geodirectory'));
|
|
| 251 | + parent::__construct( |
|
| 252 | + 'geodir_loginbox', // Base ID |
|
| 253 | + __('GD > Loginbox', 'geodirectory'), // Name
|
|
| 254 | + $widget_ops// Args |
|
| 255 | + ); |
|
| 256 | + } |
|
| 257 | + |
|
| 258 | + /** |
|
| 259 | + * Front-end display content for login widget. |
|
| 260 | + * |
|
| 261 | + * @since 1.0.0 |
|
| 262 | + * @since 1.5.1 Declare function public. |
|
| 263 | + * |
|
| 264 | + * @param array $args Widget arguments. |
|
| 265 | + * @param array $instance Saved values from database. |
|
| 266 | + */ |
|
| 267 | + public function widget($args, $instance) |
|
| 268 | + {
|
|
| 269 | + geodir_loginwidget_output($args, $instance); |
|
| 270 | + } |
|
| 271 | + |
|
| 272 | + /** |
|
| 273 | + * Sanitize login widget form values as they are saved. |
|
| 274 | + * |
|
| 275 | + * @since 1.0.0 |
|
| 276 | + * @since 1.5.1 Declare function public. |
|
| 277 | + * |
|
| 278 | + * @param array $new_instance Values just sent to be saved. |
|
| 279 | + * @param array $old_instance Previously saved values from database. |
|
| 280 | + * |
|
| 281 | + * @return array Updated safe values to be saved. |
|
| 282 | + */ |
|
| 283 | + public function update($new_instance, $old_instance) |
|
| 284 | + {
|
|
| 285 | + //save the widget |
|
| 286 | + $instance = $old_instance; |
|
| 287 | + $instance['title'] = strip_tags($new_instance['title']); |
|
| 288 | + |
|
| 289 | + return $instance; |
|
| 290 | + } |
|
| 291 | + |
|
| 292 | + /** |
|
| 293 | + * Back-end login widget settings form. |
|
| 294 | + * |
|
| 295 | + * @since 1.0.0 |
|
| 296 | + * @since 1.5.1 Declare function public. |
|
| 297 | + * |
|
| 298 | + * @param array $instance Previously saved values from database. |
|
| 299 | + * @return string|void |
|
| 300 | + */ |
|
| 301 | + public function form($instance) |
|
| 302 | + {
|
|
| 303 | + //widgetform in backend |
|
| 304 | + $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
|
|
| 305 | + $title = strip_tags($instance['title']); |
|
| 306 | + |
|
| 307 | + ?> |
|
| 308 | 308 | <p><label |
| 309 | 309 | for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Widget Title', 'geodirectory'); ?>
|
| 310 | 310 | : <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
|
@@ -313,64 +313,64 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | |
| 315 | 315 | <?php |
| 316 | - } |
|
| 317 | - } |
|
| 318 | - |
|
| 319 | - register_widget('geodir_loginwidget');
|
|
| 320 | - |
|
| 321 | - |
|
| 322 | - /** |
|
| 323 | - * GeoDirectory Social Like Widget. |
|
| 324 | - * |
|
| 325 | - * @since 1.0.0 |
|
| 326 | - */ |
|
| 327 | - class geodir_social_like_widget extends WP_Widget |
|
| 328 | - {
|
|
| 329 | - |
|
| 330 | - /** |
|
| 331 | - * Register the social like widget with WordPress. |
|
| 332 | - * |
|
| 333 | - * @since 1.0.0 |
|
| 334 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 335 | - */ |
|
| 336 | - public function __construct() {
|
|
| 337 | - $widget_ops = array('classname' => 'geodir_social_like_widget', 'description' => __('GD > Twitter,Facebook and Google+ buttons', 'geodirectory'));
|
|
| 338 | - parent::__construct( |
|
| 339 | - 'social_like_widget', // Base ID |
|
| 340 | - __('GD > Social Like', 'geodirectory'), // Name
|
|
| 341 | - $widget_ops// Args |
|
| 342 | - ); |
|
| 343 | - } |
|
| 344 | - |
|
| 345 | - /** |
|
| 346 | - * Front-end display content for social like widget. |
|
| 347 | - * |
|
| 348 | - * @since 1.0.0 |
|
| 349 | - * @since 1.5.1 Declare function public. |
|
| 350 | - * |
|
| 351 | - * @param array $args Widget arguments. |
|
| 352 | - * @param array $instance Saved values from database. |
|
| 353 | - */ |
|
| 354 | - public function widget($args, $instance) |
|
| 355 | - {
|
|
| 356 | - // prints the widget |
|
| 357 | - extract($args, EXTR_SKIP); |
|
| 358 | - |
|
| 359 | - /** |
|
| 360 | - * Filter the widget title text. |
|
| 361 | - * |
|
| 362 | - * @since 1.0.0 |
|
| 363 | - * @global object $current_user Current user object. |
|
| 364 | - * @param string $title The widget title text. |
|
| 365 | - */ |
|
| 366 | - $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
|
|
| 367 | - |
|
| 368 | - global $current_user, $post; |
|
| 369 | - echo $before_widget; |
|
| 370 | - ?> |
|
| 316 | + } |
|
| 317 | + } |
|
| 318 | + |
|
| 319 | + register_widget('geodir_loginwidget');
|
|
| 320 | + |
|
| 321 | + |
|
| 322 | + /** |
|
| 323 | + * GeoDirectory Social Like Widget. |
|
| 324 | + * |
|
| 325 | + * @since 1.0.0 |
|
| 326 | + */ |
|
| 327 | + class geodir_social_like_widget extends WP_Widget |
|
| 328 | + {
|
|
| 329 | + |
|
| 330 | + /** |
|
| 331 | + * Register the social like widget with WordPress. |
|
| 332 | + * |
|
| 333 | + * @since 1.0.0 |
|
| 334 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 335 | + */ |
|
| 336 | + public function __construct() {
|
|
| 337 | + $widget_ops = array('classname' => 'geodir_social_like_widget', 'description' => __('GD > Twitter,Facebook and Google+ buttons', 'geodirectory'));
|
|
| 338 | + parent::__construct( |
|
| 339 | + 'social_like_widget', // Base ID |
|
| 340 | + __('GD > Social Like', 'geodirectory'), // Name
|
|
| 341 | + $widget_ops// Args |
|
| 342 | + ); |
|
| 343 | + } |
|
| 344 | + |
|
| 345 | + /** |
|
| 346 | + * Front-end display content for social like widget. |
|
| 347 | + * |
|
| 348 | + * @since 1.0.0 |
|
| 349 | + * @since 1.5.1 Declare function public. |
|
| 350 | + * |
|
| 351 | + * @param array $args Widget arguments. |
|
| 352 | + * @param array $instance Saved values from database. |
|
| 353 | + */ |
|
| 354 | + public function widget($args, $instance) |
|
| 355 | + {
|
|
| 356 | + // prints the widget |
|
| 357 | + extract($args, EXTR_SKIP); |
|
| 358 | + |
|
| 359 | + /** |
|
| 360 | + * Filter the widget title text. |
|
| 361 | + * |
|
| 362 | + * @since 1.0.0 |
|
| 363 | + * @global object $current_user Current user object. |
|
| 364 | + * @param string $title The widget title text. |
|
| 365 | + */ |
|
| 366 | + $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']);
|
|
| 367 | + |
|
| 368 | + global $current_user, $post; |
|
| 369 | + echo $before_widget; |
|
| 370 | + ?> |
|
| 371 | 371 | |
| 372 | 372 | <?php //if ( get_option('gd_tweet_button') ) {
|
| 373 | - ?> |
|
| 373 | + ?> |
|
| 374 | 374 | |
| 375 | 375 | <a href="http://twitter.com/share" |
| 376 | 376 | class="twitter-share-button"><?php _e('Tweet', 'geodirectory');?></a>
|
@@ -378,23 +378,23 @@ discard block |
||
| 378 | 378 | <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script> |
| 379 | 379 | |
| 380 | 380 | <?php //} |
| 381 | - ?> |
|
| 381 | + ?> |
|
| 382 | 382 | |
| 383 | 383 | <?php // if ( get_option('gd_facebook_button') ) {
|
| 384 | - ?> |
|
| 384 | + ?> |
|
| 385 | 385 | |
| 386 | 386 | <iframe <?php if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) {
|
| 387 | - echo 'allowtransparency="true"'; |
|
| 388 | - }?> class="facebook" |
|
| 387 | + echo 'allowtransparency="true"'; |
|
| 388 | + }?> class="facebook" |
|
| 389 | 389 | src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode(geodir_curPageURL()); ?>&layout=button_count&show_faces=false&width=100&action=like&colorscheme=light" |
| 390 | 390 | style="border:none; overflow:hidden; width:100px; height:20px"></iframe> |
| 391 | 391 | |
| 392 | 392 | |
| 393 | 393 | <?php //} |
| 394 | - ?> |
|
| 394 | + ?> |
|
| 395 | 395 | |
| 396 | 396 | <?php //if ( get_option('gd_google_button') ) {
|
| 397 | - ?> |
|
| 397 | + ?> |
|
| 398 | 398 | <script> |
| 399 | 399 | window.___gcfg = {
|
| 400 | 400 | parsetags: 'explicit' |
@@ -408,118 +408,118 @@ discard block |
||
| 408 | 408 | "count": "true" |
| 409 | 409 | });</script> |
| 410 | 410 | <?php //} |
| 411 | - echo $after_widget; |
|
| 412 | - |
|
| 413 | - } |
|
| 414 | - |
|
| 415 | - /** |
|
| 416 | - * Sanitize social like widget form values as they are saved. |
|
| 417 | - * |
|
| 418 | - * @since 1.0.0 |
|
| 419 | - * @since 1.5.1 Declare function public. |
|
| 420 | - * |
|
| 421 | - * @param array $new_instance Values just sent to be saved. |
|
| 422 | - * @param array $old_instance Previously saved values from database. |
|
| 423 | - * |
|
| 424 | - * @return array Updated safe values to be saved. |
|
| 425 | - */ |
|
| 426 | - public function update($new_instance, $old_instance) |
|
| 427 | - {
|
|
| 428 | - //save the widget |
|
| 429 | - $instance = $old_instance; |
|
| 430 | - $instance['title'] = strip_tags($new_instance['title']); |
|
| 431 | - return $instance; |
|
| 432 | - } |
|
| 433 | - |
|
| 434 | - /** |
|
| 435 | - * Back-end social like widget settings form. |
|
| 436 | - * |
|
| 437 | - * @since 1.0.0 |
|
| 438 | - * @since 1.5.1 Declare function public. |
|
| 439 | - * |
|
| 440 | - * @param array $instance Previously saved values from database. |
|
| 441 | - * @return string|void |
|
| 442 | - */ |
|
| 443 | - public function form($instance) |
|
| 444 | - {
|
|
| 445 | - //widgetform in backend |
|
| 446 | - $instance = wp_parse_args((array)$instance, array('title' => ''));
|
|
| 447 | - $title = strip_tags($instance['title']); |
|
| 448 | - ?> |
|
| 411 | + echo $after_widget; |
|
| 412 | + |
|
| 413 | + } |
|
| 414 | + |
|
| 415 | + /** |
|
| 416 | + * Sanitize social like widget form values as they are saved. |
|
| 417 | + * |
|
| 418 | + * @since 1.0.0 |
|
| 419 | + * @since 1.5.1 Declare function public. |
|
| 420 | + * |
|
| 421 | + * @param array $new_instance Values just sent to be saved. |
|
| 422 | + * @param array $old_instance Previously saved values from database. |
|
| 423 | + * |
|
| 424 | + * @return array Updated safe values to be saved. |
|
| 425 | + */ |
|
| 426 | + public function update($new_instance, $old_instance) |
|
| 427 | + {
|
|
| 428 | + //save the widget |
|
| 429 | + $instance = $old_instance; |
|
| 430 | + $instance['title'] = strip_tags($new_instance['title']); |
|
| 431 | + return $instance; |
|
| 432 | + } |
|
| 433 | + |
|
| 434 | + /** |
|
| 435 | + * Back-end social like widget settings form. |
|
| 436 | + * |
|
| 437 | + * @since 1.0.0 |
|
| 438 | + * @since 1.5.1 Declare function public. |
|
| 439 | + * |
|
| 440 | + * @param array $instance Previously saved values from database. |
|
| 441 | + * @return string|void |
|
| 442 | + */ |
|
| 443 | + public function form($instance) |
|
| 444 | + {
|
|
| 445 | + //widgetform in backend |
|
| 446 | + $instance = wp_parse_args((array)$instance, array('title' => ''));
|
|
| 447 | + $title = strip_tags($instance['title']); |
|
| 448 | + ?> |
|
| 449 | 449 | <p>No settings for this widget</p> |
| 450 | 450 | |
| 451 | 451 | |
| 452 | 452 | <?php |
| 453 | - } |
|
| 454 | - } |
|
| 455 | - |
|
| 456 | - register_widget('geodir_social_like_widget');
|
|
| 457 | - |
|
| 458 | - |
|
| 459 | - /** |
|
| 460 | - * GeoDirectory Feedburner Subscribe widget. |
|
| 461 | - * |
|
| 462 | - * @since 1.0.0 |
|
| 463 | - */ |
|
| 464 | - class geodirsubscribeWidget extends WP_Widget |
|
| 465 | - {
|
|
| 466 | - |
|
| 467 | - /** |
|
| 468 | - * Register the feedburner subscribe widget with WordPress. |
|
| 469 | - * |
|
| 470 | - * @since 1.0.0 |
|
| 471 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 472 | - */ |
|
| 473 | - public function __construct() {
|
|
| 474 | - $widget_ops = array('classname' => 'geodir-subscribe', 'description' => __('GD > Google Feedburner Subscribe', 'geodirectory'));
|
|
| 475 | - parent::__construct( |
|
| 476 | - 'widget_subscribeWidget', // Base ID |
|
| 477 | - __('GD > Subscribe', 'geodirectory'), // Name
|
|
| 478 | - $widget_ops// Args |
|
| 479 | - ); |
|
| 480 | - } |
|
| 481 | - |
|
| 482 | - /** |
|
| 483 | - * Front-end display content for feedburner subscribe widget. |
|
| 484 | - * |
|
| 485 | - * @since 1.0.0 |
|
| 486 | - * @since 1.5.1 Declare function public. |
|
| 487 | - * |
|
| 488 | - * @param array $args Widget arguments. |
|
| 489 | - * @param array $instance Saved values from database. |
|
| 490 | - */ |
|
| 491 | - public function widget($args, $instance) |
|
| 492 | - {
|
|
| 493 | - // prints the widget |
|
| 494 | - extract($args, EXTR_SKIP); |
|
| 495 | - |
|
| 496 | - /** |
|
| 497 | - * Filter the widget instance id. |
|
| 498 | - * |
|
| 499 | - * @since 1.0.0 |
|
| 500 | - * @param string $id The widget instance id. |
|
| 501 | - */ |
|
| 502 | - $id = empty($instance['id']) ? '' : apply_filters('widget_id', $instance['id']);
|
|
| 503 | - |
|
| 504 | - /** This filter is documented in geodirectory_widgets.php */ |
|
| 505 | - $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
|
|
| 506 | - |
|
| 507 | - /** |
|
| 508 | - * Filter the widget text. |
|
| 509 | - * |
|
| 510 | - * @since 1.0.0 |
|
| 511 | - * @param string $text The widget text. |
|
| 512 | - */ |
|
| 513 | - $text = empty($instance['text']) ? '' : apply_filters('widget_text', $instance['text']);
|
|
| 514 | - |
|
| 515 | - echo $before_widget; |
|
| 516 | - ?> |
|
| 453 | + } |
|
| 454 | + } |
|
| 455 | + |
|
| 456 | + register_widget('geodir_social_like_widget');
|
|
| 457 | + |
|
| 458 | + |
|
| 459 | + /** |
|
| 460 | + * GeoDirectory Feedburner Subscribe widget. |
|
| 461 | + * |
|
| 462 | + * @since 1.0.0 |
|
| 463 | + */ |
|
| 464 | + class geodirsubscribeWidget extends WP_Widget |
|
| 465 | + {
|
|
| 466 | + |
|
| 467 | + /** |
|
| 468 | + * Register the feedburner subscribe widget with WordPress. |
|
| 469 | + * |
|
| 470 | + * @since 1.0.0 |
|
| 471 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 472 | + */ |
|
| 473 | + public function __construct() {
|
|
| 474 | + $widget_ops = array('classname' => 'geodir-subscribe', 'description' => __('GD > Google Feedburner Subscribe', 'geodirectory'));
|
|
| 475 | + parent::__construct( |
|
| 476 | + 'widget_subscribeWidget', // Base ID |
|
| 477 | + __('GD > Subscribe', 'geodirectory'), // Name
|
|
| 478 | + $widget_ops// Args |
|
| 479 | + ); |
|
| 480 | + } |
|
| 481 | + |
|
| 482 | + /** |
|
| 483 | + * Front-end display content for feedburner subscribe widget. |
|
| 484 | + * |
|
| 485 | + * @since 1.0.0 |
|
| 486 | + * @since 1.5.1 Declare function public. |
|
| 487 | + * |
|
| 488 | + * @param array $args Widget arguments. |
|
| 489 | + * @param array $instance Saved values from database. |
|
| 490 | + */ |
|
| 491 | + public function widget($args, $instance) |
|
| 492 | + {
|
|
| 493 | + // prints the widget |
|
| 494 | + extract($args, EXTR_SKIP); |
|
| 495 | + |
|
| 496 | + /** |
|
| 497 | + * Filter the widget instance id. |
|
| 498 | + * |
|
| 499 | + * @since 1.0.0 |
|
| 500 | + * @param string $id The widget instance id. |
|
| 501 | + */ |
|
| 502 | + $id = empty($instance['id']) ? '' : apply_filters('widget_id', $instance['id']);
|
|
| 503 | + |
|
| 504 | + /** This filter is documented in geodirectory_widgets.php */ |
|
| 505 | + $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
|
|
| 506 | + |
|
| 507 | + /** |
|
| 508 | + * Filter the widget text. |
|
| 509 | + * |
|
| 510 | + * @since 1.0.0 |
|
| 511 | + * @param string $text The widget text. |
|
| 512 | + */ |
|
| 513 | + $text = empty($instance['text']) ? '' : apply_filters('widget_text', $instance['text']);
|
|
| 514 | + |
|
| 515 | + echo $before_widget; |
|
| 516 | + ?> |
|
| 517 | 517 | |
| 518 | 518 | <?php echo $before_title . $title; ?> <a href="<?php if ($id) {
|
| 519 | - echo 'http://feeds2.feedburner.com/' . $id; |
|
| 520 | - } else {
|
|
| 521 | - bloginfo('rss_url');
|
|
| 522 | - } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title;?> |
|
| 519 | + echo 'http://feeds2.feedburner.com/' . $id; |
|
| 520 | + } else {
|
|
| 521 | + bloginfo('rss_url');
|
|
| 522 | + } ?>"><i class="fa fa-rss-square"></i> </a><?php echo $after_title;?> |
|
| 523 | 523 | |
| 524 | 524 | <?php if ($text <> "") { ?>
|
| 525 | 525 | |
@@ -544,57 +544,57 @@ discard block |
||
| 544 | 544 | </form> |
| 545 | 545 | |
| 546 | 546 | <?php |
| 547 | - echo $after_widget; |
|
| 547 | + echo $after_widget; |
|
| 548 | 548 | |
| 549 | - } |
|
| 549 | + } |
|
| 550 | 550 | |
| 551 | - /** |
|
| 552 | - * Sanitize feedburner subscribe widget form values as they are saved. |
|
| 553 | - * |
|
| 554 | - * @since 1.0.0 |
|
| 555 | - * @since 1.5.1 Declare function public. |
|
| 556 | - * |
|
| 557 | - * @param array $new_instance Values just sent to be saved. |
|
| 558 | - * @param array $old_instance Previously saved values from database. |
|
| 559 | - * |
|
| 560 | - * @return array Updated safe values to be saved. |
|
| 561 | - */ |
|
| 562 | - public function update($new_instance, $old_instance) |
|
| 563 | - {
|
|
| 551 | + /** |
|
| 552 | + * Sanitize feedburner subscribe widget form values as they are saved. |
|
| 553 | + * |
|
| 554 | + * @since 1.0.0 |
|
| 555 | + * @since 1.5.1 Declare function public. |
|
| 556 | + * |
|
| 557 | + * @param array $new_instance Values just sent to be saved. |
|
| 558 | + * @param array $old_instance Previously saved values from database. |
|
| 559 | + * |
|
| 560 | + * @return array Updated safe values to be saved. |
|
| 561 | + */ |
|
| 562 | + public function update($new_instance, $old_instance) |
|
| 563 | + {
|
|
| 564 | 564 | |
| 565 | - //save the widget |
|
| 566 | - $instance = $old_instance; |
|
| 567 | - $instance['id'] = strip_tags($new_instance['id']); |
|
| 568 | - $instance['title'] = ($new_instance['title']); |
|
| 569 | - $instance['text'] = ($new_instance['text']); |
|
| 565 | + //save the widget |
|
| 566 | + $instance = $old_instance; |
|
| 567 | + $instance['id'] = strip_tags($new_instance['id']); |
|
| 568 | + $instance['title'] = ($new_instance['title']); |
|
| 569 | + $instance['text'] = ($new_instance['text']); |
|
| 570 | 570 | |
| 571 | 571 | |
| 572 | - return $instance; |
|
| 573 | - } |
|
| 572 | + return $instance; |
|
| 573 | + } |
|
| 574 | 574 | |
| 575 | - /** |
|
| 576 | - * Back-end feedburner subscribe widget settings form. |
|
| 577 | - * |
|
| 578 | - * @since 1.0.0 |
|
| 579 | - * @since 1.5.1 Declare function public. |
|
| 580 | - * |
|
| 581 | - * @param array $instance Previously saved values from database. |
|
| 582 | - * @return string|void |
|
| 583 | - */ |
|
| 584 | - public function form($instance) |
|
| 585 | - {
|
|
| 586 | - //widgetform in backend |
|
| 587 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => ''));
|
|
| 575 | + /** |
|
| 576 | + * Back-end feedburner subscribe widget settings form. |
|
| 577 | + * |
|
| 578 | + * @since 1.0.0 |
|
| 579 | + * @since 1.5.1 Declare function public. |
|
| 580 | + * |
|
| 581 | + * @param array $instance Previously saved values from database. |
|
| 582 | + * @return string|void |
|
| 583 | + */ |
|
| 584 | + public function form($instance) |
|
| 585 | + {
|
|
| 586 | + //widgetform in backend |
|
| 587 | + $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'advt1' => '', 'text' => '', 'twitter' => '', 'facebook' => '', 'digg' => '', 'myspace' => ''));
|
|
| 588 | 588 | |
| 589 | - $id = strip_tags($instance['id']); |
|
| 589 | + $id = strip_tags($instance['id']); |
|
| 590 | 590 | |
| 591 | - $title = strip_tags($instance['title']); |
|
| 591 | + $title = strip_tags($instance['title']); |
|
| 592 | 592 | |
| 593 | - $text = strip_tags($instance['text']); |
|
| 593 | + $text = strip_tags($instance['text']); |
|
| 594 | 594 | |
| 595 | 595 | |
| 596 | 596 | |
| 597 | - ?> |
|
| 597 | + ?> |
|
| 598 | 598 | <p><label |
| 599 | 599 | for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title', 'geodirectory');?>:
|
| 600 | 600 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
|
@@ -613,101 +613,101 @@ discard block |
||
| 613 | 613 | name="<?php echo $this->get_field_name('text'); ?>"><?php echo esc_attr($text); ?></textarea></label>
|
| 614 | 614 | </p> |
| 615 | 615 | <?php |
| 616 | - } |
|
| 617 | - } |
|
| 618 | - |
|
| 619 | - register_widget('geodirsubscribeWidget');
|
|
| 620 | - |
|
| 621 | - /** |
|
| 622 | - * GeoDirectory advertise widget. |
|
| 623 | - * |
|
| 624 | - * @since 1.0.0 |
|
| 625 | - */ |
|
| 626 | - class geodiradvtwidget extends WP_Widget |
|
| 627 | - {
|
|
| 628 | - |
|
| 629 | - /** |
|
| 630 | - * Register the advertise widget with WordPress. |
|
| 631 | - * |
|
| 632 | - * @since 1.0.0 |
|
| 633 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 634 | - */ |
|
| 635 | - public function __construct() {
|
|
| 636 | - $widget_ops = array('classname' => 'GeoDirectory Advertise', 'description' => __('GD > common advertise widget in sidebar, bottom section', 'geodirectory'));
|
|
| 637 | - parent::__construct( |
|
| 638 | - 'advtwidget', // Base ID |
|
| 639 | - __('GD > Advertise', 'geodirectory'), // Name
|
|
| 640 | - $widget_ops// Args |
|
| 641 | - ); |
|
| 642 | - } |
|
| 643 | - |
|
| 644 | - |
|
| 645 | - /** |
|
| 646 | - * Front-end display content for advertise widget. |
|
| 647 | - * |
|
| 648 | - * @since 1.0.0 |
|
| 649 | - * @since 1.5.1 Declare function public. |
|
| 650 | - * |
|
| 651 | - * @param array $args Widget arguments. |
|
| 652 | - * @param array $instance Saved values from database. |
|
| 653 | - */ |
|
| 654 | - public function widget($args, $instance) |
|
| 655 | - {
|
|
| 656 | - |
|
| 657 | - // prints the widget |
|
| 658 | - |
|
| 659 | - extract($args, EXTR_SKIP); |
|
| 660 | - |
|
| 661 | - /** |
|
| 662 | - * Filter the description text. |
|
| 663 | - * |
|
| 664 | - * @since 1.0.0 |
|
| 665 | - * @param string $desc1 The widget description text. |
|
| 666 | - */ |
|
| 667 | - $desc1 = empty($instance['desc1']) ? ' ' : apply_filters('widget_desc1', $instance['desc1']);
|
|
| 668 | - echo $before_widget; |
|
| 669 | - ?> |
|
| 616 | + } |
|
| 617 | + } |
|
| 618 | + |
|
| 619 | + register_widget('geodirsubscribeWidget');
|
|
| 620 | + |
|
| 621 | + /** |
|
| 622 | + * GeoDirectory advertise widget. |
|
| 623 | + * |
|
| 624 | + * @since 1.0.0 |
|
| 625 | + */ |
|
| 626 | + class geodiradvtwidget extends WP_Widget |
|
| 627 | + {
|
|
| 628 | + |
|
| 629 | + /** |
|
| 630 | + * Register the advertise widget with WordPress. |
|
| 631 | + * |
|
| 632 | + * @since 1.0.0 |
|
| 633 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 634 | + */ |
|
| 635 | + public function __construct() {
|
|
| 636 | + $widget_ops = array('classname' => 'GeoDirectory Advertise', 'description' => __('GD > common advertise widget in sidebar, bottom section', 'geodirectory'));
|
|
| 637 | + parent::__construct( |
|
| 638 | + 'advtwidget', // Base ID |
|
| 639 | + __('GD > Advertise', 'geodirectory'), // Name
|
|
| 640 | + $widget_ops// Args |
|
| 641 | + ); |
|
| 642 | + } |
|
| 643 | + |
|
| 644 | + |
|
| 645 | + /** |
|
| 646 | + * Front-end display content for advertise widget. |
|
| 647 | + * |
|
| 648 | + * @since 1.0.0 |
|
| 649 | + * @since 1.5.1 Declare function public. |
|
| 650 | + * |
|
| 651 | + * @param array $args Widget arguments. |
|
| 652 | + * @param array $instance Saved values from database. |
|
| 653 | + */ |
|
| 654 | + public function widget($args, $instance) |
|
| 655 | + {
|
|
| 656 | + |
|
| 657 | + // prints the widget |
|
| 658 | + |
|
| 659 | + extract($args, EXTR_SKIP); |
|
| 660 | + |
|
| 661 | + /** |
|
| 662 | + * Filter the description text. |
|
| 663 | + * |
|
| 664 | + * @since 1.0.0 |
|
| 665 | + * @param string $desc1 The widget description text. |
|
| 666 | + */ |
|
| 667 | + $desc1 = empty($instance['desc1']) ? ' ' : apply_filters('widget_desc1', $instance['desc1']);
|
|
| 668 | + echo $before_widget; |
|
| 669 | + ?> |
|
| 670 | 670 | <?php if ($desc1 <> "") { ?>
|
| 671 | 671 | <?php echo $desc1; ?> |
| 672 | 672 | <?php } |
| 673 | - echo $after_widget; |
|
| 674 | - } |
|
| 675 | - |
|
| 676 | - /** |
|
| 677 | - * Sanitize advertise widget form values as they are saved. |
|
| 678 | - * |
|
| 679 | - * @since 1.0.0 |
|
| 680 | - * @since 1.5.1 Declare function public. |
|
| 681 | - * |
|
| 682 | - * @param array $new_instance Values just sent to be saved. |
|
| 683 | - * @param array $old_instance Previously saved values from database. |
|
| 684 | - * |
|
| 685 | - * @return array Updated safe values to be saved. |
|
| 686 | - */ |
|
| 687 | - public function update($new_instance, $old_instance) |
|
| 688 | - {
|
|
| 689 | - //save the widget |
|
| 690 | - $instance = $old_instance; |
|
| 691 | - $instance['desc1'] = ($new_instance['desc1']); |
|
| 692 | - return $instance; |
|
| 693 | - } |
|
| 694 | - |
|
| 695 | - /** |
|
| 696 | - * Back-end advertise widget settings form. |
|
| 697 | - * |
|
| 698 | - * @since 1.0.0 |
|
| 699 | - * @since 1.5.1 Declare function public. |
|
| 700 | - * |
|
| 701 | - * @param array $instance Previously saved values from database. |
|
| 702 | - * @return string|void |
|
| 703 | - */ |
|
| 704 | - public function form($instance) |
|
| 705 | - {
|
|
| 706 | - //widgetform in backend |
|
| 707 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
|
|
| 708 | - |
|
| 709 | - $desc1 = ($instance['desc1']); |
|
| 710 | - ?> |
|
| 673 | + echo $after_widget; |
|
| 674 | + } |
|
| 675 | + |
|
| 676 | + /** |
|
| 677 | + * Sanitize advertise widget form values as they are saved. |
|
| 678 | + * |
|
| 679 | + * @since 1.0.0 |
|
| 680 | + * @since 1.5.1 Declare function public. |
|
| 681 | + * |
|
| 682 | + * @param array $new_instance Values just sent to be saved. |
|
| 683 | + * @param array $old_instance Previously saved values from database. |
|
| 684 | + * |
|
| 685 | + * @return array Updated safe values to be saved. |
|
| 686 | + */ |
|
| 687 | + public function update($new_instance, $old_instance) |
|
| 688 | + {
|
|
| 689 | + //save the widget |
|
| 690 | + $instance = $old_instance; |
|
| 691 | + $instance['desc1'] = ($new_instance['desc1']); |
|
| 692 | + return $instance; |
|
| 693 | + } |
|
| 694 | + |
|
| 695 | + /** |
|
| 696 | + * Back-end advertise widget settings form. |
|
| 697 | + * |
|
| 698 | + * @since 1.0.0 |
|
| 699 | + * @since 1.5.1 Declare function public. |
|
| 700 | + * |
|
| 701 | + * @param array $instance Previously saved values from database. |
|
| 702 | + * @return string|void |
|
| 703 | + */ |
|
| 704 | + public function form($instance) |
|
| 705 | + {
|
|
| 706 | + //widgetform in backend |
|
| 707 | + $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'desc1' => ''));
|
|
| 708 | + |
|
| 709 | + $desc1 = ($instance['desc1']); |
|
| 710 | + ?> |
|
| 711 | 711 | <p><label |
| 712 | 712 | for="<?php echo $this->get_field_id('desc1'); ?>"><?php _e('Your Advt code (ex.google adsense, etc.)', 'geodirectory');?>
|
| 713 | 713 | <textarea class="widefat" rows="6" cols="20" id="<?php echo $this->get_field_id('desc1'); ?>"
|
@@ -715,65 +715,65 @@ discard block |
||
| 715 | 715 | </p> |
| 716 | 716 | |
| 717 | 717 | <?php |
| 718 | - } |
|
| 719 | - } |
|
| 720 | - |
|
| 721 | - register_widget('geodiradvtwidget');
|
|
| 722 | - |
|
| 723 | - /** |
|
| 724 | - * GeoDirectory Flickr widget. |
|
| 725 | - * |
|
| 726 | - * @since 1.0.0 |
|
| 727 | - */ |
|
| 728 | - class GeodirFlickrWidget extends WP_Widget |
|
| 729 | - {
|
|
| 730 | - |
|
| 731 | - /** |
|
| 732 | - * Register the flickr widget with WordPress. |
|
| 733 | - * |
|
| 734 | - * @since 1.0.0 |
|
| 735 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 736 | - */ |
|
| 737 | - public function __construct() {
|
|
| 738 | - $widget_ops = array('classname' => 'Geo Dir Flickr Photos ', 'description' => __('GD > Flickr Photos', 'geodirectory'));
|
|
| 739 | - parent::__construct( |
|
| 740 | - 'widget_flickrwidget', // Base ID |
|
| 741 | - __('GD > Flickr Photos', 'geodirectory'), // Name
|
|
| 742 | - $widget_ops// Args |
|
| 743 | - ); |
|
| 744 | - } |
|
| 745 | - |
|
| 746 | - /** |
|
| 747 | - * Front-end display content for flickr widget. |
|
| 748 | - * |
|
| 749 | - * @since 1.0.0 |
|
| 750 | - * @since 1.5.1 Declare function public. |
|
| 751 | - * |
|
| 752 | - * @param array $args Widget arguments. |
|
| 753 | - * @param array $instance Saved values from database. |
|
| 754 | - */ |
|
| 755 | - public function widget($args, $instance) |
|
| 756 | - {
|
|
| 757 | - |
|
| 758 | - // prints the widget |
|
| 759 | - extract($args, EXTR_SKIP); |
|
| 760 | - |
|
| 761 | - echo $before_widget; |
|
| 762 | - |
|
| 763 | - /** This filter is documented in geodirectory_widgets.php */ |
|
| 764 | - $id = empty($instance['id']) ? ' ' : apply_filters('widget_id', $instance['id']);
|
|
| 765 | - |
|
| 766 | - /** |
|
| 767 | - * Filter the widget number. |
|
| 768 | - * |
|
| 769 | - * This is used in the flicker widget to show how many images to show. |
|
| 770 | - * |
|
| 771 | - * @since 1.0.0 |
|
| 772 | - * @param string $number The image count. |
|
| 773 | - */ |
|
| 774 | - $number = empty($instance['number']) ? ' ' : apply_filters('widget_number', $instance['number']);
|
|
| 775 | - echo $before_title . __('Photo Gallery', 'geodirectory') . $after_title;
|
|
| 776 | - ?> |
|
| 718 | + } |
|
| 719 | + } |
|
| 720 | + |
|
| 721 | + register_widget('geodiradvtwidget');
|
|
| 722 | + |
|
| 723 | + /** |
|
| 724 | + * GeoDirectory Flickr widget. |
|
| 725 | + * |
|
| 726 | + * @since 1.0.0 |
|
| 727 | + */ |
|
| 728 | + class GeodirFlickrWidget extends WP_Widget |
|
| 729 | + {
|
|
| 730 | + |
|
| 731 | + /** |
|
| 732 | + * Register the flickr widget with WordPress. |
|
| 733 | + * |
|
| 734 | + * @since 1.0.0 |
|
| 735 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 736 | + */ |
|
| 737 | + public function __construct() {
|
|
| 738 | + $widget_ops = array('classname' => 'Geo Dir Flickr Photos ', 'description' => __('GD > Flickr Photos', 'geodirectory'));
|
|
| 739 | + parent::__construct( |
|
| 740 | + 'widget_flickrwidget', // Base ID |
|
| 741 | + __('GD > Flickr Photos', 'geodirectory'), // Name
|
|
| 742 | + $widget_ops// Args |
|
| 743 | + ); |
|
| 744 | + } |
|
| 745 | + |
|
| 746 | + /** |
|
| 747 | + * Front-end display content for flickr widget. |
|
| 748 | + * |
|
| 749 | + * @since 1.0.0 |
|
| 750 | + * @since 1.5.1 Declare function public. |
|
| 751 | + * |
|
| 752 | + * @param array $args Widget arguments. |
|
| 753 | + * @param array $instance Saved values from database. |
|
| 754 | + */ |
|
| 755 | + public function widget($args, $instance) |
|
| 756 | + {
|
|
| 757 | + |
|
| 758 | + // prints the widget |
|
| 759 | + extract($args, EXTR_SKIP); |
|
| 760 | + |
|
| 761 | + echo $before_widget; |
|
| 762 | + |
|
| 763 | + /** This filter is documented in geodirectory_widgets.php */ |
|
| 764 | + $id = empty($instance['id']) ? ' ' : apply_filters('widget_id', $instance['id']);
|
|
| 765 | + |
|
| 766 | + /** |
|
| 767 | + * Filter the widget number. |
|
| 768 | + * |
|
| 769 | + * This is used in the flicker widget to show how many images to show. |
|
| 770 | + * |
|
| 771 | + * @since 1.0.0 |
|
| 772 | + * @param string $number The image count. |
|
| 773 | + */ |
|
| 774 | + $number = empty($instance['number']) ? ' ' : apply_filters('widget_number', $instance['number']);
|
|
| 775 | + echo $before_title . __('Photo Gallery', 'geodirectory') . $after_title;
|
|
| 776 | + ?> |
|
| 777 | 777 | |
| 778 | 778 | <div class="geodir-flickr clearfix"> |
| 779 | 779 | |
@@ -784,45 +784,45 @@ discard block |
||
| 784 | 784 | |
| 785 | 785 | |
| 786 | 786 | <?php echo $after_widget; |
| 787 | - } |
|
| 788 | - |
|
| 789 | - /** |
|
| 790 | - * Sanitize flickr widget form values as they are saved. |
|
| 791 | - * |
|
| 792 | - * @since 1.0.0 |
|
| 793 | - * @since 1.5.1 Declare function public. |
|
| 794 | - * |
|
| 795 | - * @param array $new_instance Values just sent to be saved. |
|
| 796 | - * @param array $old_instance Previously saved values from database. |
|
| 797 | - * |
|
| 798 | - * @return array Updated safe values to be saved. |
|
| 799 | - */ |
|
| 800 | - public function update($new_instance, $old_instance) |
|
| 801 | - {
|
|
| 802 | - //save the widget |
|
| 803 | - $instance = $old_instance; |
|
| 804 | - $instance['id'] = strip_tags($new_instance['id']); |
|
| 805 | - $instance['number'] = strip_tags($new_instance['number']); |
|
| 806 | - return $instance; |
|
| 807 | - } |
|
| 808 | - |
|
| 809 | - /** |
|
| 810 | - * Back-end flickr widget settings form. |
|
| 811 | - * |
|
| 812 | - * @since 1.0.0 |
|
| 813 | - * @since 1.5.1 Declare function public. |
|
| 814 | - * |
|
| 815 | - * @param array $instance Previously saved values from database. |
|
| 816 | - * @return string|void |
|
| 817 | - */ |
|
| 818 | - public function form($instance) |
|
| 819 | - {
|
|
| 820 | - |
|
| 821 | - //widgetform in backend |
|
| 822 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'number' => ''));
|
|
| 823 | - $id = strip_tags($instance['id']); |
|
| 824 | - $number = strip_tags($instance['number']); |
|
| 825 | - ?> |
|
| 787 | + } |
|
| 788 | + |
|
| 789 | + /** |
|
| 790 | + * Sanitize flickr widget form values as they are saved. |
|
| 791 | + * |
|
| 792 | + * @since 1.0.0 |
|
| 793 | + * @since 1.5.1 Declare function public. |
|
| 794 | + * |
|
| 795 | + * @param array $new_instance Values just sent to be saved. |
|
| 796 | + * @param array $old_instance Previously saved values from database. |
|
| 797 | + * |
|
| 798 | + * @return array Updated safe values to be saved. |
|
| 799 | + */ |
|
| 800 | + public function update($new_instance, $old_instance) |
|
| 801 | + {
|
|
| 802 | + //save the widget |
|
| 803 | + $instance = $old_instance; |
|
| 804 | + $instance['id'] = strip_tags($new_instance['id']); |
|
| 805 | + $instance['number'] = strip_tags($new_instance['number']); |
|
| 806 | + return $instance; |
|
| 807 | + } |
|
| 808 | + |
|
| 809 | + /** |
|
| 810 | + * Back-end flickr widget settings form. |
|
| 811 | + * |
|
| 812 | + * @since 1.0.0 |
|
| 813 | + * @since 1.5.1 Declare function public. |
|
| 814 | + * |
|
| 815 | + * @param array $instance Previously saved values from database. |
|
| 816 | + * @return string|void |
|
| 817 | + */ |
|
| 818 | + public function form($instance) |
|
| 819 | + {
|
|
| 820 | + |
|
| 821 | + //widgetform in backend |
|
| 822 | + $instance = wp_parse_args((array)$instance, array('title' => '', 'id' => '', 'number' => ''));
|
|
| 823 | + $id = strip_tags($instance['id']); |
|
| 824 | + $number = strip_tags($instance['number']); |
|
| 825 | + ?> |
|
| 826 | 826 | |
| 827 | 827 | <p> |
| 828 | 828 | <label |
@@ -843,99 +843,99 @@ discard block |
||
| 843 | 843 | </label> |
| 844 | 844 | </p> |
| 845 | 845 | <?php |
| 846 | - } |
|
| 847 | - } |
|
| 848 | - |
|
| 849 | - register_widget('GeodirFlickrWidget');
|
|
| 850 | - |
|
| 851 | - /** |
|
| 852 | - * GeoDirectory Twitter widget. |
|
| 853 | - * |
|
| 854 | - * @since 1.0.0 |
|
| 855 | - */ |
|
| 856 | - class geodir_twitter extends WP_Widget |
|
| 857 | - {
|
|
| 858 | - /** |
|
| 859 | - * Register the Twitter widget with WordPress. |
|
| 860 | - * |
|
| 861 | - * @since 1.0.0 |
|
| 862 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 863 | - */ |
|
| 864 | - public function __construct() {
|
|
| 865 | - $widget_ops = array('classname' => 'Twitter', 'description' => __('GD > Twitter Feed', 'geodirectory'));
|
|
| 866 | - parent::__construct( |
|
| 867 | - 'widget_Twidget', // Base ID |
|
| 868 | - __('GD > Twitter', 'geodirectory'), // Name
|
|
| 869 | - $widget_ops// Args |
|
| 870 | - ); |
|
| 871 | - } |
|
| 872 | - |
|
| 873 | - |
|
| 874 | - /** |
|
| 875 | - * Front-end display content for Twitter widget. |
|
| 876 | - * |
|
| 877 | - * @since 1.0.0 |
|
| 878 | - * @since 1.5.1 Declare function public. |
|
| 879 | - * |
|
| 880 | - * @param array $args Widget arguments. |
|
| 881 | - * @param array $instance Saved values from database. |
|
| 882 | - */ |
|
| 883 | - public function widget($args, $instance) |
|
| 884 | - {
|
|
| 885 | - |
|
| 886 | - // prints the widget |
|
| 887 | - |
|
| 888 | - extract($args, EXTR_SKIP); |
|
| 889 | - |
|
| 890 | - /** |
|
| 891 | - * Filter the twitter widget description text. |
|
| 892 | - * |
|
| 893 | - * @since 1.0.0 |
|
| 894 | - * @param string $desc1 The widget description text. |
|
| 895 | - */ |
|
| 896 | - $desc1 = empty($instance['gd_tw_desc1']) ? ' ' : apply_filters('gd_tw_widget_desc1', $instance['gd_tw_desc1']);
|
|
| 897 | - echo $before_widget; |
|
| 898 | - if ($desc1 <> "") {
|
|
| 899 | - echo $desc1; |
|
| 900 | - } |
|
| 901 | - echo $after_widget; |
|
| 902 | - } |
|
| 903 | - |
|
| 904 | - /** |
|
| 905 | - * Sanitize twitter widget form values as they are saved. |
|
| 906 | - * |
|
| 907 | - * @since 1.0.0 |
|
| 908 | - * @since 1.5.1 Declare function public. |
|
| 909 | - * |
|
| 910 | - * @param array $new_instance Values just sent to be saved. |
|
| 911 | - * @param array $old_instance Previously saved values from database. |
|
| 912 | - * |
|
| 913 | - * @return array Updated safe values to be saved. |
|
| 914 | - */ |
|
| 915 | - public function update($new_instance, $old_instance) |
|
| 916 | - {
|
|
| 917 | - //save the widget |
|
| 918 | - $instance = $old_instance; |
|
| 919 | - $instance['gd_tw_desc1'] = ($new_instance['gd_tw_desc1']); |
|
| 920 | - return $instance; |
|
| 921 | - } |
|
| 922 | - |
|
| 923 | - /** |
|
| 924 | - * Back-end twitter widget settings form. |
|
| 925 | - * |
|
| 926 | - * @since 1.0.0 |
|
| 927 | - * @since 1.5.1 Declare function public. |
|
| 928 | - * |
|
| 929 | - * @param array $instance Previously saved values from database. |
|
| 930 | - * @return string|void |
|
| 931 | - */ |
|
| 932 | - public function form($instance) |
|
| 933 | - {
|
|
| 934 | - //widgetform in backend |
|
| 935 | - $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => ''));
|
|
| 936 | - |
|
| 937 | - $desc1 = ($instance['gd_tw_desc1']); |
|
| 938 | - ?> |
|
| 846 | + } |
|
| 847 | + } |
|
| 848 | + |
|
| 849 | + register_widget('GeodirFlickrWidget');
|
|
| 850 | + |
|
| 851 | + /** |
|
| 852 | + * GeoDirectory Twitter widget. |
|
| 853 | + * |
|
| 854 | + * @since 1.0.0 |
|
| 855 | + */ |
|
| 856 | + class geodir_twitter extends WP_Widget |
|
| 857 | + {
|
|
| 858 | + /** |
|
| 859 | + * Register the Twitter widget with WordPress. |
|
| 860 | + * |
|
| 861 | + * @since 1.0.0 |
|
| 862 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 863 | + */ |
|
| 864 | + public function __construct() {
|
|
| 865 | + $widget_ops = array('classname' => 'Twitter', 'description' => __('GD > Twitter Feed', 'geodirectory'));
|
|
| 866 | + parent::__construct( |
|
| 867 | + 'widget_Twidget', // Base ID |
|
| 868 | + __('GD > Twitter', 'geodirectory'), // Name
|
|
| 869 | + $widget_ops// Args |
|
| 870 | + ); |
|
| 871 | + } |
|
| 872 | + |
|
| 873 | + |
|
| 874 | + /** |
|
| 875 | + * Front-end display content for Twitter widget. |
|
| 876 | + * |
|
| 877 | + * @since 1.0.0 |
|
| 878 | + * @since 1.5.1 Declare function public. |
|
| 879 | + * |
|
| 880 | + * @param array $args Widget arguments. |
|
| 881 | + * @param array $instance Saved values from database. |
|
| 882 | + */ |
|
| 883 | + public function widget($args, $instance) |
|
| 884 | + {
|
|
| 885 | + |
|
| 886 | + // prints the widget |
|
| 887 | + |
|
| 888 | + extract($args, EXTR_SKIP); |
|
| 889 | + |
|
| 890 | + /** |
|
| 891 | + * Filter the twitter widget description text. |
|
| 892 | + * |
|
| 893 | + * @since 1.0.0 |
|
| 894 | + * @param string $desc1 The widget description text. |
|
| 895 | + */ |
|
| 896 | + $desc1 = empty($instance['gd_tw_desc1']) ? ' ' : apply_filters('gd_tw_widget_desc1', $instance['gd_tw_desc1']);
|
|
| 897 | + echo $before_widget; |
|
| 898 | + if ($desc1 <> "") {
|
|
| 899 | + echo $desc1; |
|
| 900 | + } |
|
| 901 | + echo $after_widget; |
|
| 902 | + } |
|
| 903 | + |
|
| 904 | + /** |
|
| 905 | + * Sanitize twitter widget form values as they are saved. |
|
| 906 | + * |
|
| 907 | + * @since 1.0.0 |
|
| 908 | + * @since 1.5.1 Declare function public. |
|
| 909 | + * |
|
| 910 | + * @param array $new_instance Values just sent to be saved. |
|
| 911 | + * @param array $old_instance Previously saved values from database. |
|
| 912 | + * |
|
| 913 | + * @return array Updated safe values to be saved. |
|
| 914 | + */ |
|
| 915 | + public function update($new_instance, $old_instance) |
|
| 916 | + {
|
|
| 917 | + //save the widget |
|
| 918 | + $instance = $old_instance; |
|
| 919 | + $instance['gd_tw_desc1'] = ($new_instance['gd_tw_desc1']); |
|
| 920 | + return $instance; |
|
| 921 | + } |
|
| 922 | + |
|
| 923 | + /** |
|
| 924 | + * Back-end twitter widget settings form. |
|
| 925 | + * |
|
| 926 | + * @since 1.0.0 |
|
| 927 | + * @since 1.5.1 Declare function public. |
|
| 928 | + * |
|
| 929 | + * @param array $instance Previously saved values from database. |
|
| 930 | + * @return string|void |
|
| 931 | + */ |
|
| 932 | + public function form($instance) |
|
| 933 | + {
|
|
| 934 | + //widgetform in backend |
|
| 935 | + $instance = wp_parse_args((array)$instance, array('title' => '', 't1' => '', 't2' => '', 't3' => '', 'img1' => '', 'gd_tw_desc1' => ''));
|
|
| 936 | + |
|
| 937 | + $desc1 = ($instance['gd_tw_desc1']); |
|
| 938 | + ?> |
|
| 939 | 939 | <p><label |
| 940 | 940 | for="<?php echo $this->get_field_id('gd_tw_desc1'); ?>"><?php _e('Your twitter code', 'geodirectory');?>
|
| 941 | 941 | <textarea class="widefat" rows="6" cols="20" |
@@ -944,169 +944,169 @@ discard block |
||
| 944 | 944 | </p> |
| 945 | 945 | |
| 946 | 946 | <?php |
| 947 | - } |
|
| 948 | - } |
|
| 949 | - |
|
| 950 | - register_widget('geodir_twitter');
|
|
| 951 | - |
|
| 952 | - /** |
|
| 953 | - * GeoDirectory Advanced Search widget. |
|
| 954 | - * |
|
| 955 | - * @since 1.0.0 |
|
| 956 | - */ |
|
| 957 | - class geodir_advance_search_widget extends WP_Widget |
|
| 958 | - {
|
|
| 959 | - /** |
|
| 960 | - * Register the advanced search widget with WordPress. |
|
| 961 | - * |
|
| 962 | - * @since 1.0.0 |
|
| 963 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 964 | - */ |
|
| 965 | - public function __construct() {
|
|
| 966 | - $widget_ops = array('classname' => 'geodir_advance_search_widget', 'description' => __('GD > Search', 'geodirectory'));
|
|
| 967 | - parent::__construct( |
|
| 968 | - 'geodir_advance_search', // Base ID |
|
| 969 | - __('GD > Search', 'geodirectory'), // Name
|
|
| 970 | - $widget_ops// Args |
|
| 971 | - ); |
|
| 972 | - } |
|
| 973 | - |
|
| 974 | - |
|
| 975 | - /** |
|
| 976 | - * Front-end display content for advanced search widget. |
|
| 977 | - * |
|
| 978 | - * @since 1.0.0 |
|
| 979 | - * @since 1.5.1 Declare function public. |
|
| 980 | - * |
|
| 981 | - * @param array $args Widget arguments. |
|
| 982 | - * @param array $instance Saved values from database. |
|
| 983 | - */ |
|
| 984 | - public function widget($args, $instance) |
|
| 985 | - {
|
|
| 986 | - /** |
|
| 987 | - * Filter the search widget arguments. |
|
| 988 | - * |
|
| 989 | - * @since 1.5.7 |
|
| 990 | - * @param array $args The widget arguments. |
|
| 991 | - * @param array $instance The widget instance. |
|
| 992 | - */ |
|
| 993 | - $args = apply_filters('widget_geodir_advance_search_args',$args,$instance);
|
|
| 994 | - |
|
| 995 | - // prints the widget |
|
| 996 | - extract($args, EXTR_SKIP); |
|
| 997 | - |
|
| 998 | - echo $before_widget; |
|
| 999 | - |
|
| 1000 | - /** This filter is documented in geodirectory_widgets.php */ |
|
| 1001 | - $title = empty($instance['title']) ? __('Search', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
|
|
| 1002 | - |
|
| 1003 | - geodir_get_template_part('listing', 'filter-form');
|
|
| 1004 | - |
|
| 1005 | - echo $after_widget; |
|
| 1006 | - } |
|
| 1007 | - |
|
| 1008 | - /** |
|
| 1009 | - * Sanitize advanced search widget form values as they are saved. |
|
| 1010 | - * |
|
| 1011 | - * @since 1.0.0 |
|
| 1012 | - * @since 1.5.1 Declare function public. |
|
| 1013 | - * |
|
| 1014 | - * @param array $new_instance Values just sent to be saved. |
|
| 1015 | - * @param array $old_instance Previously saved values from database. |
|
| 1016 | - * |
|
| 1017 | - * @return array Updated safe values to be saved. |
|
| 1018 | - */ |
|
| 1019 | - public function update($new_instance, $old_instance) |
|
| 1020 | - {
|
|
| 1021 | - //save the widget |
|
| 1022 | - //Nothing to save |
|
| 1023 | - return isset($instance) ? $instance : ''; |
|
| 1024 | - } |
|
| 1025 | - |
|
| 1026 | - /** |
|
| 1027 | - * Back-end advanced search widget settings form. |
|
| 1028 | - * |
|
| 1029 | - * @since 1.0.0 |
|
| 1030 | - * @since 1.5.1 Declare function public. |
|
| 1031 | - * |
|
| 1032 | - * @param array $instance Previously saved values from database. |
|
| 1033 | - * @return string|void |
|
| 1034 | - */ |
|
| 1035 | - public function form($instance) |
|
| 1036 | - {
|
|
| 1037 | - //widgetform in backend |
|
| 1038 | - echo __("This is a search widget to show advance search for gedodirectory listings.", 'geodirectory');
|
|
| 1039 | - } |
|
| 1040 | - } |
|
| 1041 | - |
|
| 1042 | - register_widget('geodir_advance_search_widget');
|
|
| 1043 | - |
|
| 1044 | - |
|
| 1045 | - /** |
|
| 1046 | - * Contains all functions for popular widget. |
|
| 1047 | - * |
|
| 1048 | - * @since 1.0.0 |
|
| 1049 | - * @package GeoDirectory |
|
| 1050 | - */ |
|
| 1051 | - include_once('geodirectory-widgets/geodirectory_popular_widget.php');
|
|
| 1052 | - /** |
|
| 1053 | - * Contains all functions for listing slider widget. |
|
| 1054 | - * |
|
| 1055 | - * @since 1.0.0 |
|
| 1056 | - * @package GeoDirectory |
|
| 1057 | - */ |
|
| 1058 | - include_once('geodirectory-widgets/geodirectory_listing_slider_widget.php');
|
|
| 1059 | - /** |
|
| 1060 | - * Contains all functions for home map widget. |
|
| 1061 | - * |
|
| 1062 | - * @since 1.0.0 |
|
| 1063 | - * @package GeoDirectory |
|
| 1064 | - */ |
|
| 1065 | - include_once('geodirectory-widgets/home_map_widget.php');
|
|
| 1066 | - /** |
|
| 1067 | - * Contains all functions for listing map widget. |
|
| 1068 | - * |
|
| 1069 | - * @since 1.0.0 |
|
| 1070 | - * @package GeoDirectory |
|
| 1071 | - */ |
|
| 1072 | - include_once('geodirectory-widgets/listing_map_widget.php');
|
|
| 1073 | - /** |
|
| 1074 | - * Contains all functions for reviews widget. |
|
| 1075 | - * |
|
| 1076 | - * @since 1.0.0 |
|
| 1077 | - * @package GeoDirectory |
|
| 1078 | - */ |
|
| 1079 | - include_once('geodirectory-widgets/geodirectory_reviews_widget.php');
|
|
| 1080 | - /** |
|
| 1081 | - * Contains all functions for related listing widget. |
|
| 1082 | - * |
|
| 1083 | - * @since 1.0.0 |
|
| 1084 | - * @package GeoDirectory |
|
| 1085 | - */ |
|
| 1086 | - include_once('geodirectory-widgets/geodirectory_related_listing_widget.php');
|
|
| 1087 | - /** |
|
| 1088 | - * Contains all functions for bestof widget. |
|
| 1089 | - * |
|
| 1090 | - * @since 1.0.0 |
|
| 1091 | - * @package GeoDirectory |
|
| 1092 | - */ |
|
| 1093 | - include_once('geodirectory-widgets/geodirectory_bestof_widget.php');
|
|
| 947 | + } |
|
| 948 | + } |
|
| 949 | + |
|
| 950 | + register_widget('geodir_twitter');
|
|
| 951 | + |
|
| 952 | + /** |
|
| 953 | + * GeoDirectory Advanced Search widget. |
|
| 954 | + * |
|
| 955 | + * @since 1.0.0 |
|
| 956 | + */ |
|
| 957 | + class geodir_advance_search_widget extends WP_Widget |
|
| 958 | + {
|
|
| 959 | + /** |
|
| 960 | + * Register the advanced search widget with WordPress. |
|
| 961 | + * |
|
| 962 | + * @since 1.0.0 |
|
| 963 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 964 | + */ |
|
| 965 | + public function __construct() {
|
|
| 966 | + $widget_ops = array('classname' => 'geodir_advance_search_widget', 'description' => __('GD > Search', 'geodirectory'));
|
|
| 967 | + parent::__construct( |
|
| 968 | + 'geodir_advance_search', // Base ID |
|
| 969 | + __('GD > Search', 'geodirectory'), // Name
|
|
| 970 | + $widget_ops// Args |
|
| 971 | + ); |
|
| 972 | + } |
|
| 973 | + |
|
| 974 | + |
|
| 975 | + /** |
|
| 976 | + * Front-end display content for advanced search widget. |
|
| 977 | + * |
|
| 978 | + * @since 1.0.0 |
|
| 979 | + * @since 1.5.1 Declare function public. |
|
| 980 | + * |
|
| 981 | + * @param array $args Widget arguments. |
|
| 982 | + * @param array $instance Saved values from database. |
|
| 983 | + */ |
|
| 984 | + public function widget($args, $instance) |
|
| 985 | + {
|
|
| 986 | + /** |
|
| 987 | + * Filter the search widget arguments. |
|
| 988 | + * |
|
| 989 | + * @since 1.5.7 |
|
| 990 | + * @param array $args The widget arguments. |
|
| 991 | + * @param array $instance The widget instance. |
|
| 992 | + */ |
|
| 993 | + $args = apply_filters('widget_geodir_advance_search_args',$args,$instance);
|
|
| 994 | + |
|
| 995 | + // prints the widget |
|
| 996 | + extract($args, EXTR_SKIP); |
|
| 997 | + |
|
| 998 | + echo $before_widget; |
|
| 999 | + |
|
| 1000 | + /** This filter is documented in geodirectory_widgets.php */ |
|
| 1001 | + $title = empty($instance['title']) ? __('Search', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
|
|
| 1002 | + |
|
| 1003 | + geodir_get_template_part('listing', 'filter-form');
|
|
| 1004 | + |
|
| 1005 | + echo $after_widget; |
|
| 1006 | + } |
|
| 1007 | + |
|
| 1008 | + /** |
|
| 1009 | + * Sanitize advanced search widget form values as they are saved. |
|
| 1010 | + * |
|
| 1011 | + * @since 1.0.0 |
|
| 1012 | + * @since 1.5.1 Declare function public. |
|
| 1013 | + * |
|
| 1014 | + * @param array $new_instance Values just sent to be saved. |
|
| 1015 | + * @param array $old_instance Previously saved values from database. |
|
| 1016 | + * |
|
| 1017 | + * @return array Updated safe values to be saved. |
|
| 1018 | + */ |
|
| 1019 | + public function update($new_instance, $old_instance) |
|
| 1020 | + {
|
|
| 1021 | + //save the widget |
|
| 1022 | + //Nothing to save |
|
| 1023 | + return isset($instance) ? $instance : ''; |
|
| 1024 | + } |
|
| 1025 | + |
|
| 1026 | + /** |
|
| 1027 | + * Back-end advanced search widget settings form. |
|
| 1028 | + * |
|
| 1029 | + * @since 1.0.0 |
|
| 1030 | + * @since 1.5.1 Declare function public. |
|
| 1031 | + * |
|
| 1032 | + * @param array $instance Previously saved values from database. |
|
| 1033 | + * @return string|void |
|
| 1034 | + */ |
|
| 1035 | + public function form($instance) |
|
| 1036 | + {
|
|
| 1037 | + //widgetform in backend |
|
| 1038 | + echo __("This is a search widget to show advance search for gedodirectory listings.", 'geodirectory');
|
|
| 1039 | + } |
|
| 1040 | + } |
|
| 1041 | + |
|
| 1042 | + register_widget('geodir_advance_search_widget');
|
|
| 1043 | + |
|
| 1044 | + |
|
| 1045 | + /** |
|
| 1046 | + * Contains all functions for popular widget. |
|
| 1047 | + * |
|
| 1048 | + * @since 1.0.0 |
|
| 1049 | + * @package GeoDirectory |
|
| 1050 | + */ |
|
| 1051 | + include_once('geodirectory-widgets/geodirectory_popular_widget.php');
|
|
| 1052 | + /** |
|
| 1053 | + * Contains all functions for listing slider widget. |
|
| 1054 | + * |
|
| 1055 | + * @since 1.0.0 |
|
| 1056 | + * @package GeoDirectory |
|
| 1057 | + */ |
|
| 1058 | + include_once('geodirectory-widgets/geodirectory_listing_slider_widget.php');
|
|
| 1059 | + /** |
|
| 1060 | + * Contains all functions for home map widget. |
|
| 1061 | + * |
|
| 1062 | + * @since 1.0.0 |
|
| 1063 | + * @package GeoDirectory |
|
| 1064 | + */ |
|
| 1065 | + include_once('geodirectory-widgets/home_map_widget.php');
|
|
| 1066 | + /** |
|
| 1067 | + * Contains all functions for listing map widget. |
|
| 1068 | + * |
|
| 1069 | + * @since 1.0.0 |
|
| 1070 | + * @package GeoDirectory |
|
| 1071 | + */ |
|
| 1072 | + include_once('geodirectory-widgets/listing_map_widget.php');
|
|
| 1073 | + /** |
|
| 1074 | + * Contains all functions for reviews widget. |
|
| 1075 | + * |
|
| 1076 | + * @since 1.0.0 |
|
| 1077 | + * @package GeoDirectory |
|
| 1078 | + */ |
|
| 1079 | + include_once('geodirectory-widgets/geodirectory_reviews_widget.php');
|
|
| 1080 | + /** |
|
| 1081 | + * Contains all functions for related listing widget. |
|
| 1082 | + * |
|
| 1083 | + * @since 1.0.0 |
|
| 1084 | + * @package GeoDirectory |
|
| 1085 | + */ |
|
| 1086 | + include_once('geodirectory-widgets/geodirectory_related_listing_widget.php');
|
|
| 1087 | + /** |
|
| 1088 | + * Contains all functions for bestof widget. |
|
| 1089 | + * |
|
| 1090 | + * @since 1.0.0 |
|
| 1091 | + * @package GeoDirectory |
|
| 1092 | + */ |
|
| 1093 | + include_once('geodirectory-widgets/geodirectory_bestof_widget.php');
|
|
| 1094 | + /** |
|
| 1095 | + * Contains all functions for cpt categories widget. |
|
| 1096 | + * |
|
| 1097 | + * @since 1.5.4 |
|
| 1098 | + * @package GeoDirectory |
|
| 1099 | + */ |
|
| 1100 | + include_once('geodirectory-widgets/geodirectory_cpt_categories_widget.php');
|
|
| 1094 | 1101 | /** |
| 1095 | - * Contains all functions for cpt categories widget. |
|
| 1096 | - * |
|
| 1097 | - * @since 1.5.4 |
|
| 1098 | - * @package GeoDirectory |
|
| 1099 | - */ |
|
| 1100 | - include_once('geodirectory-widgets/geodirectory_cpt_categories_widget.php');
|
|
| 1101 | - /** |
|
| 1102 | - * Contains all functions for features widget. |
|
| 1103 | - * |
|
| 1104 | - * @since 1.5.6 |
|
| 1105 | - * @package GeoDirectory |
|
| 1106 | - * @todo make the image field recurring |
|
| 1107 | - */ |
|
| 1108 | - include_once('geodirectory-widgets/geodirectory_features_widget.php');
|
|
| 1109 | - } |
|
| 1102 | + * Contains all functions for features widget. |
|
| 1103 | + * |
|
| 1104 | + * @since 1.5.6 |
|
| 1105 | + * @package GeoDirectory |
|
| 1106 | + * @todo make the image field recurring |
|
| 1107 | + */ |
|
| 1108 | + include_once('geodirectory-widgets/geodirectory_features_widget.php');
|
|
| 1109 | + } |
|
| 1110 | 1110 | |
| 1111 | 1111 | } |
| 1112 | 1112 | |
@@ -1,10 +1,10 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Template functions that affect the output of most GeoDirectory pages |
|
| 4 | - * |
|
| 5 | - * @since 1.0.0 |
|
| 6 | - * @package GeoDirectory |
|
| 7 | - */ |
|
| 3 | + * Template functions that affect the output of most GeoDirectory pages |
|
| 4 | + * |
|
| 5 | + * @since 1.0.0 |
|
| 6 | + * @package GeoDirectory |
|
| 7 | + */ |
|
| 8 | 8 | ############################################### |
| 9 | 9 | ########### DYNAMIC CONTENT ################### |
| 10 | 10 | ############################################### |
@@ -17,10 +17,10 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | function gd_compat_styles() |
| 19 | 19 | {
|
| 20 | - $tc = get_option('theme_compatibility_setting');
|
|
| 21 | - echo "<style id='gd-compat-styles' type='text/css'>"; |
|
| 22 | - echo $tc['geodir_theme_compat_css']; |
|
| 23 | - echo "</style>"; |
|
| 20 | + $tc = get_option('theme_compatibility_setting');
|
|
| 21 | + echo "<style id='gd-compat-styles' type='text/css'>"; |
|
| 22 | + echo $tc['geodir_theme_compat_css']; |
|
| 23 | + echo "</style>"; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -31,10 +31,10 @@ discard block |
||
| 31 | 31 | */ |
| 32 | 32 | function gd_compat_script() |
| 33 | 33 | {
|
| 34 | - $tc = get_option('theme_compatibility_setting');
|
|
| 35 | - echo "<script>"; |
|
| 36 | - echo $tc['geodir_theme_compat_js']; |
|
| 37 | - echo " </script>"; |
|
| 34 | + $tc = get_option('theme_compatibility_setting');
|
|
| 35 | + echo "<script>"; |
|
| 36 | + echo $tc['geodir_theme_compat_js']; |
|
| 37 | + echo " </script>"; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | function geodir_top_content_add_dynamic() |
| 49 | 49 | {
|
| 50 | - $tc = get_option('theme_compatibility_setting');
|
|
| 51 | - echo $tc['geodir_top_content_add']; |
|
| 50 | + $tc = get_option('theme_compatibility_setting');
|
|
| 51 | + echo $tc['geodir_top_content_add']; |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | */ |
| 62 | 62 | function geodir_before_main_content_add_dynamic() |
| 63 | 63 | {
|
| 64 | - $tc = get_option('theme_compatibility_setting');
|
|
| 65 | - echo $tc['geodir_before_main_content_add']; |
|
| 64 | + $tc = get_option('theme_compatibility_setting');
|
|
| 65 | + echo $tc['geodir_before_main_content_add']; |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | function geodir_full_page_class_dynamic() |
| 77 | 77 | {
|
| 78 | - $tc = get_option('theme_compatibility_setting');
|
|
| 79 | - return $tc['geodir_full_page_class_filter']; |
|
| 78 | + $tc = get_option('theme_compatibility_setting');
|
|
| 79 | + return $tc['geodir_full_page_class_filter']; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** |
@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | function geodir_before_widget_dynamic() |
| 91 | 91 | {
|
| 92 | - $tc = get_option('theme_compatibility_setting');
|
|
| 93 | - return $tc['geodir_before_widget_filter']; |
|
| 92 | + $tc = get_option('theme_compatibility_setting');
|
|
| 93 | + return $tc['geodir_before_widget_filter']; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | /** |
@@ -103,8 +103,8 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | function geodir_after_widget_dynamic() |
| 105 | 105 | {
|
| 106 | - $tc = get_option('theme_compatibility_setting');
|
|
| 107 | - return $tc['geodir_after_widget_filter']; |
|
| 106 | + $tc = get_option('theme_compatibility_setting');
|
|
| 107 | + return $tc['geodir_after_widget_filter']; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -117,8 +117,8 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | function geodir_before_title_dynamic() |
| 119 | 119 | {
|
| 120 | - $tc = get_option('theme_compatibility_setting');
|
|
| 121 | - return $tc['geodir_before_title_filter']; |
|
| 120 | + $tc = get_option('theme_compatibility_setting');
|
|
| 121 | + return $tc['geodir_before_title_filter']; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -131,8 +131,8 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | function geodir_after_title_dynamic() |
| 133 | 133 | {
|
| 134 | - $tc = get_option('theme_compatibility_setting');
|
|
| 135 | - return $tc['geodir_after_title_filter']; |
|
| 134 | + $tc = get_option('theme_compatibility_setting');
|
|
| 135 | + return $tc['geodir_after_title_filter']; |
|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /** |
@@ -145,8 +145,8 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | function geodir_menu_li_class_dynamic() |
| 147 | 147 | {
|
| 148 | - $tc = get_option('theme_compatibility_setting');
|
|
| 149 | - return $tc['geodir_menu_li_class_filter']; |
|
| 148 | + $tc = get_option('theme_compatibility_setting');
|
|
| 149 | + return $tc['geodir_menu_li_class_filter']; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** |
@@ -159,8 +159,8 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | function geodir_sub_menu_ul_class_dynamic() |
| 161 | 161 | {
|
| 162 | - $tc = get_option('theme_compatibility_setting');
|
|
| 163 | - return $tc['geodir_sub_menu_ul_class_filter']; |
|
| 162 | + $tc = get_option('theme_compatibility_setting');
|
|
| 163 | + return $tc['geodir_sub_menu_ul_class_filter']; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
@@ -173,8 +173,8 @@ discard block |
||
| 173 | 173 | */ |
| 174 | 174 | function geodir_sub_menu_li_class_dynamic() |
| 175 | 175 | {
|
| 176 | - $tc = get_option('theme_compatibility_setting');
|
|
| 177 | - return $tc['geodir_sub_menu_li_class_filter']; |
|
| 176 | + $tc = get_option('theme_compatibility_setting');
|
|
| 177 | + return $tc['geodir_sub_menu_li_class_filter']; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | /** |
@@ -187,8 +187,8 @@ discard block |
||
| 187 | 187 | */ |
| 188 | 188 | function geodir_menu_a_class_dynamic() |
| 189 | 189 | {
|
| 190 | - $tc = get_option('theme_compatibility_setting');
|
|
| 191 | - return $tc['geodir_menu_a_class_filter']; |
|
| 190 | + $tc = get_option('theme_compatibility_setting');
|
|
| 191 | + return $tc['geodir_menu_a_class_filter']; |
|
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | /** |
@@ -201,8 +201,8 @@ discard block |
||
| 201 | 201 | */ |
| 202 | 202 | function geodir_sub_menu_a_class_dynamic() |
| 203 | 203 | {
|
| 204 | - $tc = get_option('theme_compatibility_setting');
|
|
| 205 | - return $tc['geodir_sub_menu_a_class_filter']; |
|
| 204 | + $tc = get_option('theme_compatibility_setting');
|
|
| 205 | + return $tc['geodir_sub_menu_a_class_filter']; |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | /** |
@@ -215,8 +215,8 @@ discard block |
||
| 215 | 215 | */ |
| 216 | 216 | function geodir_location_switcher_menu_li_class_dynamic() |
| 217 | 217 | {
|
| 218 | - $tc = get_option('theme_compatibility_setting');
|
|
| 219 | - return $tc['geodir_location_switcher_menu_li_class_filter']; |
|
| 218 | + $tc = get_option('theme_compatibility_setting');
|
|
| 219 | + return $tc['geodir_location_switcher_menu_li_class_filter']; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | /** |
@@ -229,8 +229,8 @@ discard block |
||
| 229 | 229 | */ |
| 230 | 230 | function geodir_location_switcher_menu_a_class_dynamic() |
| 231 | 231 | {
|
| 232 | - $tc = get_option('theme_compatibility_setting');
|
|
| 233 | - return $tc['geodir_location_switcher_menu_a_class_filter']; |
|
| 232 | + $tc = get_option('theme_compatibility_setting');
|
|
| 233 | + return $tc['geodir_location_switcher_menu_a_class_filter']; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | /** |
@@ -243,8 +243,8 @@ discard block |
||
| 243 | 243 | */ |
| 244 | 244 | function geodir_location_switcher_menu_sub_ul_class_dynamic() |
| 245 | 245 | {
|
| 246 | - $tc = get_option('theme_compatibility_setting');
|
|
| 247 | - return $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
| 246 | + $tc = get_option('theme_compatibility_setting');
|
|
| 247 | + return $tc['geodir_location_switcher_menu_sub_ul_class_filter']; |
|
| 248 | 248 | } |
| 249 | 249 | |
| 250 | 250 | /** |
@@ -257,8 +257,8 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | function geodir_location_switcher_menu_sub_li_class_dynamic() |
| 259 | 259 | {
|
| 260 | - $tc = get_option('theme_compatibility_setting');
|
|
| 261 | - return $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
| 260 | + $tc = get_option('theme_compatibility_setting');
|
|
| 261 | + return $tc['geodir_location_switcher_menu_sub_li_class_filter']; |
|
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | |
@@ -275,106 +275,106 @@ discard block |
||
| 275 | 275 | function geodir_content_actions_dynamic() |
| 276 | 276 | {
|
| 277 | 277 | |
| 278 | - $tc = get_option('theme_compatibility_setting');
|
|
| 279 | - if (empty($tc)) {
|
|
| 280 | - return; |
|
| 281 | - } |
|
| 278 | + $tc = get_option('theme_compatibility_setting');
|
|
| 279 | + if (empty($tc)) {
|
|
| 280 | + return; |
|
| 281 | + } |
|
| 282 | 282 | |
| 283 | - //php |
|
| 284 | - if (!empty($tc['geodir_theme_compat_code'])) {
|
|
| 285 | - include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
|
|
| 286 | - } |
|
| 283 | + //php |
|
| 284 | + if (!empty($tc['geodir_theme_compat_code'])) {
|
|
| 285 | + include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
|
|
| 286 | + } |
|
| 287 | 287 | |
| 288 | - //geodir_full_page_class |
|
| 289 | - if (!empty($tc['geodir_full_page_class_filter'])) {
|
|
| 290 | - add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
|
|
| 291 | - } |
|
| 288 | + //geodir_full_page_class |
|
| 289 | + if (!empty($tc['geodir_full_page_class_filter'])) {
|
|
| 290 | + add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
|
|
| 291 | + } |
|
| 292 | 292 | |
| 293 | - //widget before filter |
|
| 294 | - if (!empty($tc['geodir_before_widget_filter'])) {
|
|
| 295 | - add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
|
|
| 296 | - } |
|
| 293 | + //widget before filter |
|
| 294 | + if (!empty($tc['geodir_before_widget_filter'])) {
|
|
| 295 | + add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
|
|
| 296 | + } |
|
| 297 | 297 | |
| 298 | - //widget after filter |
|
| 299 | - if (!empty($tc['geodir_after_widget_filter'])) {
|
|
| 300 | - add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
|
|
| 301 | - } |
|
| 298 | + //widget after filter |
|
| 299 | + if (!empty($tc['geodir_after_widget_filter'])) {
|
|
| 300 | + add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
|
|
| 301 | + } |
|
| 302 | 302 | |
| 303 | - //widget before title filter |
|
| 304 | - if (!empty($tc['geodir_before_title_filter'])) {
|
|
| 305 | - add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
|
|
| 306 | - } |
|
| 303 | + //widget before title filter |
|
| 304 | + if (!empty($tc['geodir_before_title_filter'])) {
|
|
| 305 | + add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
|
|
| 306 | + } |
|
| 307 | 307 | |
| 308 | - //widget before title filter |
|
| 309 | - if (!empty($tc['geodir_after_title_filter'])) {
|
|
| 310 | - add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
|
|
| 311 | - } |
|
| 308 | + //widget before title filter |
|
| 309 | + if (!empty($tc['geodir_after_title_filter'])) {
|
|
| 310 | + add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
|
|
| 311 | + } |
|
| 312 | 312 | |
| 313 | - //menu li class |
|
| 314 | - if (!empty($tc['geodir_menu_li_class_filter'])) {
|
|
| 315 | - add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
|
|
| 316 | - } |
|
| 313 | + //menu li class |
|
| 314 | + if (!empty($tc['geodir_menu_li_class_filter'])) {
|
|
| 315 | + add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
|
|
| 316 | + } |
|
| 317 | 317 | |
| 318 | - //menu ul class |
|
| 319 | - if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
|
|
| 320 | - add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
|
|
| 321 | - } |
|
| 318 | + //menu ul class |
|
| 319 | + if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
|
|
| 320 | + add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
|
|
| 321 | + } |
|
| 322 | 322 | |
| 323 | - //menu sub li class |
|
| 324 | - if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
|
|
| 325 | - add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
|
|
| 326 | - } |
|
| 323 | + //menu sub li class |
|
| 324 | + if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
|
|
| 325 | + add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
|
|
| 326 | + } |
|
| 327 | 327 | |
| 328 | - //menu a class |
|
| 329 | - if (!empty($tc['geodir_menu_a_class_filter'])) {
|
|
| 330 | - add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
|
|
| 331 | - } |
|
| 328 | + //menu a class |
|
| 329 | + if (!empty($tc['geodir_menu_a_class_filter'])) {
|
|
| 330 | + add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
|
|
| 331 | + } |
|
| 332 | 332 | |
| 333 | - //menu sub a class |
|
| 334 | - if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
|
|
| 335 | - add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
|
|
| 336 | - } |
|
| 333 | + //menu sub a class |
|
| 334 | + if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
|
|
| 335 | + add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
|
|
| 336 | + } |
|
| 337 | 337 | |
| 338 | - //location menu li class |
|
| 339 | - if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
|
|
| 340 | - add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
|
|
| 341 | - } |
|
| 338 | + //location menu li class |
|
| 339 | + if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
|
|
| 340 | + add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
|
|
| 341 | + } |
|
| 342 | 342 | |
| 343 | - //location menu sub ul class |
|
| 344 | - if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
|
|
| 345 | - add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
|
|
| 346 | - } |
|
| 343 | + //location menu sub ul class |
|
| 344 | + if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
|
|
| 345 | + add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
|
|
| 346 | + } |
|
| 347 | 347 | |
| 348 | - //location menu sub li class |
|
| 349 | - if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
|
|
| 350 | - add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
|
|
| 351 | - } |
|
| 348 | + //location menu sub li class |
|
| 349 | + if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
|
|
| 350 | + add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
|
|
| 351 | + } |
|
| 352 | 352 | |
| 353 | - //location menu a class |
|
| 354 | - if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
|
|
| 355 | - add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
|
|
| 356 | - } |
|
| 353 | + //location menu a class |
|
| 354 | + if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
|
|
| 355 | + add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
|
|
| 356 | + } |
|
| 357 | 357 | |
| 358 | - // compat styles |
|
| 359 | - if (!empty($tc['geodir_theme_compat_css'])) {
|
|
| 360 | - add_action('wp_head', 'gd_compat_styles');
|
|
| 361 | - } |
|
| 358 | + // compat styles |
|
| 359 | + if (!empty($tc['geodir_theme_compat_css'])) {
|
|
| 360 | + add_action('wp_head', 'gd_compat_styles');
|
|
| 361 | + } |
|
| 362 | 362 | |
| 363 | - // compat js |
|
| 364 | - if (!empty($tc['geodir_theme_compat_js'])) {
|
|
| 365 | - add_action('wp_footer', 'gd_compat_script');
|
|
| 366 | - } |
|
| 363 | + // compat js |
|
| 364 | + if (!empty($tc['geodir_theme_compat_js'])) {
|
|
| 365 | + add_action('wp_footer', 'gd_compat_script');
|
|
| 366 | + } |
|
| 367 | 367 | |
| 368 | 368 | |
| 369 | - // geodir_top_content_add |
|
| 370 | - if (!empty($tc['geodir_top_content_add'])) {
|
|
| 371 | - add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
|
|
| 372 | - } |
|
| 369 | + // geodir_top_content_add |
|
| 370 | + if (!empty($tc['geodir_top_content_add'])) {
|
|
| 371 | + add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
|
|
| 372 | + } |
|
| 373 | 373 | |
| 374 | - // geodir_before_main_content_add |
|
| 375 | - if (!empty($tc['geodir_before_main_content_add'])) {
|
|
| 376 | - add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
|
|
| 377 | - } |
|
| 374 | + // geodir_before_main_content_add |
|
| 375 | + if (!empty($tc['geodir_before_main_content_add'])) {
|
|
| 376 | + add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
|
|
| 377 | + } |
|
| 378 | 378 | |
| 379 | 379 | |
| 380 | 380 | } |
@@ -397,23 +397,23 @@ discard block |
||
| 397 | 397 | */ |
| 398 | 398 | function geodir_action_wrapper_open($type = '', $id = '', $class = '') |
| 399 | 399 | {
|
| 400 | - $tc = get_option('theme_compatibility_setting');
|
|
| 401 | - if (!empty($tc['geodir_wrapper_open_replace'])) {
|
|
| 402 | - $text = $tc['geodir_wrapper_open_replace']; |
|
| 403 | - } else {
|
|
| 404 | - $text = '<div id="[id]" class="[class]">'; |
|
| 405 | - } |
|
| 400 | + $tc = get_option('theme_compatibility_setting');
|
|
| 401 | + if (!empty($tc['geodir_wrapper_open_replace'])) {
|
|
| 402 | + $text = $tc['geodir_wrapper_open_replace']; |
|
| 403 | + } else {
|
|
| 404 | + $text = '<div id="[id]" class="[class]">'; |
|
| 405 | + } |
|
| 406 | 406 | |
| 407 | - if (!empty($tc['geodir_wrapper_open_id'])) {
|
|
| 408 | - $id = $tc['geodir_wrapper_open_id']; |
|
| 409 | - } |
|
| 410 | - if (!empty($tc['geodir_wrapper_open_class'])) {
|
|
| 411 | - $class = $tc['geodir_wrapper_open_class']; |
|
| 412 | - } |
|
| 407 | + if (!empty($tc['geodir_wrapper_open_id'])) {
|
|
| 408 | + $id = $tc['geodir_wrapper_open_id']; |
|
| 409 | + } |
|
| 410 | + if (!empty($tc['geodir_wrapper_open_class'])) {
|
|
| 411 | + $class = $tc['geodir_wrapper_open_class']; |
|
| 412 | + } |
|
| 413 | 413 | |
| 414 | - $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 414 | + $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 415 | 415 | |
| 416 | - echo $text; |
|
| 416 | + echo $text; |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | // action for adding the wrapperdiv closing tag |
@@ -428,14 +428,14 @@ discard block |
||
| 428 | 428 | */ |
| 429 | 429 | function geodir_action_wrapper_close($type = '') |
| 430 | 430 | {
|
| 431 | - $tc = get_option('theme_compatibility_setting');
|
|
| 432 | - if (!empty($tc['geodir_wrapper_close_replace'])) {
|
|
| 433 | - $text = $tc['geodir_wrapper_close_replace']; |
|
| 434 | - } else {
|
|
| 435 | - $text = '</div><!-- wrapper ends here-->'; |
|
| 436 | - } |
|
| 431 | + $tc = get_option('theme_compatibility_setting');
|
|
| 432 | + if (!empty($tc['geodir_wrapper_close_replace'])) {
|
|
| 433 | + $text = $tc['geodir_wrapper_close_replace']; |
|
| 434 | + } else {
|
|
| 435 | + $text = '</div><!-- wrapper ends here-->'; |
|
| 436 | + } |
|
| 437 | 437 | |
| 438 | - echo $text; |
|
| 438 | + echo $text; |
|
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | // action for adding the content div opening tag |
@@ -451,35 +451,35 @@ discard block |
||
| 451 | 451 | */ |
| 452 | 452 | function geodir_action_wrapper_content_open($type = '', $id = '', $class = '') |
| 453 | 453 | {
|
| 454 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
|
|
| 455 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 456 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
|
|
| 457 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 458 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
|
|
| 459 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 460 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
|
|
| 461 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 462 | - } else {
|
|
| 463 | - $width_css = ''; |
|
| 464 | - } |
|
| 465 | - |
|
| 466 | - $tc = get_option('theme_compatibility_setting');
|
|
| 467 | - if (!empty($tc['geodir_wrapper_content_open_replace'])) {
|
|
| 468 | - $text = $tc['geodir_wrapper_content_open_replace']; |
|
| 469 | - } else {
|
|
| 470 | - $text = '<div id="[id]" class="[class]" role="main" [width_css]>'; |
|
| 471 | - } |
|
| 472 | - |
|
| 473 | - if (!empty($tc['geodir_wrapper_content_open_id'])) {
|
|
| 474 | - $id = $tc['geodir_wrapper_content_open_id']; |
|
| 475 | - } |
|
| 476 | - if (!empty($tc['geodir_wrapper_content_open_class'])) {
|
|
| 477 | - $class = $tc['geodir_wrapper_content_open_class']; |
|
| 478 | - } |
|
| 479 | - |
|
| 480 | - $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
|
|
| 481 | - |
|
| 482 | - echo $text; |
|
| 454 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
|
|
| 455 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 456 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
|
|
| 457 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 458 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
|
|
| 459 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 460 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
|
|
| 461 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 462 | + } else {
|
|
| 463 | + $width_css = ''; |
|
| 464 | + } |
|
| 465 | + |
|
| 466 | + $tc = get_option('theme_compatibility_setting');
|
|
| 467 | + if (!empty($tc['geodir_wrapper_content_open_replace'])) {
|
|
| 468 | + $text = $tc['geodir_wrapper_content_open_replace']; |
|
| 469 | + } else {
|
|
| 470 | + $text = '<div id="[id]" class="[class]" role="main" [width_css]>'; |
|
| 471 | + } |
|
| 472 | + |
|
| 473 | + if (!empty($tc['geodir_wrapper_content_open_id'])) {
|
|
| 474 | + $id = $tc['geodir_wrapper_content_open_id']; |
|
| 475 | + } |
|
| 476 | + if (!empty($tc['geodir_wrapper_content_open_class'])) {
|
|
| 477 | + $class = $tc['geodir_wrapper_content_open_class']; |
|
| 478 | + } |
|
| 479 | + |
|
| 480 | + $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
|
|
| 481 | + |
|
| 482 | + echo $text; |
|
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | // action for adding the primary div closing tag |
@@ -493,13 +493,13 @@ discard block |
||
| 493 | 493 | */ |
| 494 | 494 | function geodir_action_wrapper_content_close($type = '') |
| 495 | 495 | {
|
| 496 | - $tc = get_option('theme_compatibility_setting');
|
|
| 497 | - if (!empty($tc['geodir_wrapper_content_close_replace'])) {
|
|
| 498 | - $text = $tc['geodir_wrapper_content_close_replace']; |
|
| 499 | - } else {
|
|
| 500 | - $text = '</div><!-- content ends here-->'; |
|
| 501 | - } |
|
| 502 | - echo $text; |
|
| 496 | + $tc = get_option('theme_compatibility_setting');
|
|
| 497 | + if (!empty($tc['geodir_wrapper_content_close_replace'])) {
|
|
| 498 | + $text = $tc['geodir_wrapper_content_close_replace']; |
|
| 499 | + } else {
|
|
| 500 | + $text = '</div><!-- content ends here-->'; |
|
| 501 | + } |
|
| 502 | + echo $text; |
|
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | // action for adding the <article> opening tag |
@@ -517,24 +517,24 @@ discard block |
||
| 517 | 517 | */ |
| 518 | 518 | function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '') |
| 519 | 519 | {
|
| 520 | - $class = implode(" ", $class);
|
|
| 521 | - $tc = get_option('theme_compatibility_setting');
|
|
| 522 | - if (!empty($tc['geodir_article_open_replace'])) {
|
|
| 523 | - $text = $tc['geodir_article_open_replace']; |
|
| 524 | - } else {
|
|
| 525 | - $text = '<article id="[id]" class="[class]" >'; |
|
| 526 | - } |
|
| 520 | + $class = implode(" ", $class);
|
|
| 521 | + $tc = get_option('theme_compatibility_setting');
|
|
| 522 | + if (!empty($tc['geodir_article_open_replace'])) {
|
|
| 523 | + $text = $tc['geodir_article_open_replace']; |
|
| 524 | + } else {
|
|
| 525 | + $text = '<article id="[id]" class="[class]" >'; |
|
| 526 | + } |
|
| 527 | 527 | |
| 528 | - if (!empty($tc['geodir_article_open_id'])) {
|
|
| 529 | - $id = $tc['geodir_article_open_id']; |
|
| 530 | - } |
|
| 531 | - if (!empty($tc['geodir_article_open_class'])) {
|
|
| 532 | - $class = $tc['geodir_article_open_class']; |
|
| 533 | - } |
|
| 528 | + if (!empty($tc['geodir_article_open_id'])) {
|
|
| 529 | + $id = $tc['geodir_article_open_id']; |
|
| 530 | + } |
|
| 531 | + if (!empty($tc['geodir_article_open_class'])) {
|
|
| 532 | + $class = $tc['geodir_article_open_class']; |
|
| 533 | + } |
|
| 534 | 534 | |
| 535 | - $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
|
|
| 535 | + $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
|
|
| 536 | 536 | |
| 537 | - echo $text; |
|
| 537 | + echo $text; |
|
| 538 | 538 | } |
| 539 | 539 | |
| 540 | 540 | // action for adding the primary div closing tag |
@@ -548,13 +548,13 @@ discard block |
||
| 548 | 548 | */ |
| 549 | 549 | function geodir_action_article_close($type = '') |
| 550 | 550 | {
|
| 551 | - $tc = get_option('theme_compatibility_setting');
|
|
| 552 | - if (!empty($tc['geodir_article_close_replace'])) {
|
|
| 553 | - $text = $tc['geodir_article_close_replace']; |
|
| 554 | - } else {
|
|
| 555 | - $text = '</article><!-- article ends here-->'; |
|
| 556 | - } |
|
| 557 | - echo $text; |
|
| 551 | + $tc = get_option('theme_compatibility_setting');
|
|
| 552 | + if (!empty($tc['geodir_article_close_replace'])) {
|
|
| 553 | + $text = $tc['geodir_article_close_replace']; |
|
| 554 | + } else {
|
|
| 555 | + $text = '</article><!-- article ends here-->'; |
|
| 556 | + } |
|
| 557 | + echo $text; |
|
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | // action for adding the sidebar opening tag |
@@ -571,35 +571,35 @@ discard block |
||
| 571 | 571 | */ |
| 572 | 572 | function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '') |
| 573 | 573 | {
|
| 574 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
|
|
| 575 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 576 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
|
|
| 577 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 578 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
|
|
| 579 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 580 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
|
|
| 581 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 582 | - } else {
|
|
| 583 | - $width_css = ''; |
|
| 584 | - } |
|
| 585 | - |
|
| 586 | - $tc = get_option('theme_compatibility_setting');
|
|
| 587 | - if (!empty($tc['geodir_sidebar_right_open_replace'])) {
|
|
| 588 | - $text = $tc['geodir_sidebar_right_open_replace']; |
|
| 589 | - } else {
|
|
| 590 | - $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 591 | - } |
|
| 592 | - |
|
| 593 | - if (!empty($tc['geodir_sidebar_right_open_id'])) {
|
|
| 594 | - $id = $tc['geodir_sidebar_right_open_id']; |
|
| 595 | - } |
|
| 596 | - if (!empty($tc['geodir_sidebar_right_open_class'])) {
|
|
| 597 | - $class = $tc['geodir_sidebar_right_open_class']; |
|
| 598 | - } |
|
| 599 | - |
|
| 600 | - $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 601 | - |
|
| 602 | - echo $text; |
|
| 574 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
|
|
| 575 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 576 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
|
|
| 577 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 578 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
|
|
| 579 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 580 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
|
|
| 581 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 582 | + } else {
|
|
| 583 | + $width_css = ''; |
|
| 584 | + } |
|
| 585 | + |
|
| 586 | + $tc = get_option('theme_compatibility_setting');
|
|
| 587 | + if (!empty($tc['geodir_sidebar_right_open_replace'])) {
|
|
| 588 | + $text = $tc['geodir_sidebar_right_open_replace']; |
|
| 589 | + } else {
|
|
| 590 | + $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 591 | + } |
|
| 592 | + |
|
| 593 | + if (!empty($tc['geodir_sidebar_right_open_id'])) {
|
|
| 594 | + $id = $tc['geodir_sidebar_right_open_id']; |
|
| 595 | + } |
|
| 596 | + if (!empty($tc['geodir_sidebar_right_open_class'])) {
|
|
| 597 | + $class = $tc['geodir_sidebar_right_open_class']; |
|
| 598 | + } |
|
| 599 | + |
|
| 600 | + $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 601 | + |
|
| 602 | + echo $text; |
|
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | // action for adding the primary div closing tag |
@@ -613,13 +613,13 @@ discard block |
||
| 613 | 613 | */ |
| 614 | 614 | function geodir_action_sidebar_right_close($type = '') |
| 615 | 615 | {
|
| 616 | - $tc = get_option('theme_compatibility_setting');
|
|
| 617 | - if (!empty($tc['geodir_sidebar_right_close_replace'])) {
|
|
| 618 | - $text = $tc['geodir_sidebar_right_close_replace']; |
|
| 619 | - } else {
|
|
| 620 | - $text = '</aside><!-- sidebar ends here-->'; |
|
| 621 | - } |
|
| 622 | - echo $text; |
|
| 616 | + $tc = get_option('theme_compatibility_setting');
|
|
| 617 | + if (!empty($tc['geodir_sidebar_right_close_replace'])) {
|
|
| 618 | + $text = $tc['geodir_sidebar_right_close_replace']; |
|
| 619 | + } else {
|
|
| 620 | + $text = '</aside><!-- sidebar ends here-->'; |
|
| 621 | + } |
|
| 622 | + echo $text; |
|
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | |
@@ -640,121 +640,121 @@ discard block |
||
| 640 | 640 | */ |
| 641 | 641 | function geodir_action_geodir_set_preview_post() |
| 642 | 642 | {
|
| 643 | - global $post, $preview, $gd_session; |
|
| 644 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 645 | - if (!$preview || $is_backend_preview) {
|
|
| 646 | - return; |
|
| 647 | - }// bail if not previewing |
|
| 648 | - |
|
| 649 | - $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : ''; |
|
| 650 | - |
|
| 651 | - $fields_info = geodir_get_custom_fields_type($listing_type); |
|
| 652 | - |
|
| 653 | - foreach ($_REQUEST as $pkey => $pval) {
|
|
| 654 | - if ($pkey == 'geodir_video') {
|
|
| 655 | - $tags = '<iframe>'; |
|
| 656 | - } else if ($pkey == 'post_desc') {
|
|
| 657 | - $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
| 658 | - } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
|
|
| 659 | - $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
| 660 | - } else if (is_array($_REQUEST[$pkey])) {
|
|
| 661 | - $tags = 'skip_field'; |
|
| 662 | - } else {
|
|
| 663 | - $tags = ''; |
|
| 664 | - } |
|
| 665 | - /** |
|
| 666 | - * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page. |
|
| 667 | - * |
|
| 668 | - * @since 1.0.0 |
|
| 669 | - * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'. |
|
| 670 | - * @param string|array $pkey The field id/name. If array then value is set as "skip_field". |
|
| 671 | - */ |
|
| 672 | - $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
|
|
| 673 | - |
|
| 674 | - if ($tags != 'skip_field') {
|
|
| 675 | - $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
| 676 | - } |
|
| 677 | - } |
|
| 678 | - |
|
| 679 | - $post = (object)$_REQUEST; |
|
| 680 | - |
|
| 681 | - |
|
| 682 | - if (isset($post->video)) {
|
|
| 683 | - $post->video = stripslashes($post->video); |
|
| 684 | - } |
|
| 685 | - |
|
| 686 | - if (isset($post->Video2)) {
|
|
| 687 | - $post->Video2 = stripslashes($post->Video2); |
|
| 688 | - } |
|
| 689 | - |
|
| 690 | - $post_type = $post->listing_type; |
|
| 691 | - $post_type_info = get_post_type_object($post_type); |
|
| 692 | - |
|
| 693 | - $listing_label = $post_type_info->labels->singular_name; |
|
| 694 | - |
|
| 695 | - $term_icon = ''; |
|
| 696 | - |
|
| 697 | - if (!empty($post->post_category)) {
|
|
| 698 | - foreach ($post->post_category as $post_taxonomy => $post_term) {
|
|
| 699 | - |
|
| 700 | - if ($post_term != '' && !is_array($post_term)) {
|
|
| 701 | - $post_term = explode(',', trim($post_term, ','));
|
|
| 702 | - } |
|
| 643 | + global $post, $preview, $gd_session; |
|
| 644 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 645 | + if (!$preview || $is_backend_preview) {
|
|
| 646 | + return; |
|
| 647 | + }// bail if not previewing |
|
| 648 | + |
|
| 649 | + $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : ''; |
|
| 650 | + |
|
| 651 | + $fields_info = geodir_get_custom_fields_type($listing_type); |
|
| 652 | + |
|
| 653 | + foreach ($_REQUEST as $pkey => $pval) {
|
|
| 654 | + if ($pkey == 'geodir_video') {
|
|
| 655 | + $tags = '<iframe>'; |
|
| 656 | + } else if ($pkey == 'post_desc') {
|
|
| 657 | + $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
| 658 | + } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
|
|
| 659 | + $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'; |
|
| 660 | + } else if (is_array($_REQUEST[$pkey])) {
|
|
| 661 | + $tags = 'skip_field'; |
|
| 662 | + } else {
|
|
| 663 | + $tags = ''; |
|
| 664 | + } |
|
| 665 | + /** |
|
| 666 | + * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page. |
|
| 667 | + * |
|
| 668 | + * @since 1.0.0 |
|
| 669 | + * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'. |
|
| 670 | + * @param string|array $pkey The field id/name. If array then value is set as "skip_field". |
|
| 671 | + */ |
|
| 672 | + $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
|
|
| 673 | + |
|
| 674 | + if ($tags != 'skip_field') {
|
|
| 675 | + $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags); |
|
| 676 | + } |
|
| 677 | + } |
|
| 678 | + |
|
| 679 | + $post = (object)$_REQUEST; |
|
| 680 | + |
|
| 681 | + |
|
| 682 | + if (isset($post->video)) {
|
|
| 683 | + $post->video = stripslashes($post->video); |
|
| 684 | + } |
|
| 685 | + |
|
| 686 | + if (isset($post->Video2)) {
|
|
| 687 | + $post->Video2 = stripslashes($post->Video2); |
|
| 688 | + } |
|
| 689 | + |
|
| 690 | + $post_type = $post->listing_type; |
|
| 691 | + $post_type_info = get_post_type_object($post_type); |
|
| 692 | + |
|
| 693 | + $listing_label = $post_type_info->labels->singular_name; |
|
| 694 | + |
|
| 695 | + $term_icon = ''; |
|
| 696 | + |
|
| 697 | + if (!empty($post->post_category)) {
|
|
| 698 | + foreach ($post->post_category as $post_taxonomy => $post_term) {
|
|
| 699 | + |
|
| 700 | + if ($post_term != '' && !is_array($post_term)) {
|
|
| 701 | + $post_term = explode(',', trim($post_term, ','));
|
|
| 702 | + } |
|
| 703 | 703 | |
| 704 | - if (is_array($post_term)) {
|
|
| 705 | - $post_term = array_unique($post_term); |
|
| 706 | - } |
|
| 704 | + if (is_array($post_term)) {
|
|
| 705 | + $post_term = array_unique($post_term); |
|
| 706 | + } |
|
| 707 | 707 | |
| 708 | - if (!empty($post_term)) {
|
|
| 709 | - foreach ($post_term as $cat_id) {
|
|
| 710 | - $cat_id = trim($cat_id); |
|
| 711 | - |
|
| 712 | - if ($cat_id != '') {
|
|
| 713 | - $term_icon = get_option('geodir_default_marker_icon');
|
|
| 714 | - |
|
| 715 | - if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
|
|
| 716 | - if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
|
|
| 717 | - if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
| 718 | - $term_icon = $term_icon_url['src']; |
|
| 719 | - break; |
|
| 720 | - } |
|
| 721 | - } |
|
| 722 | - } |
|
| 723 | - } |
|
| 724 | - } |
|
| 725 | - } |
|
| 726 | - } |
|
| 708 | + if (!empty($post_term)) {
|
|
| 709 | + foreach ($post_term as $cat_id) {
|
|
| 710 | + $cat_id = trim($cat_id); |
|
| 711 | + |
|
| 712 | + if ($cat_id != '') {
|
|
| 713 | + $term_icon = get_option('geodir_default_marker_icon');
|
|
| 714 | + |
|
| 715 | + if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
|
|
| 716 | + if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
|
|
| 717 | + if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
| 718 | + $term_icon = $term_icon_url['src']; |
|
| 719 | + break; |
|
| 720 | + } |
|
| 721 | + } |
|
| 722 | + } |
|
| 723 | + } |
|
| 724 | + } |
|
| 725 | + } |
|
| 726 | + } |
|
| 727 | 727 | |
| 728 | - $post_latitude = isset($post->post_latitude) ? $post->post_latitude : ''; |
|
| 729 | - $post_longitude = isset($post->post_longitude) ? $post->post_longitude : ''; |
|
| 728 | + $post_latitude = isset($post->post_latitude) ? $post->post_latitude : ''; |
|
| 729 | + $post_longitude = isset($post->post_longitude) ? $post->post_longitude : ''; |
|
| 730 | 730 | |
| 731 | - $srcharr = array("'", "/", "-", '"', '\\');
|
|
| 732 | - $replarr = array("′", "⁄", "–", "“", '');
|
|
| 731 | + $srcharr = array("'", "/", "-", '"', '\\');
|
|
| 732 | + $replarr = array("′", "⁄", "–", "“", '');
|
|
| 733 | 733 | |
| 734 | - $json_title = str_replace($srcharr, $replarr, $post->post_title); |
|
| 734 | + $json_title = str_replace($srcharr, $replarr, $post->post_title); |
|
| 735 | 735 | |
| 736 | - $json = '{';
|
|
| 737 | - $json .= '"post_preview": "1",'; |
|
| 738 | - $json .= '"t": "' . $json_title . '",'; |
|
| 739 | - $json .= '"lt": "' . $post_latitude . '",'; |
|
| 740 | - $json .= '"ln": "' . $post_longitude . '",'; |
|
| 741 | - $json .= '"i":"' . $term_icon . '"'; |
|
| 742 | - $json .= '}'; |
|
| 736 | + $json = '{';
|
|
| 737 | + $json .= '"post_preview": "1",'; |
|
| 738 | + $json .= '"t": "' . $json_title . '",'; |
|
| 739 | + $json .= '"lt": "' . $post_latitude . '",'; |
|
| 740 | + $json .= '"ln": "' . $post_longitude . '",'; |
|
| 741 | + $json .= '"i":"' . $term_icon . '"'; |
|
| 742 | + $json .= '}'; |
|
| 743 | 743 | |
| 744 | - $post->marker_json = $json; |
|
| 744 | + $post->marker_json = $json; |
|
| 745 | 745 | |
| 746 | - $gd_session->set('listing', $_REQUEST);
|
|
| 746 | + $gd_session->set('listing', $_REQUEST);
|
|
| 747 | 747 | |
| 748 | - // we need to define a few things to trick the setup_postdata |
|
| 749 | - if (!isset($post->ID)) {
|
|
| 750 | - $post->ID = ''; |
|
| 751 | - $post->post_author = ''; |
|
| 752 | - $post->post_date = ''; |
|
| 753 | - $post->post_content = ''; |
|
| 754 | - $post->default_category = ''; |
|
| 755 | - $post->post_type = ''; |
|
| 756 | - } |
|
| 757 | - setup_postdata($post); |
|
| 748 | + // we need to define a few things to trick the setup_postdata |
|
| 749 | + if (!isset($post->ID)) {
|
|
| 750 | + $post->ID = ''; |
|
| 751 | + $post->post_author = ''; |
|
| 752 | + $post->post_date = ''; |
|
| 753 | + $post->post_content = ''; |
|
| 754 | + $post->default_category = ''; |
|
| 755 | + $post->post_type = ''; |
|
| 756 | + } |
|
| 757 | + setup_postdata($post); |
|
| 758 | 758 | } |
| 759 | 759 | |
| 760 | 760 | /** |
@@ -766,15 +766,15 @@ discard block |
||
| 766 | 766 | */ |
| 767 | 767 | function geodir_action_geodir_preview_code() |
| 768 | 768 | {
|
| 769 | - global $preview; |
|
| 769 | + global $preview; |
|
| 770 | 770 | |
| 771 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 771 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 772 | 772 | |
| 773 | - if (!$preview || $is_backend_preview) {
|
|
| 774 | - return; |
|
| 775 | - }// bail if not previewing |
|
| 773 | + if (!$preview || $is_backend_preview) {
|
|
| 774 | + return; |
|
| 775 | + }// bail if not previewing |
|
| 776 | 776 | |
| 777 | - geodir_get_template_part('preview', 'buttons');
|
|
| 777 | + geodir_get_template_part('preview', 'buttons');
|
|
| 778 | 778 | } |
| 779 | 779 | |
| 780 | 780 | // action for adding the details page top widget area |
@@ -790,20 +790,20 @@ discard block |
||
| 790 | 790 | */ |
| 791 | 791 | function geodir_action_geodir_sidebar_detail_top($class = '') |
| 792 | 792 | {
|
| 793 | - if (get_option('geodir_show_detail_top_section')) { ?>
|
|
| 793 | + if (get_option('geodir_show_detail_top_section')) { ?>
|
|
| 794 | 794 | <div |
| 795 | 795 | class="<?php |
| 796 | - /** |
|
| 797 | - * Filter the div class for the wrapper of the full width widget areas. |
|
| 798 | - * |
|
| 799 | - * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas. |
|
| 800 | - * |
|
| 801 | - * @since 1.0.0 |
|
| 802 | - * @param string $class The class of the div. |
|
| 803 | - * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section', |
|
| 804 | - * 'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'. |
|
| 805 | - */ |
|
| 806 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
|
|
| 796 | + /** |
|
| 797 | + * Filter the div class for the wrapper of the full width widget areas. |
|
| 798 | + * |
|
| 799 | + * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas. |
|
| 800 | + * |
|
| 801 | + * @since 1.0.0 |
|
| 802 | + * @param string $class The class of the div. |
|
| 803 | + * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section', |
|
| 804 | + * 'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'. |
|
| 805 | + */ |
|
| 806 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
|
|
| 807 | 807 | <?php dynamic_sidebar('geodir_detail_top'); ?>
|
| 808 | 808 | </div> |
| 809 | 809 | <?php } |
@@ -827,11 +827,11 @@ discard block |
||
| 827 | 827 | */ |
| 828 | 828 | function geodir_action_geodir_sidebar_detail_bottom_section($class = '') |
| 829 | 829 | {
|
| 830 | - if (get_option('geodir_show_detail_bottom_section')) { ?>
|
|
| 830 | + if (get_option('geodir_show_detail_bottom_section')) { ?>
|
|
| 831 | 831 | <div |
| 832 | 832 | class="<?php |
| 833 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 834 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
|
|
| 833 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 834 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
|
|
| 835 | 835 | <?php dynamic_sidebar('geodir_detail_bottom'); ?>
|
| 836 | 836 | </div><!-- clearfix ends here--> |
| 837 | 837 | <?php } |
@@ -845,7 +845,7 @@ discard block |
||
| 845 | 845 | */ |
| 846 | 846 | function geodir_details_sidebar_widget_area() |
| 847 | 847 | {
|
| 848 | - dynamic_sidebar('geodir_detail_sidebar');
|
|
| 848 | + dynamic_sidebar('geodir_detail_sidebar');
|
|
| 849 | 849 | } |
| 850 | 850 | |
| 851 | 851 | /** |
@@ -856,12 +856,12 @@ discard block |
||
| 856 | 856 | */ |
| 857 | 857 | function geodir_details_sidebar_place_details() |
| 858 | 858 | {
|
| 859 | - /** |
|
| 860 | - * Used to add items to the details page sidebar. |
|
| 861 | - * |
|
| 862 | - * @since 1.0.0 |
|
| 863 | - */ |
|
| 864 | - do_action('geodir_detail_page_sidebar');
|
|
| 859 | + /** |
|
| 860 | + * Used to add items to the details page sidebar. |
|
| 861 | + * |
|
| 862 | + * @since 1.0.0 |
|
| 863 | + */ |
|
| 864 | + do_action('geodir_detail_page_sidebar');
|
|
| 865 | 865 | } |
| 866 | 866 | |
| 867 | 867 | add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
|
@@ -876,68 +876,68 @@ discard block |
||
| 876 | 876 | */ |
| 877 | 877 | function geodir_action_details_sidebar() |
| 878 | 878 | {
|
| 879 | - // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
|
| 880 | - if (get_option('geodir_detail_sidebar_left_section')) {
|
|
| 881 | - /** |
|
| 882 | - * Called before the details page left sidebar is opened. |
|
| 883 | - * |
|
| 884 | - * This is used to add opening wrapper HTML to the details page left sidebar. |
|
| 885 | - * |
|
| 886 | - * @since 1.0.0 |
|
| 887 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 888 | - * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'. |
|
| 889 | - * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'. |
|
| 890 | - * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
| 891 | - */ |
|
| 892 | - do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 893 | - ?> |
|
| 879 | + // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
|
| 880 | + if (get_option('geodir_detail_sidebar_left_section')) {
|
|
| 881 | + /** |
|
| 882 | + * Called before the details page left sidebar is opened. |
|
| 883 | + * |
|
| 884 | + * This is used to add opening wrapper HTML to the details page left sidebar. |
|
| 885 | + * |
|
| 886 | + * @since 1.0.0 |
|
| 887 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 888 | + * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'. |
|
| 889 | + * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'. |
|
| 890 | + * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
| 891 | + */ |
|
| 892 | + do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 893 | + ?> |
|
| 894 | 894 | <div class="geodir-content-left geodir-sidebar-wrap"><?php |
| 895 | - /** |
|
| 896 | - * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar. |
|
| 897 | - * |
|
| 898 | - * This is used to add all info to the details page sidebars. |
|
| 899 | - * |
|
| 900 | - * @since 1.0.0 |
|
| 901 | - */ |
|
| 902 | - do_action('geodir_detail_sidebar_inside');
|
|
| 903 | - ?></div><!-- end geodir-content-left --><?php |
|
| 904 | - /** |
|
| 905 | - * Called after the details page left sidebar. |
|
| 906 | - * |
|
| 907 | - * This is used to add closing wrapper HTML to the details page left sidebar. |
|
| 908 | - * |
|
| 909 | - * @since 1.0.0 |
|
| 910 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 911 | - */ |
|
| 912 | - do_action('geodir_sidebar_left_close', 'details-page');
|
|
| 913 | - } else {
|
|
| 914 | - /** |
|
| 915 | - * Called before the details page right sidebar is opened. |
|
| 916 | - * |
|
| 917 | - * This is used to add opening wrapper HTML to the details page right sidebar. |
|
| 918 | - * |
|
| 919 | - * @since 1.0.0 |
|
| 920 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'. |
|
| 921 | - * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'. |
|
| 922 | - * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'. |
|
| 923 | - * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
| 924 | - */ |
|
| 925 | - do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 926 | - ?> |
|
| 895 | + /** |
|
| 896 | + * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar. |
|
| 897 | + * |
|
| 898 | + * This is used to add all info to the details page sidebars. |
|
| 899 | + * |
|
| 900 | + * @since 1.0.0 |
|
| 901 | + */ |
|
| 902 | + do_action('geodir_detail_sidebar_inside');
|
|
| 903 | + ?></div><!-- end geodir-content-left --><?php |
|
| 904 | + /** |
|
| 905 | + * Called after the details page left sidebar. |
|
| 906 | + * |
|
| 907 | + * This is used to add closing wrapper HTML to the details page left sidebar. |
|
| 908 | + * |
|
| 909 | + * @since 1.0.0 |
|
| 910 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 911 | + */ |
|
| 912 | + do_action('geodir_sidebar_left_close', 'details-page');
|
|
| 913 | + } else {
|
|
| 914 | + /** |
|
| 915 | + * Called before the details page right sidebar is opened. |
|
| 916 | + * |
|
| 917 | + * This is used to add opening wrapper HTML to the details page right sidebar. |
|
| 918 | + * |
|
| 919 | + * @since 1.0.0 |
|
| 920 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'. |
|
| 921 | + * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'. |
|
| 922 | + * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'. |
|
| 923 | + * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'. |
|
| 924 | + */ |
|
| 925 | + do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 926 | + ?> |
|
| 927 | 927 | <div class="geodir-content-right geodir-sidebar-wrap"><?php |
| 928 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 929 | - do_action('geodir_detail_sidebar_inside');
|
|
| 930 | - ?></div><!-- end geodir-content-right --><?php |
|
| 931 | - /** |
|
| 932 | - * Called after the details page right sidebar. |
|
| 933 | - * |
|
| 934 | - * This is used to add closing wrapper HTML to the details page right sidebar. |
|
| 935 | - * |
|
| 936 | - * @since 1.0.0 |
|
| 937 | - * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 938 | - */ |
|
| 939 | - do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 940 | - } |
|
| 928 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 929 | + do_action('geodir_detail_sidebar_inside');
|
|
| 930 | + ?></div><!-- end geodir-content-right --><?php |
|
| 931 | + /** |
|
| 932 | + * Called after the details page right sidebar. |
|
| 933 | + * |
|
| 934 | + * This is used to add closing wrapper HTML to the details page right sidebar. |
|
| 935 | + * |
|
| 936 | + * @since 1.0.0 |
|
| 937 | + * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 938 | + */ |
|
| 939 | + do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 940 | + } |
|
| 941 | 941 | } |
| 942 | 942 | |
| 943 | 943 | add_action('geodir_page_title', 'geodir_action_page_title', 10);
|
@@ -951,21 +951,21 @@ discard block |
||
| 951 | 951 | */ |
| 952 | 952 | function geodir_action_page_title() |
| 953 | 953 | {
|
| 954 | - /** |
|
| 955 | - * Filter the page title HTML h1 class. |
|
| 956 | - * |
|
| 957 | - * @since 1.0.0 |
|
| 958 | - * @param string $class The class to use. Default is 'entry-title fn'. |
|
| 959 | - */ |
|
| 960 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 961 | - /** |
|
| 962 | - * Filter the page title HTML header wrapper class. |
|
| 963 | - * |
|
| 964 | - * @since 1.0.0 |
|
| 965 | - * @param string $class The class to use. Default is 'entry-header'. |
|
| 966 | - */ |
|
| 967 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 968 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>'; |
|
| 954 | + /** |
|
| 955 | + * Filter the page title HTML h1 class. |
|
| 956 | + * |
|
| 957 | + * @since 1.0.0 |
|
| 958 | + * @param string $class The class to use. Default is 'entry-title fn'. |
|
| 959 | + */ |
|
| 960 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 961 | + /** |
|
| 962 | + * Filter the page title HTML header wrapper class. |
|
| 963 | + * |
|
| 964 | + * @since 1.0.0 |
|
| 965 | + * @param string $class The class to use. Default is 'entry-header'. |
|
| 966 | + */ |
|
| 967 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 968 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>'; |
|
| 969 | 969 | } |
| 970 | 970 | |
| 971 | 971 | |
@@ -982,87 +982,87 @@ discard block |
||
| 982 | 982 | */ |
| 983 | 983 | function geodir_action_details_slider() |
| 984 | 984 | {
|
| 985 | - global $preview, $post; |
|
| 986 | - |
|
| 987 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend |
|
| 988 | - |
|
| 989 | - if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
|
|
| 990 | - $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 985 | + global $preview, $post; |
|
| 991 | 986 | |
| 992 | - $preview_post_images = array(); |
|
| 993 | - if ($preview_get_images) {
|
|
| 994 | - foreach ($preview_get_images as $row) {
|
|
| 995 | - $preview_post_images[] = $row->src; |
|
| 996 | - } |
|
| 997 | - } |
|
| 998 | - if (!empty($preview_post_images)) {
|
|
| 999 | - $post->post_images = implode(',', $preview_post_images);
|
|
| 1000 | - } |
|
| 1001 | - } |
|
| 987 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend |
|
| 1002 | 988 | |
| 1003 | - if ($preview) {
|
|
| 1004 | - $post_images = array(); |
|
| 1005 | - if (isset($post->post_images) && !empty($post->post_images)) {
|
|
| 1006 | - $post->post_images = trim($post->post_images, ","); |
|
| 1007 | - $post_images = explode(",", $post->post_images);
|
|
| 1008 | - } |
|
| 989 | + if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
|
|
| 990 | + $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 1009 | 991 | |
| 1010 | - $main_slides = ''; |
|
| 1011 | - $nav_slides = ''; |
|
| 1012 | - $slides = 0; |
|
| 1013 | - |
|
| 1014 | - if (!empty($post_images)) {
|
|
| 1015 | - foreach ($post_images as $image) {
|
|
| 1016 | - if (!empty($image)) {
|
|
| 1017 | - $sizes = getimagesize(trim($image)); |
|
| 1018 | - $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0; |
|
| 1019 | - $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
|
| 1020 | - |
|
| 1021 | - if ($image && $width && $height) {
|
|
| 1022 | - $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1023 | - } |
|
| 1024 | - |
|
| 1025 | - if (isset($image->src)) {
|
|
| 1026 | - if ($image->height >= 400) {
|
|
| 1027 | - $spacer_height = 0; |
|
| 1028 | - } else {
|
|
| 1029 | - $spacer_height = ((400 - $image->height) / 2); |
|
| 1030 | - } |
|
| 1031 | - |
|
| 1032 | - $image_title = isset($image->title) ? $image->title : ''; |
|
| 1033 | - |
|
| 1034 | - $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1035 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>'; |
|
| 1036 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1037 | - $slides++; |
|
| 1038 | - } |
|
| 1039 | - } |
|
| 1040 | - }// endfore |
|
| 1041 | - } //end if |
|
| 1042 | - } else {
|
|
| 1043 | - $main_slides = ''; |
|
| 1044 | - $nav_slides = ''; |
|
| 1045 | - $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page. |
|
| 1046 | - $slides = 0; |
|
| 1047 | - |
|
| 1048 | - if (!empty($post_images)) {
|
|
| 1049 | - foreach ($post_images as $image) {
|
|
| 1050 | - if ($image->height >= 400) {
|
|
| 1051 | - $spacer_height = 0; |
|
| 1052 | - } else {
|
|
| 1053 | - $spacer_height = ((400 - $image->height) / 2); |
|
| 1054 | - } |
|
| 1055 | - $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1056 | - $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1057 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
| 1058 | - $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1059 | - $slides++; |
|
| 1060 | - } |
|
| 1061 | - }// endfore |
|
| 1062 | - } |
|
| 992 | + $preview_post_images = array(); |
|
| 993 | + if ($preview_get_images) {
|
|
| 994 | + foreach ($preview_get_images as $row) {
|
|
| 995 | + $preview_post_images[] = $row->src; |
|
| 996 | + } |
|
| 997 | + } |
|
| 998 | + if (!empty($preview_post_images)) {
|
|
| 999 | + $post->post_images = implode(',', $preview_post_images);
|
|
| 1000 | + } |
|
| 1001 | + } |
|
| 1002 | + |
|
| 1003 | + if ($preview) {
|
|
| 1004 | + $post_images = array(); |
|
| 1005 | + if (isset($post->post_images) && !empty($post->post_images)) {
|
|
| 1006 | + $post->post_images = trim($post->post_images, ","); |
|
| 1007 | + $post_images = explode(",", $post->post_images);
|
|
| 1008 | + } |
|
| 1009 | + |
|
| 1010 | + $main_slides = ''; |
|
| 1011 | + $nav_slides = ''; |
|
| 1012 | + $slides = 0; |
|
| 1013 | + |
|
| 1014 | + if (!empty($post_images)) {
|
|
| 1015 | + foreach ($post_images as $image) {
|
|
| 1016 | + if (!empty($image)) {
|
|
| 1017 | + $sizes = getimagesize(trim($image)); |
|
| 1018 | + $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0; |
|
| 1019 | + $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
|
| 1020 | + |
|
| 1021 | + if ($image && $width && $height) {
|
|
| 1022 | + $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1023 | + } |
|
| 1024 | + |
|
| 1025 | + if (isset($image->src)) {
|
|
| 1026 | + if ($image->height >= 400) {
|
|
| 1027 | + $spacer_height = 0; |
|
| 1028 | + } else {
|
|
| 1029 | + $spacer_height = ((400 - $image->height) / 2); |
|
| 1030 | + } |
|
| 1031 | + |
|
| 1032 | + $image_title = isset($image->title) ? $image->title : ''; |
|
| 1033 | + |
|
| 1034 | + $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1035 | + $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>'; |
|
| 1036 | + $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1037 | + $slides++; |
|
| 1038 | + } |
|
| 1039 | + } |
|
| 1040 | + }// endfore |
|
| 1041 | + } //end if |
|
| 1042 | + } else {
|
|
| 1043 | + $main_slides = ''; |
|
| 1044 | + $nav_slides = ''; |
|
| 1045 | + $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page. |
|
| 1046 | + $slides = 0; |
|
| 1047 | + |
|
| 1048 | + if (!empty($post_images)) {
|
|
| 1049 | + foreach ($post_images as $image) {
|
|
| 1050 | + if ($image->height >= 400) {
|
|
| 1051 | + $spacer_height = 0; |
|
| 1052 | + } else {
|
|
| 1053 | + $spacer_height = ((400 - $image->height) / 2); |
|
| 1054 | + } |
|
| 1055 | + $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1056 | + $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
|
| 1057 | + $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
| 1058 | + $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
|
| 1059 | + $slides++; |
|
| 1060 | + } |
|
| 1061 | + }// endfore |
|
| 1062 | + } |
|
| 1063 | 1063 | |
| 1064 | - if (!empty($post_images)) {
|
|
| 1065 | - ?> |
|
| 1064 | + if (!empty($post_images)) {
|
|
| 1065 | + ?> |
|
| 1066 | 1066 | <div class="geodir_flex-container"> |
| 1067 | 1067 | <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div> |
| 1068 | 1068 | <div id="geodir_slider" class="geodir_flexslider "> |
@@ -1075,7 +1075,7 @@ discard block |
||
| 1075 | 1075 | <?php } ?> |
| 1076 | 1076 | </div> |
| 1077 | 1077 | <?php |
| 1078 | - } |
|
| 1078 | + } |
|
| 1079 | 1079 | } |
| 1080 | 1080 | |
| 1081 | 1081 | add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
|
@@ -1090,166 +1090,166 @@ discard block |
||
| 1090 | 1090 | */ |
| 1091 | 1091 | function geodir_action_details_taxonomies() |
| 1092 | 1092 | {
|
| 1093 | - global $preview, $post;?> |
|
| 1093 | + global $preview, $post;?> |
|
| 1094 | 1094 | <p class="geodir_post_taxomomies clearfix"> |
| 1095 | 1095 | <?php |
| 1096 | - $taxonomies = array(); |
|
| 1097 | - |
|
| 1098 | - $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 1099 | - |
|
| 1100 | - if ($preview && !$is_backend_preview) {
|
|
| 1101 | - $post_type = $post->listing_type; |
|
| 1102 | - $post_taxonomy = $post_type . 'category'; |
|
| 1103 | - $post->$post_taxonomy = $post->post_category[$post_taxonomy]; |
|
| 1104 | - } else {
|
|
| 1105 | - $post_type = $post->post_type; |
|
| 1106 | - $post_taxonomy = $post_type . 'category'; |
|
| 1107 | - } |
|
| 1096 | + $taxonomies = array(); |
|
| 1097 | + |
|
| 1098 | + $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend |
|
| 1099 | + |
|
| 1100 | + if ($preview && !$is_backend_preview) {
|
|
| 1101 | + $post_type = $post->listing_type; |
|
| 1102 | + $post_taxonomy = $post_type . 'category'; |
|
| 1103 | + $post->$post_taxonomy = $post->post_category[$post_taxonomy]; |
|
| 1104 | + } else {
|
|
| 1105 | + $post_type = $post->post_type; |
|
| 1106 | + $post_taxonomy = $post_type . 'category'; |
|
| 1107 | + } |
|
| 1108 | 1108 | //{
|
| 1109 | - $post_type_info = get_post_type_object($post_type); |
|
| 1110 | - $listing_label = $post_type_info->labels->singular_name; |
|
| 1111 | - |
|
| 1112 | - if (!empty($post->post_tags)) {
|
|
| 1113 | - |
|
| 1114 | - if (taxonomy_exists($post_type . '_tags')): |
|
| 1115 | - $links = array(); |
|
| 1116 | - $terms = array(); |
|
| 1117 | - // to limit post tags |
|
| 1118 | - $post_tags = trim($post->post_tags, ","); |
|
| 1119 | - $post_id = isset($post->ID) ? $post->ID : ''; |
|
| 1120 | - /** |
|
| 1121 | - * Filter the post tags. |
|
| 1122 | - * |
|
| 1123 | - * Allows you to filter the post tags output on the details page of a post. |
|
| 1124 | - * |
|
| 1125 | - * @since 1.0.0 |
|
| 1126 | - * @param string $post_tags A comma seperated list of tags. |
|
| 1127 | - * @param int $post_id The current post id. |
|
| 1128 | - */ |
|
| 1129 | - $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
|
|
| 1130 | - |
|
| 1131 | - $post->post_tags = $post_tags; |
|
| 1132 | - $post_tags = explode(",", trim($post->post_tags, ","));
|
|
| 1133 | - |
|
| 1134 | - foreach ($post_tags as $post_term) {
|
|
| 1135 | - |
|
| 1136 | - // fix slug creation order for tags & location |
|
| 1137 | - $post_term = trim($post_term); |
|
| 1138 | - |
|
| 1139 | - $priority_location = false; |
|
| 1140 | - if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
|
|
| 1141 | - $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1142 | - } else {
|
|
| 1143 | - $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
|
| 1144 | - $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
|
| 1145 | - $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL; |
|
| 1146 | - $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false; |
|
| 1147 | - $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false; |
|
| 1148 | - $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
|
| 1149 | - if ($match_country || $match_region || $match_city) {
|
|
| 1150 | - $priority_location = true; |
|
| 1151 | - $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1152 | - } else {
|
|
| 1153 | - $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
| 1154 | - $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1155 | - } |
|
| 1156 | - } |
|
| 1157 | - |
|
| 1158 | - if (!is_wp_error($term) && is_object($term)) {
|
|
| 1159 | - |
|
| 1160 | - // fix tag link on detail page |
|
| 1161 | - if ($priority_location) {
|
|
| 1162 | - |
|
| 1163 | - $tag_link = "<a href=''>$post_term</a>"; |
|
| 1164 | - /** |
|
| 1165 | - * Filter the tag name on the details page. |
|
| 1166 | - * |
|
| 1167 | - * @since 1.5.6 |
|
| 1168 | - * @param string $tag_link The tag link html. |
|
| 1169 | - * @param object $term The tag term object. |
|
| 1170 | - */ |
|
| 1171 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1172 | - $links[] = $tag_link; |
|
| 1173 | - } else {
|
|
| 1174 | - $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
| 1175 | - /** This action is documented in geodirectory-template_actions.php */ |
|
| 1176 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1177 | - $links[] = $tag_link; |
|
| 1178 | - } |
|
| 1179 | - $terms[] = $term; |
|
| 1180 | - } |
|
| 1181 | - // |
|
| 1182 | - } |
|
| 1183 | - if (!isset($listing_label)) {
|
|
| 1184 | - $listing_label = ''; |
|
| 1185 | - } |
|
| 1186 | - $taxonomies[$post_type . '_tags'] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $links, (object)$terms);
|
|
| 1187 | - endif; |
|
| 1188 | - |
|
| 1189 | - } |
|
| 1190 | - |
|
| 1191 | - if (!empty($post->$post_taxonomy)) {
|
|
| 1192 | - $links = array(); |
|
| 1193 | - $terms = array(); |
|
| 1194 | - $termsOrdered = array(); |
|
| 1195 | - if (!is_array($post->$post_taxonomy)) {
|
|
| 1196 | - $post_term = explode(",", trim($post->$post_taxonomy, ","));
|
|
| 1197 | - } else {
|
|
| 1198 | - $post_term = $post->$post_taxonomy; |
|
| 1109 | + $post_type_info = get_post_type_object($post_type); |
|
| 1110 | + $listing_label = $post_type_info->labels->singular_name; |
|
| 1111 | + |
|
| 1112 | + if (!empty($post->post_tags)) {
|
|
| 1113 | + |
|
| 1114 | + if (taxonomy_exists($post_type . '_tags')): |
|
| 1115 | + $links = array(); |
|
| 1116 | + $terms = array(); |
|
| 1117 | + // to limit post tags |
|
| 1118 | + $post_tags = trim($post->post_tags, ","); |
|
| 1119 | + $post_id = isset($post->ID) ? $post->ID : ''; |
|
| 1120 | + /** |
|
| 1121 | + * Filter the post tags. |
|
| 1122 | + * |
|
| 1123 | + * Allows you to filter the post tags output on the details page of a post. |
|
| 1124 | + * |
|
| 1125 | + * @since 1.0.0 |
|
| 1126 | + * @param string $post_tags A comma seperated list of tags. |
|
| 1127 | + * @param int $post_id The current post id. |
|
| 1128 | + */ |
|
| 1129 | + $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
|
|
| 1130 | + |
|
| 1131 | + $post->post_tags = $post_tags; |
|
| 1132 | + $post_tags = explode(",", trim($post->post_tags, ","));
|
|
| 1133 | + |
|
| 1134 | + foreach ($post_tags as $post_term) {
|
|
| 1135 | + |
|
| 1136 | + // fix slug creation order for tags & location |
|
| 1137 | + $post_term = trim($post_term); |
|
| 1138 | + |
|
| 1139 | + $priority_location = false; |
|
| 1140 | + if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
|
|
| 1141 | + $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1142 | + } else {
|
|
| 1143 | + $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL; |
|
| 1144 | + $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL; |
|
| 1145 | + $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL; |
|
| 1146 | + $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false; |
|
| 1147 | + $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false; |
|
| 1148 | + $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false; |
|
| 1149 | + if ($match_country || $match_region || $match_city) {
|
|
| 1150 | + $priority_location = true; |
|
| 1151 | + $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1152 | + } else {
|
|
| 1153 | + $insert_term = wp_insert_term($post_term, $post_type . '_tags'); |
|
| 1154 | + $term = get_term_by('name', $post_term, $post_type . '_tags');
|
|
| 1155 | + } |
|
| 1156 | + } |
|
| 1157 | + |
|
| 1158 | + if (!is_wp_error($term) && is_object($term)) {
|
|
| 1159 | + |
|
| 1160 | + // fix tag link on detail page |
|
| 1161 | + if ($priority_location) {
|
|
| 1162 | + |
|
| 1163 | + $tag_link = "<a href=''>$post_term</a>"; |
|
| 1164 | + /** |
|
| 1165 | + * Filter the tag name on the details page. |
|
| 1166 | + * |
|
| 1167 | + * @since 1.5.6 |
|
| 1168 | + * @param string $tag_link The tag link html. |
|
| 1169 | + * @param object $term The tag term object. |
|
| 1170 | + */ |
|
| 1171 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1172 | + $links[] = $tag_link; |
|
| 1173 | + } else {
|
|
| 1174 | + $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
|
| 1175 | + /** This action is documented in geodirectory-template_actions.php */ |
|
| 1176 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1177 | + $links[] = $tag_link; |
|
| 1178 | + } |
|
| 1179 | + $terms[] = $term; |
|
| 1180 | + } |
|
| 1181 | + // |
|
| 1182 | + } |
|
| 1183 | + if (!isset($listing_label)) {
|
|
| 1184 | + $listing_label = ''; |
|
| 1185 | + } |
|
| 1186 | + $taxonomies[$post_type . '_tags'] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $links, (object)$terms);
|
|
| 1187 | + endif; |
|
| 1188 | + |
|
| 1189 | + } |
|
| 1190 | + |
|
| 1191 | + if (!empty($post->$post_taxonomy)) {
|
|
| 1192 | + $links = array(); |
|
| 1193 | + $terms = array(); |
|
| 1194 | + $termsOrdered = array(); |
|
| 1195 | + if (!is_array($post->$post_taxonomy)) {
|
|
| 1196 | + $post_term = explode(",", trim($post->$post_taxonomy, ","));
|
|
| 1197 | + } else {
|
|
| 1198 | + $post_term = $post->$post_taxonomy; |
|
| 1199 | 1199 | |
| 1200 | 1200 | if ($preview && !$is_backend_preview) {
|
| 1201 | 1201 | $post_term = geodir_add_parent_terms($post_term, $post_taxonomy); |
| 1202 | 1202 | } |
| 1203 | - } |
|
| 1203 | + } |
|
| 1204 | + |
|
| 1205 | + $post_term = array_unique($post_term); |
|
| 1206 | + if (!empty($post_term)) {
|
|
| 1207 | + foreach ($post_term as $post_term) {
|
|
| 1208 | + $post_term = trim($post_term); |
|
| 1209 | + |
|
| 1210 | + if ($post_term != ''): |
|
| 1211 | + $term = get_term_by('id', $post_term, $post_taxonomy);
|
|
| 1212 | + |
|
| 1213 | + if (is_object($term)) {
|
|
| 1214 | + $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
| 1215 | + /** |
|
| 1216 | + * Filter the category name on the details page. |
|
| 1217 | + * |
|
| 1218 | + * @since 1.5.6 |
|
| 1219 | + * @param string $term_link The link html to the category. |
|
| 1220 | + * @param object $term The category term object. |
|
| 1221 | + */ |
|
| 1222 | + $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
|
|
| 1223 | + $links[] = $term_link; |
|
| 1224 | + $terms[] = $term; |
|
| 1225 | + } |
|
| 1226 | + endif; |
|
| 1227 | + } |
|
| 1228 | + // order alphabetically |
|
| 1229 | + asort($links); |
|
| 1230 | + foreach (array_keys($links) as $key) {
|
|
| 1231 | + $termsOrdered[$key] = $terms[$key]; |
|
| 1232 | + } |
|
| 1233 | + $terms = $termsOrdered; |
|
| 1204 | 1234 | |
| 1205 | - $post_term = array_unique($post_term); |
|
| 1206 | - if (!empty($post_term)) {
|
|
| 1207 | - foreach ($post_term as $post_term) {
|
|
| 1208 | - $post_term = trim($post_term); |
|
| 1209 | - |
|
| 1210 | - if ($post_term != ''): |
|
| 1211 | - $term = get_term_by('id', $post_term, $post_taxonomy);
|
|
| 1212 | - |
|
| 1213 | - if (is_object($term)) {
|
|
| 1214 | - $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>"; |
|
| 1215 | - /** |
|
| 1216 | - * Filter the category name on the details page. |
|
| 1217 | - * |
|
| 1218 | - * @since 1.5.6 |
|
| 1219 | - * @param string $term_link The link html to the category. |
|
| 1220 | - * @param object $term The category term object. |
|
| 1221 | - */ |
|
| 1222 | - $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
|
|
| 1223 | - $links[] = $term_link; |
|
| 1224 | - $terms[] = $term; |
|
| 1225 | - } |
|
| 1226 | - endif; |
|
| 1227 | - } |
|
| 1228 | - // order alphabetically |
|
| 1229 | - asort($links); |
|
| 1230 | - foreach (array_keys($links) as $key) {
|
|
| 1231 | - $termsOrdered[$key] = $terms[$key]; |
|
| 1232 | - } |
|
| 1233 | - $terms = $termsOrdered; |
|
| 1235 | + } |
|
| 1234 | 1236 | |
| 1235 | - } |
|
| 1237 | + if (!isset($listing_label)) {
|
|
| 1238 | + $listing_label = ''; |
|
| 1239 | + } |
|
| 1240 | + $taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object)$terms);
|
|
| 1236 | 1241 | |
| 1237 | - if (!isset($listing_label)) {
|
|
| 1238 | - $listing_label = ''; |
|
| 1239 | - } |
|
| 1240 | - $taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object)$terms);
|
|
| 1241 | - |
|
| 1242 | - } |
|
| 1242 | + } |
|
| 1243 | 1243 | |
| 1244 | 1244 | |
| 1245 | - if (isset($taxonomies[$post_taxonomy])) {
|
|
| 1246 | - echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
| 1247 | - } |
|
| 1245 | + if (isset($taxonomies[$post_taxonomy])) {
|
|
| 1246 | + echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
|
| 1247 | + } |
|
| 1248 | 1248 | |
| 1249 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1250 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1249 | + if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1250 | + echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1251 | 1251 | |
| 1252 | - ?> |
|
| 1252 | + ?> |
|
| 1253 | 1253 | </p><?php |
| 1254 | 1254 | } |
| 1255 | 1255 | |
@@ -1271,126 +1271,126 @@ discard block |
||
| 1271 | 1271 | function geodir_action_details_micordata($post='') |
| 1272 | 1272 | {
|
| 1273 | 1273 | |
| 1274 | - global $preview; |
|
| 1275 | - if(empty($post)){global $post;}
|
|
| 1276 | - if ($preview || !geodir_is_page('detail')) {
|
|
| 1277 | - return; |
|
| 1278 | - } |
|
| 1279 | - |
|
| 1280 | - // url |
|
| 1281 | - $c_url = geodir_curPageURL(); |
|
| 1282 | - |
|
| 1283 | - // post reviews |
|
| 1284 | - $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
|
|
| 1285 | - if (empty($post_reviews)) {
|
|
| 1286 | - $reviews = ''; |
|
| 1287 | - } else {
|
|
| 1288 | - foreach ($post_reviews as $review) {
|
|
| 1289 | - $reviews[] = array( |
|
| 1290 | - "@type" => "Review", |
|
| 1291 | - "author" => $review->comment_author, |
|
| 1292 | - "datePublished" => $review->comment_date, |
|
| 1293 | - "description" => $review->comment_content, |
|
| 1294 | - "reviewRating" => array( |
|
| 1295 | - "@type" => "Rating", |
|
| 1296 | - "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
| 1297 | - "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
|
| 1298 | - "worstRating" => "1" |
|
| 1299 | - ) |
|
| 1300 | - ); |
|
| 1301 | - } |
|
| 1302 | - |
|
| 1303 | - } |
|
| 1304 | - |
|
| 1305 | - // post images |
|
| 1306 | - $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 1307 | - if (empty($post_images)) {
|
|
| 1308 | - $images = ''; |
|
| 1309 | - } else {
|
|
| 1310 | - $i_arr = array(); |
|
| 1311 | - foreach ($post_images as $img) {
|
|
| 1312 | - $i_arr[] = $img->src; |
|
| 1313 | - } |
|
| 1314 | - |
|
| 1315 | - if (count($i_arr) == 1) {
|
|
| 1316 | - $images = $i_arr[0]; |
|
| 1317 | - } else {
|
|
| 1318 | - $images = $i_arr; |
|
| 1319 | - } |
|
| 1320 | - |
|
| 1321 | - } |
|
| 1322 | - //print_r($post); |
|
| 1323 | - // external links |
|
| 1324 | - $external_links = array(); |
|
| 1325 | - $external_links[] = $post->geodir_website; |
|
| 1326 | - $external_links[] = $post->geodir_twitter; |
|
| 1327 | - $external_links[] = $post->geodir_facebook; |
|
| 1328 | - $external_links = array_filter($external_links); |
|
| 1329 | - |
|
| 1330 | - if(!empty($external_links)){
|
|
| 1331 | - $external_links = array_values($external_links); |
|
| 1332 | - } |
|
| 1333 | - |
|
| 1334 | - // reviews |
|
| 1335 | - $comment_count = geodir_get_review_count_total($post->ID); |
|
| 1336 | - $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 1337 | - |
|
| 1338 | - // schema type |
|
| 1339 | - $schema_type = 'LocalBusiness'; |
|
| 1340 | - if(isset($post->default_category) && $post->default_category){
|
|
| 1341 | - $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
|
| 1342 | - if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
|
|
| 1343 | - } |
|
| 1344 | - |
|
| 1345 | - $schema = array(); |
|
| 1346 | - $schema['@context'] = "http://schema.org"; |
|
| 1347 | - $schema['@type'] = $schema_type; |
|
| 1348 | - $schema['name'] = $post->post_name; |
|
| 1349 | - $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
| 1350 | - $schema['telephone'] = $post->geodir_contact; |
|
| 1351 | - $schema['url'] = $c_url; |
|
| 1352 | - $schema['sameAs'] = $external_links; |
|
| 1353 | - $schema['image'] = $images; |
|
| 1354 | - $schema['address'] = array( |
|
| 1355 | - "@type" => "PostalAddress", |
|
| 1356 | - "streetAddress" => $post->post_address, |
|
| 1357 | - "addressLocality" => $post->post_city, |
|
| 1358 | - "addressRegion" => $post->post_region, |
|
| 1359 | - "addressCountry" => $post->post_country, |
|
| 1360 | - "postalCode" => $post->post_zip |
|
| 1361 | - ); |
|
| 1362 | - |
|
| 1363 | - if($post->post_latitude && $post->post_longitude) {
|
|
| 1364 | - $schema['geo'] = array( |
|
| 1365 | - "@type" => "GeoCoordinates", |
|
| 1366 | - "latitude" => $post->post_latitude, |
|
| 1367 | - "longitude" => $post->post_longitude |
|
| 1368 | - ); |
|
| 1369 | - } |
|
| 1370 | - |
|
| 1371 | - if($post_avgratings) {
|
|
| 1372 | - $schema['aggregateRating'] = array( |
|
| 1373 | - "@type" => "AggregateRating", |
|
| 1374 | - "ratingValue" => $post_avgratings, |
|
| 1375 | - "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
| 1376 | - "worstRating" => "1", |
|
| 1377 | - "ratingCount" => $comment_count |
|
| 1378 | - ); |
|
| 1379 | - } |
|
| 1380 | - $schema['review'] = $reviews; |
|
| 1381 | - |
|
| 1382 | - /** |
|
| 1383 | - * Allow the schema JSON-LD info to be filtered. |
|
| 1384 | - * |
|
| 1385 | - * @since 1.5.4 |
|
| 1386 | - * @since 1.5.7 Added $post variable. |
|
| 1387 | - * @param array $schema The array of schema data to be filtered. |
|
| 1388 | - * @param object $post The post object. |
|
| 1389 | - */ |
|
| 1390 | - $schema = apply_filters('geodir_details_schema', $schema,$post);
|
|
| 1391 | - |
|
| 1392 | - |
|
| 1393 | - echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
| 1274 | + global $preview; |
|
| 1275 | + if(empty($post)){global $post;}
|
|
| 1276 | + if ($preview || !geodir_is_page('detail')) {
|
|
| 1277 | + return; |
|
| 1278 | + } |
|
| 1279 | + |
|
| 1280 | + // url |
|
| 1281 | + $c_url = geodir_curPageURL(); |
|
| 1282 | + |
|
| 1283 | + // post reviews |
|
| 1284 | + $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
|
|
| 1285 | + if (empty($post_reviews)) {
|
|
| 1286 | + $reviews = ''; |
|
| 1287 | + } else {
|
|
| 1288 | + foreach ($post_reviews as $review) {
|
|
| 1289 | + $reviews[] = array( |
|
| 1290 | + "@type" => "Review", |
|
| 1291 | + "author" => $review->comment_author, |
|
| 1292 | + "datePublished" => $review->comment_date, |
|
| 1293 | + "description" => $review->comment_content, |
|
| 1294 | + "reviewRating" => array( |
|
| 1295 | + "@type" => "Rating", |
|
| 1296 | + "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
| 1297 | + "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
|
| 1298 | + "worstRating" => "1" |
|
| 1299 | + ) |
|
| 1300 | + ); |
|
| 1301 | + } |
|
| 1302 | + |
|
| 1303 | + } |
|
| 1304 | + |
|
| 1305 | + // post images |
|
| 1306 | + $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
|
|
| 1307 | + if (empty($post_images)) {
|
|
| 1308 | + $images = ''; |
|
| 1309 | + } else {
|
|
| 1310 | + $i_arr = array(); |
|
| 1311 | + foreach ($post_images as $img) {
|
|
| 1312 | + $i_arr[] = $img->src; |
|
| 1313 | + } |
|
| 1314 | + |
|
| 1315 | + if (count($i_arr) == 1) {
|
|
| 1316 | + $images = $i_arr[0]; |
|
| 1317 | + } else {
|
|
| 1318 | + $images = $i_arr; |
|
| 1319 | + } |
|
| 1320 | + |
|
| 1321 | + } |
|
| 1322 | + //print_r($post); |
|
| 1323 | + // external links |
|
| 1324 | + $external_links = array(); |
|
| 1325 | + $external_links[] = $post->geodir_website; |
|
| 1326 | + $external_links[] = $post->geodir_twitter; |
|
| 1327 | + $external_links[] = $post->geodir_facebook; |
|
| 1328 | + $external_links = array_filter($external_links); |
|
| 1329 | + |
|
| 1330 | + if(!empty($external_links)){
|
|
| 1331 | + $external_links = array_values($external_links); |
|
| 1332 | + } |
|
| 1333 | + |
|
| 1334 | + // reviews |
|
| 1335 | + $comment_count = geodir_get_review_count_total($post->ID); |
|
| 1336 | + $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 1337 | + |
|
| 1338 | + // schema type |
|
| 1339 | + $schema_type = 'LocalBusiness'; |
|
| 1340 | + if(isset($post->default_category) && $post->default_category){
|
|
| 1341 | + $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
|
| 1342 | + if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
|
|
| 1343 | + } |
|
| 1344 | + |
|
| 1345 | + $schema = array(); |
|
| 1346 | + $schema['@context'] = "http://schema.org"; |
|
| 1347 | + $schema['@type'] = $schema_type; |
|
| 1348 | + $schema['name'] = $post->post_name; |
|
| 1349 | + $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
| 1350 | + $schema['telephone'] = $post->geodir_contact; |
|
| 1351 | + $schema['url'] = $c_url; |
|
| 1352 | + $schema['sameAs'] = $external_links; |
|
| 1353 | + $schema['image'] = $images; |
|
| 1354 | + $schema['address'] = array( |
|
| 1355 | + "@type" => "PostalAddress", |
|
| 1356 | + "streetAddress" => $post->post_address, |
|
| 1357 | + "addressLocality" => $post->post_city, |
|
| 1358 | + "addressRegion" => $post->post_region, |
|
| 1359 | + "addressCountry" => $post->post_country, |
|
| 1360 | + "postalCode" => $post->post_zip |
|
| 1361 | + ); |
|
| 1362 | + |
|
| 1363 | + if($post->post_latitude && $post->post_longitude) {
|
|
| 1364 | + $schema['geo'] = array( |
|
| 1365 | + "@type" => "GeoCoordinates", |
|
| 1366 | + "latitude" => $post->post_latitude, |
|
| 1367 | + "longitude" => $post->post_longitude |
|
| 1368 | + ); |
|
| 1369 | + } |
|
| 1370 | + |
|
| 1371 | + if($post_avgratings) {
|
|
| 1372 | + $schema['aggregateRating'] = array( |
|
| 1373 | + "@type" => "AggregateRating", |
|
| 1374 | + "ratingValue" => $post_avgratings, |
|
| 1375 | + "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
| 1376 | + "worstRating" => "1", |
|
| 1377 | + "ratingCount" => $comment_count |
|
| 1378 | + ); |
|
| 1379 | + } |
|
| 1380 | + $schema['review'] = $reviews; |
|
| 1381 | + |
|
| 1382 | + /** |
|
| 1383 | + * Allow the schema JSON-LD info to be filtered. |
|
| 1384 | + * |
|
| 1385 | + * @since 1.5.4 |
|
| 1386 | + * @since 1.5.7 Added $post variable. |
|
| 1387 | + * @param array $schema The array of schema data to be filtered. |
|
| 1388 | + * @param object $post The post object. |
|
| 1389 | + */ |
|
| 1390 | + $schema = apply_filters('geodir_details_schema', $schema,$post);
|
|
| 1391 | + |
|
| 1392 | + |
|
| 1393 | + echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
|
| 1394 | 1394 | |
| 1395 | 1395 | } |
| 1396 | 1396 | |
@@ -1408,7 +1408,7 @@ discard block |
||
| 1408 | 1408 | */ |
| 1409 | 1409 | function geodir_action_details_next_prev() |
| 1410 | 1410 | {
|
| 1411 | - ?> |
|
| 1411 | + ?> |
|
| 1412 | 1412 | <div class="geodir-pos_navigation clearfix"> |
| 1413 | 1413 | <div |
| 1414 | 1414 | class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
|
@@ -1426,15 +1426,15 @@ discard block |
||
| 1426 | 1426 | */ |
| 1427 | 1427 | function geodir_action_before_single_post() |
| 1428 | 1428 | {
|
| 1429 | - global $post; |
|
| 1430 | - /** |
|
| 1431 | - * Called at the very start fo the details page output, before the title section. |
|
| 1432 | - * |
|
| 1433 | - * @since 1.0.0 |
|
| 1434 | - * @param object $post The current post object. |
|
| 1435 | - * @global WP_Post|null $post The current post, if available. |
|
| 1436 | - */ |
|
| 1437 | - do_action('geodir_before_single_post', $post); // extra action
|
|
| 1429 | + global $post; |
|
| 1430 | + /** |
|
| 1431 | + * Called at the very start fo the details page output, before the title section. |
|
| 1432 | + * |
|
| 1433 | + * @since 1.0.0 |
|
| 1434 | + * @param object $post The current post object. |
|
| 1435 | + * @global WP_Post|null $post The current post, if available. |
|
| 1436 | + */ |
|
| 1437 | + do_action('geodir_before_single_post', $post); // extra action
|
|
| 1438 | 1438 | } |
| 1439 | 1439 | |
| 1440 | 1440 | /** |
@@ -1445,13 +1445,13 @@ discard block |
||
| 1445 | 1445 | */ |
| 1446 | 1446 | function geodir_action_after_single_post($post) |
| 1447 | 1447 | {
|
| 1448 | - /** |
|
| 1449 | - * Called on the details page after the details page tabs section and before the next/prev buttons. |
|
| 1450 | - * |
|
| 1451 | - * @since 1.0.0 |
|
| 1452 | - * @param object $post The current post object. |
|
| 1453 | - */ |
|
| 1454 | - do_action('geodir_after_single_post', $post); // extra action
|
|
| 1448 | + /** |
|
| 1449 | + * Called on the details page after the details page tabs section and before the next/prev buttons. |
|
| 1450 | + * |
|
| 1451 | + * @since 1.0.0 |
|
| 1452 | + * @param object $post The current post object. |
|
| 1453 | + */ |
|
| 1454 | + do_action('geodir_after_single_post', $post); // extra action
|
|
| 1455 | 1455 | } |
| 1456 | 1456 | |
| 1457 | 1457 | add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
|
@@ -1477,167 +1477,167 @@ discard block |
||
| 1477 | 1477 | */ |
| 1478 | 1478 | function geodir_action_listings_title() |
| 1479 | 1479 | {
|
| 1480 | - global $wp, $term; |
|
| 1481 | - |
|
| 1482 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 1483 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 1484 | - |
|
| 1485 | - $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 1486 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 1487 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 1488 | - } |
|
| 1489 | - |
|
| 1490 | - $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
| 1491 | - $single_name = $post_type_info->labels->singular_name; |
|
| 1492 | - |
|
| 1493 | - $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
|
| 1480 | + global $wp, $term; |
|
| 1494 | 1481 | |
| 1495 | - $gd_country = get_query_var('gd_country');
|
|
| 1496 | - $gd_region = get_query_var('gd_region');
|
|
| 1497 | - $gd_city = get_query_var('gd_city');
|
|
| 1482 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 1483 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 1498 | 1484 | |
| 1499 | - if (!empty($term)) {
|
|
| 1500 | - $location_name = ''; |
|
| 1501 | - if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
|
|
| 1502 | - if ($gd_country != '') {
|
|
| 1503 | - $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
|
|
| 1504 | - } |
|
| 1505 | - |
|
| 1506 | - if ($gd_region != '') {
|
|
| 1507 | - $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
|
|
| 1508 | - } |
|
| 1509 | - |
|
| 1510 | - if ($gd_city != '') {
|
|
| 1511 | - $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
|
|
| 1512 | - } |
|
| 1513 | - } |
|
| 1514 | - |
|
| 1515 | - $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 1516 | - if (!empty($current_term)) {
|
|
| 1517 | - $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1518 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1519 | - $location_last_char = substr($location_name, -1); |
|
| 1520 | - $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1521 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1522 | - } else {
|
|
| 1523 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1524 | - } |
|
| 1525 | - } else {
|
|
| 1526 | - if (count($taxonomy) > 1) {
|
|
| 1527 | - $current_term = get_term_by('slug', $term, $taxonomy[1]);
|
|
| 1528 | - |
|
| 1529 | - if (!empty($current_term)) {
|
|
| 1530 | - $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1531 | - if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1532 | - $location_last_char = substr($location_name, -1); |
|
| 1533 | - $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1534 | - $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1535 | - } else {
|
|
| 1536 | - $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1537 | - } |
|
| 1538 | - } |
|
| 1539 | - } |
|
| 1540 | - } |
|
| 1485 | + $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 1486 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 1487 | + $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 1488 | + } |
|
| 1541 | 1489 | |
| 1542 | - } else {
|
|
| 1543 | - $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
| 1544 | - $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
| 1545 | - $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
| 1490 | + $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory'); |
|
| 1491 | + $single_name = $post_type_info->labels->singular_name; |
|
| 1546 | 1492 | |
| 1547 | - $gd_country_actual = $gd_region_actual = $gd_city_actual = ''; |
|
| 1493 | + $taxonomy = geodir_get_taxonomies($gd_post_type, true); |
|
| 1548 | 1494 | |
| 1549 | - if (function_exists('get_actual_location_name')) {
|
|
| 1550 | - $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
|
|
| 1551 | - $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
|
|
| 1552 | - $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
|
|
| 1553 | - } |
|
| 1495 | + $gd_country = get_query_var('gd_country');
|
|
| 1496 | + $gd_region = get_query_var('gd_region');
|
|
| 1497 | + $gd_city = get_query_var('gd_city');
|
|
| 1554 | 1498 | |
| 1555 | - if ($gd_city != '') {
|
|
| 1556 | - if ($gd_city_actual != '') {
|
|
| 1557 | - $gd_city = $gd_city_actual; |
|
| 1558 | - } else {
|
|
| 1559 | - $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
|
|
| 1560 | - $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
|
|
| 1561 | - $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
|
| 1562 | - } |
|
| 1563 | - |
|
| 1564 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
|
|
| 1565 | - } else if ($gd_region != '') {
|
|
| 1566 | - if ($gd_region_actual != '') {
|
|
| 1567 | - $gd_region = $gd_region_actual; |
|
| 1568 | - } else {
|
|
| 1569 | - $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
|
|
| 1570 | - $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
|
|
| 1571 | - $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
|
| 1572 | - } |
|
| 1573 | - |
|
| 1574 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
|
|
| 1575 | - } else if ($gd_country != '') {
|
|
| 1576 | - if ($gd_country_actual != '') {
|
|
| 1577 | - $gd_country = $gd_country_actual; |
|
| 1578 | - } else {
|
|
| 1579 | - $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
|
|
| 1580 | - $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
|
|
| 1581 | - $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
|
| 1582 | - } |
|
| 1583 | - |
|
| 1584 | - $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
|
|
| 1585 | - } |
|
| 1586 | - } |
|
| 1587 | - |
|
| 1588 | - if (is_search()) {
|
|
| 1589 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 1590 | - } |
|
| 1591 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1592 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 1593 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1594 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 1595 | - |
|
| 1596 | - |
|
| 1597 | - $title = $list_title; |
|
| 1598 | - if(geodir_is_page('pt')){
|
|
| 1599 | - $gd_page = 'pt'; |
|
| 1600 | - $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1601 | - } |
|
| 1602 | - elseif(geodir_is_page('listing')){
|
|
| 1603 | - $gd_page = 'listing'; |
|
| 1604 | - global $wp_query; |
|
| 1605 | - $current_term = $wp_query->get_queried_object(); |
|
| 1606 | - if (strpos($current_term->taxonomy,'_tags') !== false) {
|
|
| 1607 | - $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
|
| 1608 | - }else{
|
|
| 1609 | - $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
|
| 1610 | - } |
|
| 1499 | + if (!empty($term)) {
|
|
| 1500 | + $location_name = ''; |
|
| 1501 | + if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
|
|
| 1502 | + if ($gd_country != '') {
|
|
| 1503 | + $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
|
|
| 1504 | + } |
|
| 1611 | 1505 | |
| 1612 | - } |
|
| 1613 | - elseif(geodir_is_page('author')){
|
|
| 1614 | - $gd_page = 'author'; |
|
| 1615 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 1616 | - $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 1617 | - }else{
|
|
| 1618 | - $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 1619 | - } |
|
| 1506 | + if ($gd_region != '') {
|
|
| 1507 | + $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
|
|
| 1508 | + } |
|
| 1620 | 1509 | |
| 1621 | - } |
|
| 1510 | + if ($gd_city != '') {
|
|
| 1511 | + $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
|
|
| 1512 | + } |
|
| 1513 | + } |
|
| 1514 | + |
|
| 1515 | + $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 1516 | + if (!empty($current_term)) {
|
|
| 1517 | + $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1518 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1519 | + $location_last_char = substr($location_name, -1); |
|
| 1520 | + $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1521 | + $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1522 | + } else {
|
|
| 1523 | + $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1524 | + } |
|
| 1525 | + } else {
|
|
| 1526 | + if (count($taxonomy) > 1) {
|
|
| 1527 | + $current_term = get_term_by('slug', $term, $taxonomy[1]);
|
|
| 1528 | + |
|
| 1529 | + if (!empty($current_term)) {
|
|
| 1530 | + $current_term_name = __(ucfirst($current_term->name), 'geodirectory'); |
|
| 1531 | + if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
|
|
| 1532 | + $location_last_char = substr($location_name, -1); |
|
| 1533 | + $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
|
|
| 1534 | + $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
|
|
| 1535 | + } else {
|
|
| 1536 | + $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
|
|
| 1537 | + } |
|
| 1538 | + } |
|
| 1539 | + } |
|
| 1540 | + } |
|
| 1541 | + |
|
| 1542 | + } else {
|
|
| 1543 | + $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : ''; |
|
| 1544 | + $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : ''; |
|
| 1545 | + $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : ''; |
|
| 1546 | + |
|
| 1547 | + $gd_country_actual = $gd_region_actual = $gd_city_actual = ''; |
|
| 1548 | + |
|
| 1549 | + if (function_exists('get_actual_location_name')) {
|
|
| 1550 | + $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
|
|
| 1551 | + $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
|
|
| 1552 | + $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
|
|
| 1553 | + } |
|
| 1554 | + |
|
| 1555 | + if ($gd_city != '') {
|
|
| 1556 | + if ($gd_city_actual != '') {
|
|
| 1557 | + $gd_city = $gd_city_actual; |
|
| 1558 | + } else {
|
|
| 1559 | + $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
|
|
| 1560 | + $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
|
|
| 1561 | + $gd_city = __(geodir_ucwords($gd_city), 'geodirectory'); |
|
| 1562 | + } |
|
| 1622 | 1563 | |
| 1564 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
|
|
| 1565 | + } else if ($gd_region != '') {
|
|
| 1566 | + if ($gd_region_actual != '') {
|
|
| 1567 | + $gd_region = $gd_region_actual; |
|
| 1568 | + } else {
|
|
| 1569 | + $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
|
|
| 1570 | + $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
|
|
| 1571 | + $gd_region = __(geodir_ucwords($gd_region), 'geodirectory'); |
|
| 1572 | + } |
|
| 1623 | 1573 | |
| 1624 | - /** |
|
| 1625 | - * Filter page title to replace variables. |
|
| 1626 | - * |
|
| 1627 | - * @since 1.5.4 |
|
| 1628 | - * @param string $title The page title including variables. |
|
| 1629 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 1630 | - */ |
|
| 1631 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1574 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
|
|
| 1575 | + } else if ($gd_country != '') {
|
|
| 1576 | + if ($gd_country_actual != '') {
|
|
| 1577 | + $gd_country = $gd_country_actual; |
|
| 1578 | + } else {
|
|
| 1579 | + $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
|
|
| 1580 | + $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
|
|
| 1581 | + $gd_country = __(geodir_ucwords($gd_country), 'geodirectory'); |
|
| 1582 | + } |
|
| 1632 | 1583 | |
| 1633 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 1634 | - /** |
|
| 1635 | - * Filter the listing page title. |
|
| 1636 | - * |
|
| 1637 | - * @since 1.0.0 |
|
| 1638 | - * @param string $list_title The title for the category page. |
|
| 1639 | - */ |
|
| 1640 | - apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
|
|
| 1584 | + $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
|
|
| 1585 | + } |
|
| 1586 | + } |
|
| 1587 | + |
|
| 1588 | + if (is_search()) {
|
|
| 1589 | + $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 1590 | + } |
|
| 1591 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1592 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 1593 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1594 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 1595 | + |
|
| 1596 | + |
|
| 1597 | + $title = $list_title; |
|
| 1598 | + if(geodir_is_page('pt')){
|
|
| 1599 | + $gd_page = 'pt'; |
|
| 1600 | + $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1601 | + } |
|
| 1602 | + elseif(geodir_is_page('listing')){
|
|
| 1603 | + $gd_page = 'listing'; |
|
| 1604 | + global $wp_query; |
|
| 1605 | + $current_term = $wp_query->get_queried_object(); |
|
| 1606 | + if (strpos($current_term->taxonomy,'_tags') !== false) {
|
|
| 1607 | + $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
|
| 1608 | + }else{
|
|
| 1609 | + $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
|
| 1610 | + } |
|
| 1611 | + |
|
| 1612 | + } |
|
| 1613 | + elseif(geodir_is_page('author')){
|
|
| 1614 | + $gd_page = 'author'; |
|
| 1615 | + if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 1616 | + $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 1617 | + }else{
|
|
| 1618 | + $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 1619 | + } |
|
| 1620 | + |
|
| 1621 | + } |
|
| 1622 | + |
|
| 1623 | + |
|
| 1624 | + /** |
|
| 1625 | + * Filter page title to replace variables. |
|
| 1626 | + * |
|
| 1627 | + * @since 1.5.4 |
|
| 1628 | + * @param string $title The page title including variables. |
|
| 1629 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 1630 | + */ |
|
| 1631 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1632 | + |
|
| 1633 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 1634 | + /** |
|
| 1635 | + * Filter the listing page title. |
|
| 1636 | + * |
|
| 1637 | + * @since 1.0.0 |
|
| 1638 | + * @param string $list_title The title for the category page. |
|
| 1639 | + */ |
|
| 1640 | + apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
|
|
| 1641 | 1641 | } |
| 1642 | 1642 | |
| 1643 | 1643 | add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
|
@@ -1650,33 +1650,33 @@ discard block |
||
| 1650 | 1650 | */ |
| 1651 | 1651 | function geodir_action_listings_description() |
| 1652 | 1652 | {
|
| 1653 | - global $wp_query; |
|
| 1654 | - $current_term = $wp_query->get_queried_object(); |
|
| 1655 | - |
|
| 1656 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 1657 | - if (isset($current_term->term_id) && $current_term->term_id != '') {
|
|
| 1658 | - |
|
| 1659 | - $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
| 1660 | - $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
|
| 1661 | - if ($term_desc && !$saved_data) {
|
|
| 1662 | - $saved_data = $term_desc; |
|
| 1663 | - } |
|
| 1664 | - /** |
|
| 1665 | - * Apply the core filter `the_content` filter to the variable string. |
|
| 1666 | - * |
|
| 1667 | - * This is a WordPress core filter that does many things. |
|
| 1668 | - * |
|
| 1669 | - * @since 1.0.0 |
|
| 1670 | - * @param string $var The string to apply the filter to. |
|
| 1671 | - */ |
|
| 1672 | - $cat_description = apply_filters('the_content', $saved_data);
|
|
| 1673 | - if ($cat_description) {
|
|
| 1674 | - ?> |
|
| 1653 | + global $wp_query; |
|
| 1654 | + $current_term = $wp_query->get_queried_object(); |
|
| 1655 | + |
|
| 1656 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 1657 | + if (isset($current_term->term_id) && $current_term->term_id != '') {
|
|
| 1658 | + |
|
| 1659 | + $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags'); |
|
| 1660 | + $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type)); |
|
| 1661 | + if ($term_desc && !$saved_data) {
|
|
| 1662 | + $saved_data = $term_desc; |
|
| 1663 | + } |
|
| 1664 | + /** |
|
| 1665 | + * Apply the core filter `the_content` filter to the variable string. |
|
| 1666 | + * |
|
| 1667 | + * This is a WordPress core filter that does many things. |
|
| 1668 | + * |
|
| 1669 | + * @since 1.0.0 |
|
| 1670 | + * @param string $var The string to apply the filter to. |
|
| 1671 | + */ |
|
| 1672 | + $cat_description = apply_filters('the_content', $saved_data);
|
|
| 1673 | + if ($cat_description) {
|
|
| 1674 | + ?> |
|
| 1675 | 1675 | |
| 1676 | 1676 | <div class="term_description"><?php echo $cat_description;?></div> <?php |
| 1677 | - } |
|
| 1677 | + } |
|
| 1678 | 1678 | |
| 1679 | - } |
|
| 1679 | + } |
|
| 1680 | 1680 | } |
| 1681 | 1681 | |
| 1682 | 1682 | // action for adding the listings page top widget area |
@@ -1695,11 +1695,11 @@ discard block |
||
| 1695 | 1695 | */ |
| 1696 | 1696 | function geodir_action_geodir_sidebar_listings_top() |
| 1697 | 1697 | {
|
| 1698 | - if (get_option('geodir_show_listing_top_section')) { ?>
|
|
| 1698 | + if (get_option('geodir_show_listing_top_section')) { ?>
|
|
| 1699 | 1699 | <div |
| 1700 | 1700 | class="<?php |
| 1701 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1702 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
|
|
| 1701 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1702 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
|
|
| 1703 | 1703 | <?php dynamic_sidebar('geodir_listing_top'); ?>
|
| 1704 | 1704 | </div><!-- clearfix ends here--> |
| 1705 | 1705 | <?php } |
@@ -1722,35 +1722,35 @@ discard block |
||
| 1722 | 1722 | */ |
| 1723 | 1723 | function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '') |
| 1724 | 1724 | {
|
| 1725 | - if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
|
|
| 1726 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1727 | - } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
|
|
| 1728 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1729 | - } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
|
|
| 1730 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1731 | - } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
|
|
| 1732 | - $width_css = 'style="width:' . $width . '%;"'; |
|
| 1733 | - } else {
|
|
| 1734 | - $width_css = ''; |
|
| 1735 | - } |
|
| 1736 | - |
|
| 1737 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1738 | - if (!empty($tc['geodir_sidebar_left_open_replace'])) {
|
|
| 1739 | - $text = $tc['geodir_sidebar_left_open_replace']; |
|
| 1740 | - } else {
|
|
| 1741 | - $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 1742 | - } |
|
| 1743 | - |
|
| 1744 | - if (!empty($tc['geodir_sidebar_left_open_id'])) {
|
|
| 1745 | - $id = $tc['geodir_sidebar_left_open_id']; |
|
| 1746 | - } |
|
| 1747 | - if (!empty($tc['geodir_sidebar_left_open_class'])) {
|
|
| 1748 | - $class = $tc['geodir_sidebar_left_open_class']; |
|
| 1749 | - } |
|
| 1750 | - |
|
| 1751 | - $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 1752 | - |
|
| 1753 | - echo $text; |
|
| 1725 | + if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
|
|
| 1726 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1727 | + } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
|
|
| 1728 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1729 | + } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
|
|
| 1730 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1731 | + } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
|
|
| 1732 | + $width_css = 'style="width:' . $width . '%;"'; |
|
| 1733 | + } else {
|
|
| 1734 | + $width_css = ''; |
|
| 1735 | + } |
|
| 1736 | + |
|
| 1737 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1738 | + if (!empty($tc['geodir_sidebar_left_open_replace'])) {
|
|
| 1739 | + $text = $tc['geodir_sidebar_left_open_replace']; |
|
| 1740 | + } else {
|
|
| 1741 | + $text = '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>'; |
|
| 1742 | + } |
|
| 1743 | + |
|
| 1744 | + if (!empty($tc['geodir_sidebar_left_open_id'])) {
|
|
| 1745 | + $id = $tc['geodir_sidebar_left_open_id']; |
|
| 1746 | + } |
|
| 1747 | + if (!empty($tc['geodir_sidebar_left_open_class'])) {
|
|
| 1748 | + $class = $tc['geodir_sidebar_left_open_class']; |
|
| 1749 | + } |
|
| 1750 | + |
|
| 1751 | + $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
|
|
| 1752 | + |
|
| 1753 | + echo $text; |
|
| 1754 | 1754 | } |
| 1755 | 1755 | |
| 1756 | 1756 | // action for adding the primary div closing tag |
@@ -1766,13 +1766,13 @@ discard block |
||
| 1766 | 1766 | */ |
| 1767 | 1767 | function geodir_action_sidebar_left_close($type = '') |
| 1768 | 1768 | {
|
| 1769 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1770 | - if (!empty($tc['geodir_sidebar_left_close_replace'])) {
|
|
| 1771 | - $text = $tc['geodir_sidebar_left_close_replace']; |
|
| 1772 | - } else {
|
|
| 1773 | - $text = '</aside><!-- sidebar ends here-->'; |
|
| 1774 | - } |
|
| 1775 | - echo $text; |
|
| 1769 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1770 | + if (!empty($tc['geodir_sidebar_left_close_replace'])) {
|
|
| 1771 | + $text = $tc['geodir_sidebar_left_close_replace']; |
|
| 1772 | + } else {
|
|
| 1773 | + $text = '</aside><!-- sidebar ends here-->'; |
|
| 1774 | + } |
|
| 1775 | + echo $text; |
|
| 1776 | 1776 | } |
| 1777 | 1777 | |
| 1778 | 1778 | /** |
@@ -1785,7 +1785,7 @@ discard block |
||
| 1785 | 1785 | */ |
| 1786 | 1786 | function geodir_listing_left_section() |
| 1787 | 1787 | {
|
| 1788 | - if (get_option('geodir_show_listing_left_section')) { ?>
|
|
| 1788 | + if (get_option('geodir_show_listing_left_section')) { ?>
|
|
| 1789 | 1789 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 1790 | 1790 | <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
|
| 1791 | 1791 | </div><!-- end geodir-content-left --> |
@@ -1803,20 +1803,20 @@ discard block |
||
| 1803 | 1803 | */ |
| 1804 | 1804 | function geodir_action_listings_sidebar_left() |
| 1805 | 1805 | {
|
| 1806 | - if (get_option('geodir_show_listing_left_section')) {
|
|
| 1807 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1808 | - do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 1809 | - /** |
|
| 1810 | - * Calls the listings page (category) left sidebar content. |
|
| 1811 | - * |
|
| 1812 | - * All the content for the listings page left sidebar is added via this hook. |
|
| 1813 | - * |
|
| 1814 | - * @since 1.0.0 |
|
| 1815 | - */ |
|
| 1816 | - do_action('geodir_listings_sidebar_left_inside');
|
|
| 1817 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1818 | - do_action('geodir_sidebar_left_close', 'listings-page');
|
|
| 1819 | - } |
|
| 1806 | + if (get_option('geodir_show_listing_left_section')) {
|
|
| 1807 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1808 | + do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 1809 | + /** |
|
| 1810 | + * Calls the listings page (category) left sidebar content. |
|
| 1811 | + * |
|
| 1812 | + * All the content for the listings page left sidebar is added via this hook. |
|
| 1813 | + * |
|
| 1814 | + * @since 1.0.0 |
|
| 1815 | + */ |
|
| 1816 | + do_action('geodir_listings_sidebar_left_inside');
|
|
| 1817 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1818 | + do_action('geodir_sidebar_left_close', 'listings-page');
|
|
| 1819 | + } |
|
| 1820 | 1820 | } |
| 1821 | 1821 | |
| 1822 | 1822 | /** |
@@ -1829,7 +1829,7 @@ discard block |
||
| 1829 | 1829 | */ |
| 1830 | 1830 | function geodir_listing_right_section() |
| 1831 | 1831 | {
|
| 1832 | - if (get_option('geodir_show_listing_right_section')) { ?>
|
|
| 1832 | + if (get_option('geodir_show_listing_right_section')) { ?>
|
|
| 1833 | 1833 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 1834 | 1834 | <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
|
| 1835 | 1835 | </div><!-- end geodir-content-right --> |
@@ -1847,20 +1847,20 @@ discard block |
||
| 1847 | 1847 | */ |
| 1848 | 1848 | function geodir_action_listings_sidebar_right() |
| 1849 | 1849 | {
|
| 1850 | - if (get_option('geodir_show_listing_right_section')) {
|
|
| 1851 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1852 | - do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 1853 | - /** |
|
| 1854 | - * Calls the listings page (category) right sidebar content. |
|
| 1855 | - * |
|
| 1856 | - * All the content for the listings page right sidebar is added via this hook. |
|
| 1857 | - * |
|
| 1858 | - * @since 1.0.0 |
|
| 1859 | - */ |
|
| 1860 | - do_action('geodir_listings_sidebar_right_inside');
|
|
| 1861 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 1862 | - do_action('geodir_sidebar_right_close', 'listings-page');
|
|
| 1863 | - } |
|
| 1850 | + if (get_option('geodir_show_listing_right_section')) {
|
|
| 1851 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1852 | + do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 1853 | + /** |
|
| 1854 | + * Calls the listings page (category) right sidebar content. |
|
| 1855 | + * |
|
| 1856 | + * All the content for the listings page right sidebar is added via this hook. |
|
| 1857 | + * |
|
| 1858 | + * @since 1.0.0 |
|
| 1859 | + */ |
|
| 1860 | + do_action('geodir_listings_sidebar_right_inside');
|
|
| 1861 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 1862 | + do_action('geodir_sidebar_right_close', 'listings-page');
|
|
| 1863 | + } |
|
| 1864 | 1864 | } |
| 1865 | 1865 | |
| 1866 | 1866 | |
@@ -1877,23 +1877,23 @@ discard block |
||
| 1877 | 1877 | */ |
| 1878 | 1878 | function geodir_action_main_content_open($type = '', $id = '', $class = '') |
| 1879 | 1879 | {
|
| 1880 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1881 | - if (!empty($tc['geodir_main_content_open_replace'])) {
|
|
| 1882 | - $text = $tc['geodir_main_content_open_replace']; |
|
| 1883 | - } else {
|
|
| 1884 | - $text = '<main id="[id]" class="[class]" role="main">'; |
|
| 1885 | - } |
|
| 1880 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1881 | + if (!empty($tc['geodir_main_content_open_replace'])) {
|
|
| 1882 | + $text = $tc['geodir_main_content_open_replace']; |
|
| 1883 | + } else {
|
|
| 1884 | + $text = '<main id="[id]" class="[class]" role="main">'; |
|
| 1885 | + } |
|
| 1886 | 1886 | |
| 1887 | - if (!empty($tc['geodir_main_content_open_id'])) {
|
|
| 1888 | - $id = $tc['geodir_main_content_open_id']; |
|
| 1889 | - } |
|
| 1890 | - if (!empty($tc['geodir_main_content_open_class'])) {
|
|
| 1891 | - $class = $tc['geodir_main_content_open_class']; |
|
| 1892 | - } |
|
| 1887 | + if (!empty($tc['geodir_main_content_open_id'])) {
|
|
| 1888 | + $id = $tc['geodir_main_content_open_id']; |
|
| 1889 | + } |
|
| 1890 | + if (!empty($tc['geodir_main_content_open_class'])) {
|
|
| 1891 | + $class = $tc['geodir_main_content_open_class']; |
|
| 1892 | + } |
|
| 1893 | 1893 | |
| 1894 | - $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 1894 | + $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
|
|
| 1895 | 1895 | |
| 1896 | - echo $text; |
|
| 1896 | + echo $text; |
|
| 1897 | 1897 | } |
| 1898 | 1898 | |
| 1899 | 1899 | // action for adding the primary div closing tag |
@@ -1906,13 +1906,13 @@ discard block |
||
| 1906 | 1906 | */ |
| 1907 | 1907 | function geodir_action_main_content_close() |
| 1908 | 1908 | {
|
| 1909 | - $tc = get_option('theme_compatibility_setting');
|
|
| 1910 | - if (!empty($tc['geodir_main_content_close_replace'])) {
|
|
| 1911 | - $text = $tc['geodir_main_content_close_replace']; |
|
| 1912 | - } else {
|
|
| 1913 | - $text = '</main><!-- main ends here-->'; |
|
| 1914 | - } |
|
| 1915 | - echo $text; |
|
| 1909 | + $tc = get_option('theme_compatibility_setting');
|
|
| 1910 | + if (!empty($tc['geodir_main_content_close_replace'])) {
|
|
| 1911 | + $text = $tc['geodir_main_content_close_replace']; |
|
| 1912 | + } else {
|
|
| 1913 | + $text = '</main><!-- main ends here-->'; |
|
| 1914 | + } |
|
| 1915 | + echo $text; |
|
| 1916 | 1916 | } |
| 1917 | 1917 | |
| 1918 | 1918 | /** |
@@ -1924,14 +1924,14 @@ discard block |
||
| 1924 | 1924 | */ |
| 1925 | 1925 | function geodir_action_listings_content_inside() |
| 1926 | 1926 | {
|
| 1927 | - global $gridview_columns; |
|
| 1928 | - $listing_view = get_option('geodir_listing_view');
|
|
| 1929 | - if (strstr($listing_view, 'gridview')) {
|
|
| 1930 | - $gridview_columns = $listing_view; |
|
| 1931 | - $listing_view_exp = explode('_', $listing_view);
|
|
| 1932 | - $listing_view = $listing_view_exp[0]; |
|
| 1933 | - } |
|
| 1934 | - geodir_get_template_part('listing', 'listview');
|
|
| 1927 | + global $gridview_columns; |
|
| 1928 | + $listing_view = get_option('geodir_listing_view');
|
|
| 1929 | + if (strstr($listing_view, 'gridview')) {
|
|
| 1930 | + $gridview_columns = $listing_view; |
|
| 1931 | + $listing_view_exp = explode('_', $listing_view);
|
|
| 1932 | + $listing_view = $listing_view_exp[0]; |
|
| 1933 | + } |
|
| 1934 | + geodir_get_template_part('listing', 'listview');
|
|
| 1935 | 1935 | } |
| 1936 | 1936 | |
| 1937 | 1937 | add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
|
@@ -1947,47 +1947,47 @@ discard block |
||
| 1947 | 1947 | */ |
| 1948 | 1948 | function geodir_action_listings_content() |
| 1949 | 1949 | {
|
| 1950 | - /** |
|
| 1951 | - * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1952 | - * |
|
| 1953 | - * @since 1.0.0 |
|
| 1954 | - * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1955 | - * @param string $id The id for the div. Usually 'geodir-main-content'. |
|
| 1956 | - * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1957 | - * @see 'geodir_main_content_close' Where the oposing closing tag is added. |
|
| 1958 | - */ |
|
| 1959 | - do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
|
|
| 1960 | - $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
|
|
| 1961 | - echo '<div class="clearfix '.$extra_class.'">'; |
|
| 1962 | - /** |
|
| 1963 | - * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
|
| 1964 | - * |
|
| 1965 | - * @since 1.0.0 |
|
| 1966 | - */ |
|
| 1967 | - do_action('geodir_before_listing');
|
|
| 1968 | - echo '</div>'; |
|
| 1969 | - |
|
| 1970 | - /** |
|
| 1971 | - * This actions calls the listings list content. Used on listings pages and search and author pages. |
|
| 1972 | - * |
|
| 1973 | - * @since 1.0.0 |
|
| 1974 | - */ |
|
| 1975 | - do_action('geodir_listings_content_inside');
|
|
| 1976 | - |
|
| 1977 | - /** |
|
| 1978 | - * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages. |
|
| 1979 | - * |
|
| 1980 | - * @since 1.0.0 |
|
| 1981 | - */ |
|
| 1982 | - do_action('geodir_after_listing');
|
|
| 1983 | - |
|
| 1984 | - /** |
|
| 1985 | - * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1986 | - * |
|
| 1987 | - * @since 1.0.0 |
|
| 1988 | - * @see 'geodir_main_content_open' Where the oposing opening tag is added. |
|
| 1989 | - */ |
|
| 1990 | - do_action('geodir_main_content_close', 'listings-page');
|
|
| 1950 | + /** |
|
| 1951 | + * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1952 | + * |
|
| 1953 | + * @since 1.0.0 |
|
| 1954 | + * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1955 | + * @param string $id The id for the div. Usually 'geodir-main-content'. |
|
| 1956 | + * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'. |
|
| 1957 | + * @see 'geodir_main_content_close' Where the oposing closing tag is added. |
|
| 1958 | + */ |
|
| 1959 | + do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
|
|
| 1960 | + $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
|
|
| 1961 | + echo '<div class="clearfix '.$extra_class.'">'; |
|
| 1962 | + /** |
|
| 1963 | + * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
|
| 1964 | + * |
|
| 1965 | + * @since 1.0.0 |
|
| 1966 | + */ |
|
| 1967 | + do_action('geodir_before_listing');
|
|
| 1968 | + echo '</div>'; |
|
| 1969 | + |
|
| 1970 | + /** |
|
| 1971 | + * This actions calls the listings list content. Used on listings pages and search and author pages. |
|
| 1972 | + * |
|
| 1973 | + * @since 1.0.0 |
|
| 1974 | + */ |
|
| 1975 | + do_action('geodir_listings_content_inside');
|
|
| 1976 | + |
|
| 1977 | + /** |
|
| 1978 | + * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages. |
|
| 1979 | + * |
|
| 1980 | + * @since 1.0.0 |
|
| 1981 | + */ |
|
| 1982 | + do_action('geodir_after_listing');
|
|
| 1983 | + |
|
| 1984 | + /** |
|
| 1985 | + * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc. |
|
| 1986 | + * |
|
| 1987 | + * @since 1.0.0 |
|
| 1988 | + * @see 'geodir_main_content_open' Where the oposing opening tag is added. |
|
| 1989 | + */ |
|
| 1990 | + do_action('geodir_main_content_close', 'listings-page');
|
|
| 1991 | 1991 | } |
| 1992 | 1992 | |
| 1993 | 1993 | |
@@ -2002,10 +2002,10 @@ discard block |
||
| 2002 | 2002 | */ |
| 2003 | 2003 | function geodir_action_sidebar_listings_bottom_section() |
| 2004 | 2004 | {
|
| 2005 | - if (get_option('geodir_show_listing_bottom_section')) { ?>
|
|
| 2005 | + if (get_option('geodir_show_listing_bottom_section')) { ?>
|
|
| 2006 | 2006 | <div class="<?php |
| 2007 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2008 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
|
|
| 2007 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2008 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
|
|
| 2009 | 2009 | <?php dynamic_sidebar('geodir_listing_bottom'); ?>
|
| 2010 | 2010 | </div><!-- clearfix ends here--> |
| 2011 | 2011 | <?php } |
@@ -2025,38 +2025,38 @@ discard block |
||
| 2025 | 2025 | */ |
| 2026 | 2026 | function geodir_action_add_listing_page_title() |
| 2027 | 2027 | {
|
| 2028 | - if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
| 2029 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2030 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2031 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2032 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2033 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2034 | - |
|
| 2035 | - $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
|
|
| 2036 | - |
|
| 2037 | - if(geodir_is_page('add-listing')){
|
|
| 2038 | - $gd_page = 'add-listing'; |
|
| 2039 | - if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
|
| 2040 | - $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
|
| 2041 | - }elseif(isset($listing_type)){
|
|
| 2042 | - $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
|
| 2043 | - } |
|
| 2028 | + if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
| 2029 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2030 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2031 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2032 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2033 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2034 | + |
|
| 2035 | + $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
|
|
| 2044 | 2036 | |
| 2045 | - } |
|
| 2037 | + if(geodir_is_page('add-listing')){
|
|
| 2038 | + $gd_page = 'add-listing'; |
|
| 2039 | + if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
|
| 2040 | + $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
|
| 2041 | + }elseif(isset($listing_type)){
|
|
| 2042 | + $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
|
| 2043 | + } |
|
| 2046 | 2044 | |
| 2045 | + } |
|
| 2047 | 2046 | |
| 2048 | - /** |
|
| 2049 | - * Filter page title to replace variables. |
|
| 2050 | - * |
|
| 2051 | - * @since 1.5.4 |
|
| 2052 | - * @param string $title The page title including variables. |
|
| 2053 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 2054 | - */ |
|
| 2055 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2056 | 2047 | |
| 2057 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
| 2058 | - echo $title; |
|
| 2059 | - echo '</h1></header>'; |
|
| 2048 | + /** |
|
| 2049 | + * Filter page title to replace variables. |
|
| 2050 | + * |
|
| 2051 | + * @since 1.5.4 |
|
| 2052 | + * @param string $title The page title including variables. |
|
| 2053 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 2054 | + */ |
|
| 2055 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2056 | + |
|
| 2057 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
|
| 2058 | + echo $title; |
|
| 2059 | + echo '</h1></header>'; |
|
| 2060 | 2060 | } |
| 2061 | 2061 | |
| 2062 | 2062 | add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
|
@@ -2087,54 +2087,54 @@ discard block |
||
| 2087 | 2087 | */ |
| 2088 | 2088 | function geodir_action_add_listing_form() |
| 2089 | 2089 | {
|
| 2090 | - global $cat_display, $post_cat, $current_user, $gd_session; |
|
| 2091 | - $page_id = get_the_ID(); |
|
| 2092 | - $post = ''; |
|
| 2093 | - $title = ''; |
|
| 2094 | - $desc = ''; |
|
| 2095 | - $kw_tags = ''; |
|
| 2096 | - $required_msg = ''; |
|
| 2097 | - $submit_button = ''; |
|
| 2098 | - |
|
| 2099 | - $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add'; |
|
| 2100 | - |
|
| 2101 | - $thumb_img_arr = array(); |
|
| 2102 | - $curImages = ''; |
|
| 2103 | - |
|
| 2104 | - if (isset($_REQUEST['backandedit'])) {
|
|
| 2105 | - global $post; |
|
| 2106 | - $post = (object)$gd_session->get('listing');
|
|
| 2107 | - $listing_type = $post->listing_type; |
|
| 2108 | - $title = $post->post_title; |
|
| 2109 | - $desc = $post->post_desc; |
|
| 2110 | - $post_cat = $post->post_category; |
|
| 2111 | - |
|
| 2112 | - $kw_tags = $post->post_tags; |
|
| 2113 | - $curImages = isset($post->post_images) ? $post->post_images : ''; |
|
| 2114 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2115 | - global $post, $post_images; |
|
| 2116 | - |
|
| 2117 | - $post = geodir_get_post_info($_REQUEST['pid']); |
|
| 2118 | - $thumb_img_arr = geodir_get_images($post->ID); |
|
| 2119 | - if ($thumb_img_arr) {
|
|
| 2120 | - foreach ($thumb_img_arr as $post_img) {
|
|
| 2121 | - $curImages .= $post_img->src . ','; |
|
| 2122 | - } |
|
| 2123 | - } |
|
| 2124 | - |
|
| 2125 | - $listing_type = $post->post_type; |
|
| 2126 | - $title = $post->post_title; |
|
| 2127 | - $desc = $post->post_content; |
|
| 2128 | - $kw_tags = $post->post_tags; |
|
| 2129 | - $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
|
|
| 2130 | - } else {
|
|
| 2131 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2132 | - } |
|
| 2133 | - |
|
| 2134 | - if ($current_user->ID != '0') {
|
|
| 2135 | - $user_login = true; |
|
| 2136 | - } |
|
| 2137 | - ?> |
|
| 2090 | + global $cat_display, $post_cat, $current_user, $gd_session; |
|
| 2091 | + $page_id = get_the_ID(); |
|
| 2092 | + $post = ''; |
|
| 2093 | + $title = ''; |
|
| 2094 | + $desc = ''; |
|
| 2095 | + $kw_tags = ''; |
|
| 2096 | + $required_msg = ''; |
|
| 2097 | + $submit_button = ''; |
|
| 2098 | + |
|
| 2099 | + $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add'; |
|
| 2100 | + |
|
| 2101 | + $thumb_img_arr = array(); |
|
| 2102 | + $curImages = ''; |
|
| 2103 | + |
|
| 2104 | + if (isset($_REQUEST['backandedit'])) {
|
|
| 2105 | + global $post; |
|
| 2106 | + $post = (object)$gd_session->get('listing');
|
|
| 2107 | + $listing_type = $post->listing_type; |
|
| 2108 | + $title = $post->post_title; |
|
| 2109 | + $desc = $post->post_desc; |
|
| 2110 | + $post_cat = $post->post_category; |
|
| 2111 | + |
|
| 2112 | + $kw_tags = $post->post_tags; |
|
| 2113 | + $curImages = isset($post->post_images) ? $post->post_images : ''; |
|
| 2114 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2115 | + global $post, $post_images; |
|
| 2116 | + |
|
| 2117 | + $post = geodir_get_post_info($_REQUEST['pid']); |
|
| 2118 | + $thumb_img_arr = geodir_get_images($post->ID); |
|
| 2119 | + if ($thumb_img_arr) {
|
|
| 2120 | + foreach ($thumb_img_arr as $post_img) {
|
|
| 2121 | + $curImages .= $post_img->src . ','; |
|
| 2122 | + } |
|
| 2123 | + } |
|
| 2124 | + |
|
| 2125 | + $listing_type = $post->post_type; |
|
| 2126 | + $title = $post->post_title; |
|
| 2127 | + $desc = $post->post_content; |
|
| 2128 | + $kw_tags = $post->post_tags; |
|
| 2129 | + $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
|
|
| 2130 | + } else {
|
|
| 2131 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2132 | + } |
|
| 2133 | + |
|
| 2134 | + if ($current_user->ID != '0') {
|
|
| 2135 | + $user_login = true; |
|
| 2136 | + } |
|
| 2137 | + ?> |
|
| 2138 | 2138 | <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data"> |
| 2139 | 2139 | <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/> |
| 2140 | 2140 | <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/> |
@@ -2145,27 +2145,27 @@ discard block |
||
| 2145 | 2145 | <?php } if (isset($_REQUEST['backandedit'])) { ?>
|
| 2146 | 2146 | <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/> |
| 2147 | 2147 | <?php |
| 2148 | - } |
|
| 2149 | - /** |
|
| 2150 | - * Called at the very top of the add listing page form for frontend. |
|
| 2151 | - * |
|
| 2152 | - * This is called just before the "Enter Listing Details" text. |
|
| 2153 | - * |
|
| 2154 | - * @since 1.0.0 |
|
| 2155 | - */ |
|
| 2156 | - do_action('geodir_before_detail_fields');
|
|
| 2157 | - ?> |
|
| 2148 | + } |
|
| 2149 | + /** |
|
| 2150 | + * Called at the very top of the add listing page form for frontend. |
|
| 2151 | + * |
|
| 2152 | + * This is called just before the "Enter Listing Details" text. |
|
| 2153 | + * |
|
| 2154 | + * @since 1.0.0 |
|
| 2155 | + */ |
|
| 2156 | + do_action('geodir_before_detail_fields');
|
|
| 2157 | + ?> |
|
| 2158 | 2158 | <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5> |
| 2159 | 2159 | <?php |
| 2160 | - /** |
|
| 2161 | - * Called at the top of the add listing page form for frontend. |
|
| 2162 | - * |
|
| 2163 | - * This is called after the "Enter Listing Details" text. |
|
| 2164 | - * |
|
| 2165 | - * @since 1.0.0 |
|
| 2166 | - */ |
|
| 2167 | - do_action('geodir_before_main_form_fields');
|
|
| 2168 | - ?> |
|
| 2160 | + /** |
|
| 2161 | + * Called at the top of the add listing page form for frontend. |
|
| 2162 | + * |
|
| 2163 | + * This is called after the "Enter Listing Details" text. |
|
| 2164 | + * |
|
| 2165 | + * @since 1.0.0 |
|
| 2166 | + */ |
|
| 2167 | + do_action('geodir_before_main_form_fields');
|
|
| 2168 | + ?> |
|
| 2169 | 2169 | <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details"> |
| 2170 | 2170 | <label><?php echo PLACE_TITLE_TEXT;?><span>*</span> </label> |
| 2171 | 2171 | <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield" |
@@ -2173,57 +2173,57 @@ discard block |
||
| 2173 | 2173 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span> |
| 2174 | 2174 | </div> |
| 2175 | 2175 | <?php |
| 2176 | - $show_editor = get_option('geodir_tiny_editor_on_add_listing');
|
|
| 2177 | - |
|
| 2178 | - $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc)); |
|
| 2179 | - $desc_limit = ''; |
|
| 2180 | - /** |
|
| 2181 | - * Filter the add listing description field character limit number. |
|
| 2182 | - * |
|
| 2183 | - * @since 1.0.0 |
|
| 2184 | - * @param int $desc_limit The amount of characters to limit the description to. |
|
| 2185 | - */ |
|
| 2186 | - $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
|
|
| 2187 | - /** |
|
| 2188 | - * Filter the add listing description field text. |
|
| 2189 | - * |
|
| 2190 | - * @since 1.0.0 |
|
| 2191 | - * @param string $desc The text for the description field. |
|
| 2192 | - * @param int $desc_limit The character limit numer if any. |
|
| 2193 | - */ |
|
| 2194 | - $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
|
|
| 2195 | - $desc_limit_msg = ''; |
|
| 2196 | - /** |
|
| 2197 | - * Filter the add listing description limit message. |
|
| 2198 | - * |
|
| 2199 | - * This is the message shown if there is a limit applied to the amount of characters the description can use. |
|
| 2200 | - * |
|
| 2201 | - * @since 1.0.0 |
|
| 2202 | - * @param string $desc_limit_msg The limit message string if any. |
|
| 2203 | - * @param int $desc_limit The character limit numer if any. |
|
| 2204 | - */ |
|
| 2205 | - $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
|
|
| 2176 | + $show_editor = get_option('geodir_tiny_editor_on_add_listing');
|
|
| 2177 | + |
|
| 2178 | + $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc)); |
|
| 2179 | + $desc_limit = ''; |
|
| 2180 | + /** |
|
| 2181 | + * Filter the add listing description field character limit number. |
|
| 2182 | + * |
|
| 2183 | + * @since 1.0.0 |
|
| 2184 | + * @param int $desc_limit The amount of characters to limit the description to. |
|
| 2185 | + */ |
|
| 2186 | + $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
|
|
| 2187 | + /** |
|
| 2188 | + * Filter the add listing description field text. |
|
| 2189 | + * |
|
| 2190 | + * @since 1.0.0 |
|
| 2191 | + * @param string $desc The text for the description field. |
|
| 2192 | + * @param int $desc_limit The character limit numer if any. |
|
| 2193 | + */ |
|
| 2194 | + $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
|
|
| 2195 | + $desc_limit_msg = ''; |
|
| 2196 | + /** |
|
| 2197 | + * Filter the add listing description limit message. |
|
| 2198 | + * |
|
| 2199 | + * This is the message shown if there is a limit applied to the amount of characters the description can use. |
|
| 2200 | + * |
|
| 2201 | + * @since 1.0.0 |
|
| 2202 | + * @param string $desc_limit_msg The limit message string if any. |
|
| 2203 | + * @param int $desc_limit The character limit numer if any. |
|
| 2204 | + */ |
|
| 2205 | + $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
|
|
| 2206 | 2206 | |
| 2207 | - $desc_class = ''; |
|
| 2208 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2209 | - /** |
|
| 2210 | - * Called on the add listing page form for frontend just before the description field. |
|
| 2211 | - * |
|
| 2212 | - * @since 1.0.0 |
|
| 2213 | - */ |
|
| 2214 | - do_action('geodir_before_description_field');
|
|
| 2207 | + $desc_class = ''; |
|
| 2208 | + if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2209 | + /** |
|
| 2210 | + * Called on the add listing page form for frontend just before the description field. |
|
| 2211 | + * |
|
| 2212 | + * @since 1.0.0 |
|
| 2213 | + */ |
|
| 2214 | + do_action('geodir_before_description_field');
|
|
| 2215 | 2215 | |
| 2216 | - $desc_class = ' required_field'; |
|
| 2217 | - } else {
|
|
| 2218 | - $desc_class = ' hidden'; |
|
| 2219 | - } |
|
| 2220 | - ?> |
|
| 2216 | + $desc_class = ' required_field'; |
|
| 2217 | + } else {
|
|
| 2218 | + $desc_class = ' hidden'; |
|
| 2219 | + } |
|
| 2220 | + ?> |
|
| 2221 | 2221 | <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>"> |
| 2222 | 2222 | <label><?php echo PLACE_DESC_TEXT;?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
|
| 2223 | 2223 | <?php |
| 2224 | - if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
|
|
| 2225 | - $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
|
| 2226 | - ?> |
|
| 2224 | + if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
|
|
| 2225 | + $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
|
| 2226 | + ?> |
|
| 2227 | 2227 | <div class="editor" field_id="post_desc" field_type="editor"> |
| 2228 | 2228 | <?php wp_editor($desc, "post_desc", $editor_settings); ?> |
| 2229 | 2229 | </div> |
@@ -2237,56 +2237,56 @@ discard block |
||
| 2237 | 2237 | <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span> |
| 2238 | 2238 | </div> |
| 2239 | 2239 | <?php |
| 2240 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2241 | - /** |
|
| 2242 | - * Called on the add listing page form for frontend just after the description field. |
|
| 2243 | - * |
|
| 2244 | - * @since 1.0.0 |
|
| 2245 | - */ |
|
| 2246 | - do_action('geodir_after_description_field');
|
|
| 2247 | - } |
|
| 2240 | + if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2241 | + /** |
|
| 2242 | + * Called on the add listing page form for frontend just after the description field. |
|
| 2243 | + * |
|
| 2244 | + * @since 1.0.0 |
|
| 2245 | + */ |
|
| 2246 | + do_action('geodir_after_description_field');
|
|
| 2247 | + } |
|
| 2248 | 2248 | |
| 2249 | - $kw_tags = esc_attr(stripslashes($kw_tags)); |
|
| 2250 | - $kw_tags_count = TAGKW_TEXT_COUNT; |
|
| 2251 | - $kw_tags_msg = TAGKW_MSG; |
|
| 2252 | - /** |
|
| 2253 | - * Filter the add listing tags character limit. |
|
| 2254 | - * |
|
| 2255 | - * @since 1.0.0 |
|
| 2256 | - * @param int $kw_tags_count The character count limit if any. |
|
| 2257 | - */ |
|
| 2258 | - $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
|
|
| 2259 | - /** |
|
| 2260 | - * Filter the add listing tags field value. |
|
| 2261 | - * |
|
| 2262 | - * You can use the $_REQUEST values to check if this is a go back and edit value etc. |
|
| 2263 | - * |
|
| 2264 | - * @since 1.0.0 |
|
| 2265 | - * @param string $kw_tags The tag field value, usually a comma separated list of tags. |
|
| 2266 | - * @param int $kw_tags_count The character count limit if any. |
|
| 2267 | - */ |
|
| 2268 | - $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
|
|
| 2269 | - /** |
|
| 2270 | - * Filter the add listing tags field message text. |
|
| 2271 | - * |
|
| 2272 | - * @since 1.0.0 |
|
| 2273 | - * @param string $kw_tags_msg The message shown under the field. |
|
| 2274 | - * @param int $kw_tags_count The character count limit if any. |
|
| 2275 | - */ |
|
| 2276 | - $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
|
|
| 2249 | + $kw_tags = esc_attr(stripslashes($kw_tags)); |
|
| 2250 | + $kw_tags_count = TAGKW_TEXT_COUNT; |
|
| 2251 | + $kw_tags_msg = TAGKW_MSG; |
|
| 2252 | + /** |
|
| 2253 | + * Filter the add listing tags character limit. |
|
| 2254 | + * |
|
| 2255 | + * @since 1.0.0 |
|
| 2256 | + * @param int $kw_tags_count The character count limit if any. |
|
| 2257 | + */ |
|
| 2258 | + $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
|
|
| 2259 | + /** |
|
| 2260 | + * Filter the add listing tags field value. |
|
| 2261 | + * |
|
| 2262 | + * You can use the $_REQUEST values to check if this is a go back and edit value etc. |
|
| 2263 | + * |
|
| 2264 | + * @since 1.0.0 |
|
| 2265 | + * @param string $kw_tags The tag field value, usually a comma separated list of tags. |
|
| 2266 | + * @param int $kw_tags_count The character count limit if any. |
|
| 2267 | + */ |
|
| 2268 | + $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
|
|
| 2269 | + /** |
|
| 2270 | + * Filter the add listing tags field message text. |
|
| 2271 | + * |
|
| 2272 | + * @since 1.0.0 |
|
| 2273 | + * @param string $kw_tags_msg The message shown under the field. |
|
| 2274 | + * @param int $kw_tags_count The character count limit if any. |
|
| 2275 | + */ |
|
| 2276 | + $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
|
|
| 2277 | 2277 | |
| 2278 | - $tags_class = ''; |
|
| 2279 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2280 | - /** |
|
| 2281 | - * Called on the add listing page form for frontend just before the tags field. |
|
| 2282 | - * |
|
| 2283 | - * @since 1.0.0 |
|
| 2284 | - */ |
|
| 2285 | - do_action('geodir_before_listing_tags_field');
|
|
| 2286 | - } else {
|
|
| 2287 | - $tags_class = ' hidden'; |
|
| 2288 | - } |
|
| 2289 | - ?> |
|
| 2278 | + $tags_class = ''; |
|
| 2279 | + if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2280 | + /** |
|
| 2281 | + * Called on the add listing page form for frontend just before the tags field. |
|
| 2282 | + * |
|
| 2283 | + * @since 1.0.0 |
|
| 2284 | + */ |
|
| 2285 | + do_action('geodir_before_listing_tags_field');
|
|
| 2286 | + } else {
|
|
| 2287 | + $tags_class = ' hidden'; |
|
| 2288 | + } |
|
| 2289 | + ?> |
|
| 2290 | 2290 | <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>"> |
| 2291 | 2291 | <label><?php echo TAGKW_TEXT; ?></label> |
| 2292 | 2292 | <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield" |
@@ -2294,90 +2294,90 @@ discard block |
||
| 2294 | 2294 | <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span> |
| 2295 | 2295 | </div> |
| 2296 | 2296 | <?php |
| 2297 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2298 | - /** |
|
| 2299 | - * Called on the add listing page form for frontend just after the tags field. |
|
| 2300 | - * |
|
| 2301 | - * @since 1.0.0 |
|
| 2302 | - */ |
|
| 2303 | - do_action('geodir_after_listing_tags_field');
|
|
| 2304 | - } |
|
| 2297 | + if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2298 | + /** |
|
| 2299 | + * Called on the add listing page form for frontend just after the tags field. |
|
| 2300 | + * |
|
| 2301 | + * @since 1.0.0 |
|
| 2302 | + */ |
|
| 2303 | + do_action('geodir_after_listing_tags_field');
|
|
| 2304 | + } |
|
| 2305 | 2305 | |
| 2306 | - $package_info = array(); |
|
| 2307 | - $package_info = geodir_post_package_info($package_info, $post); |
|
| 2306 | + $package_info = array(); |
|
| 2307 | + $package_info = geodir_post_package_info($package_info, $post); |
|
| 2308 | 2308 | |
| 2309 | - geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type); |
|
| 2309 | + geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type); |
|
| 2310 | 2310 | |
| 2311 | - // adjust values here |
|
| 2312 | - $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls |
|
| 2311 | + // adjust values here |
|
| 2312 | + $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls |
|
| 2313 | 2313 | |
| 2314 | - $multiple = true; // allow multiple files upload |
|
| 2314 | + $multiple = true; // allow multiple files upload |
|
| 2315 | 2315 | |
| 2316 | - $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
| 2316 | + $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels) |
|
| 2317 | 2317 | |
| 2318 | - $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
| 2318 | + $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels) |
|
| 2319 | 2319 | |
| 2320 | - $thumb_img_arr = array(); |
|
| 2321 | - $totImg = 0; |
|
| 2322 | - if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
|
| 2323 | - $post = (object)$gd_session->get('listing');
|
|
| 2324 | - if (isset($post->post_images)) |
|
| 2325 | - $curImages = trim($post->post_images, ","); |
|
| 2320 | + $thumb_img_arr = array(); |
|
| 2321 | + $totImg = 0; |
|
| 2322 | + if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
|
| 2323 | + $post = (object)$gd_session->get('listing');
|
|
| 2324 | + if (isset($post->post_images)) |
|
| 2325 | + $curImages = trim($post->post_images, ","); |
|
| 2326 | 2326 | |
| 2327 | 2327 | |
| 2328 | - if ($curImages != '') {
|
|
| 2329 | - $curImages_array = explode(',', $curImages);
|
|
| 2330 | - $totImg = count($curImages_array); |
|
| 2331 | - } |
|
| 2332 | - |
|
| 2333 | - $listing_type = $post->listing_type; |
|
| 2328 | + if ($curImages != '') {
|
|
| 2329 | + $curImages_array = explode(',', $curImages);
|
|
| 2330 | + $totImg = count($curImages_array); |
|
| 2331 | + } |
|
| 2334 | 2332 | |
| 2335 | - } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2336 | - $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
| 2337 | - $listing_type = $post->post_type; |
|
| 2338 | - $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
| 2333 | + $listing_type = $post->listing_type; |
|
| 2339 | 2334 | |
| 2340 | - } else {
|
|
| 2341 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2342 | - } |
|
| 2335 | + } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2336 | + $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
| 2337 | + $listing_type = $post->post_type; |
|
| 2338 | + $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
|
| 2343 | 2339 | |
| 2340 | + } else {
|
|
| 2341 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2342 | + } |
|
| 2344 | 2343 | |
| 2345 | - if (!empty($thumb_img_arr)) {
|
|
| 2346 | - foreach ($thumb_img_arr as $img) {
|
|
| 2347 | - //$curImages = $img->src.","; |
|
| 2348 | - } |
|
| 2349 | 2344 | |
| 2350 | - $totImg = count((array)$thumb_img_arr); |
|
| 2351 | - } |
|
| 2345 | + if (!empty($thumb_img_arr)) {
|
|
| 2346 | + foreach ($thumb_img_arr as $img) {
|
|
| 2347 | + //$curImages = $img->src.","; |
|
| 2348 | + } |
|
| 2352 | 2349 | |
| 2353 | - if ($curImages != '') |
|
| 2354 | - $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 2355 | - else |
|
| 2356 | - $svalue = ''; |
|
| 2357 | - |
|
| 2358 | - $image_limit = $package_info->image_limit; |
|
| 2359 | - $show_image_input_box = ($image_limit != '0'); |
|
| 2360 | - /** |
|
| 2361 | - * Filter to be able to show/hide the image upload section of the add listing form. |
|
| 2362 | - * |
|
| 2363 | - * @since 1.0.0 |
|
| 2364 | - * @param bool $show_image_input_box Set true to show. Set false to not show. |
|
| 2365 | - * @param string $listing_type The custom post type slug. |
|
| 2366 | - */ |
|
| 2367 | - $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
|
|
| 2368 | - if ($show_image_input_box) {
|
|
| 2369 | - ?> |
|
| 2350 | + $totImg = count((array)$thumb_img_arr); |
|
| 2351 | + } |
|
| 2352 | + |
|
| 2353 | + if ($curImages != '') |
|
| 2354 | + $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 2355 | + else |
|
| 2356 | + $svalue = ''; |
|
| 2357 | + |
|
| 2358 | + $image_limit = $package_info->image_limit; |
|
| 2359 | + $show_image_input_box = ($image_limit != '0'); |
|
| 2360 | + /** |
|
| 2361 | + * Filter to be able to show/hide the image upload section of the add listing form. |
|
| 2362 | + * |
|
| 2363 | + * @since 1.0.0 |
|
| 2364 | + * @param bool $show_image_input_box Set true to show. Set false to not show. |
|
| 2365 | + * @param string $listing_type The custom post type slug. |
|
| 2366 | + */ |
|
| 2367 | + $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
|
|
| 2368 | + if ($show_image_input_box) {
|
|
| 2369 | + ?> |
|
| 2370 | 2370 | |
| 2371 | 2371 | <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?> |
| 2372 | 2372 | <?php if ($image_limit == 1) {
|
| 2373 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
|
| 2374 | - } ?> |
|
| 2373 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
|
| 2374 | + } ?> |
|
| 2375 | 2375 | <?php if ($image_limit > 1) {
|
| 2376 | - echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
|
|
| 2377 | - } ?> |
|
| 2376 | + echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
|
|
| 2377 | + } ?> |
|
| 2378 | 2378 | <?php if ($image_limit == '') {
|
| 2379 | - echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
|
|
| 2380 | - } ?> |
|
| 2379 | + echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
|
|
| 2380 | + } ?> |
|
| 2381 | 2381 | </h5> |
| 2382 | 2382 | |
| 2383 | 2383 | <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox" |
@@ -2415,12 +2415,12 @@ discard block |
||
| 2415 | 2415 | <?php } ?> |
| 2416 | 2416 | |
| 2417 | 2417 | <?php |
| 2418 | - /** |
|
| 2419 | - * Called on the add listing page form for frontend just after the image upload field. |
|
| 2420 | - * |
|
| 2421 | - * @since 1.0.0 |
|
| 2422 | - */ |
|
| 2423 | - do_action('geodir_after_main_form_fields');?>
|
|
| 2418 | + /** |
|
| 2419 | + * Called on the add listing page form for frontend just after the image upload field. |
|
| 2420 | + * |
|
| 2421 | + * @since 1.0.0 |
|
| 2422 | + */ |
|
| 2423 | + do_action('geodir_after_main_form_fields');?>
|
|
| 2424 | 2424 | |
| 2425 | 2425 | |
| 2426 | 2426 | <!-- add captcha code --> |
@@ -2449,7 +2449,7 @@ discard block |
||
| 2449 | 2449 | |
| 2450 | 2450 | </form> |
| 2451 | 2451 | <?php |
| 2452 | - wp_reset_query(); |
|
| 2452 | + wp_reset_query(); |
|
| 2453 | 2453 | } |
| 2454 | 2454 | |
| 2455 | 2455 | /** |
@@ -2460,7 +2460,7 @@ discard block |
||
| 2460 | 2460 | */ |
| 2461 | 2461 | function geodir_add_listing_sidebar_widget_area() |
| 2462 | 2462 | {
|
| 2463 | - dynamic_sidebar('geodir_add_listing_sidebar');
|
|
| 2463 | + dynamic_sidebar('geodir_add_listing_sidebar');
|
|
| 2464 | 2464 | } |
| 2465 | 2465 | |
| 2466 | 2466 | add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
|
@@ -2475,16 +2475,16 @@ discard block |
||
| 2475 | 2475 | */ |
| 2476 | 2476 | function geodir_action_add_listing_sidebar() |
| 2477 | 2477 | {
|
| 2478 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2479 | - do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2480 | - /** |
|
| 2481 | - * This is used to add the content to the add listing page sidebar. |
|
| 2482 | - * |
|
| 2483 | - * @since 1.0.0 |
|
| 2484 | - */ |
|
| 2485 | - do_action('geodir_add_listing_sidebar_inside');
|
|
| 2486 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2487 | - do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 2478 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2479 | + do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2480 | + /** |
|
| 2481 | + * This is used to add the content to the add listing page sidebar. |
|
| 2482 | + * |
|
| 2483 | + * @since 1.0.0 |
|
| 2484 | + */ |
|
| 2485 | + do_action('geodir_add_listing_sidebar_inside');
|
|
| 2486 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2487 | + do_action('geodir_sidebar_right_close', 'details-page');
|
|
| 2488 | 2488 | } |
| 2489 | 2489 | |
| 2490 | 2490 | ############################################### |
@@ -2501,11 +2501,11 @@ discard block |
||
| 2501 | 2501 | */ |
| 2502 | 2502 | function geodir_action_geodir_sidebar_signup_top() |
| 2503 | 2503 | {
|
| 2504 | - ?> |
|
| 2504 | + ?> |
|
| 2505 | 2505 | <div |
| 2506 | 2506 | class="<?php |
| 2507 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2508 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
|
|
| 2507 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2508 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
|
|
| 2509 | 2509 | <?php dynamic_sidebar('Reg/Login Top Section');?>
|
| 2510 | 2510 | </div><!-- clearfix ends here--> |
| 2511 | 2511 | <?php |
@@ -2524,9 +2524,9 @@ discard block |
||
| 2524 | 2524 | function geodir_action_signup_forms() |
| 2525 | 2525 | {
|
| 2526 | 2526 | |
| 2527 | - global $user_login; |
|
| 2527 | + global $user_login; |
|
| 2528 | 2528 | |
| 2529 | - ?> |
|
| 2529 | + ?> |
|
| 2530 | 2530 | <script type="text/javascript"> |
| 2531 | 2531 | <?php if ( $user_login ) { ?>
|
| 2532 | 2532 | setTimeout(function () {
|
@@ -2562,65 +2562,65 @@ discard block |
||
| 2562 | 2562 | <?php } ?> |
| 2563 | 2563 | </script><?php |
| 2564 | 2564 | |
| 2565 | - global $errors; |
|
| 2566 | - if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
| 2567 | - $errors->add('claim_login', LOGIN_CLAIM);
|
|
| 2568 | - |
|
| 2569 | - if (!empty($errors)) {
|
|
| 2570 | - foreach ($errors as $errorsObj) {
|
|
| 2571 | - foreach ($errorsObj as $key => $val) {
|
|
| 2572 | - for ($i = 0; $i < count($val); $i++) {
|
|
| 2573 | - echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
| 2574 | - $registration_error_msg = 1; |
|
| 2575 | - } |
|
| 2576 | - } |
|
| 2577 | - } |
|
| 2578 | - } |
|
| 2565 | + global $errors; |
|
| 2566 | + if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
| 2567 | + $errors->add('claim_login', LOGIN_CLAIM);
|
|
| 2568 | + |
|
| 2569 | + if (!empty($errors)) {
|
|
| 2570 | + foreach ($errors as $errorsObj) {
|
|
| 2571 | + foreach ($errorsObj as $key => $val) {
|
|
| 2572 | + for ($i = 0; $i < count($val); $i++) {
|
|
| 2573 | + echo "<div class=sucess_msg>" . $val[$i] . '</div>'; |
|
| 2574 | + $registration_error_msg = 1; |
|
| 2575 | + } |
|
| 2576 | + } |
|
| 2577 | + } |
|
| 2578 | + } |
|
| 2579 | 2579 | |
| 2580 | - if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
|
|
| 2581 | - ?> |
|
| 2580 | + if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
|
|
| 2581 | + ?> |
|
| 2582 | 2582 | |
| 2583 | 2583 | <div class="login_form"> |
| 2584 | 2584 | <?php |
| 2585 | - /** |
|
| 2586 | - * Contains login form template. |
|
| 2587 | - * |
|
| 2588 | - * @since 1.0.0 |
|
| 2589 | - */ |
|
| 2590 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2585 | + /** |
|
| 2586 | + * Contains login form template. |
|
| 2587 | + * |
|
| 2588 | + * @since 1.0.0 |
|
| 2589 | + */ |
|
| 2590 | + include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2591 | 2591 | </div> |
| 2592 | 2592 | |
| 2593 | 2593 | <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
|
| 2594 | 2594 | |
| 2595 | 2595 | <div class="registration_form"> |
| 2596 | 2596 | <?php |
| 2597 | - /** |
|
| 2598 | - * Contains registration form template. |
|
| 2599 | - * |
|
| 2600 | - * @since 1.0.0 |
|
| 2601 | - */ |
|
| 2602 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2597 | + /** |
|
| 2598 | + * Contains registration form template. |
|
| 2599 | + * |
|
| 2600 | + * @since 1.0.0 |
|
| 2601 | + */ |
|
| 2602 | + include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2603 | 2603 | </div> |
| 2604 | 2604 | |
| 2605 | 2605 | <?php } else { ?>
|
| 2606 | 2606 | |
| 2607 | 2607 | <div class="login_form_l"> |
| 2608 | 2608 | <?php |
| 2609 | - /** |
|
| 2610 | - * Contains login form template. |
|
| 2611 | - * |
|
| 2612 | - * @since 1.0.0 |
|
| 2613 | - */ |
|
| 2614 | - include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2609 | + /** |
|
| 2610 | + * Contains login form template. |
|
| 2611 | + * |
|
| 2612 | + * @since 1.0.0 |
|
| 2613 | + */ |
|
| 2614 | + include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?> |
|
| 2615 | 2615 | </div> |
| 2616 | 2616 | <div class="registration_form_r"> |
| 2617 | 2617 | <?php |
| 2618 | - /** |
|
| 2619 | - * Contains registration form template. |
|
| 2620 | - * |
|
| 2621 | - * @since 1.0.0 |
|
| 2622 | - */ |
|
| 2623 | - include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2618 | + /** |
|
| 2619 | + * Contains registration form template. |
|
| 2620 | + * |
|
| 2621 | + * @since 1.0.0 |
|
| 2622 | + */ |
|
| 2623 | + include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?> |
|
| 2624 | 2624 | </div> |
| 2625 | 2625 | |
| 2626 | 2626 | <?php }?> |
@@ -2651,66 +2651,66 @@ discard block |
||
| 2651 | 2651 | */ |
| 2652 | 2652 | function geodir_action_author_page_title() |
| 2653 | 2653 | {
|
| 2654 | - global $term; |
|
| 2654 | + global $term; |
|
| 2655 | 2655 | |
| 2656 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 2657 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 2656 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 2657 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 2658 | 2658 | |
| 2659 | - $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 2660 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 2661 | - $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 2662 | - } |
|
| 2659 | + $add_string_in_title = __('All', 'geodirectory') . ' ';
|
|
| 2660 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 2661 | + $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
|
|
| 2662 | + } |
|
| 2663 | 2663 | |
| 2664 | - $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
| 2665 | - $single_name = $post_type_info->labels->singular_name; |
|
| 2664 | + $list_title = $add_string_in_title . $post_type_info->labels->name; |
|
| 2665 | + $single_name = $post_type_info->labels->singular_name; |
|
| 2666 | 2666 | |
| 2667 | - $taxonomy = geodir_get_taxonomies($gd_post_type); |
|
| 2667 | + $taxonomy = geodir_get_taxonomies($gd_post_type); |
|
| 2668 | 2668 | |
| 2669 | - if (!empty($term)) {
|
|
| 2670 | - $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 2671 | - if (!empty($current_term)) |
|
| 2672 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2673 | - } |
|
| 2669 | + if (!empty($term)) {
|
|
| 2670 | + $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
|
| 2671 | + if (!empty($current_term)) |
|
| 2672 | + $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2673 | + } |
|
| 2674 | 2674 | |
| 2675 | 2675 | |
| 2676 | - if (is_search()) {
|
|
| 2677 | - $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2676 | + if (is_search()) {
|
|
| 2677 | + $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2678 | 2678 | |
| 2679 | - } |
|
| 2680 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2681 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2682 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2683 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2679 | + } |
|
| 2680 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2681 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2682 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2683 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2684 | 2684 | |
| 2685 | - $title = $list_title; |
|
| 2686 | - if(geodir_is_page('author')){
|
|
| 2687 | - $gd_page = 'author'; |
|
| 2688 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 2689 | - $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 2690 | - }else{
|
|
| 2691 | - $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 2692 | - } |
|
| 2685 | + $title = $list_title; |
|
| 2686 | + if(geodir_is_page('author')){
|
|
| 2687 | + $gd_page = 'author'; |
|
| 2688 | + if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 2689 | + $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
|
| 2690 | + }else{
|
|
| 2691 | + $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
|
| 2692 | + } |
|
| 2693 | 2693 | |
| 2694 | - } |
|
| 2694 | + } |
|
| 2695 | 2695 | |
| 2696 | 2696 | |
| 2697 | - /** |
|
| 2698 | - * Filter page title to replace variables. |
|
| 2699 | - * |
|
| 2700 | - * @since 1.5.4 |
|
| 2701 | - * @param string $title The page title including variables. |
|
| 2702 | - * @param string $gd_page The GeoDirectory page type if any. |
|
| 2703 | - */ |
|
| 2704 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2697 | + /** |
|
| 2698 | + * Filter page title to replace variables. |
|
| 2699 | + * |
|
| 2700 | + * @since 1.5.4 |
|
| 2701 | + * @param string $title The page title including variables. |
|
| 2702 | + * @param string $gd_page The GeoDirectory page type if any. |
|
| 2703 | + */ |
|
| 2704 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2705 | 2705 | |
| 2706 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2707 | - /** |
|
| 2708 | - * Filter the author page title text. |
|
| 2709 | - * |
|
| 2710 | - * @since 1.0.0 |
|
| 2711 | - * @param string $list_title The title for the page. |
|
| 2712 | - */ |
|
| 2713 | - apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
|
|
| 2706 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2707 | + /** |
|
| 2708 | + * Filter the author page title text. |
|
| 2709 | + * |
|
| 2710 | + * @since 1.0.0 |
|
| 2711 | + * @param string $list_title The title for the page. |
|
| 2712 | + */ |
|
| 2713 | + apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
|
|
| 2714 | 2714 | } |
| 2715 | 2715 | |
| 2716 | 2716 | |
@@ -2728,11 +2728,11 @@ discard block |
||
| 2728 | 2728 | */ |
| 2729 | 2729 | function geodir_action_geodir_sidebar_author_top() |
| 2730 | 2730 | {
|
| 2731 | - if (get_option('geodir_show_author_top_section')) { ?>
|
|
| 2731 | + if (get_option('geodir_show_author_top_section')) { ?>
|
|
| 2732 | 2732 | <div |
| 2733 | 2733 | class="<?php |
| 2734 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2735 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
|
|
| 2734 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2735 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
|
|
| 2736 | 2736 | <?php dynamic_sidebar('geodir_author_top'); ?>
|
| 2737 | 2737 | </div><!-- clearfix ends here--> |
| 2738 | 2738 | <?php } |
@@ -2748,7 +2748,7 @@ discard block |
||
| 2748 | 2748 | */ |
| 2749 | 2749 | function geodir_author_left_section() |
| 2750 | 2750 | {
|
| 2751 | - if (get_option('geodir_show_author_left_section')) { ?>
|
|
| 2751 | + if (get_option('geodir_show_author_left_section')) { ?>
|
|
| 2752 | 2752 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 2753 | 2753 | <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
|
| 2754 | 2754 | </div><!-- end geodir-content-left --> |
@@ -2769,19 +2769,19 @@ discard block |
||
| 2769 | 2769 | */ |
| 2770 | 2770 | function geodir_action_author_sidebar_left() |
| 2771 | 2771 | {
|
| 2772 | - if (get_option('geodir_show_author_left_section')) {
|
|
| 2772 | + if (get_option('geodir_show_author_left_section')) {
|
|
| 2773 | 2773 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
| 2774 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2775 | - do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 2776 | - /** |
|
| 2777 | - * This is used to add the content to the author page left sidebar (if active). |
|
| 2778 | - * |
|
| 2779 | - * @since 1.0.0 |
|
| 2780 | - */ |
|
| 2781 | - do_action('geodir_author_sidebar_left_inside');
|
|
| 2782 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2783 | - do_action('geodir_sidebar_left_close', 'author-page');
|
|
| 2784 | - } |
|
| 2774 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2775 | + do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 2776 | + /** |
|
| 2777 | + * This is used to add the content to the author page left sidebar (if active). |
|
| 2778 | + * |
|
| 2779 | + * @since 1.0.0 |
|
| 2780 | + */ |
|
| 2781 | + do_action('geodir_author_sidebar_left_inside');
|
|
| 2782 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2783 | + do_action('geodir_sidebar_left_close', 'author-page');
|
|
| 2784 | + } |
|
| 2785 | 2785 | } |
| 2786 | 2786 | |
| 2787 | 2787 | /** |
@@ -2794,7 +2794,7 @@ discard block |
||
| 2794 | 2794 | */ |
| 2795 | 2795 | function geodir_author_right_section() |
| 2796 | 2796 | {
|
| 2797 | - if (get_option('geodir_show_author_right_section')) { ?>
|
|
| 2797 | + if (get_option('geodir_show_author_right_section')) { ?>
|
|
| 2798 | 2798 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 2799 | 2799 | <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
|
| 2800 | 2800 | </div><!-- end geodir-content-right --> |
@@ -2814,18 +2814,18 @@ discard block |
||
| 2814 | 2814 | */ |
| 2815 | 2815 | function geodir_action_author_sidebar_right() |
| 2816 | 2816 | {
|
| 2817 | - if (get_option('geodir_show_author_right_section')) {
|
|
| 2818 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2819 | - do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2820 | - /** |
|
| 2821 | - * This is used to add the content to the author page right sidebar (if active). |
|
| 2822 | - * |
|
| 2823 | - * @since 1.0.0 |
|
| 2824 | - */ |
|
| 2825 | - do_action('geodir_author_sidebar_right_inside');
|
|
| 2826 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2827 | - do_action('geodir_sidebar_right_close', 'author-page');
|
|
| 2828 | - } |
|
| 2817 | + if (get_option('geodir_show_author_right_section')) {
|
|
| 2818 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2819 | + do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 2820 | + /** |
|
| 2821 | + * This is used to add the content to the author page right sidebar (if active). |
|
| 2822 | + * |
|
| 2823 | + * @since 1.0.0 |
|
| 2824 | + */ |
|
| 2825 | + do_action('geodir_author_sidebar_right_inside');
|
|
| 2826 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2827 | + do_action('geodir_sidebar_right_close', 'author-page');
|
|
| 2828 | + } |
|
| 2829 | 2829 | } |
| 2830 | 2830 | |
| 2831 | 2831 | /** |
@@ -2837,14 +2837,14 @@ discard block |
||
| 2837 | 2837 | */ |
| 2838 | 2838 | function geodir_action_author_content_inside() |
| 2839 | 2839 | {
|
| 2840 | - global $gridview_columns; |
|
| 2841 | - $listing_view = get_option('geodir_author_view');
|
|
| 2842 | - if (strstr($listing_view, 'gridview')) {
|
|
| 2843 | - $gridview_columns = $listing_view; |
|
| 2844 | - $listing_view_exp = explode('_', $listing_view);
|
|
| 2845 | - $listing_view = $listing_view_exp[0]; |
|
| 2846 | - } |
|
| 2847 | - geodir_get_template_part('listing', 'listview');
|
|
| 2840 | + global $gridview_columns; |
|
| 2841 | + $listing_view = get_option('geodir_author_view');
|
|
| 2842 | + if (strstr($listing_view, 'gridview')) {
|
|
| 2843 | + $gridview_columns = $listing_view; |
|
| 2844 | + $listing_view_exp = explode('_', $listing_view);
|
|
| 2845 | + $listing_view = $listing_view_exp[0]; |
|
| 2846 | + } |
|
| 2847 | + geodir_get_template_part('listing', 'listview');
|
|
| 2848 | 2848 | } |
| 2849 | 2849 | |
| 2850 | 2850 | add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
|
@@ -2859,22 +2859,22 @@ discard block |
||
| 2859 | 2859 | */ |
| 2860 | 2860 | function geodir_action_author_content() |
| 2861 | 2861 | {
|
| 2862 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2863 | - do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
|
|
| 2864 | - echo '<div class="clearfix">'; |
|
| 2865 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2866 | - do_action('geodir_before_listing');
|
|
| 2867 | - echo '</div>'; |
|
| 2868 | - /** |
|
| 2869 | - * This is used to add the content to the author page main content. |
|
| 2870 | - * |
|
| 2871 | - * @since 1.0.0 |
|
| 2872 | - */ |
|
| 2873 | - do_action('geodir_author_content_inside');
|
|
| 2874 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2875 | - do_action('geodir_after_listing');
|
|
| 2876 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2877 | - do_action('geodir_main_content_close', 'author-page');
|
|
| 2862 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2863 | + do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
|
|
| 2864 | + echo '<div class="clearfix">'; |
|
| 2865 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2866 | + do_action('geodir_before_listing');
|
|
| 2867 | + echo '</div>'; |
|
| 2868 | + /** |
|
| 2869 | + * This is used to add the content to the author page main content. |
|
| 2870 | + * |
|
| 2871 | + * @since 1.0.0 |
|
| 2872 | + */ |
|
| 2873 | + do_action('geodir_author_content_inside');
|
|
| 2874 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2875 | + do_action('geodir_after_listing');
|
|
| 2876 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2877 | + do_action('geodir_main_content_close', 'author-page');
|
|
| 2878 | 2878 | } |
| 2879 | 2879 | |
| 2880 | 2880 | add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
|
@@ -2888,11 +2888,11 @@ discard block |
||
| 2888 | 2888 | */ |
| 2889 | 2889 | function geodir_action_sidebar_author_bottom_section() |
| 2890 | 2890 | {
|
| 2891 | - if (get_option('geodir_show_author_bottom_section')) { ?>
|
|
| 2891 | + if (get_option('geodir_show_author_bottom_section')) { ?>
|
|
| 2892 | 2892 | <div |
| 2893 | 2893 | class="<?php |
| 2894 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2895 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
|
|
| 2894 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2895 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
|
|
| 2896 | 2896 | <?php dynamic_sidebar('geodir_author_bottom'); ?>
|
| 2897 | 2897 | </div><!-- clearfix ends here--> |
| 2898 | 2898 | <?php } |
@@ -2911,23 +2911,23 @@ discard block |
||
| 2911 | 2911 | */ |
| 2912 | 2912 | function geodir_action_search_page_title() |
| 2913 | 2913 | {
|
| 2914 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 2915 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 2914 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 2915 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 2916 | 2916 | |
| 2917 | - $pt_name = ''; |
|
| 2918 | - if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
|
|
| 2917 | + $pt_name = ''; |
|
| 2918 | + if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
|
|
| 2919 | 2919 | |
| 2920 | - if (is_search()) {
|
|
| 2921 | - $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2920 | + if (is_search()) {
|
|
| 2921 | + $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
|
| 2922 | 2922 | |
| 2923 | - } |
|
| 2924 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2925 | - $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2926 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2927 | - $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2928 | - echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2929 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2930 | - apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
|
|
| 2923 | + } |
|
| 2924 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2925 | + $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
|
| 2926 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2927 | + $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
|
| 2928 | + echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
|
| 2929 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2930 | + apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
|
|
| 2931 | 2931 | } |
| 2932 | 2932 | |
| 2933 | 2933 | // action for adding the listings page top widget area |
@@ -2943,11 +2943,11 @@ discard block |
||
| 2943 | 2943 | */ |
| 2944 | 2944 | function geodir_action_geodir_sidebar_search_top() |
| 2945 | 2945 | {
|
| 2946 | - if (get_option('geodir_show_search_top_section')) { ?>
|
|
| 2946 | + if (get_option('geodir_show_search_top_section')) { ?>
|
|
| 2947 | 2947 | <div |
| 2948 | 2948 | class="<?php |
| 2949 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2950 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
|
|
| 2949 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2950 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
|
|
| 2951 | 2951 | <?php dynamic_sidebar('geodir_search_top'); ?>
|
| 2952 | 2952 | </div><!-- clearfix ends here--> |
| 2953 | 2953 | <?php } |
@@ -2963,7 +2963,7 @@ discard block |
||
| 2963 | 2963 | */ |
| 2964 | 2964 | function geodir_search_left_section() |
| 2965 | 2965 | {
|
| 2966 | - if (get_option('geodir_show_search_left_section')) { ?>
|
|
| 2966 | + if (get_option('geodir_show_search_left_section')) { ?>
|
|
| 2967 | 2967 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 2968 | 2968 | <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
|
| 2969 | 2969 | </div><!-- end geodir-content-left --> |
@@ -2983,19 +2983,19 @@ discard block |
||
| 2983 | 2983 | */ |
| 2984 | 2984 | function geodir_action_search_sidebar_left() |
| 2985 | 2985 | {
|
| 2986 | - if (get_option('geodir_show_search_left_section')) {
|
|
| 2986 | + if (get_option('geodir_show_search_left_section')) {
|
|
| 2987 | 2987 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
| 2988 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2989 | - do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 2990 | - /** |
|
| 2991 | - * This is used to add the content to the search page left sidebar (if active). |
|
| 2992 | - * |
|
| 2993 | - * @since 1.0.0 |
|
| 2994 | - */ |
|
| 2995 | - do_action('geodir_search_sidebar_left_inside');
|
|
| 2996 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 2997 | - do_action('geodir_sidebar_left_close', 'search-page');
|
|
| 2998 | - } |
|
| 2988 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2989 | + do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 2990 | + /** |
|
| 2991 | + * This is used to add the content to the search page left sidebar (if active). |
|
| 2992 | + * |
|
| 2993 | + * @since 1.0.0 |
|
| 2994 | + */ |
|
| 2995 | + do_action('geodir_search_sidebar_left_inside');
|
|
| 2996 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 2997 | + do_action('geodir_sidebar_left_close', 'search-page');
|
|
| 2998 | + } |
|
| 2999 | 2999 | } |
| 3000 | 3000 | |
| 3001 | 3001 | /** |
@@ -3008,7 +3008,7 @@ discard block |
||
| 3008 | 3008 | */ |
| 3009 | 3009 | function geodir_search_right_section() |
| 3010 | 3010 | {
|
| 3011 | - if (get_option('geodir_show_search_right_section')) { ?>
|
|
| 3011 | + if (get_option('geodir_show_search_right_section')) { ?>
|
|
| 3012 | 3012 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 3013 | 3013 | <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
|
| 3014 | 3014 | </div><!-- end geodir-content-right --> |
@@ -3028,18 +3028,18 @@ discard block |
||
| 3028 | 3028 | */ |
| 3029 | 3029 | function geodir_action_search_sidebar_right() |
| 3030 | 3030 | {
|
| 3031 | - if (get_option('geodir_show_search_right_section')) {
|
|
| 3032 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3033 | - do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3034 | - /** |
|
| 3035 | - * This is used to add the content to the search page right sidebar (if active). |
|
| 3036 | - * |
|
| 3037 | - * @since 1.0.0 |
|
| 3038 | - */ |
|
| 3039 | - do_action('geodir_search_sidebar_right_inside');
|
|
| 3040 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3041 | - do_action('geodir_sidebar_right_close', 'search-page');
|
|
| 3042 | - } |
|
| 3031 | + if (get_option('geodir_show_search_right_section')) {
|
|
| 3032 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3033 | + do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3034 | + /** |
|
| 3035 | + * This is used to add the content to the search page right sidebar (if active). |
|
| 3036 | + * |
|
| 3037 | + * @since 1.0.0 |
|
| 3038 | + */ |
|
| 3039 | + do_action('geodir_search_sidebar_right_inside');
|
|
| 3040 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3041 | + do_action('geodir_sidebar_right_close', 'search-page');
|
|
| 3042 | + } |
|
| 3043 | 3043 | } |
| 3044 | 3044 | |
| 3045 | 3045 | |
@@ -3054,11 +3054,11 @@ discard block |
||
| 3054 | 3054 | */ |
| 3055 | 3055 | function geodir_action_sidebar_search_bottom_section() |
| 3056 | 3056 | {
|
| 3057 | - if (get_option('geodir_show_search_bottom_section')) { ?>
|
|
| 3057 | + if (get_option('geodir_show_search_bottom_section')) { ?>
|
|
| 3058 | 3058 | <div |
| 3059 | 3059 | class="<?php |
| 3060 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3061 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
|
|
| 3060 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3061 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
|
|
| 3062 | 3062 | <?php dynamic_sidebar('geodir_search_bottom'); ?>
|
| 3063 | 3063 | </div><!-- clearfix ends here--> |
| 3064 | 3064 | <?php } |
@@ -3073,14 +3073,14 @@ discard block |
||
| 3073 | 3073 | */ |
| 3074 | 3074 | function geodir_action_search_content_inside() |
| 3075 | 3075 | {
|
| 3076 | - global $gridview_columns; |
|
| 3077 | - $listing_view = get_option('geodir_search_view');
|
|
| 3078 | - if (strstr($listing_view, 'gridview')) {
|
|
| 3079 | - $gridview_columns = $listing_view; |
|
| 3080 | - $listing_view_exp = explode('_', $listing_view);
|
|
| 3081 | - $listing_view = $listing_view_exp[0]; |
|
| 3082 | - } |
|
| 3083 | - geodir_get_template_part('listing', 'listview');
|
|
| 3076 | + global $gridview_columns; |
|
| 3077 | + $listing_view = get_option('geodir_search_view');
|
|
| 3078 | + if (strstr($listing_view, 'gridview')) {
|
|
| 3079 | + $gridview_columns = $listing_view; |
|
| 3080 | + $listing_view_exp = explode('_', $listing_view);
|
|
| 3081 | + $listing_view = $listing_view_exp[0]; |
|
| 3082 | + } |
|
| 3083 | + geodir_get_template_part('listing', 'listview');
|
|
| 3084 | 3084 | } |
| 3085 | 3085 | |
| 3086 | 3086 | add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
|
@@ -3096,22 +3096,22 @@ discard block |
||
| 3096 | 3096 | */ |
| 3097 | 3097 | function geodir_action_search_content() |
| 3098 | 3098 | {
|
| 3099 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3100 | - do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
|
|
| 3101 | - echo '<div class="clearfix">'; |
|
| 3102 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3103 | - do_action('geodir_before_listing');
|
|
| 3104 | - echo '</div>'; |
|
| 3105 | - /** |
|
| 3106 | - * This is used to add the content to the search page main content. |
|
| 3107 | - * |
|
| 3108 | - * @since 1.0.0 |
|
| 3109 | - */ |
|
| 3110 | - do_action('geodir_search_content_inside');
|
|
| 3111 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3112 | - do_action('geodir_after_listing');
|
|
| 3113 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3114 | - do_action('geodir_main_content_close', 'search-page');
|
|
| 3099 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3100 | + do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
|
|
| 3101 | + echo '<div class="clearfix">'; |
|
| 3102 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3103 | + do_action('geodir_before_listing');
|
|
| 3104 | + echo '</div>'; |
|
| 3105 | + /** |
|
| 3106 | + * This is used to add the content to the search page main content. |
|
| 3107 | + * |
|
| 3108 | + * @since 1.0.0 |
|
| 3109 | + */ |
|
| 3110 | + do_action('geodir_search_content_inside');
|
|
| 3111 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3112 | + do_action('geodir_after_listing');
|
|
| 3113 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3114 | + do_action('geodir_main_content_close', 'search-page');
|
|
| 3115 | 3115 | } |
| 3116 | 3116 | |
| 3117 | 3117 | ############################################### |
@@ -3134,11 +3134,11 @@ discard block |
||
| 3134 | 3134 | */ |
| 3135 | 3135 | function geodir_action_geodir_sidebar_home_top() |
| 3136 | 3136 | {
|
| 3137 | - if (get_option('geodir_show_home_top_section')) { ?>
|
|
| 3137 | + if (get_option('geodir_show_home_top_section')) { ?>
|
|
| 3138 | 3138 | <div |
| 3139 | 3139 | class="<?php |
| 3140 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3141 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
|
|
| 3140 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3141 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
|
|
| 3142 | 3142 | <?php dynamic_sidebar('geodir_home_top'); ?>
|
| 3143 | 3143 | </div><!-- clearfix ends here--> |
| 3144 | 3144 | <?php } |
@@ -3154,7 +3154,7 @@ discard block |
||
| 3154 | 3154 | */ |
| 3155 | 3155 | function geodir_home_left_section() |
| 3156 | 3156 | {
|
| 3157 | - if (get_option('geodir_show_home_left_section')) { ?>
|
|
| 3157 | + if (get_option('geodir_show_home_left_section')) { ?>
|
|
| 3158 | 3158 | <div class="geodir-content-left geodir-sidebar-wrap"> |
| 3159 | 3159 | <?php dynamic_sidebar('geodir_home_left'); ?>
|
| 3160 | 3160 | </div><!-- end geodir-content-left --> |
@@ -3176,19 +3176,19 @@ discard block |
||
| 3176 | 3176 | */ |
| 3177 | 3177 | function geodir_action_home_sidebar_left() |
| 3178 | 3178 | {
|
| 3179 | - if (get_option('geodir_show_home_left_section')) {
|
|
| 3179 | + if (get_option('geodir_show_home_left_section')) {
|
|
| 3180 | 3180 | // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='') |
| 3181 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3182 | - do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 3183 | - /** |
|
| 3184 | - * This is used to add the content to the home page left sidebar (if active). |
|
| 3185 | - * |
|
| 3186 | - * @since 1.0.0 |
|
| 3187 | - */ |
|
| 3188 | - do_action('geodir_home_sidebar_left_inside');
|
|
| 3189 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3190 | - do_action('geodir_sidebar_left_close', 'home-page');
|
|
| 3191 | - } |
|
| 3181 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3182 | + do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
|
|
| 3183 | + /** |
|
| 3184 | + * This is used to add the content to the home page left sidebar (if active). |
|
| 3185 | + * |
|
| 3186 | + * @since 1.0.0 |
|
| 3187 | + */ |
|
| 3188 | + do_action('geodir_home_sidebar_left_inside');
|
|
| 3189 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3190 | + do_action('geodir_sidebar_left_close', 'home-page');
|
|
| 3191 | + } |
|
| 3192 | 3192 | } |
| 3193 | 3193 | |
| 3194 | 3194 | /** |
@@ -3201,7 +3201,7 @@ discard block |
||
| 3201 | 3201 | */ |
| 3202 | 3202 | function geodir_home_right_section() |
| 3203 | 3203 | {
|
| 3204 | - if (get_option('geodir_show_home_right_section')) { ?>
|
|
| 3204 | + if (get_option('geodir_show_home_right_section')) { ?>
|
|
| 3205 | 3205 | <div class="geodir-content-right geodir-sidebar-wrap"> |
| 3206 | 3206 | <?php dynamic_sidebar('geodir_home_right'); ?>
|
| 3207 | 3207 | </div><!-- end geodir-content-right --> |
@@ -3222,18 +3222,18 @@ discard block |
||
| 3222 | 3222 | */ |
| 3223 | 3223 | function geodir_action_home_sidebar_right() |
| 3224 | 3224 | {
|
| 3225 | - if (get_option('geodir_show_home_right_section')) {
|
|
| 3226 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3227 | - do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3228 | - /** |
|
| 3229 | - * This is used to add the content to the home page right sidebar (if active). |
|
| 3230 | - * |
|
| 3231 | - * @since 1.0.0 |
|
| 3232 | - */ |
|
| 3233 | - do_action('geodir_home_sidebar_right_inside');
|
|
| 3234 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3235 | - do_action('geodir_sidebar_right_close', 'home-page');
|
|
| 3236 | - } |
|
| 3225 | + if (get_option('geodir_show_home_right_section')) {
|
|
| 3226 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3227 | + do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
|
|
| 3228 | + /** |
|
| 3229 | + * This is used to add the content to the home page right sidebar (if active). |
|
| 3230 | + * |
|
| 3231 | + * @since 1.0.0 |
|
| 3232 | + */ |
|
| 3233 | + do_action('geodir_home_sidebar_right_inside');
|
|
| 3234 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3235 | + do_action('geodir_sidebar_right_close', 'home-page');
|
|
| 3236 | + } |
|
| 3237 | 3237 | } |
| 3238 | 3238 | |
| 3239 | 3239 | /** |
@@ -3244,7 +3244,7 @@ discard block |
||
| 3244 | 3244 | */ |
| 3245 | 3245 | function geodir_action_home_content_inside() |
| 3246 | 3246 | {
|
| 3247 | - dynamic_sidebar('geodir_home_content');
|
|
| 3247 | + dynamic_sidebar('geodir_home_content');
|
|
| 3248 | 3248 | } |
| 3249 | 3249 | |
| 3250 | 3250 | add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
|
@@ -3259,28 +3259,28 @@ discard block |
||
| 3259 | 3259 | */ |
| 3260 | 3260 | function geodir_action_home_content() |
| 3261 | 3261 | {
|
| 3262 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3263 | - do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
|
|
| 3264 | - /** |
|
| 3265 | - * This called before the home page main content. |
|
| 3266 | - * |
|
| 3267 | - * @since 1.0.0 |
|
| 3268 | - */ |
|
| 3269 | - do_action('geodir_before_home_content');
|
|
| 3270 | - /** |
|
| 3271 | - * This is used to add the content to the home page main content. |
|
| 3272 | - * |
|
| 3273 | - * @since 1.0.0 |
|
| 3274 | - */ |
|
| 3275 | - do_action('geodir_home_content_inside');
|
|
| 3276 | - /** |
|
| 3277 | - * This is called after the homepage main content. |
|
| 3278 | - * |
|
| 3279 | - * @since 1.0.0 |
|
| 3280 | - */ |
|
| 3281 | - do_action('geodir_after_home_content');
|
|
| 3282 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3283 | - do_action('geodir_main_content_close', 'home-page');
|
|
| 3262 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3263 | + do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
|
|
| 3264 | + /** |
|
| 3265 | + * This called before the home page main content. |
|
| 3266 | + * |
|
| 3267 | + * @since 1.0.0 |
|
| 3268 | + */ |
|
| 3269 | + do_action('geodir_before_home_content');
|
|
| 3270 | + /** |
|
| 3271 | + * This is used to add the content to the home page main content. |
|
| 3272 | + * |
|
| 3273 | + * @since 1.0.0 |
|
| 3274 | + */ |
|
| 3275 | + do_action('geodir_home_content_inside');
|
|
| 3276 | + /** |
|
| 3277 | + * This is called after the homepage main content. |
|
| 3278 | + * |
|
| 3279 | + * @since 1.0.0 |
|
| 3280 | + */ |
|
| 3281 | + do_action('geodir_after_home_content');
|
|
| 3282 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3283 | + do_action('geodir_main_content_close', 'home-page');
|
|
| 3284 | 3284 | } |
| 3285 | 3285 | |
| 3286 | 3286 | add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
|
@@ -3295,11 +3295,11 @@ discard block |
||
| 3295 | 3295 | */ |
| 3296 | 3296 | function geodir_action_sidebar_home_bottom_section() |
| 3297 | 3297 | {
|
| 3298 | - if (get_option('geodir_show_home_bottom_section')) { ?>
|
|
| 3298 | + if (get_option('geodir_show_home_bottom_section')) { ?>
|
|
| 3299 | 3299 | <div |
| 3300 | 3300 | class="<?php |
| 3301 | - /** This action is documented in geodirectory_template_actions.php */ |
|
| 3302 | - echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
|
|
| 3301 | + /** This action is documented in geodirectory_template_actions.php */ |
|
| 3302 | + echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
|
|
| 3303 | 3303 | <?php dynamic_sidebar('geodir_home_bottom'); ?>
|
| 3304 | 3304 | </div><!-- clearfix ends here--> |
| 3305 | 3305 | <?php } |
@@ -3327,13 +3327,13 @@ discard block |
||
| 3327 | 3327 | */ |
| 3328 | 3328 | function geodir_filter_listing_page_title($list_title) |
| 3329 | 3329 | {
|
| 3330 | - if (is_search() && trim(get_search_query()) == '') {
|
|
| 3331 | - $gd_post_type = geodir_get_current_posttype(); |
|
| 3332 | - $post_type_info = get_post_type_object($gd_post_type); |
|
| 3330 | + if (is_search() && trim(get_search_query()) == '') {
|
|
| 3331 | + $gd_post_type = geodir_get_current_posttype(); |
|
| 3332 | + $post_type_info = get_post_type_object($gd_post_type); |
|
| 3333 | 3333 | |
| 3334 | - $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
|
|
| 3335 | - } |
|
| 3336 | - return $list_title; |
|
| 3334 | + $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
|
|
| 3335 | + } |
|
| 3336 | + return $list_title; |
|
| 3337 | 3337 | } |
| 3338 | 3338 | |
| 3339 | 3339 | add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
|
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | } |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | - $post = (object)$_REQUEST; |
|
| 679 | + $post = (object) $_REQUEST; |
|
| 680 | 680 | |
| 681 | 681 | |
| 682 | 682 | if (isset($post->video)) {
|
@@ -1019,7 +1019,7 @@ discard block |
||
| 1019 | 1019 | $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0; |
| 1020 | 1020 | |
| 1021 | 1021 | if ($image && $width && $height) {
|
| 1022 | - $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1022 | + $image = (object) array('src' => $image, 'width' => $width, 'height' => $height);
|
|
| 1023 | 1023 | } |
| 1024 | 1024 | |
| 1025 | 1025 | if (isset($image->src)) {
|
@@ -1052,9 +1052,9 @@ discard block |
||
| 1052 | 1052 | } else {
|
| 1053 | 1053 | $spacer_height = ((400 - $image->height) / 2); |
| 1054 | 1054 | } |
| 1055 | - $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1055 | + $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : ''; |
|
| 1056 | 1056 | $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />'; |
| 1057 | - $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>'; |
|
| 1057 | + $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />' . $caption . '</li>'; |
|
| 1058 | 1058 | $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>'; |
| 1059 | 1059 | $slides++; |
| 1060 | 1060 | } |
@@ -1090,7 +1090,7 @@ discard block |
||
| 1090 | 1090 | */ |
| 1091 | 1091 | function geodir_action_details_taxonomies() |
| 1092 | 1092 | {
|
| 1093 | - global $preview, $post;?> |
|
| 1093 | + global $preview, $post; ?> |
|
| 1094 | 1094 | <p class="geodir_post_taxomomies clearfix"> |
| 1095 | 1095 | <?php |
| 1096 | 1096 | $taxonomies = array(); |
@@ -1168,12 +1168,12 @@ discard block |
||
| 1168 | 1168 | * @param string $tag_link The tag link html. |
| 1169 | 1169 | * @param object $term The tag term object. |
| 1170 | 1170 | */ |
| 1171 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1171 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
|
|
| 1172 | 1172 | $links[] = $tag_link; |
| 1173 | 1173 | } else {
|
| 1174 | 1174 | $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>"; |
| 1175 | 1175 | /** This action is documented in geodirectory-template_actions.php */ |
| 1176 | - $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
|
|
| 1176 | + $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
|
|
| 1177 | 1177 | $links[] = $tag_link; |
| 1178 | 1178 | } |
| 1179 | 1179 | $terms[] = $term; |
@@ -1183,7 +1183,7 @@ discard block |
||
| 1183 | 1183 | if (!isset($listing_label)) {
|
| 1184 | 1184 | $listing_label = ''; |
| 1185 | 1185 | } |
| 1186 | - $taxonomies[$post_type . '_tags'] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $links, (object)$terms);
|
|
| 1186 | + $taxonomies[$post_type . '_tags'] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $links, (object) $terms);
|
|
| 1187 | 1187 | endif; |
| 1188 | 1188 | |
| 1189 | 1189 | } |
@@ -1219,7 +1219,7 @@ discard block |
||
| 1219 | 1219 | * @param string $term_link The link html to the category. |
| 1220 | 1220 | * @param object $term The category term object. |
| 1221 | 1221 | */ |
| 1222 | - $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
|
|
| 1222 | + $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term);
|
|
| 1223 | 1223 | $links[] = $term_link; |
| 1224 | 1224 | $terms[] = $term; |
| 1225 | 1225 | } |
@@ -1237,7 +1237,7 @@ discard block |
||
| 1237 | 1237 | if (!isset($listing_label)) {
|
| 1238 | 1238 | $listing_label = ''; |
| 1239 | 1239 | } |
| 1240 | - $taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object)$terms);
|
|
| 1240 | + $taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object) $terms);
|
|
| 1241 | 1241 | |
| 1242 | 1242 | } |
| 1243 | 1243 | |
@@ -1268,11 +1268,11 @@ discard block |
||
| 1268 | 1268 | * @param object $post Optional. The post object or blank. |
| 1269 | 1269 | * @package GeoDirectory |
| 1270 | 1270 | */ |
| 1271 | -function geodir_action_details_micordata($post='') |
|
| 1271 | +function geodir_action_details_micordata($post = '') |
|
| 1272 | 1272 | {
|
| 1273 | 1273 | |
| 1274 | 1274 | global $preview; |
| 1275 | - if(empty($post)){global $post;}
|
|
| 1275 | + if (empty($post)) {global $post; }
|
|
| 1276 | 1276 | if ($preview || !geodir_is_page('detail')) {
|
| 1277 | 1277 | return; |
| 1278 | 1278 | } |
@@ -1293,7 +1293,7 @@ discard block |
||
| 1293 | 1293 | "description" => $review->comment_content, |
| 1294 | 1294 | "reviewRating" => array( |
| 1295 | 1295 | "@type" => "Rating", |
| 1296 | - "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score. |
|
| 1296 | + "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score. |
|
| 1297 | 1297 | "ratingValue" => geodir_get_commentoverall($review->comment_ID), |
| 1298 | 1298 | "worstRating" => "1" |
| 1299 | 1299 | ) |
@@ -1321,13 +1321,13 @@ discard block |
||
| 1321 | 1321 | } |
| 1322 | 1322 | //print_r($post); |
| 1323 | 1323 | // external links |
| 1324 | - $external_links = array(); |
|
| 1324 | + $external_links = array(); |
|
| 1325 | 1325 | $external_links[] = $post->geodir_website; |
| 1326 | 1326 | $external_links[] = $post->geodir_twitter; |
| 1327 | 1327 | $external_links[] = $post->geodir_facebook; |
| 1328 | 1328 | $external_links = array_filter($external_links); |
| 1329 | 1329 | |
| 1330 | - if(!empty($external_links)){
|
|
| 1330 | + if (!empty($external_links)) {
|
|
| 1331 | 1331 | $external_links = array_values($external_links); |
| 1332 | 1332 | } |
| 1333 | 1333 | |
@@ -1337,16 +1337,16 @@ discard block |
||
| 1337 | 1337 | |
| 1338 | 1338 | // schema type |
| 1339 | 1339 | $schema_type = 'LocalBusiness'; |
| 1340 | - if(isset($post->default_category) && $post->default_category){
|
|
| 1340 | + if (isset($post->default_category) && $post->default_category) {
|
|
| 1341 | 1341 | $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type); |
| 1342 | - if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
|
|
| 1342 | + if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
|
|
| 1343 | 1343 | } |
| 1344 | 1344 | |
| 1345 | 1345 | $schema = array(); |
| 1346 | 1346 | $schema['@context'] = "http://schema.org"; |
| 1347 | 1347 | $schema['@type'] = $schema_type; |
| 1348 | 1348 | $schema['name'] = $post->post_name; |
| 1349 | - $schema['description'] = wp_strip_all_tags( $post->post_content, true ); |
|
| 1349 | + $schema['description'] = wp_strip_all_tags($post->post_content, true); |
|
| 1350 | 1350 | $schema['telephone'] = $post->geodir_contact; |
| 1351 | 1351 | $schema['url'] = $c_url; |
| 1352 | 1352 | $schema['sameAs'] = $external_links; |
@@ -1360,7 +1360,7 @@ discard block |
||
| 1360 | 1360 | "postalCode" => $post->post_zip |
| 1361 | 1361 | ); |
| 1362 | 1362 | |
| 1363 | - if($post->post_latitude && $post->post_longitude) {
|
|
| 1363 | + if ($post->post_latitude && $post->post_longitude) {
|
|
| 1364 | 1364 | $schema['geo'] = array( |
| 1365 | 1365 | "@type" => "GeoCoordinates", |
| 1366 | 1366 | "latitude" => $post->post_latitude, |
@@ -1368,7 +1368,7 @@ discard block |
||
| 1368 | 1368 | ); |
| 1369 | 1369 | } |
| 1370 | 1370 | |
| 1371 | - if($post_avgratings) {
|
|
| 1371 | + if ($post_avgratings) {
|
|
| 1372 | 1372 | $schema['aggregateRating'] = array( |
| 1373 | 1373 | "@type" => "AggregateRating", |
| 1374 | 1374 | "ratingValue" => $post_avgratings, |
@@ -1387,7 +1387,7 @@ discard block |
||
| 1387 | 1387 | * @param array $schema The array of schema data to be filtered. |
| 1388 | 1388 | * @param object $post The post object. |
| 1389 | 1389 | */ |
| 1390 | - $schema = apply_filters('geodir_details_schema', $schema,$post);
|
|
| 1390 | + $schema = apply_filters('geodir_details_schema', $schema, $post);
|
|
| 1391 | 1391 | |
| 1392 | 1392 | |
| 1393 | 1393 | echo '<script type="application/ld+json">' . json_encode($schema) . '</script>'; |
@@ -1595,26 +1595,26 @@ discard block |
||
| 1595 | 1595 | |
| 1596 | 1596 | |
| 1597 | 1597 | $title = $list_title; |
| 1598 | - if(geodir_is_page('pt')){
|
|
| 1598 | + if (geodir_is_page('pt')) {
|
|
| 1599 | 1599 | $gd_page = 'pt'; |
| 1600 | - $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1600 | + $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
|
| 1601 | 1601 | } |
| 1602 | - elseif(geodir_is_page('listing')){
|
|
| 1602 | + elseif (geodir_is_page('listing')) {
|
|
| 1603 | 1603 | $gd_page = 'listing'; |
| 1604 | 1604 | global $wp_query; |
| 1605 | 1605 | $current_term = $wp_query->get_queried_object(); |
| 1606 | - if (strpos($current_term->taxonomy,'_tags') !== false) {
|
|
| 1606 | + if (strpos($current_term->taxonomy, '_tags') !== false) {
|
|
| 1607 | 1607 | $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
| 1608 | - }else{
|
|
| 1608 | + } else {
|
|
| 1609 | 1609 | $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
| 1610 | 1610 | } |
| 1611 | 1611 | |
| 1612 | 1612 | } |
| 1613 | - elseif(geodir_is_page('author')){
|
|
| 1613 | + elseif (geodir_is_page('author')) {
|
|
| 1614 | 1614 | $gd_page = 'author'; |
| 1615 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 1615 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 1616 | 1616 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 1617 | - }else{
|
|
| 1617 | + } else {
|
|
| 1618 | 1618 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 1619 | 1619 | } |
| 1620 | 1620 | |
@@ -1628,7 +1628,7 @@ discard block |
||
| 1628 | 1628 | * @param string $title The page title including variables. |
| 1629 | 1629 | * @param string $gd_page The GeoDirectory page type if any. |
| 1630 | 1630 | */ |
| 1631 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1631 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 1632 | 1632 | |
| 1633 | 1633 | echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
| 1634 | 1634 | /** |
@@ -1673,7 +1673,7 @@ discard block |
||
| 1673 | 1673 | if ($cat_description) {
|
| 1674 | 1674 | ?> |
| 1675 | 1675 | |
| 1676 | - <div class="term_description"><?php echo $cat_description;?></div> <?php |
|
| 1676 | + <div class="term_description"><?php echo $cat_description; ?></div> <?php |
|
| 1677 | 1677 | } |
| 1678 | 1678 | |
| 1679 | 1679 | } |
@@ -1958,7 +1958,7 @@ discard block |
||
| 1958 | 1958 | */ |
| 1959 | 1959 | do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
|
| 1960 | 1960 | $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
|
| 1961 | - echo '<div class="clearfix '.$extra_class.'">'; |
|
| 1961 | + echo '<div class="clearfix ' . $extra_class . '">'; |
|
| 1962 | 1962 | /** |
| 1963 | 1963 | * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages. |
| 1964 | 1964 | * |
@@ -2034,11 +2034,11 @@ discard block |
||
| 2034 | 2034 | |
| 2035 | 2035 | $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
|
| 2036 | 2036 | |
| 2037 | - if(geodir_is_page('add-listing')){
|
|
| 2037 | + if (geodir_is_page('add-listing')) {
|
|
| 2038 | 2038 | $gd_page = 'add-listing'; |
| 2039 | - if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
|
| 2039 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
|
| 2040 | 2040 | $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
| 2041 | - }elseif(isset($listing_type)){
|
|
| 2041 | + }elseif (isset($listing_type)) {
|
|
| 2042 | 2042 | $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
| 2043 | 2043 | } |
| 2044 | 2044 | |
@@ -2052,7 +2052,7 @@ discard block |
||
| 2052 | 2052 | * @param string $title The page title including variables. |
| 2053 | 2053 | * @param string $gd_page The GeoDirectory page type if any. |
| 2054 | 2054 | */ |
| 2055 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2055 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2056 | 2056 | |
| 2057 | 2057 | echo '<header class="' . $class_header . '"><h1 class="' . $class . '">'; |
| 2058 | 2058 | echo $title; |
@@ -2068,7 +2068,7 @@ discard block |
||
| 2068 | 2068 | */ |
| 2069 | 2069 | function geodir_action_add_listing_page_mandatory() |
| 2070 | 2070 | {?>
|
| 2071 | - <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p> |
|
| 2071 | + <p class="geodir-note "><span class="geodir-required">*</span> <?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p> |
|
| 2072 | 2072 | <?php |
| 2073 | 2073 | } |
| 2074 | 2074 | |
@@ -2103,7 +2103,7 @@ discard block |
||
| 2103 | 2103 | |
| 2104 | 2104 | if (isset($_REQUEST['backandedit'])) {
|
| 2105 | 2105 | global $post; |
| 2106 | - $post = (object)$gd_session->get('listing');
|
|
| 2106 | + $post = (object) $gd_session->get('listing');
|
|
| 2107 | 2107 | $listing_type = $post->listing_type; |
| 2108 | 2108 | $title = $post->post_title; |
| 2109 | 2109 | $desc = $post->post_desc; |
@@ -2135,15 +2135,15 @@ discard block |
||
| 2135 | 2135 | $user_login = true; |
| 2136 | 2136 | } |
| 2137 | 2137 | ?> |
| 2138 | - <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data"> |
|
| 2139 | - <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
| 2140 | - <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/> |
|
| 2138 | + <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data"> |
|
| 2139 | + <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
| 2140 | + <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/> |
|
| 2141 | 2141 | <?php if ($page_id) { ?>
|
| 2142 | - <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/> |
|
| 2142 | + <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/> |
|
| 2143 | 2143 | <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
|
| 2144 | - <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/> |
|
| 2144 | + <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/> |
|
| 2145 | 2145 | <?php } if (isset($_REQUEST['backandedit'])) { ?>
|
| 2146 | - <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/> |
|
| 2146 | + <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/> |
|
| 2147 | 2147 | <?php |
| 2148 | 2148 | } |
| 2149 | 2149 | /** |
@@ -2155,7 +2155,7 @@ discard block |
||
| 2155 | 2155 | */ |
| 2156 | 2156 | do_action('geodir_before_detail_fields');
|
| 2157 | 2157 | ?> |
| 2158 | - <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5> |
|
| 2158 | + <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5> |
|
| 2159 | 2159 | <?php |
| 2160 | 2160 | /** |
| 2161 | 2161 | * Called at the top of the add listing page form for frontend. |
@@ -2167,10 +2167,10 @@ discard block |
||
| 2167 | 2167 | do_action('geodir_before_main_form_fields');
|
| 2168 | 2168 | ?> |
| 2169 | 2169 | <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details"> |
| 2170 | - <label><?php echo PLACE_TITLE_TEXT;?><span>*</span> </label> |
|
| 2170 | + <label><?php echo PLACE_TITLE_TEXT; ?><span>*</span> </label> |
|
| 2171 | 2171 | <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield" |
| 2172 | 2172 | value="<?php echo esc_attr(stripslashes($title)); ?>"/> |
| 2173 | - <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span> |
|
| 2173 | + <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
|
| 2174 | 2174 | </div> |
| 2175 | 2175 | <?php |
| 2176 | 2176 | $show_editor = get_option('geodir_tiny_editor_on_add_listing');
|
@@ -2205,7 +2205,7 @@ discard block |
||
| 2205 | 2205 | $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
|
| 2206 | 2206 | |
| 2207 | 2207 | $desc_class = ''; |
| 2208 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2208 | + if ($desc_limit === '' || (int) $desc_limit > 0) {
|
|
| 2209 | 2209 | /** |
| 2210 | 2210 | * Called on the add listing page form for frontend just before the description field. |
| 2211 | 2211 | * |
@@ -2218,8 +2218,8 @@ discard block |
||
| 2218 | 2218 | $desc_class = ' hidden'; |
| 2219 | 2219 | } |
| 2220 | 2220 | ?> |
| 2221 | - <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>"> |
|
| 2222 | - <label><?php echo PLACE_DESC_TEXT;?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
|
|
| 2221 | + <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>"> |
|
| 2222 | + <label><?php echo PLACE_DESC_TEXT; ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
|
|
| 2223 | 2223 | <?php |
| 2224 | 2224 | if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
|
| 2225 | 2225 | $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
|
@@ -2228,16 +2228,16 @@ discard block |
||
| 2228 | 2228 | <?php wp_editor($desc, "post_desc", $editor_settings); ?> |
| 2229 | 2229 | </div> |
| 2230 | 2230 | <?php if ($desc_limit != '') { ?>
|
| 2231 | - <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
|
|
| 2231 | + <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
|
|
| 2232 | 2232 | <?php } } else { ?>
|
| 2233 | 2233 | <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea> |
| 2234 | 2234 | <?php } if ($desc_limit_msg != '') { ?>
|
| 2235 | 2235 | <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span> |
| 2236 | 2236 | <?php } ?> |
| 2237 | - <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span> |
|
| 2237 | + <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span> |
|
| 2238 | 2238 | </div> |
| 2239 | 2239 | <?php |
| 2240 | - if ($desc_limit === '' || (int)$desc_limit > 0) {
|
|
| 2240 | + if ($desc_limit === '' || (int) $desc_limit > 0) {
|
|
| 2241 | 2241 | /** |
| 2242 | 2242 | * Called on the add listing page form for frontend just after the description field. |
| 2243 | 2243 | * |
@@ -2276,7 +2276,7 @@ discard block |
||
| 2276 | 2276 | $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
|
| 2277 | 2277 | |
| 2278 | 2278 | $tags_class = ''; |
| 2279 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2279 | + if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
|
|
| 2280 | 2280 | /** |
| 2281 | 2281 | * Called on the add listing page form for frontend just before the tags field. |
| 2282 | 2282 | * |
@@ -2287,14 +2287,14 @@ discard block |
||
| 2287 | 2287 | $tags_class = ' hidden'; |
| 2288 | 2288 | } |
| 2289 | 2289 | ?> |
| 2290 | - <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>"> |
|
| 2290 | + <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>"> |
|
| 2291 | 2291 | <label><?php echo TAGKW_TEXT; ?></label> |
| 2292 | 2292 | <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield" |
| 2293 | - maxlength="<?php echo $kw_tags_count;?>"/> |
|
| 2294 | - <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span> |
|
| 2293 | + maxlength="<?php echo $kw_tags_count; ?>"/> |
|
| 2294 | + <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span> |
|
| 2295 | 2295 | </div> |
| 2296 | 2296 | <?php |
| 2297 | - if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
|
|
| 2297 | + if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
|
|
| 2298 | 2298 | /** |
| 2299 | 2299 | * Called on the add listing page form for frontend just after the tags field. |
| 2300 | 2300 | * |
@@ -2320,7 +2320,7 @@ discard block |
||
| 2320 | 2320 | $thumb_img_arr = array(); |
| 2321 | 2321 | $totImg = 0; |
| 2322 | 2322 | if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
| 2323 | - $post = (object)$gd_session->get('listing');
|
|
| 2323 | + $post = (object) $gd_session->get('listing');
|
|
| 2324 | 2324 | if (isset($post->post_images)) |
| 2325 | 2325 | $curImages = trim($post->post_images, ","); |
| 2326 | 2326 | |
@@ -2333,7 +2333,7 @@ discard block |
||
| 2333 | 2333 | $listing_type = $post->listing_type; |
| 2334 | 2334 | |
| 2335 | 2335 | } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
|
| 2336 | - $post = geodir_get_post_info((int)$_REQUEST['pid']); |
|
| 2336 | + $post = geodir_get_post_info((int) $_REQUEST['pid']); |
|
| 2337 | 2337 | $listing_type = $post->post_type; |
| 2338 | 2338 | $thumb_img_arr = geodir_get_images($_REQUEST['pid']); |
| 2339 | 2339 | |
@@ -2347,7 +2347,7 @@ discard block |
||
| 2347 | 2347 | //$curImages = $img->src.","; |
| 2348 | 2348 | } |
| 2349 | 2349 | |
| 2350 | - $totImg = count((array)$thumb_img_arr); |
|
| 2350 | + $totImg = count((array) $thumb_img_arr); |
|
| 2351 | 2351 | } |
| 2352 | 2352 | |
| 2353 | 2353 | if ($curImages != '') |
@@ -2368,7 +2368,7 @@ discard block |
||
| 2368 | 2368 | if ($show_image_input_box) {
|
| 2369 | 2369 | ?> |
| 2370 | 2370 | |
| 2371 | - <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?> |
|
| 2371 | + <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?> |
|
| 2372 | 2372 | <?php if ($image_limit == 1) {
|
| 2373 | 2373 | echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
|
| 2374 | 2374 | } ?> |
@@ -2391,7 +2391,7 @@ discard block |
||
| 2391 | 2391 | <div |
| 2392 | 2392 | class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>" |
| 2393 | 2393 | id="<?php echo $id; ?>plupload-upload-ui"> |
| 2394 | - <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
|
|
| 2394 | + <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
|
|
| 2395 | 2395 | <input id="<?php echo $id; ?>plupload-browse-button" type="button" |
| 2396 | 2396 | value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
|
| 2397 | 2397 | <span class="ajaxnonceplu" |
@@ -2408,7 +2408,7 @@ discard block |
||
| 2408 | 2408 | id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;"> |
| 2409 | 2409 | </div> |
| 2410 | 2410 | <span |
| 2411 | - id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory');?></span>
|
|
| 2411 | + id="upload-msg"><?php _e('Please drag & drop the images to rearrange the order', 'geodirectory'); ?></span>
|
|
| 2412 | 2412 | <span id="<?php echo $id; ?>upload-error" style="display:none"></span> |
| 2413 | 2413 | </div> |
| 2414 | 2414 | |
@@ -2420,7 +2420,7 @@ discard block |
||
| 2420 | 2420 | * |
| 2421 | 2421 | * @since 1.0.0 |
| 2422 | 2422 | */ |
| 2423 | - do_action('geodir_after_main_form_fields');?>
|
|
| 2423 | + do_action('geodir_after_main_form_fields'); ?>
|
|
| 2424 | 2424 | |
| 2425 | 2425 | |
| 2426 | 2426 | <!-- add captcha code --> |
@@ -2431,7 +2431,7 @@ discard block |
||
| 2431 | 2431 | </script> |
| 2432 | 2432 | <noscript> |
| 2433 | 2433 | <div> |
| 2434 | - <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
|
|
| 2434 | + <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
|
|
| 2435 | 2435 | <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/> |
| 2436 | 2436 | </div> |
| 2437 | 2437 | </noscript> |
@@ -2441,10 +2441,10 @@ discard block |
||
| 2441 | 2441 | <!-- end captcha code --> |
| 2442 | 2442 | |
| 2443 | 2443 | <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;"> |
| 2444 | - <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>" |
|
| 2445 | - class="geodir_button" <?php echo $submit_button;?>/> |
|
| 2444 | + <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>" |
|
| 2445 | + class="geodir_button" <?php echo $submit_button; ?>/> |
|
| 2446 | 2446 | <span class="geodir_message_note" |
| 2447 | - style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
|
|
| 2447 | + style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
|
|
| 2448 | 2448 | </div> |
| 2449 | 2449 | |
| 2450 | 2450 | </form> |
@@ -2506,7 +2506,7 @@ discard block |
||
| 2506 | 2506 | class="<?php |
| 2507 | 2507 | /** This action is documented in geodirectory_template_actions.php */ |
| 2508 | 2508 | echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
|
| 2509 | - <?php dynamic_sidebar('Reg/Login Top Section');?>
|
|
| 2509 | + <?php dynamic_sidebar('Reg/Login Top Section'); ?>
|
|
| 2510 | 2510 | </div><!-- clearfix ends here--> |
| 2511 | 2511 | <?php |
| 2512 | 2512 | } |
@@ -2528,7 +2528,7 @@ discard block |
||
| 2528 | 2528 | |
| 2529 | 2529 | ?> |
| 2530 | 2530 | <script type="text/javascript"> |
| 2531 | - <?php if ( $user_login ) { ?>
|
|
| 2531 | + <?php if ($user_login) { ?>
|
|
| 2532 | 2532 | setTimeout(function () {
|
| 2533 | 2533 | try {
|
| 2534 | 2534 | d = document.getElementById('user_pass');
|
@@ -2545,7 +2545,7 @@ discard block |
||
| 2545 | 2545 | <?php } ?> |
| 2546 | 2546 | </script> |
| 2547 | 2547 | <script type="text/javascript"> |
| 2548 | - <?php if ( $user_login ) { ?>
|
|
| 2548 | + <?php if ($user_login) { ?>
|
|
| 2549 | 2549 | setTimeout(function () {
|
| 2550 | 2550 | try {
|
| 2551 | 2551 | d = document.getElementById('user_pass');
|
@@ -2683,11 +2683,11 @@ discard block |
||
| 2683 | 2683 | $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
|
| 2684 | 2684 | |
| 2685 | 2685 | $title = $list_title; |
| 2686 | - if(geodir_is_page('author')){
|
|
| 2686 | + if (geodir_is_page('author')) {
|
|
| 2687 | 2687 | $gd_page = 'author'; |
| 2688 | - if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
|
| 2688 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
|
|
| 2689 | 2689 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 2690 | - }else{
|
|
| 2690 | + } else {
|
|
| 2691 | 2691 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 2692 | 2692 | } |
| 2693 | 2693 | |
@@ -2701,7 +2701,7 @@ discard block |
||
| 2701 | 2701 | * @param string $title The page title including variables. |
| 2702 | 2702 | * @param string $gd_page The GeoDirectory page type if any. |
| 2703 | 2703 | */ |
| 2704 | - $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2704 | + $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
|
|
| 2705 | 2705 | |
| 2706 | 2706 | echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . |
| 2707 | 2707 | /** |
@@ -2915,7 +2915,7 @@ discard block |
||
| 2915 | 2915 | $post_type_info = get_post_type_object($gd_post_type); |
| 2916 | 2916 | |
| 2917 | 2917 | $pt_name = ''; |
| 2918 | - if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
|
|
| 2918 | + if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
|
|
| 2919 | 2919 | |
| 2920 | 2920 | if (is_search()) {
|
| 2921 | 2921 | $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
|
@@ -714,8 +714,9 @@ discard block |
||
| 714 | 714 | |
| 715 | 715 | if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
|
| 716 | 716 | if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
|
| 717 | - if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') |
|
| 718 | - $term_icon = $term_icon_url['src']; |
|
| 717 | + if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') { |
|
| 718 | + $term_icon = $term_icon_url['src']; |
|
| 719 | + } |
|
| 719 | 720 | break; |
| 720 | 721 | } |
| 721 | 722 | } |
@@ -1246,8 +1247,9 @@ discard block |
||
| 1246 | 1247 | echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>'; |
| 1247 | 1248 | } |
| 1248 | 1249 | |
| 1249 | - if (isset($taxonomies[$post_type . '_tags'])) |
|
| 1250 | - echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1250 | + if (isset($taxonomies[$post_type . '_tags'])) { |
|
| 1251 | + echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>'; |
|
| 1252 | + } |
|
| 1251 | 1253 | |
| 1252 | 1254 | ?> |
| 1253 | 1255 | </p><?php |
@@ -1598,23 +1600,21 @@ discard block |
||
| 1598 | 1600 | if(geodir_is_page('pt')){
|
| 1599 | 1601 | $gd_page = 'pt'; |
| 1600 | 1602 | $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
|
| 1601 | - } |
|
| 1602 | - elseif(geodir_is_page('listing')){
|
|
| 1603 | + } elseif(geodir_is_page('listing')){
|
|
| 1603 | 1604 | $gd_page = 'listing'; |
| 1604 | 1605 | global $wp_query; |
| 1605 | 1606 | $current_term = $wp_query->get_queried_object(); |
| 1606 | 1607 | if (strpos($current_term->taxonomy,'_tags') !== false) {
|
| 1607 | 1608 | $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
|
| 1608 | - }else{
|
|
| 1609 | + } else{
|
|
| 1609 | 1610 | $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
|
| 1610 | 1611 | } |
| 1611 | 1612 | |
| 1612 | - } |
|
| 1613 | - elseif(geodir_is_page('author')){
|
|
| 1613 | + } elseif(geodir_is_page('author')){
|
|
| 1614 | 1614 | $gd_page = 'author'; |
| 1615 | 1615 | if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
| 1616 | 1616 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 1617 | - }else{
|
|
| 1617 | + } else{
|
|
| 1618 | 1618 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 1619 | 1619 | } |
| 1620 | 1620 | |
@@ -2025,8 +2025,9 @@ discard block |
||
| 2025 | 2025 | */ |
| 2026 | 2026 | function geodir_action_add_listing_page_title() |
| 2027 | 2027 | {
|
| 2028 | - if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') |
|
| 2029 | - $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2028 | + if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') { |
|
| 2029 | + $listing_type = sanitize_text_field($_REQUEST['listing_type']); |
|
| 2030 | + } |
|
| 2030 | 2031 | /** This action is documented in geodirectory_template_actions.php */ |
| 2031 | 2032 | $class = apply_filters('geodir_page_title_class', 'entry-title fn');
|
| 2032 | 2033 | /** This action is documented in geodirectory_template_actions.php */ |
@@ -2038,7 +2039,7 @@ discard block |
||
| 2038 | 2039 | $gd_page = 'add-listing'; |
| 2039 | 2040 | if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
|
| 2040 | 2041 | $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
|
| 2041 | - }elseif(isset($listing_type)){
|
|
| 2042 | + } elseif(isset($listing_type)){
|
|
| 2042 | 2043 | $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
|
| 2043 | 2044 | } |
| 2044 | 2045 | |
@@ -2321,8 +2322,9 @@ discard block |
||
| 2321 | 2322 | $totImg = 0; |
| 2322 | 2323 | if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
|
| 2323 | 2324 | $post = (object)$gd_session->get('listing');
|
| 2324 | - if (isset($post->post_images)) |
|
| 2325 | - $curImages = trim($post->post_images, ","); |
|
| 2325 | + if (isset($post->post_images)) { |
|
| 2326 | + $curImages = trim($post->post_images, ","); |
|
| 2327 | + } |
|
| 2326 | 2328 | |
| 2327 | 2329 | |
| 2328 | 2330 | if ($curImages != '') {
|
@@ -2350,10 +2352,13 @@ discard block |
||
| 2350 | 2352 | $totImg = count((array)$thumb_img_arr); |
| 2351 | 2353 | } |
| 2352 | 2354 | |
| 2353 | - if ($curImages != '') |
|
| 2354 | - $svalue = $curImages; // this will be initial value of the above form field. Image urls. |
|
| 2355 | - else |
|
| 2356 | - $svalue = ''; |
|
| 2355 | + if ($curImages != '') { |
|
| 2356 | + $svalue = $curImages; |
|
| 2357 | + } |
|
| 2358 | + // this will be initial value of the above form field. Image urls. |
|
| 2359 | + else { |
|
| 2360 | + $svalue = ''; |
|
| 2361 | + } |
|
| 2357 | 2362 | |
| 2358 | 2363 | $image_limit = $package_info->image_limit; |
| 2359 | 2364 | $show_image_input_box = ($image_limit != '0'); |
@@ -2563,8 +2568,9 @@ discard block |
||
| 2563 | 2568 | </script><?php |
| 2564 | 2569 | |
| 2565 | 2570 | global $errors; |
| 2566 | - if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') |
|
| 2567 | - $errors->add('claim_login', LOGIN_CLAIM);
|
|
| 2571 | + if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') { |
|
| 2572 | + $errors->add('claim_login', LOGIN_CLAIM); |
|
| 2573 | + } |
|
| 2568 | 2574 | |
| 2569 | 2575 | if (!empty($errors)) {
|
| 2570 | 2576 | foreach ($errors as $errorsObj) {
|
@@ -2668,8 +2674,9 @@ discard block |
||
| 2668 | 2674 | |
| 2669 | 2675 | if (!empty($term)) {
|
| 2670 | 2676 | $current_term = get_term_by('slug', $term, $taxonomy[0]);
|
| 2671 | - if (!empty($current_term)) |
|
| 2672 | - $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
|
|
| 2677 | + if (!empty($current_term)) { |
|
| 2678 | + $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'"; |
|
| 2679 | + } |
|
| 2673 | 2680 | } |
| 2674 | 2681 | |
| 2675 | 2682 | |
@@ -2687,7 +2694,7 @@ discard block |
||
| 2687 | 2694 | $gd_page = 'author'; |
| 2688 | 2695 | if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
|
| 2689 | 2696 | $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
|
| 2690 | - }else{
|
|
| 2697 | + } else{
|
|
| 2691 | 2698 | $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
|
| 2692 | 2699 | } |
| 2693 | 2700 | |