Ejemplo n.º 1
0
        ?>
" <?php 
        if (isset($listing_width) && $listing_width) {
            echo "style='width:{$listing_width}%;'";
        }
        ?>
>
                    <article class="geodir-category-listing <?php 
        if ($post_view_article_class) {
            echo $post_view_article_class;
        }
        ?>
">
                        <div class="geodir-post-img">
                            <?php 
        if ($fimage = geodir_show_featured_image($post->ID, 'list-thumb', true, false, $post->featured_image)) {
            ?>
                                <a href="<?php 
            the_permalink();
            ?>
"><?php 
            echo $fimage;
            ?>
</a>
                                <?php 
            /** This action is documented in geodirectory-templates/listing-listview.php */
            do_action('geodir_before_badge_on_image', $post);
            if ($post->is_featured) {
                echo geodir_show_badges_on_image('featured', $post, get_permalink());
            }
            if (round(abs(strtotime($post->post_date) - strtotime(date('Y-m-d'))) / 86400) < $geodir_days_new) {
Ejemplo n.º 2
0
    /**
     * Set post Map Marker info html.
     *
     * @since 1.0.0
     * @package GeoDirectory
     * @global array $geodir_addon_list List of active GeoDirectory extensions.
     * @param object $postinfo_obj The post details object.
     * @param string $post_preview Is this a post preview?.
     * @return mixed|string|void
     */
    function geodir_get_infowindow_html($postinfo_obj, $post_preview = '')
    {
        global $preview;
        $srcharr = array("'", "/", "-", '"', '\\');
        $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
        if (isset($_SESSION['listing']) && isset($post_preview) && $post_preview != '') {
            $ID = '';
            $plink = '';
            if (isset($postinfo_obj->pid)) {
                $ID = $postinfo_obj->pid;
                $plink = get_permalink($ID);
            }
            $title = str_replace($srcharr, $replarr, $postinfo_obj->post_title);
            $lat = $postinfo_obj->post_latitude;
            $lng = $postinfo_obj->post_longitude;
            $address = str_replace($srcharr, $replarr, $postinfo_obj->post_address);
            $contact = str_replace($srcharr, $replarr, $postinfo_obj->geodir_contact);
            $timing = str_replace($srcharr, $replarr, $postinfo_obj->geodir_timing);
        } else {
            $ID = $postinfo_obj->post_id;
            $title = str_replace($srcharr, $replarr, htmlentities($postinfo_obj->post_title, ENT_COMPAT, 'UTF-8'));
            // fix by Stiofan
            $plink = get_permalink($ID);
            $lat = htmlentities(geodir_get_post_meta($ID, 'post_latitude', true));
            $lng = htmlentities(geodir_get_post_meta($ID, 'post_longitude', true));
            $address = str_replace($srcharr, $replarr, htmlentities(geodir_get_post_meta($ID, 'post_address', true), ENT_COMPAT, 'UTF-8'));
            // fix by Stiofan
            $contact = str_replace($srcharr, $replarr, htmlentities(geodir_get_post_meta($ID, 'geodir_contact', true), ENT_COMPAT, 'UTF-8'));
            $timing = str_replace($srcharr, $replarr, geodir_get_post_meta($ID, 'geodir_timing', true));
        }
        // filter field as per price package
        global $geodir_addon_list;
        if (isset($geodir_addon_list['geodir_payment_manager']) && $geodir_addon_list['geodir_payment_manager'] == 'yes') {
            $post_type = get_post_type($ID);
            $package_id = isset($postinfo_obj->package_id) && $postinfo_obj->package_id ? $postinfo_obj->package_id : NULL;
            $field_name = 'geodir_contact';
            if (!check_field_visibility($package_id, $field_name, $post_type)) {
                $contact = '';
            }
            $field_name = 'geodir_timing';
            if (!check_field_visibility($package_id, $field_name, $post_type)) {
                $timing = '';
            }
        }
        if ($lat && $lng) {
            ob_start();
            ?>
            <div class="gd-bubble" style="height: 100px;max-height: 100px;">
                <div class="gd-bubble-inside">
                    <?php 
            $comment_count = '';
            $rating_star = '';
            if ($ID != '') {
                $rating_star = '';
                $comment_count = geodir_get_review_count_total($ID);
                if (!$preview) {
                    $post_avgratings = geodir_get_post_rating($ID);
                    $rating_star = geodir_get_rating_stars($post_avgratings, $ID, false);
                    /**
                     * Filter to change rating stars
                     *
                     * You can use this filter to change Rating stars.
                     *
                     * @since 1.0.0
                     * @package GeoDirectory
                     * @param string $rating_star Rating stars.
                     * @param float $post_avgratings Average ratings of the post.
                     * @param int $ID The post ID.
                     */
                    $rating_star = apply_filters('geodir_review_rating_stars_on_infowindow', $rating_star, $post_avgratings, $ID);
                }
            }
            ?>
                    <div class="geodir-bubble_desc">
                        <h4>
                            <a href="<?php 
            if ($plink != '') {
                echo $plink;
            } else {
                echo 'javascript:void(0);';
            }
            ?>
"><?php 
            echo $title;
            ?>
</a>
                        </h4>
                        <?php 
            if (isset($_SESSION['listing']) && isset($post_preview) && $post_preview != '') {
                $post_images = array();
                if (!empty($postinfo_obj->post_images)) {
                    $post_images = explode(",", $postinfo_obj->post_images);
                }
                if (!empty($post_images)) {
                    ?>
                                <div class="geodir-bubble_image"><a href="<?php 
                    if ($plink != '') {
                        echo $plink;
                    } else {
                        echo 'javascript:void(0);';
                    }
                    ?>
"><img alt="bubble image" style="max-height:50px;"
                                               src="<?php 
                    echo $post_images[0];
                    ?>
"/></a></div>
                            <?php 
                }
            } else {
                if ($image = geodir_show_featured_image($ID, 'widget-thumb', true, false, $postinfo_obj->featured_image)) {
                    ?>
                                <div class="geodir-bubble_image"><a
                                        href="<?php 
                    echo $plink;
                    ?>
"><?php 
                    echo $image;
                    ?>
</a></div>
                            <?php 
                }
            }
            ?>
                        <div class="geodir-bubble-meta-side">
                            <span class="geodir_address"><i class="fa fa-home"></i> <?php 
            echo $address;
            ?>
</span>
                            <?php 
            if ($contact) {
                ?>
<span class="geodir_contact"><i
                                class="fa fa-phone"></i> <?php 
                echo $contact;
                ?>
</span><?php 
            }
            ?>
                            <?php 
            if ($timing) {
                ?>
<span class="geodir_timing"><i
                                class="fa fa-clock-o"></i> <?php 
                echo $timing;
                ?>
</span><?php 
            }
            /**
             * Fires after the meta info in the map info window.
             *
             * This can be used to add more info to the map info window after the normal meta info.
             *
             * @since 1.4.2
             * @param object $postinfo_obj The posts info as an object.
             * @param bool|string $post_preview True if currently in post preview page. Empty string if not.                           *
             */
            do_action('geodir_infowindow_meta_after', $postinfo_obj, $post_preview);
            ?>
                        </div>
                        <?php 
            if (isset($postinfo_obj->recurring_dates)) {
                $recuring_data = unserialize($postinfo_obj->recurring_dates);
                $output = '';
                $output .= '<div class="geodir_event_schedule">';
                $event_recurring_dates = explode(',', $recuring_data['event_recurring_dates']);
                $starttimes = isset($recuring_data['starttime']) ? $recuring_data['starttime'] : '';
                $endtimes = isset($recuring_data['endtime']) ? $recuring_data['endtime'] : '';
                $e = 0;
                foreach ($event_recurring_dates as $key => $date) {
                    if (strtotime($date) < strtotime(date("Y-m-d"))) {
                        continue;
                    }
                    // if the event is old don't show it on the map
                    $e++;
                    if ($e == 2) {
                        break;
                    }
                    // only show 3 event dates
                    $output .= '<p>';
                    //$geodir_num_dates++;
                    if (isset($recuring_data['different_times']) && $recuring_data['different_times'] == '1') {
                        $starttimes = isset($recuring_data['starttimes'][$key]) ? $recuring_data['starttimes'][$key] : '';
                        $endtimes = isset($recuring_data['endtimes'][$key]) ? $recuring_data['endtimes'][$key] : '';
                    }
                    $sdate = strtotime($date . ' ' . $starttimes);
                    $edate = strtotime($date . ' ' . $endtimes);
                    if ($starttimes > $endtimes) {
                        $edate = strtotime($date . ' ' . $endtimes . " +1 day");
                    }
                    global $geodir_date_time_format;
                    $output .= '<i class="fa fa-caret-right"></i>' . date($geodir_date_time_format, $sdate);
                    //$output .=  __(' To', GEODIREVENTS_TEXTDOMAIN).' ';
                    $output .= '<br />';
                    $output .= '<i class="fa fa-caret-left"></i>' . date($geodir_date_time_format, $edate);
                    //.'<br />';
                    $output .= '</p>';
                }
                $output .= '</div>';
                echo $output;
            }
            if ($ID) {
                $post_author = isset($postinfo_obj->post_author) ? $postinfo_obj->post_author : get_post_field('post_author', $ID);
                ?>
                        <div class="geodir-bubble-meta-fade"></div>

                        <div class="geodir-bubble-meta-bottom">
                                <span class="geodir-bubble-rating"><?php 
                echo $rating_star;
                ?>
</span>

                                <span
                                    class="geodir-bubble-fav"><?php 
                echo geodir_favourite_html($post_author, $ID);
                ?>
</span>
                  <span class="geodir-bubble-reviews"><a href="<?php 
                echo get_comments_link($ID);
                ?>
"
                                                         class="geodir-pcomments"><i class="fa fa-comments"></i>
                          <?php 
                echo get_comments_number($ID);
                ?>
                      </a></span>
                            </div>

                        <?php 
            }
            ?>

                    </div>
                </div>
            </div>
            <?php 
            $html = ob_get_clean();
            /**
             * Filter to change infowindow html
             *
             * You can use this filter to change infowindow html.
             *
             * @since 1.0.0
             * @package GeoDirectory
             * @param string $html Infowindow html.
             * @param object $postinfo_obj The Post object.
             * @param bool|string $post_preview Is this a post preview?
             */
            $html = apply_filters('geodir_custom_infowindow_html', $html, $postinfo_obj, $post_preview);
            return $html;
        }
    }
Ejemplo n.º 3
0
/**
 * Prints Attachments meta box content.
 *
 * @since 1.0.0
 * @package GeoDirectory
 * @global object $post The post object.
 * @global int $post_id The post ID.
 */
function geodir_post_attachments()
{
    global $post, $post_id;
    wp_nonce_field(plugin_basename(__FILE__), 'geodir_post_attachments_noncename');
    if (geodir_get_featured_image($post_id, 'thumbnail')) {
        echo '<h4>' . __('Featured Image', GEODIRECTORY_TEXTDOMAIN) . '</h4>';
        geodir_show_featured_image($post_id, 'thumbnail');
    }
    $image_limit = 0;
    ?>


    <h5 class="form_title">
        <?php 
    if ($image_limit != 0 && $image_limit == 1) {
        echo '<br /><small>(' . __('You can upload', GEODIRECTORY_TEXTDOMAIN) . ' ' . $image_limit . ' ' . __('image with this package', GEODIRECTORY_TEXTDOMAIN) . ')</small>';
    }
    ?>
        <?php 
    if ($image_limit != 0 && $image_limit > 1) {
        echo '<br /><small>(' . __('You can upload', GEODIRECTORY_TEXTDOMAIN) . ' ' . $image_limit . ' ' . __('images with this package', GEODIRECTORY_TEXTDOMAIN) . ')</small>';
    }
    ?>
        <?php 
    if ($image_limit == 0) {
        echo '<br /><small>(' . __('You can upload unlimited images with this package', GEODIRECTORY_TEXTDOMAIN) . ')</small>';
    }
    ?>
    </h5>


    <?php 
    $curImages = geodir_get_images($post_id);
    $place_img_array = array();
    if (!empty($curImages)) {
        foreach ($curImages as $p_img) {
            $place_img_array[] = $p_img->src;
        }
    }
    if (!empty($place_img_array)) {
        $curImages = implode(',', $place_img_array);
    }
    // adjust values here
    $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
    $svalue = $curImages;
    // this will be initial value of the above form field. Image urls.
    $multiple = true;
    // allow multiple files upload
    $width = geodir_media_image_large_width();
    // If you want to automatically resize all uploaded images then provide width here (in pixels)
    $height = geodir_media_image_large_height();
    // If you want to automatically resize all uploaded images then provide height here (in pixels)
    ?>

    <div class="gtd-form_row clearfix" id="<?php 
    echo $id;
    ?>
dropbox" style="border:1px solid #999999; padding:5px;"
         align="center">
        <input type="hidden" name="<?php 
    echo $id;
    ?>
" id="<?php 
    echo $id;
    ?>
" value="<?php 
    echo $svalue;
    ?>
"/>

        <div
            class="plupload-upload-uic hide-if-no-js <?php 
    if ($multiple) {
        ?>
plupload-upload-uic-multiple<?php 
    }
    ?>
"
            id="<?php 
    echo $id;
    ?>
plupload-upload-ui">
            <h4><?php 
    _e('Drop files to upload', GEODIRECTORY_TEXTDOMAIN);
    ?>
</h4>
            <input id="<?php 
    echo $id;
    ?>
plupload-browse-button" type="button"
                   value="<?php 
    _e('Select Files', GEODIRECTORY_TEXTDOMAIN);
    ?>
" class="button"/>
            <span class="ajaxnonceplu" id="ajaxnonceplu<?php 
    echo wp_create_nonce($id . 'pluploadan');
    ?>
"></span>
            <?php 
    if ($width && $height) {
        ?>
                <span class="plupload-resize"></span>
                <span class="plupload-width" id="plupload-width<?php 
        echo $width;
        ?>
"></span>
                <span class="plupload-height" id="plupload-height<?php 
        echo $height;
        ?>
"></span>
            <?php 
    }
    ?>
            <div class="filelist"></div>
        </div>
        <div class="plupload-thumbs <?php 
    if ($multiple) {
        ?>
plupload-thumbs-multiple<?php 
    }
    ?>
 clearfix"
             id="<?php 
    echo $id;
    ?>
plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;">
        </div>
        <span
            id="upload-msg"><?php 
    _e('Please drag &amp; drop the images to rearrange the order', GEODIRECTORY_TEXTDOMAIN);
    ?>
</span>
        <span id="<?php 
    echo $id;
    ?>
upload-error" style="display:none"></span>
    </div>

<?php 
}
Ejemplo n.º 4
0
    /**
     * Set post Map Marker info html.
     *
     * @since 1.0.0
     * @since 1.5.4 Modified to add new action "geodir_infowindow_meta_before".
     * @package GeoDirectory
     * @global array $geodir_addon_list List of active GeoDirectory extensions.
     * @param object $postinfo_obj The post details object.
     * @param string $post_preview Is this a post preview?.
     * @return mixed|string|void
     */
    function geodir_get_infowindow_html($postinfo_obj, $post_preview = '')
    {
        global $preview;
        $srcharr = array("'", "/", "-", '"', '\\');
        $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
        if (isset($_SESSION['listing']) && isset($post_preview) && $post_preview != '') {
            $ID = '';
            $plink = '';
            if (isset($postinfo_obj->pid)) {
                $ID = $postinfo_obj->pid;
                $plink = get_permalink($ID);
            }
            $title = str_replace($srcharr, $replarr, $postinfo_obj->post_title);
            $lat = $postinfo_obj->post_latitude;
            $lng = $postinfo_obj->post_longitude;
            $address = str_replace($srcharr, $replarr, $postinfo_obj->post_address);
            $contact = str_replace($srcharr, $replarr, $postinfo_obj->geodir_contact);
            $timing = str_replace($srcharr, $replarr, $postinfo_obj->geodir_timing);
        } else {
            $ID = $postinfo_obj->post_id;
            $title = str_replace($srcharr, $replarr, htmlentities($postinfo_obj->post_title, ENT_COMPAT, 'UTF-8'));
            // fix by Stiofan
            $plink = get_permalink($ID);
            $lat = htmlentities(geodir_get_post_meta($ID, 'post_latitude', true));
            $lng = htmlentities(geodir_get_post_meta($ID, 'post_longitude', true));
            $address = str_replace($srcharr, $replarr, htmlentities(geodir_get_post_meta($ID, 'post_address', true), ENT_COMPAT, 'UTF-8'));
            // fix by Stiofan
            $contact = str_replace($srcharr, $replarr, htmlentities(geodir_get_post_meta($ID, 'geodir_contact', true), ENT_COMPAT, 'UTF-8'));
            $timing = str_replace($srcharr, $replarr, geodir_get_post_meta($ID, 'geodir_timing', true));
        }
        // filter field as per price package
        global $geodir_addon_list;
        if (isset($geodir_addon_list['geodir_payment_manager']) && $geodir_addon_list['geodir_payment_manager'] == 'yes') {
            $post_type = get_post_type($ID);
            $package_id = isset($postinfo_obj->package_id) && $postinfo_obj->package_id ? $postinfo_obj->package_id : NULL;
            $field_name = 'geodir_contact';
            if (!check_field_visibility($package_id, $field_name, $post_type)) {
                $contact = '';
            }
            $field_name = 'geodir_timing';
            if (!check_field_visibility($package_id, $field_name, $post_type)) {
                $timing = '';
            }
        }
        if ($lat && $lng) {
            ob_start();
            ?>
            <div class="gd-bubble" style="">
                <div class="gd-bubble-inside">
                    <?php 
            $comment_count = '';
            $rating_star = '';
            if ($ID != '') {
                $rating_star = '';
                $comment_count = geodir_get_review_count_total($ID);
                if (!$preview) {
                    $post_avgratings = geodir_get_post_rating($ID);
                    $rating_star = geodir_get_rating_stars($post_avgratings, $ID, false);
                    /**
                     * Filter to change rating stars
                     *
                     * You can use this filter to change Rating stars.
                     *
                     * @since 1.0.0
                     * @package GeoDirectory
                     * @param string $rating_star Rating stars.
                     * @param float $post_avgratings Average ratings of the post.
                     * @param int $ID The post ID.
                     */
                    $rating_star = apply_filters('geodir_review_rating_stars_on_infowindow', $rating_star, $post_avgratings, $ID);
                }
            }
            ?>
                    <div class="geodir-bubble_desc">
                        <h4>
                            <a href="<?php 
            if ($plink != '') {
                echo $plink;
            } else {
                echo 'javascript:void(0);';
            }
            ?>
"><?php 
            echo $title;
            ?>
</a>
                        </h4>
                        <?php 
            if (isset($_SESSION['listing']) && isset($post_preview) && $post_preview != '') {
                $post_images = array();
                if (!empty($postinfo_obj->post_images)) {
                    $post_images = explode(",", $postinfo_obj->post_images);
                }
                if (!empty($post_images)) {
                    ?>
                                <div class="geodir-bubble_image"><a href="<?php 
                    if ($plink != '') {
                        echo $plink;
                    } else {
                        echo 'javascript:void(0);';
                    }
                    ?>
"><img alt="bubble image" style="max-height:50px;"
                                               src="<?php 
                    echo $post_images[0];
                    ?>
"/></a></div>
                            <?php 
                } else {
                    echo '<div class="geodir-bubble_image"></div>';
                }
            } else {
                if ($image = geodir_show_featured_image($ID, 'widget-thumb', true, false, $postinfo_obj->featured_image)) {
                    ?>
                                <div class="geodir-bubble_image"><a href="<?php 
                    echo $plink;
                    ?>
"><?php 
                    echo $image;
                    ?>
</a></div>
                            <?php 
                } else {
                    echo '<div class="geodir-bubble_image"></div>';
                }
            }
            ?>
                        <div class="geodir-bubble-meta-side">
                            <?php 
            /**
             * Fires before the meta info in the map info window.
             *
             * This can be used to add more info to the map info window before the normal meta info.
             *
             * @since 1.5.4
             * @param int $ID The post id.
             * @param object $postinfo_obj The posts info as an object.
             * @param bool|string $post_preview True if currently in post preview page. Empty string if not.                           *
             */
            do_action('geodir_infowindow_meta_before', $ID, $postinfo_obj, $post_preview);
            ?>
                            <span class="geodir_address"><i class="fa fa-home"></i> <?php 
            echo $address;
            ?>
</span>
                            <?php 
            if ($contact) {
                ?>
<span class="geodir_contact"><i
                                class="fa fa-phone"></i> <?php 
                echo $contact;
                ?>
</span><?php 
            }
            ?>
                            <?php 
            if ($timing) {
                ?>
<span class="geodir_timing"><i
                                class="fa fa-clock-o"></i> <?php 
                echo $timing;
                ?>
</span><?php 
            }
            /**
             * Fires after the meta info in the map info window.
             *
             * This can be used to add more info to the map info window after the normal meta info.
             *
             * @since 1.4.2
             * @param object $postinfo_obj The posts info as an object.
             * @param bool|string $post_preview True if currently in post preview page. Empty string if not.                           *
             */
            do_action('geodir_infowindow_meta_after', $postinfo_obj, $post_preview);
            ?>
                        </div>
                        <?php 
            if ($ID) {
                $post_author = isset($postinfo_obj->post_author) ? $postinfo_obj->post_author : get_post_field('post_author', $ID);
                ?>
                            <div class="geodir-bubble-meta-fade"></div>

                            <div class="geodir-bubble-meta-bottom">
                                <span class="geodir-bubble-rating"><?php 
                echo $rating_star;
                ?>
</span>

                                <span
                                    class="geodir-bubble-fav"><?php 
                echo geodir_favourite_html($post_author, $ID);
                ?>
</span>
                  <span class="geodir-bubble-reviews"><a href="<?php 
                echo get_comments_link($ID);
                ?>
"
                                                         class="geodir-pcomments"><i class="fa fa-comments"></i>
                          <?php 
                echo get_comments_number($ID);
                ?>
                      </a></span>
                            </div>

                        <?php 
            }
            ?>

                    </div>
                </div>
            </div>
            <?php 
            $html = ob_get_clean();
            /**
             * Filter to change infowindow html
             *
             * You can use this filter to change infowindow html.
             *
             * @since 1.0.0
             * @package GeoDirectory
             * @param string $html Infowindow html.
             * @param object $postinfo_obj The Post object.
             * @param bool|string $post_preview Is this a post preview?
             */
            $html = apply_filters('geodir_custom_infowindow_html', $html, $postinfo_obj, $post_preview);
            return $html;
        }
    }
Ejemplo n.º 5
0
    function geodir_get_infowindow_html($postinfo_obj, $post_preview = '')
    {
        global $preview;
        $srcharr = array("'", "/", "-", '"', '\\');
        $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
        if (isset($_SESSION['listing']) && isset($post_preview) && $post_preview != '') {
            $ID = '';
            $plink = '';
            if (isset($postinfo_obj->pid)) {
                $ID = $postinfo_obj->pid;
                $plink = get_permalink($ID);
            }
            $title = str_replace($srcharr, $replarr, $postinfo_obj->post_title);
            $lat = $postinfo_obj->post_latitude;
            $lng = $postinfo_obj->post_longitude;
            $address = str_replace($srcharr, $replarr, $postinfo_obj->post_address);
            $city = str_replace($srcharr, $replarr, $postinfo_obj->post_city);
            $contact = str_replace($srcharr, $replarr, $postinfo_obj->geodir_contact);
            $timing = str_replace($srcharr, $replarr, $postinfo_obj->geodir_timing);
        } else {
            $ID = $postinfo_obj->post_id;
            $title = str_replace($srcharr, $replarr, htmlentities($postinfo_obj->post_title, ENT_COMPAT, 'UTF-8'));
            // fix by Stiofan
            $plink = get_permalink($ID);
            $lat = htmlentities(geodir_get_post_meta($ID, 'post_latitude', true));
            $lng = htmlentities(geodir_get_post_meta($ID, 'post_longitude', true));
            $address = str_replace($srcharr, $replarr, htmlentities(geodir_get_post_meta($ID, 'post_address', true), ENT_COMPAT, 'UTF-8'));
            // fix by Stiofan
            $city = str_replace($srcharr, $replarr, htmlentities(geodir_get_post_meta($ID, 'post_city', true), ENT_COMPAT, 'UTF-8'));
            $contact = str_replace($srcharr, $replarr, htmlentities(geodir_get_post_meta($ID, 'geodir_contact', true), ENT_COMPAT, 'UTF-8'));
            $timing = str_replace($srcharr, $replarr, geodir_get_post_meta($ID, 'geodir_timing', true));
        }
        if ($lat && $lng) {
            ob_start();
            ?>

	<div class="bubble">
		<div style="position: relative;margin:5px 0px; ">
			<?php 
            $comment_count = '';
            $rating_star = '';
            if ($ID != '') {
                $rating_star = '';
                //$comment_count = get_comments_number($ID); // for some reason the filter is not applied here.
                $comment_count = isset($postinfo_obj->rating_count) ? $postinfo_obj->rating_count : 0;
                //$comment_count = geodir_get_comments_number($ID);
                $post_ratings = geodir_get_postoverall($ID);
                // $post_ratings = geodir_get_commentoverall_number($ID);
                if (!$preview) {
                    if ($comment_count > 0) {
                        $post_avgratings = $post_ratings / $comment_count;
                    } else {
                        $post_avgratings = $post_ratings;
                    }
                    //$rating_star = geodir_get_rating_stars($post_avgratings,$ID,true);
                    $rating_star = geodir_get_rating_stars($post_avgratings, $ID, false);
                    $rating_star = apply_filters('geodir_review_rating_stars_on_infowindow', $rating_star, $post_avgratings, $ID);
                }
            }
            ?>
				
			<div class="geodir-bubble_desc">
				<h4>
					<a href="<?php 
            if ($plink != '') {
                echo $plink;
            } else {
                echo 'javascript:void(0);';
            }
            ?>
"><?php 
            echo $title;
            ?>
</a>
				</h4>
               <?php 
            if (isset($_SESSION['listing']) && isset($post_preview) && $post_preview != '') {
                $post_images = array();
                if (!empty($postinfo_obj->post_images)) {
                    $post_images = explode(",", $postinfo_obj->post_images);
                }
                if (!empty($post_images)) {
                    ?>
					
					<div class="geodir-bubble_image" >
					<a href="<?php 
                    if ($plink != '') {
                        echo $plink;
                    } else {
                        echo 'javascript:void(0);';
                    }
                    ?>
">
					<img style="max-height:50px;" src="<?php 
                    echo $post_images[0];
                    ?>
" />
					</a>
					</div> 
				<?php 
                }
            } else {
                if ($image = geodir_show_featured_image($ID, 'widget-thumb', true, false, $postinfo_obj->featured_image)) {
                    ?>
				<div class="geodir-bubble_image" >
					<a href="<?php 
                    echo $plink;
                    ?>
">
					<?php 
                    echo $image;
                    ?>
					</a>
				</div> 
				<?php 
                }
            }
            ?>
                
                
                
				
                
              <div class="geodir-bubble-meta-side">
				<span class="geodir_address"><i class="fa fa-home"></i> <?php 
            echo $address . ', ' . $city;
            ?>
</span>
				<?php 
            if ($contact) {
                ?>
<span class="geodir_contact"><i class="fa fa-phone"></i> <?php 
                echo $contact;
                ?>
</span><?php 
            }
            ?>
				<?php 
            if ($timing) {
                ?>
<span class="geodir_timing"><i class="fa fa-clock-o"></i> <?php 
                echo $timing;
                ?>
</span><?php 
            }
            ?>
              </div>
             
            <?php 
            if (isset($postinfo_obj->recurring_dates)) {
                $recuring_data = unserialize($postinfo_obj->recurring_dates);
                //print_r($recuring_data); echo '###';
                $output = '';
                $output .= '<div class="geodir_event_schedule">';
                $event_recurring_dates = explode(',', $recuring_data['event_recurring_dates']);
                $starttimes = isset($recuring_data['starttime']) ? $recuring_data['starttime'] : '';
                $endtimes = isset($recuring_data['endtime']) ? $recuring_data['endtime'] : '';
                $e = 0;
                foreach ($event_recurring_dates as $key => $date) {
                    if (strtotime($date) < strtotime(date("Y-m-d"))) {
                        continue;
                    }
                    // if the event is old don't show it on the map
                    $e++;
                    if ($e == 2) {
                        break;
                    }
                    // only show 3 event dates
                    $output .= '<p>';
                    //$geodir_num_dates++;
                    if (isset($recuring_data['different_times']) && $recuring_data['different_times'] == '1') {
                        $starttimes = isset($recuring_data['starttimes'][$key]) ? $recuring_data['starttimes'][$key] : '';
                        $endtimes = isset($recuring_data['endtimes'][$key]) ? $recuring_data['endtimes'][$key] : '';
                    }
                    $sdate = strtotime($date . ' ' . $starttimes);
                    $edate = strtotime($date . ' ' . $endtimes);
                    if ($starttimes > $endtimes) {
                        $edate = strtotime($date . ' ' . $endtimes . " +1 day");
                    }
                    global $geodir_date_time_format;
                    $output .= '<i class="fa fa-caret-right"></i>' . date($geodir_date_time_format, $sdate);
                    //$output .=  __(' To', GEODIREVENTS_TEXTDOMAIN).' ';
                    $output .= '<br />';
                    $output .= '<i class="fa fa-caret-left"></i>' . date($geodir_date_time_format, $edate);
                    //.'<br />';
                    $output .= '</p>';
                }
                $output .= '</div>';
                echo $output;
            }
            if ($ID) {
                $post_author = isset($postinfo_obj->post_author) ? $postinfo_obj->post_author : get_post_field('post_author', $ID);
                ?>

              <div class="geodir-bubble-meta-bottom">
                  <span class="geodir-bubble-rating"><?php 
                echo $rating_star;
                ?>
</span>
                  
                  <span class="geodir-bubble-fav"><?php 
                echo geodir_favourite_html($post_author, $ID);
                ?>
</span>
                  <span class="geodir-bubble-reviews"><a href="<?php 
                echo get_comments_link($ID);
                ?>
" class="geodir-pcomments"><i class="fa fa-comments"></i>
                            <?php 
                echo get_comments_number($ID);
                ?>
                                     </a></span>
              </div>
 
       <?php 
            }
            ?>
 
			       
			</div>             					
		</div>
	</div>
	<?php 
            $html = ob_get_clean();
            $html = apply_filters('geodir_custom_infowindow_html', $html, $postinfo_obj, $post_preview);
            return $html;
        }
    }