@@ -44,57 +44,57 @@ discard block |
||
| 44 | 44 | |
| 45 | 45 | <?php if (have_posts()) : |
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * Called inside the `ul` of the listings template, but before any `li` elements. |
|
| 49 | - * |
|
| 50 | - * When used by the widget view template then it will only show if there are listings to be shown. |
|
| 51 | - * |
|
| 52 | - * @since 1.0.0 |
|
| 53 | - * @see 'geodir_after_listing_post_listview' |
|
| 54 | - */ |
|
| 55 | - do_action('geodir_before_listing_post_listview');
|
|
| 56 | - |
|
| 57 | - while (have_posts()) : the_post(); |
|
| 58 | - global $post, $wpdb, $preview; |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * Add a class to the `li` element of the listings list template. |
|
| 62 | - * |
|
| 63 | - * @since 1.0.0 |
|
| 64 | - * @param string $class The extra class for the `li` element, default empty. |
|
| 65 | - */ |
|
| 66 | - $post_view_class = apply_filters('geodir_post_view_extra_class', '');
|
|
| 67 | - |
|
| 68 | - /** |
|
| 69 | - * Add a class to the `article` tag inside the `li` element on the listings list template. |
|
| 70 | - * |
|
| 71 | - * @since 1.0.0 |
|
| 72 | - * @param string $class The extra class for the `article` element, default empty. |
|
| 73 | - */ |
|
| 74 | - $post_view_article_class = apply_filters('geodir_post_view_article_extra_class', '');
|
|
| 75 | - ?> |
|
| 47 | + /** |
|
| 48 | + * Called inside the `ul` of the listings template, but before any `li` elements. |
|
| 49 | + * |
|
| 50 | + * When used by the widget view template then it will only show if there are listings to be shown. |
|
| 51 | + * |
|
| 52 | + * @since 1.0.0 |
|
| 53 | + * @see 'geodir_after_listing_post_listview' |
|
| 54 | + */ |
|
| 55 | + do_action('geodir_before_listing_post_listview');
|
|
| 56 | + |
|
| 57 | + while (have_posts()) : the_post(); |
|
| 58 | + global $post, $wpdb, $preview; |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * Add a class to the `li` element of the listings list template. |
|
| 62 | + * |
|
| 63 | + * @since 1.0.0 |
|
| 64 | + * @param string $class The extra class for the `li` element, default empty. |
|
| 65 | + */ |
|
| 66 | + $post_view_class = apply_filters('geodir_post_view_extra_class', '');
|
|
| 67 | + |
|
| 68 | + /** |
|
| 69 | + * Add a class to the `article` tag inside the `li` element on the listings list template. |
|
| 70 | + * |
|
| 71 | + * @since 1.0.0 |
|
| 72 | + * @param string $class The extra class for the `article` element, default empty. |
|
| 73 | + */ |
|
| 74 | + $post_view_article_class = apply_filters('geodir_post_view_article_extra_class', '');
|
|
| 75 | + ?> |
|
| 76 | 76 | |
| 77 | 77 | <li class="clearfix <?php if ($grid_view_class) {
|
| 78 | - echo 'geodir-gridview ' . $grid_view_class; |
|
| 79 | - } else {
|
|
| 80 | - echo ' geodir-listview '; |
|
| 81 | - } ?> <?php if ($post_view_class) {
|
|
| 82 | - echo $post_view_class; |
|
| 83 | - } ?>" <?php if (isset($listing_width) && $listing_width) echo "style='width:{$listing_width}%;'"; // Width for widget listing
|
|
| 84 | - |
|
| 85 | - echo " data-post-id='$post->ID' "; |
|
| 86 | - /** |
|
| 87 | - * Called inside the `<li>` tag for listing outputs. |
|
| 88 | - * |
|
| 89 | - * @since 1.5.9 |
|
| 90 | - * @param object $post The post object. |
|
| 91 | - * @param string $string If called on the listing or widget template. |
|
| 92 | - */ |
|
| 93 | - do_action('geodir_listview_inside_li', $post, 'listing');
|
|
| 94 | - ?> > |
|
| 78 | + echo 'geodir-gridview ' . $grid_view_class; |
|
| 79 | + } else {
|
|
| 80 | + echo ' geodir-listview '; |
|
| 81 | + } ?> <?php if ($post_view_class) {
|
|
| 82 | + echo $post_view_class; |
|
| 83 | + } ?>" <?php if (isset($listing_width) && $listing_width) echo "style='width:{$listing_width}%;'"; // Width for widget listing
|
|
| 84 | + |
|
| 85 | + echo " data-post-id='$post->ID' "; |
|
| 86 | + /** |
|
| 87 | + * Called inside the `<li>` tag for listing outputs. |
|
| 88 | + * |
|
| 89 | + * @since 1.5.9 |
|
| 90 | + * @param object $post The post object. |
|
| 91 | + * @param string $string If called on the listing or widget template. |
|
| 92 | + */ |
|
| 93 | + do_action('geodir_listview_inside_li', $post, 'listing');
|
|
| 94 | + ?> > |
|
| 95 | 95 | <article class="geodir-category-listing <?php if ($post_view_article_class) {
|
| 96 | - echo $post_view_article_class; |
|
| 97 | - } ?>"> |
|
| 96 | + echo $post_view_article_class; |
|
| 97 | + } ?>"> |
|
| 98 | 98 | <div class="geodir-post-img <?php echo apply_filters('geodir_listing_listview_thumb_extra_class', '', 'listing'); ?>">
|
| 99 | 99 | <?php if ($fimage = geodir_show_featured_image($post->ID, 'list-thumb', true, false, $post->featured_image)) { ?>
|
| 100 | 100 | |
@@ -102,37 +102,37 @@ discard block |
||
| 102 | 102 | <?php echo $fimage; ?> |
| 103 | 103 | </a> |
| 104 | 104 | <?php |
| 105 | - /** |
|
| 106 | - * Called before badges are output. |
|
| 107 | - * |
|
| 108 | - * Called on the listings template after the image has been output and before the badges like `new` or `featured` are output. |
|
| 109 | - * |
|
| 110 | - * @since 1.0.0 |
|
| 111 | - * @param object $post The post object. |
|
| 112 | - * @see 'geodir_after_badge_on_image' |
|
| 113 | - */ |
|
| 114 | - do_action('geodir_before_badge_on_image', $post);
|
|
| 115 | - if (isset($post->is_featured) && $post->is_featured) {
|
|
| 116 | - echo geodir_show_badges_on_image('featured', $post, get_permalink());
|
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - $geodir_days_new = (int)get_option('geodir_listing_new_days');
|
|
| 120 | - |
|
| 121 | - if (round(abs(strtotime($post->post_date) - strtotime(date('Y-m-d'))) / 86400) < $geodir_days_new) {
|
|
| 122 | - echo geodir_show_badges_on_image('new', $post, get_permalink());
|
|
| 123 | - } |
|
| 124 | - |
|
| 125 | - /** |
|
| 126 | - * Called after badges are output. |
|
| 127 | - * |
|
| 128 | - * Called on the listings template after the image and badges like `new` or `featured` have been output. |
|
| 129 | - * |
|
| 130 | - * @since 1.0.0 |
|
| 131 | - * @param object $post The post object. |
|
| 132 | - * @see 'geodir_before_badge_on_image' |
|
| 133 | - */ |
|
| 134 | - do_action('geodir_after_badge_on_image', $post);
|
|
| 135 | - ?> |
|
| 105 | + /** |
|
| 106 | + * Called before badges are output. |
|
| 107 | + * |
|
| 108 | + * Called on the listings template after the image has been output and before the badges like `new` or `featured` are output. |
|
| 109 | + * |
|
| 110 | + * @since 1.0.0 |
|
| 111 | + * @param object $post The post object. |
|
| 112 | + * @see 'geodir_after_badge_on_image' |
|
| 113 | + */ |
|
| 114 | + do_action('geodir_before_badge_on_image', $post);
|
|
| 115 | + if (isset($post->is_featured) && $post->is_featured) {
|
|
| 116 | + echo geodir_show_badges_on_image('featured', $post, get_permalink());
|
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + $geodir_days_new = (int)get_option('geodir_listing_new_days');
|
|
| 120 | + |
|
| 121 | + if (round(abs(strtotime($post->post_date) - strtotime(date('Y-m-d'))) / 86400) < $geodir_days_new) {
|
|
| 122 | + echo geodir_show_badges_on_image('new', $post, get_permalink());
|
|
| 123 | + } |
|
| 124 | + |
|
| 125 | + /** |
|
| 126 | + * Called after badges are output. |
|
| 127 | + * |
|
| 128 | + * Called on the listings template after the image and badges like `new` or `featured` have been output. |
|
| 129 | + * |
|
| 130 | + * @since 1.0.0 |
|
| 131 | + * @param object $post The post object. |
|
| 132 | + * @see 'geodir_before_badge_on_image' |
|
| 133 | + */ |
|
| 134 | + do_action('geodir_after_badge_on_image', $post);
|
|
| 135 | + ?> |
|
| 136 | 136 | |
| 137 | 137 | |
| 138 | 138 | <?php } ?> |
@@ -142,15 +142,15 @@ discard block |
||
| 142 | 142 | <div class="geodir-content <?php echo apply_filters('geodir_listing_listview_content_extra_class', '', 'listing'); ?>">
|
| 143 | 143 | |
| 144 | 144 | <?php |
| 145 | - /** |
|
| 146 | - * Called before the post title on the listings view template. |
|
| 147 | - * |
|
| 148 | - * @since 1.0.0 |
|
| 149 | - * @param string $type The template type, default 'listview'. |
|
| 150 | - * @param object $post The post object. |
|
| 151 | - * @see 'geodir_after_listing_post_title' |
|
| 152 | - */ |
|
| 153 | - do_action('geodir_before_listing_post_title', 'listview', $post); ?>
|
|
| 145 | + /** |
|
| 146 | + * Called before the post title on the listings view template. |
|
| 147 | + * |
|
| 148 | + * @since 1.0.0 |
|
| 149 | + * @param string $type The template type, default 'listview'. |
|
| 150 | + * @param object $post The post object. |
|
| 151 | + * @see 'geodir_after_listing_post_title' |
|
| 152 | + */ |
|
| 153 | + do_action('geodir_before_listing_post_title', 'listview', $post); ?>
|
|
| 154 | 154 | |
| 155 | 155 | <header class="geodir-entry-header"><h2 class="geodir-entry-title"> |
| 156 | 156 | <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> |
@@ -162,225 +162,225 @@ discard block |
||
| 162 | 162 | <!-- .entry-header --> |
| 163 | 163 | |
| 164 | 164 | <?php |
| 165 | - /** |
|
| 166 | - * Called after the post title on the listings view template. |
|
| 167 | - * |
|
| 168 | - * @since 1.0.0 |
|
| 169 | - * @param string $type The template type, default 'listview'. |
|
| 170 | - * @param object $post The post object. |
|
| 171 | - * @see 'geodir_before_listing_post_title' |
|
| 172 | - */ |
|
| 173 | - do_action('geodir_after_listing_post_title', 'listview', $post); ?>
|
|
| 165 | + /** |
|
| 166 | + * Called after the post title on the listings view template. |
|
| 167 | + * |
|
| 168 | + * @since 1.0.0 |
|
| 169 | + * @param string $type The template type, default 'listview'. |
|
| 170 | + * @param object $post The post object. |
|
| 171 | + * @see 'geodir_before_listing_post_title' |
|
| 172 | + */ |
|
| 173 | + do_action('geodir_after_listing_post_title', 'listview', $post); ?>
|
|
| 174 | 174 | |
| 175 | 175 | <?php /// Print Distance |
| 176 | - if ( ( isset( $_REQUEST['sgeo_lat'] ) && $_REQUEST['sgeo_lat'] != '' ) || ( $related_nearest && $related_parent_lat ) ) {
|
|
| 177 | - if ( $related_nearest && $related_parent_lat ) {
|
|
| 178 | - $startPoint = array('latitude' => $related_parent_lat, 'longitude' => $related_parent_lon);
|
|
| 179 | - } else {
|
|
| 180 | - $startPoint = array('latitude' => $_REQUEST['sgeo_lat'], 'longitude' => $_REQUEST['sgeo_lon']);
|
|
| 181 | - } |
|
| 182 | - |
|
| 183 | - $endLat = $post->post_latitude; |
|
| 184 | - $endLon = $post->post_longitude; |
|
| 185 | - $endPoint = array('latitude' => $endLat, 'longitude' => $endLon);
|
|
| 186 | - $uom = get_option('geodir_search_dist_1');
|
|
| 187 | - $distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom); ?> |
|
| 176 | + if ( ( isset( $_REQUEST['sgeo_lat'] ) && $_REQUEST['sgeo_lat'] != '' ) || ( $related_nearest && $related_parent_lat ) ) {
|
|
| 177 | + if ( $related_nearest && $related_parent_lat ) {
|
|
| 178 | + $startPoint = array('latitude' => $related_parent_lat, 'longitude' => $related_parent_lon);
|
|
| 179 | + } else {
|
|
| 180 | + $startPoint = array('latitude' => $_REQUEST['sgeo_lat'], 'longitude' => $_REQUEST['sgeo_lon']);
|
|
| 181 | + } |
|
| 182 | + |
|
| 183 | + $endLat = $post->post_latitude; |
|
| 184 | + $endLon = $post->post_longitude; |
|
| 185 | + $endPoint = array('latitude' => $endLat, 'longitude' => $endLon);
|
|
| 186 | + $uom = get_option('geodir_search_dist_1');
|
|
| 187 | + $distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom); ?> |
|
| 188 | 188 | <h3> |
| 189 | 189 | <?php |
| 190 | 190 | |
| 191 | - if (round($distance, 2) == 0) {
|
|
| 192 | - $uom = get_option('geodir_search_dist_2');
|
|
| 193 | - |
|
| 194 | - $distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom); |
|
| 195 | - if ($uom == 'feet') {
|
|
| 196 | - $uom = __('feet', 'geodirectory');
|
|
| 197 | - } else {
|
|
| 198 | - $uom = __('meters', 'geodirectory');
|
|
| 199 | - } |
|
| 200 | - echo round($distance) . ' ' . $uom . '<br />'; |
|
| 201 | - } else {
|
|
| 202 | - if ($uom == 'miles') {
|
|
| 203 | - $uom = __('miles', 'geodirectory');
|
|
| 204 | - } else {
|
|
| 205 | - $uom = __('km', 'geodirectory');
|
|
| 206 | - } |
|
| 207 | - echo round($distance, 2) . ' ' . $uom . '<br />'; |
|
| 208 | - } |
|
| 209 | - ?> |
|
| 191 | + if (round($distance, 2) == 0) {
|
|
| 192 | + $uom = get_option('geodir_search_dist_2');
|
|
| 193 | + |
|
| 194 | + $distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom); |
|
| 195 | + if ($uom == 'feet') {
|
|
| 196 | + $uom = __('feet', 'geodirectory');
|
|
| 197 | + } else {
|
|
| 198 | + $uom = __('meters', 'geodirectory');
|
|
| 199 | + } |
|
| 200 | + echo round($distance) . ' ' . $uom . '<br />'; |
|
| 201 | + } else {
|
|
| 202 | + if ($uom == 'miles') {
|
|
| 203 | + $uom = __('miles', 'geodirectory');
|
|
| 204 | + } else {
|
|
| 205 | + $uom = __('km', 'geodirectory');
|
|
| 206 | + } |
|
| 207 | + echo round($distance, 2) . ' ' . $uom . '<br />'; |
|
| 208 | + } |
|
| 209 | + ?> |
|
| 210 | 210 | </h3> |
| 211 | 211 | <?php } ?> |
| 212 | 212 | |
| 213 | 213 | |
| 214 | 214 | <?php |
| 215 | - /** |
|
| 216 | - * Called before the post excerpt on the listings view template. |
|
| 217 | - * |
|
| 218 | - * @since 1.0.0 |
|
| 219 | - * @param object $post The post object. |
|
| 220 | - * @see 'geodir_after_listing_post_excerpt' |
|
| 221 | - */ |
|
| 222 | - do_action('geodir_before_listing_post_excerpt', $post); ?>
|
|
| 215 | + /** |
|
| 216 | + * Called before the post excerpt on the listings view template. |
|
| 217 | + * |
|
| 218 | + * @since 1.0.0 |
|
| 219 | + * @param object $post The post object. |
|
| 220 | + * @see 'geodir_after_listing_post_excerpt' |
|
| 221 | + */ |
|
| 222 | + do_action('geodir_before_listing_post_excerpt', $post); ?>
|
|
| 223 | 223 | <?php echo geodir_show_listing_info('listing'); ?>
|
| 224 | 224 | <div class="geodir-entry-content"> |
| 225 | 225 | |
| 226 | 226 | <?php |
| 227 | - /** |
|
| 228 | - * Filter to hide the listing excerpt |
|
| 229 | - * |
|
| 230 | - * @since 1.5.3 |
|
| 231 | - * @param bool $display Display the excerpt or not. Default true. |
|
| 232 | - * @param string $view The view type, default 'listview'. |
|
| 233 | - * @param object $post The post object. |
|
| 234 | - */ |
|
| 235 | - $show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'listview', $post);
|
|
| 236 | - if ($show_listing_excerpt) {
|
|
| 237 | - if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
|
|
| 238 | - $content_out = geodir_max_excerpt( $character_count ); |
|
| 239 | - } else {
|
|
| 240 | - $content_out = get_the_excerpt(); |
|
| 241 | - } |
|
| 242 | - if ( ! empty( $content_out ) ) {
|
|
| 243 | - echo "<p>" . $content_out . "</p>"; |
|
| 244 | - } |
|
| 245 | - } |
|
| 246 | - ?></div> |
|
| 227 | + /** |
|
| 228 | + * Filter to hide the listing excerpt |
|
| 229 | + * |
|
| 230 | + * @since 1.5.3 |
|
| 231 | + * @param bool $display Display the excerpt or not. Default true. |
|
| 232 | + * @param string $view The view type, default 'listview'. |
|
| 233 | + * @param object $post The post object. |
|
| 234 | + */ |
|
| 235 | + $show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'listview', $post);
|
|
| 236 | + if ($show_listing_excerpt) {
|
|
| 237 | + if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
|
|
| 238 | + $content_out = geodir_max_excerpt( $character_count ); |
|
| 239 | + } else {
|
|
| 240 | + $content_out = get_the_excerpt(); |
|
| 241 | + } |
|
| 242 | + if ( ! empty( $content_out ) ) {
|
|
| 243 | + echo "<p>" . $content_out . "</p>"; |
|
| 244 | + } |
|
| 245 | + } |
|
| 246 | + ?></div> |
|
| 247 | 247 | |
| 248 | 248 | <?php |
| 249 | - /** |
|
| 250 | - * Called after the post excerpt on the listings view template. |
|
| 251 | - * |
|
| 252 | - * @since 1.0.0 |
|
| 253 | - * @param object $post The post object. |
|
| 254 | - * @see 'geodir_before_listing_post_excerpt' |
|
| 255 | - */ |
|
| 256 | - do_action('geodir_after_listing_post_excerpt', $post); ?>
|
|
| 249 | + /** |
|
| 250 | + * Called after the post excerpt on the listings view template. |
|
| 251 | + * |
|
| 252 | + * @since 1.0.0 |
|
| 253 | + * @param object $post The post object. |
|
| 254 | + * @see 'geodir_before_listing_post_excerpt' |
|
| 255 | + */ |
|
| 256 | + do_action('geodir_after_listing_post_excerpt', $post); ?>
|
|
| 257 | 257 | </div> |
| 258 | 258 | <!-- gd-content ends here--> |
| 259 | 259 | <?php |
| 260 | - /** |
|
| 261 | - * Called after printing listing content. |
|
| 262 | - * |
|
| 263 | - * @since 1.5.3 |
|
| 264 | - * @param object $post The post object. |
|
| 265 | - * @param string $view The view type, default 'listing'. |
|
| 266 | - */ |
|
| 267 | - do_action( 'geodir_after_listing_content', $post, 'listing' ); ?> |
|
| 260 | + /** |
|
| 261 | + * Called after printing listing content. |
|
| 262 | + * |
|
| 263 | + * @since 1.5.3 |
|
| 264 | + * @param object $post The post object. |
|
| 265 | + * @param string $view The view type, default 'listing'. |
|
| 266 | + */ |
|
| 267 | + do_action( 'geodir_after_listing_content', $post, 'listing' ); ?> |
|
| 268 | 268 | <footer class="geodir-entry-meta <?php echo apply_filters('geodir_listing_listview_meta_extra_class', '', 'listing'); ?>">
|
| 269 | 269 | <div class="geodir-addinfo clearfix <?php echo apply_filters('geodir_listing_listview_addinfo_extra_class', '', 'listing'); ?>">
|
| 270 | 270 | |
| 271 | 271 | <?php |
| 272 | - /** |
|
| 273 | - * Called before printing review stars html. |
|
| 274 | - * |
|
| 275 | - * @since 1.5.3 |
|
| 276 | - * @param object $post The post object. |
|
| 277 | - * @param string $view The view type, default 'listing'. |
|
| 278 | - */ |
|
| 279 | - do_action( 'geodir_before_review_html', $post, 'listing' ); |
|
| 280 | - |
|
| 281 | - $review_show = geodir_is_reviews_show('listview');
|
|
| 282 | - |
|
| 283 | - if ($review_show) {
|
|
| 284 | - |
|
| 285 | - if (!$preview) {
|
|
| 286 | - $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 287 | - /** |
|
| 288 | - * Called before the rating stars are output on the listings view template. |
|
| 289 | - * |
|
| 290 | - * @since 1.0.0 |
|
| 291 | - * @param float $post_avgratings The average rating for the post. |
|
| 292 | - * @param int $post->ID The post ID. |
|
| 293 | - * @see 'geodir_after_review_rating_stars_on_listview' |
|
| 294 | - */ |
|
| 295 | - do_action('geodir_before_review_rating_stars_on_listview', $post_avgratings, $post->ID);
|
|
| 296 | - |
|
| 297 | - echo geodir_get_rating_stars($post_avgratings, $post->ID); |
|
| 298 | - |
|
| 299 | - /** |
|
| 300 | - * Called after the rating stars are output on the listings view template. |
|
| 301 | - * |
|
| 302 | - * @since 1.0.0 |
|
| 303 | - * @param float $post_avgratings The average rating for the post. |
|
| 304 | - * @param int $post->ID The post ID. |
|
| 305 | - * @see 'geodir_before_review_rating_stars_on_listview' |
|
| 306 | - */ |
|
| 307 | - do_action('geodir_after_review_rating_stars_on_listview', $post_avgratings, $post->ID);
|
|
| 308 | - } |
|
| 309 | - ?> |
|
| 272 | + /** |
|
| 273 | + * Called before printing review stars html. |
|
| 274 | + * |
|
| 275 | + * @since 1.5.3 |
|
| 276 | + * @param object $post The post object. |
|
| 277 | + * @param string $view The view type, default 'listing'. |
|
| 278 | + */ |
|
| 279 | + do_action( 'geodir_before_review_html', $post, 'listing' ); |
|
| 280 | + |
|
| 281 | + $review_show = geodir_is_reviews_show('listview');
|
|
| 282 | + |
|
| 283 | + if ($review_show) {
|
|
| 284 | + |
|
| 285 | + if (!$preview) {
|
|
| 286 | + $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 287 | + /** |
|
| 288 | + * Called before the rating stars are output on the listings view template. |
|
| 289 | + * |
|
| 290 | + * @since 1.0.0 |
|
| 291 | + * @param float $post_avgratings The average rating for the post. |
|
| 292 | + * @param int $post->ID The post ID. |
|
| 293 | + * @see 'geodir_after_review_rating_stars_on_listview' |
|
| 294 | + */ |
|
| 295 | + do_action('geodir_before_review_rating_stars_on_listview', $post_avgratings, $post->ID);
|
|
| 296 | + |
|
| 297 | + echo geodir_get_rating_stars($post_avgratings, $post->ID); |
|
| 298 | + |
|
| 299 | + /** |
|
| 300 | + * Called after the rating stars are output on the listings view template. |
|
| 301 | + * |
|
| 302 | + * @since 1.0.0 |
|
| 303 | + * @param float $post_avgratings The average rating for the post. |
|
| 304 | + * @param int $post->ID The post ID. |
|
| 305 | + * @see 'geodir_before_review_rating_stars_on_listview' |
|
| 306 | + */ |
|
| 307 | + do_action('geodir_after_review_rating_stars_on_listview', $post_avgratings, $post->ID);
|
|
| 308 | + } |
|
| 309 | + ?> |
|
| 310 | 310 | <a href="<?php comments_link(); ?>" class="geodir-pcomments"><i |
| 311 | 311 | class="fa fa-comments"></i> |
| 312 | 312 | <?php geodir_comments_number($post->rating_count); ?></a> |
| 313 | 313 | <?php |
| 314 | - } |
|
| 314 | + } |
|
| 315 | 315 | |
| 316 | 316 | |
| 317 | - /** |
|
| 318 | - * Called after printing favorite html. |
|
| 319 | - * |
|
| 320 | - * @since 1.0.0 |
|
| 321 | - */ |
|
| 322 | - do_action( 'geodir_after_favorite_html', $post->ID, 'listing' ); |
|
| 317 | + /** |
|
| 318 | + * Called after printing favorite html. |
|
| 319 | + * |
|
| 320 | + * @since 1.0.0 |
|
| 321 | + */ |
|
| 322 | + do_action( 'geodir_after_favorite_html', $post->ID, 'listing' ); |
|
| 323 | 323 | |
| 324 | 324 | |
| 325 | - /** |
|
| 326 | - * Called after printing map pin point. |
|
| 327 | - * |
|
| 328 | - * @since 1.0.0 |
|
| 329 | - * @since 1.5.9 Added $post as second param. |
|
| 330 | - * @param int $post->ID The post id. |
|
| 331 | - * @param object $post The post object. |
|
| 332 | - */ |
|
| 333 | - do_action( 'geodir_listing_after_pinpoint', $post->ID ,$post); |
|
| 325 | + /** |
|
| 326 | + * Called after printing map pin point. |
|
| 327 | + * |
|
| 328 | + * @since 1.0.0 |
|
| 329 | + * @since 1.5.9 Added $post as second param. |
|
| 330 | + * @param int $post->ID The post id. |
|
| 331 | + * @param object $post The post object. |
|
| 332 | + */ |
|
| 333 | + do_action( 'geodir_listing_after_pinpoint', $post->ID ,$post); |
|
| 334 | 334 | |
| 335 | - if ($post->post_author == get_current_user_id()) { ?>
|
|
| 335 | + if ($post->post_author == get_current_user_id()) { ?>
|
|
| 336 | 336 | <?php |
| 337 | - $addplacelink = get_permalink(geodir_add_listing_page_id()); |
|
| 338 | - $editlink = geodir_getlink($addplacelink, array('pid' => $post->ID), false);
|
|
| 339 | - $upgradelink = geodir_getlink($editlink, array('upgrade' => '1'), false);
|
|
| 337 | + $addplacelink = get_permalink(geodir_add_listing_page_id()); |
|
| 338 | + $editlink = geodir_getlink($addplacelink, array('pid' => $post->ID), false);
|
|
| 339 | + $upgradelink = geodir_getlink($editlink, array('upgrade' => '1'), false);
|
|
| 340 | 340 | |
| 341 | - $ajaxlink = geodir_get_ajax_url(); |
|
| 342 | - $deletelink = geodir_getlink($ajaxlink, array('geodir_ajax' => 'add_listing', 'ajax_action' => 'delete', 'pid' => $post->ID), false);
|
|
| 341 | + $ajaxlink = geodir_get_ajax_url(); |
|
| 342 | + $deletelink = geodir_getlink($ajaxlink, array('geodir_ajax' => 'add_listing', 'ajax_action' => 'delete', 'pid' => $post->ID), false);
|
|
| 343 | 343 | |
| 344 | - ?> |
|
| 344 | + ?> |
|
| 345 | 345 | |
| 346 | 346 | <span class="geodir-authorlink clearfix"> |
| 347 | 347 | |
| 348 | 348 | <?php if (isset($_REQUEST['geodir_dashbord']) && $_REQUEST['geodir_dashbord']) {
|
| 349 | - /** |
|
| 350 | - * Called before the edit post link on the listings view template used on the author page. |
|
| 351 | - * |
|
| 352 | - * @since 1.0.0 |
|
| 353 | - * @see 'geodir_after_edit_post_link_on_listing' |
|
| 354 | - */ |
|
| 355 | - do_action('geodir_before_edit_post_link_on_listing');
|
|
| 356 | - ?> |
|
| 349 | + /** |
|
| 350 | + * Called before the edit post link on the listings view template used on the author page. |
|
| 351 | + * |
|
| 352 | + * @since 1.0.0 |
|
| 353 | + * @see 'geodir_after_edit_post_link_on_listing' |
|
| 354 | + */ |
|
| 355 | + do_action('geodir_before_edit_post_link_on_listing');
|
|
| 356 | + ?> |
|
| 357 | 357 | |
| 358 | 358 | <a href="<?php echo esc_url($editlink); ?>" class="geodir-edit" |
| 359 | 359 | title="<?php _e('Edit Listing', 'geodirectory'); ?>">
|
| 360 | 360 | <?php |
| 361 | - $geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fa fa-edit');
|
|
| 362 | - echo '<i class="'. $geodir_listing_edit_icon .'"></i>'; |
|
| 363 | - ?> |
|
| 361 | + $geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fa fa-edit');
|
|
| 362 | + echo '<i class="'. $geodir_listing_edit_icon .'"></i>'; |
|
| 363 | + ?> |
|
| 364 | 364 | <?php _e('Edit', 'geodirectory'); ?>
|
| 365 | 365 | </a> |
| 366 | 366 | <a href="<?php echo esc_url($deletelink); ?>" class="geodir-delete" |
| 367 | 367 | title="<?php _e('Delete Listing', 'geodirectory'); ?>">
|
| 368 | 368 | <?php |
| 369 | - $geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fa fa-close');
|
|
| 370 | - echo '<i class="'. $geodir_listing_delete_icon .'"></i>'; |
|
| 371 | - ?> |
|
| 369 | + $geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fa fa-close');
|
|
| 370 | + echo '<i class="'. $geodir_listing_delete_icon .'"></i>'; |
|
| 371 | + ?> |
|
| 372 | 372 | <?php _e('Delete', 'geodirectory'); ?>
|
| 373 | 373 | </a> |
| 374 | 374 | <?php |
| 375 | 375 | |
| 376 | - /** |
|
| 377 | - * Called after the edit post link on the listings view template used on the author page. |
|
| 378 | - * |
|
| 379 | - * @since 1.0.0 |
|
| 380 | - * @see 'geodir_before_edit_post_link_on_listing' |
|
| 381 | - */ |
|
| 382 | - do_action('geodir_after_edit_post_link_on_listing');
|
|
| 383 | - } ?> |
|
| 376 | + /** |
|
| 377 | + * Called after the edit post link on the listings view template used on the author page. |
|
| 378 | + * |
|
| 379 | + * @since 1.0.0 |
|
| 380 | + * @see 'geodir_before_edit_post_link_on_listing' |
|
| 381 | + */ |
|
| 382 | + do_action('geodir_after_edit_post_link_on_listing');
|
|
| 383 | + } ?> |
|
| 384 | 384 | </span> |
| 385 | 385 | |
| 386 | 386 | <?php } ?> |
@@ -393,32 +393,32 @@ discard block |
||
| 393 | 393 | </li> |
| 394 | 394 | |
| 395 | 395 | <?php |
| 396 | - endwhile; |
|
| 397 | - |
|
| 398 | - /** |
|
| 399 | - * Called inside the `ul` of the listings template, but after all `li` elements. |
|
| 400 | - * |
|
| 401 | - * When used by the widget view template then it will only show if there are listings to be shown. |
|
| 402 | - * |
|
| 403 | - * @since 1.0.0 |
|
| 404 | - * @see 'geodir_before_listing_post_listview' |
|
| 405 | - */ |
|
| 406 | - do_action('geodir_after_listing_post_listview');
|
|
| 407 | - |
|
| 408 | - else: |
|
| 396 | + endwhile; |
|
| 397 | + |
|
| 398 | + /** |
|
| 399 | + * Called inside the `ul` of the listings template, but after all `li` elements. |
|
| 400 | + * |
|
| 401 | + * When used by the widget view template then it will only show if there are listings to be shown. |
|
| 402 | + * |
|
| 403 | + * @since 1.0.0 |
|
| 404 | + * @see 'geodir_before_listing_post_listview' |
|
| 405 | + */ |
|
| 406 | + do_action('geodir_after_listing_post_listview');
|
|
| 407 | + |
|
| 408 | + else: |
|
| 409 | 409 | $favorite = isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' ? true : false; |
| 410 | 410 | |
| 411 | 411 | /** |
| 412 | - * Called inside the `ul` of the listings template, when no listing found. |
|
| 413 | - * |
|
| 414 | - * @since 1.5.5 |
|
| 412 | + * Called inside the `ul` of the listings template, when no listing found. |
|
| 413 | + * |
|
| 414 | + * @since 1.5.5 |
|
| 415 | 415 | * @param string 'listing-listview' Listing listview template. |
| 416 | 416 | * @param bool $favorite Are favorite listings results? |
| 417 | - */ |
|
| 418 | - do_action('geodir_message_not_found_on_listing', 'listing-listview', $favorite);
|
|
| 419 | - endif; |
|
| 417 | + */ |
|
| 418 | + do_action('geodir_message_not_found_on_listing', 'listing-listview', $favorite);
|
|
| 419 | + endif; |
|
| 420 | 420 | |
| 421 | - ?> |
|
| 421 | + ?> |
|
| 422 | 422 | </ul> <!-- geodir_category_list_view ends here--> |
| 423 | 423 | |
| 424 | 424 | <div class="clear"></div> |
@@ -20,72 +20,72 @@ discard block |
||
| 20 | 20 | /** This action is documented in geodirectory-templates/listing-listview.php */ |
| 21 | 21 | $grid_view_class = apply_filters('geodir_grid_view_widget_columns', $gridview_columns_widget);
|
| 22 | 22 | if ($gd_session->get('gd_listing_view') && !isset($before_widget)) {
|
| 23 | - $grid_view_class = geodir_convert_listing_view_class($gd_session->get('gd_listing_view'));
|
|
| 23 | + $grid_view_class = geodir_convert_listing_view_class($gd_session->get('gd_listing_view'));
|
|
| 24 | 24 | } |
| 25 | 25 | ?> |
| 26 | 26 | <ul class="geodir_category_list_view clearfix <?php echo apply_filters('geodir_listing_listview_ul_extra_class', '', 'widget'); ?>">
|
| 27 | 27 | <?php |
| 28 | - if (!empty($widget_listings)) {
|
|
| 29 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 30 | - do_action('geodir_before_listing_post_listview');
|
|
| 31 | - $all_postypes = geodir_get_posttypes(); |
|
| 32 | - $geodir_days_new = (int)get_option('geodir_listing_new_days');
|
|
| 33 | - foreach ($widget_listings as $widget_listing) {
|
|
| 34 | - global $gd_widget_listing_type; |
|
| 35 | - $post = $widget_listing; |
|
| 28 | + if (!empty($widget_listings)) {
|
|
| 29 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 30 | + do_action('geodir_before_listing_post_listview');
|
|
| 31 | + $all_postypes = geodir_get_posttypes(); |
|
| 32 | + $geodir_days_new = (int)get_option('geodir_listing_new_days');
|
|
| 33 | + foreach ($widget_listings as $widget_listing) {
|
|
| 34 | + global $gd_widget_listing_type; |
|
| 35 | + $post = $widget_listing; |
|
| 36 | 36 | |
| 37 | - $GLOBALS['post'] = $post; |
|
| 38 | - setup_postdata($post); |
|
| 37 | + $GLOBALS['post'] = $post; |
|
| 38 | + setup_postdata($post); |
|
| 39 | 39 | |
| 40 | - $gd_widget_listing_type = $post->post_type; |
|
| 40 | + $gd_widget_listing_type = $post->post_type; |
|
| 41 | 41 | |
| 42 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 43 | - $post_view_class = apply_filters('geodir_post_view_extra_class', '', $all_postypes);
|
|
| 42 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 43 | + $post_view_class = apply_filters('geodir_post_view_extra_class', '', $all_postypes);
|
|
| 44 | 44 | |
| 45 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 46 | - $post_view_article_class = apply_filters('geodir_post_view_article_extra_class', '');
|
|
| 47 | - ?> |
|
| 45 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 46 | + $post_view_article_class = apply_filters('geodir_post_view_article_extra_class', '');
|
|
| 47 | + ?> |
|
| 48 | 48 | <li class="clearfix <?php if ($grid_view_class) {
|
| 49 | - echo 'geodir-gridview ' . $grid_view_class; |
|
| 50 | - } else {
|
|
| 51 | - echo ' geodir-listview '; |
|
| 52 | - } ?> <?php if ($post_view_class) {
|
|
| 53 | - echo $post_view_class; |
|
| 54 | - } ?>" <?php if (isset($listing_width) && $listing_width) {
|
|
| 55 | - echo "style='width:{$listing_width}%;'";
|
|
| 56 | - } |
|
| 49 | + echo 'geodir-gridview ' . $grid_view_class; |
|
| 50 | + } else {
|
|
| 51 | + echo ' geodir-listview '; |
|
| 52 | + } ?> <?php if ($post_view_class) {
|
|
| 53 | + echo $post_view_class; |
|
| 54 | + } ?>" <?php if (isset($listing_width) && $listing_width) {
|
|
| 55 | + echo "style='width:{$listing_width}%;'";
|
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - echo " data-post-id='$post->ID' "; |
|
| 59 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 60 | - do_action('geodir_listview_inside_li', $post, 'widget');
|
|
| 61 | - ?>> |
|
| 58 | + echo " data-post-id='$post->ID' "; |
|
| 59 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 60 | + do_action('geodir_listview_inside_li', $post, 'widget');
|
|
| 61 | + ?>> |
|
| 62 | 62 | <article class="geodir-category-listing <?php if ($post_view_article_class) {
|
| 63 | - echo $post_view_article_class; |
|
| 64 | - } ?>"> |
|
| 63 | + echo $post_view_article_class; |
|
| 64 | + } ?>"> |
|
| 65 | 65 | <div class="geodir-post-img <?php echo apply_filters('geodir_listing_listview_thumb_extra_class', '', 'widget'); ?>">
|
| 66 | 66 | <?php if ($fimage = geodir_show_featured_image($post->ID, 'list-thumb', true, false, $post->featured_image)) { ?>
|
| 67 | 67 | <a href="<?php the_permalink(); ?>"><?php echo $fimage; ?></a> |
| 68 | 68 | <?php |
| 69 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 70 | - do_action('geodir_before_badge_on_image', $post);
|
|
| 71 | - if ($post->is_featured) {
|
|
| 72 | - echo geodir_show_badges_on_image('featured', $post, get_permalink());
|
|
| 73 | - } |
|
| 69 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 70 | + do_action('geodir_before_badge_on_image', $post);
|
|
| 71 | + if ($post->is_featured) {
|
|
| 72 | + echo geodir_show_badges_on_image('featured', $post, get_permalink());
|
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | 75 | |
| 76 | - if (round(abs(strtotime($post->post_date) - strtotime(date('Y-m-d'))) / 86400) < $geodir_days_new) {
|
|
| 77 | - echo geodir_show_badges_on_image('new', $post, get_permalink());
|
|
| 78 | - } |
|
| 76 | + if (round(abs(strtotime($post->post_date) - strtotime(date('Y-m-d'))) / 86400) < $geodir_days_new) {
|
|
| 77 | + echo geodir_show_badges_on_image('new', $post, get_permalink());
|
|
| 78 | + } |
|
| 79 | 79 | |
| 80 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 81 | - do_action('geodir_after_badge_on_image', $post);
|
|
| 82 | - } |
|
| 83 | - ?> |
|
| 80 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 81 | + do_action('geodir_after_badge_on_image', $post);
|
|
| 82 | + } |
|
| 83 | + ?> |
|
| 84 | 84 | </div> |
| 85 | 85 | <div class="geodir-content <?php echo apply_filters('geodir_listing_listview_content_extra_class', '', 'widget'); ?>">
|
| 86 | 86 | <?php |
| 87 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 88 | - do_action('geodir_before_listing_post_title', 'listview', $post); ?>
|
|
| 87 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 88 | + do_action('geodir_before_listing_post_title', 'listview', $post); ?>
|
|
| 89 | 89 | <header class="geodir-entry-header"> |
| 90 | 90 | <?php $title_tag = !empty($title_tag) ? $title_tag : 'h3'; ?> |
| 91 | 91 | <<?php echo esc_attr($title_tag); ?> class="geodir-entry-title"> |
@@ -95,162 +95,162 @@ discard block |
||
| 95 | 95 | </header> |
| 96 | 96 | <!-- .entry-header --> |
| 97 | 97 | <?php |
| 98 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 99 | - do_action('geodir_after_listing_post_title', 'listview', $post); ?>
|
|
| 98 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 99 | + do_action('geodir_after_listing_post_title', 'listview', $post); ?>
|
|
| 100 | 100 | <?php /// Print Distance |
| 101 | - if ( ( isset( $_REQUEST['sgeo_lat'] ) && $_REQUEST['sgeo_lat'] != '' ) || ( $related_nearest && $related_parent_lat ) ) {
|
|
| 102 | - if ( $related_nearest && $related_parent_lat ) {
|
|
| 103 | - $startPoint = array('latitude' => $related_parent_lat, 'longitude' => $related_parent_lon);
|
|
| 104 | - } else {
|
|
| 105 | - $startPoint = array('latitude' => $_REQUEST['sgeo_lat'], 'longitude' => $_REQUEST['sgeo_lon']);
|
|
| 106 | - } |
|
| 101 | + if ( ( isset( $_REQUEST['sgeo_lat'] ) && $_REQUEST['sgeo_lat'] != '' ) || ( $related_nearest && $related_parent_lat ) ) {
|
|
| 102 | + if ( $related_nearest && $related_parent_lat ) {
|
|
| 103 | + $startPoint = array('latitude' => $related_parent_lat, 'longitude' => $related_parent_lon);
|
|
| 104 | + } else {
|
|
| 105 | + $startPoint = array('latitude' => $_REQUEST['sgeo_lat'], 'longitude' => $_REQUEST['sgeo_lon']);
|
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | - $endLat = $post->post_latitude; |
|
| 109 | - $endLon = $post->post_longitude; |
|
| 110 | - $endPoint = array('latitude' => $endLat, 'longitude' => $endLon);
|
|
| 111 | - $uom = get_option('geodir_search_dist_1');
|
|
| 112 | - $distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom); |
|
| 113 | - ?> |
|
| 108 | + $endLat = $post->post_latitude; |
|
| 109 | + $endLon = $post->post_longitude; |
|
| 110 | + $endPoint = array('latitude' => $endLat, 'longitude' => $endLon);
|
|
| 111 | + $uom = get_option('geodir_search_dist_1');
|
|
| 112 | + $distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom); |
|
| 113 | + ?> |
|
| 114 | 114 | <h3> |
| 115 | 115 | <?php |
| 116 | - if (round($distance, 2) == 0) {
|
|
| 117 | - $uom = get_option('geodir_search_dist_2');
|
|
| 118 | - $distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom); |
|
| 119 | - if ($uom == 'feet') {
|
|
| 120 | - $uom = __('feet', 'geodirectory');
|
|
| 121 | - } else {
|
|
| 122 | - $uom = __('meters', 'geodirectory');
|
|
| 123 | - } |
|
| 124 | - echo round($distance) . ' ' . __($uom, 'geodirectory') . ' |
|
| 116 | + if (round($distance, 2) == 0) {
|
|
| 117 | + $uom = get_option('geodir_search_dist_2');
|
|
| 118 | + $distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom); |
|
| 119 | + if ($uom == 'feet') {
|
|
| 120 | + $uom = __('feet', 'geodirectory');
|
|
| 121 | + } else {
|
|
| 122 | + $uom = __('meters', 'geodirectory');
|
|
| 123 | + } |
|
| 124 | + echo round($distance) . ' ' . __($uom, 'geodirectory') . ' |
|
| 125 | 125 | <br /> |
| 126 | 126 | '; |
| 127 | - } else {
|
|
| 128 | - if ($uom == 'miles') {
|
|
| 129 | - $uom = __('miles', 'geodirectory');
|
|
| 130 | - } else {
|
|
| 131 | - $uom = __('km', 'geodirectory');
|
|
| 132 | - } |
|
| 133 | - echo round($distance, 2) . ' ' . __($uom, 'geodirectory') . ' |
|
| 127 | + } else {
|
|
| 128 | + if ($uom == 'miles') {
|
|
| 129 | + $uom = __('miles', 'geodirectory');
|
|
| 130 | + } else {
|
|
| 131 | + $uom = __('km', 'geodirectory');
|
|
| 132 | + } |
|
| 133 | + echo round($distance, 2) . ' ' . __($uom, 'geodirectory') . ' |
|
| 134 | 134 | <br /> |
| 135 | 135 | '; |
| 136 | - } |
|
| 137 | - ?> |
|
| 136 | + } |
|
| 137 | + ?> |
|
| 138 | 138 | </h3> |
| 139 | 139 | <?php } ?> |
| 140 | 140 | <?php |
| 141 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 142 | - do_action('geodir_before_listing_post_excerpt', $post); ?>
|
|
| 141 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 142 | + do_action('geodir_before_listing_post_excerpt', $post); ?>
|
|
| 143 | 143 | <?php echo geodir_show_listing_info('listing'); ?>
|
| 144 | 144 | <?php if (isset($character_count) && $character_count == '0') {
|
| 145 | - } else { ?>
|
|
| 145 | + } else { ?>
|
|
| 146 | 146 | <div class="geodir-entry-content"> |
| 147 | 147 | <?php |
| 148 | - /** |
|
| 149 | - * Filter to hide the listing excerpt |
|
| 150 | - * |
|
| 151 | - * @since 1.5.3 |
|
| 152 | - * @param bool $display Display the excerpt or not. Default true. |
|
| 153 | - * @param object $post The post object. |
|
| 154 | - */ |
|
| 155 | - $show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'widget', $post);
|
|
| 156 | - if ($show_listing_excerpt) {
|
|
| 157 | - if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
|
|
| 158 | - $content_out = geodir_max_excerpt( $character_count ); |
|
| 159 | - } else {
|
|
| 160 | - $content_out = get_the_excerpt(); |
|
| 161 | - } |
|
| 162 | - if ( ! empty( $content_out ) ) {
|
|
| 163 | - echo "<p>" . $content_out . "</p>"; |
|
| 164 | - } |
|
| 165 | - } |
|
| 166 | - ?> |
|
| 148 | + /** |
|
| 149 | + * Filter to hide the listing excerpt |
|
| 150 | + * |
|
| 151 | + * @since 1.5.3 |
|
| 152 | + * @param bool $display Display the excerpt or not. Default true. |
|
| 153 | + * @param object $post The post object. |
|
| 154 | + */ |
|
| 155 | + $show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'widget', $post);
|
|
| 156 | + if ($show_listing_excerpt) {
|
|
| 157 | + if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
|
|
| 158 | + $content_out = geodir_max_excerpt( $character_count ); |
|
| 159 | + } else {
|
|
| 160 | + $content_out = get_the_excerpt(); |
|
| 161 | + } |
|
| 162 | + if ( ! empty( $content_out ) ) {
|
|
| 163 | + echo "<p>" . $content_out . "</p>"; |
|
| 164 | + } |
|
| 165 | + } |
|
| 166 | + ?> |
|
| 167 | 167 | </div> |
| 168 | 168 | <?php } ?> |
| 169 | 169 | <?php |
| 170 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 171 | - do_action('geodir_after_listing_post_excerpt', $post); ?>
|
|
| 170 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 171 | + do_action('geodir_after_listing_post_excerpt', $post); ?>
|
|
| 172 | 172 | </div> |
| 173 | 173 | <!-- gd-content ends here--> |
| 174 | 174 | <?php |
| 175 | - /** |
|
| 176 | - * Called after printing listing content. |
|
| 177 | - * |
|
| 178 | - * @since 1.5.3 |
|
| 179 | - * @param object $post The post object. |
|
| 180 | - * @param string $view The view type, default 'widget'. |
|
| 181 | - */ |
|
| 182 | - do_action( 'geodir_after_listing_content', $post, 'widget' ); ?> |
|
| 175 | + /** |
|
| 176 | + * Called after printing listing content. |
|
| 177 | + * |
|
| 178 | + * @since 1.5.3 |
|
| 179 | + * @param object $post The post object. |
|
| 180 | + * @param string $view The view type, default 'widget'. |
|
| 181 | + */ |
|
| 182 | + do_action( 'geodir_after_listing_content', $post, 'widget' ); ?> |
|
| 183 | 183 | <footer class="geodir-entry-meta <?php echo apply_filters('geodir_listing_listview_meta_extra_class', '', 'widget'); ?>">
|
| 184 | 184 | <div class="geodir-addinfo clearfix <?php echo apply_filters('geodir_listing_listview_addinfo_extra_class', '', 'widget'); ?>">
|
| 185 | 185 | <?php |
| 186 | - /** |
|
| 187 | - * Called before printing review stars html. |
|
| 188 | - * |
|
| 189 | - * @since 1.5.3 |
|
| 190 | - * @param object $post The post object. |
|
| 191 | - * @param string $view The view type, default 'widget'. |
|
| 192 | - */ |
|
| 193 | - do_action( 'geodir_before_review_html', $post, 'widget' ); |
|
| 194 | - $review_show = geodir_is_reviews_show('listview');
|
|
| 195 | - if ($review_show) {
|
|
| 186 | + /** |
|
| 187 | + * Called before printing review stars html. |
|
| 188 | + * |
|
| 189 | + * @since 1.5.3 |
|
| 190 | + * @param object $post The post object. |
|
| 191 | + * @param string $view The view type, default 'widget'. |
|
| 192 | + */ |
|
| 193 | + do_action( 'geodir_before_review_html', $post, 'widget' ); |
|
| 194 | + $review_show = geodir_is_reviews_show('listview');
|
|
| 195 | + if ($review_show) {
|
|
| 196 | 196 | |
| 197 | - $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 197 | + $post_avgratings = geodir_get_post_rating($post->ID); |
|
| 198 | 198 | |
| 199 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 200 | - do_action('geodir_before_review_rating_stars_on_listview', $post_avgratings, $post->ID);
|
|
| 199 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 200 | + do_action('geodir_before_review_rating_stars_on_listview', $post_avgratings, $post->ID);
|
|
| 201 | 201 | |
| 202 | - echo geodir_get_rating_stars($post_avgratings, $post->ID); |
|
| 202 | + echo geodir_get_rating_stars($post_avgratings, $post->ID); |
|
| 203 | 203 | |
| 204 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 205 | - do_action('geodir_after_review_rating_stars_on_listview', $post_avgratings, $post->ID);
|
|
| 206 | - ?><a href="<?php comments_link(); ?>" class="geodir-pcomments"><i |
|
| 204 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 205 | + do_action('geodir_after_review_rating_stars_on_listview', $post_avgratings, $post->ID);
|
|
| 206 | + ?><a href="<?php comments_link(); ?>" class="geodir-pcomments"><i |
|
| 207 | 207 | class="fa fa-comments"></i> <?php geodir_comments_number($post->rating_count); ?> |
| 208 | 208 | </a> |
| 209 | 209 | <?php |
| 210 | - } |
|
| 210 | + } |
|
| 211 | 211 | |
| 212 | 212 | |
| 213 | - /** |
|
| 214 | - * Called after printing favorite html. |
|
| 215 | - * |
|
| 216 | - * @since 1.0.0 |
|
| 217 | - */ |
|
| 218 | - do_action( 'geodir_after_favorite_html', $post->ID, 'widget' ); |
|
| 213 | + /** |
|
| 214 | + * Called after printing favorite html. |
|
| 215 | + * |
|
| 216 | + * @since 1.0.0 |
|
| 217 | + */ |
|
| 218 | + do_action( 'geodir_after_favorite_html', $post->ID, 'widget' ); |
|
| 219 | 219 | |
| 220 | - if ($post->post_author == get_current_user_id()) {
|
|
| 221 | - $addplacelink = get_permalink(geodir_add_listing_page_id()); |
|
| 222 | - $editlink = geodir_getlink($addplacelink, array('pid' => $post->ID), false);
|
|
| 223 | - $upgradelink = geodir_getlink($editlink, array('upgrade' => '1'), false);
|
|
| 220 | + if ($post->post_author == get_current_user_id()) {
|
|
| 221 | + $addplacelink = get_permalink(geodir_add_listing_page_id()); |
|
| 222 | + $editlink = geodir_getlink($addplacelink, array('pid' => $post->ID), false);
|
|
| 223 | + $upgradelink = geodir_getlink($editlink, array('upgrade' => '1'), false);
|
|
| 224 | 224 | |
| 225 | - $ajaxlink = geodir_get_ajax_url(); |
|
| 226 | - $deletelink = geodir_getlink($ajaxlink, array('geodir_ajax' => 'add_listing', 'ajax_action' => 'delete', 'pid' => $post->ID), false);
|
|
| 227 | - ?> |
|
| 225 | + $ajaxlink = geodir_get_ajax_url(); |
|
| 226 | + $deletelink = geodir_getlink($ajaxlink, array('geodir_ajax' => 'add_listing', 'ajax_action' => 'delete', 'pid' => $post->ID), false);
|
|
| 227 | + ?> |
|
| 228 | 228 | <span class="geodir-authorlink clearfix"> |
| 229 | 229 | <?php |
| 230 | - if (isset($_REQUEST['geodir_dashbord']) && $_REQUEST['geodir_dashbord']) {
|
|
| 231 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 232 | - do_action('geodir_before_edit_post_link_on_listing');
|
|
| 233 | - ?> |
|
| 230 | + if (isset($_REQUEST['geodir_dashbord']) && $_REQUEST['geodir_dashbord']) {
|
|
| 231 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 232 | + do_action('geodir_before_edit_post_link_on_listing');
|
|
| 233 | + ?> |
|
| 234 | 234 | <a href="<?php echo esc_url($editlink); ?>" class="geodir-edit" |
| 235 | 235 | title="<?php _e('Edit Listing', 'geodirectory'); ?>">
|
| 236 | 236 | <?php |
| 237 | - $geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fa fa-edit');
|
|
| 238 | - echo '<i class="'. $geodir_listing_edit_icon .'"></i>'; |
|
| 239 | - ?> |
|
| 237 | + $geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fa fa-edit');
|
|
| 238 | + echo '<i class="'. $geodir_listing_edit_icon .'"></i>'; |
|
| 239 | + ?> |
|
| 240 | 240 | <?php _e('Edit', 'geodirectory'); ?>
|
| 241 | 241 | </a> |
| 242 | 242 | <a href="<?php echo esc_url($deletelink); ?>" class="geodir-delete" |
| 243 | 243 | title="<?php _e('Delete Listing', 'geodirectory'); ?>">
|
| 244 | 244 | <?php |
| 245 | - $geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fa fa-close');
|
|
| 246 | - echo '<i class="'. $geodir_listing_delete_icon .'"></i>'; |
|
| 247 | - ?> |
|
| 245 | + $geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fa fa-close');
|
|
| 246 | + echo '<i class="'. $geodir_listing_delete_icon .'"></i>'; |
|
| 247 | + ?> |
|
| 248 | 248 | <?php _e('Delete', 'geodirectory'); ?>
|
| 249 | 249 | </a> |
| 250 | 250 | <?php |
| 251 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 252 | - do_action('geodir_after_edit_post_link_on_listing');
|
|
| 253 | - } ?> |
|
| 251 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 252 | + do_action('geodir_after_edit_post_link_on_listing');
|
|
| 253 | + } ?> |
|
| 254 | 254 | </span> |
| 255 | 255 | <?php } ?> |
| 256 | 256 | </div> |
@@ -260,17 +260,17 @@ discard block |
||
| 260 | 260 | </article> |
| 261 | 261 | </li> |
| 262 | 262 | <?php |
| 263 | - unset($gd_widget_listing_type); |
|
| 264 | - } |
|
| 265 | - /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 266 | - do_action('geodir_after_listing_post_listview');
|
|
| 267 | - } else {
|
|
| 263 | + unset($gd_widget_listing_type); |
|
| 264 | + } |
|
| 265 | + /** This action is documented in geodirectory-templates/listing-listview.php */ |
|
| 266 | + do_action('geodir_after_listing_post_listview');
|
|
| 267 | + } else {
|
|
| 268 | 268 | $favorite = isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' ? true : false; |
| 269 | 269 | |
| 270 | 270 | /** This action is documented in geodirectory-templates/listing-listview.php */ |
| 271 | - do_action('geodir_message_not_found_on_listing', 'widget-listing-listview', $favorite);
|
|
| 272 | - } |
|
| 273 | - ?> |
|
| 271 | + do_action('geodir_message_not_found_on_listing', 'widget-listing-listview', $favorite);
|
|
| 272 | + } |
|
| 273 | + ?> |
|
| 274 | 274 | </ul> <!-- geodir_category_list_view ends here--> |
| 275 | 275 | <div class="clear"></div> |
| 276 | 276 | <?php |