Supreme Directory: Repositioning the ratings in list-view

This topic contains 2 replies, has 2 voices, and was last updated by  Atilla Boz 7 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #366762

    Atilla Boz
    Full Member
    Post count: 280

    Hello everyone,

    I have changed the view of my listings in list view mode. Usually on the right side there are the stars rating icons etc and below that there is alot of whitespace if you have a longer description text.

    Since with help of GD support we added a left sidebar in the listings we needed some extra space in the content area and re-positioned the stars to below the title.

    I changed the following file for that (and a little CSS, float left etc):
    wp-content/plugins/geodirectory/geodirectory-templates/listings-listview.php

    I deleted this code from its usual place and re-added it below line 212 after

    <?php } ?>

    where the code for the title ends. Now it has a cleaner look and we have some extra space, too.

    
    
    
    <div class="geodir-addinfo clearfix <?php echo apply_filters('geodir_listing_listview_addinfo_extra_class', '', 'listing'); ?>">
    
                                    <?php
                                    /**
                                     * Called before printing review stars html.
                                     *
                                     * @since 1.5.3
                                     * @param object $post The post object.
                                     * @param string $view The view type, default 'listing'.
                                     */
                                    do_action( 'geodir_before_review_html', $post, 'listing' );
    
                                    $review_show = geodir_is_reviews_show('listview');
    
                                    if ($review_show) {
    
                                        if (!$preview) {
                                            $post_avgratings = geodir_get_post_rating($post->ID);
                                            /**
                                             * Called before the rating stars are output on the listings view template.
                                             *
                                             * @since 1.0.0
                                             * @param float $post_avgratings The average rating for the post.
                                             * @param int $post->ID The post ID.
                                             * @see 'geodir_after_review_rating_stars_on_listview'
                                             */
                                            do_action('geodir_before_review_rating_stars_on_listview', $post_avgratings, $post->ID);
    
                                            echo geodir_get_rating_stars($post_avgratings, $post->ID);
    
                                            /**
                                             * Called after the rating stars are output on the listings view template.
                                             *
                                             * @since 1.0.0
                                             * @param float $post_avgratings The average rating for the post.
                                             * @param int $post->ID The post ID.
                                             * @see 'geodir_before_review_rating_stars_on_listview'
                                             */
                                            do_action('geodir_after_review_rating_stars_on_listview', $post_avgratings, $post->ID);
                                        }
                                        ?>
                                        <a href="<?php comments_link(); ?>" class="geodir-pcomments"><i
                                                class="fa fa-comments"></i>
                                            <?php geodir_comments_number($post->rating_count); ?></a>
                                    <?php
                                    }
    
                                    /**
                                     * Called after printing favorite html.
                                     *
                                     * @since 1.0.0
                                     */
                                    do_action( 'geodir_after_favorite_html', $post->ID, 'listing' );
    
                                    /**
                                     * Called after printing map pin point.
                                     *
                                     * @since 1.0.0
                                     * @since 1.5.9 Added $post as second param.
                                     * @param int $post->ID The post id.
                                     * @param object $post The post object.
                                     */
                                    do_action( 'geodir_listing_after_pinpoint', $post->ID ,$post);
    
                                    if ($post->post_author == get_current_user_id()) { ?>
                                        <?php
                                        $addplacelink = get_permalink(geodir_add_listing_page_id());
                                        $editlink = geodir_getlink($addplacelink, array('pid' => $post->ID), false);
                                        $upgradelink = geodir_getlink($editlink, array('upgrade' => '1'), false);
    
                                        $ajaxlink = geodir_get_ajax_url();
                                        $deletelink = geodir_getlink($ajaxlink, array('geodir_ajax' => 'add_listing', 'ajax_action' => 'delete', 'pid' => $post->ID), false);
    
                                        ?>
    
                                        <span class="geodir-authorlink clearfix">
    											
    											<?php if (isset($_REQUEST['geodir_dashbord']) && $_REQUEST['geodir_dashbord']) {
                                                    /**
                                                     * Called before the edit post link on the listings view template used on the author page.
                                                     *
                                                     * @since 1.0.0
                                                     * @see 'geodir_after_edit_post_link_on_listing'
                                                     */
                                                    do_action('geodir_before_edit_post_link_on_listing');
                                                    ?>
    
                                                    <a href="<?php echo esc_url($editlink); ?>" class="geodir-edit"
                                                       title="<?php _e('Edit Listing', 'geodirectory'); ?>">
                                                        <?php
                                                        $geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fa fa-edit');
                                                        echo '<i class="'. $geodir_listing_edit_icon .'"></i>';
                                                        ?>
                                                        <?php _e('Edit', 'geodirectory'); ?>
                                                    </a>
                                                    <a href="<?php echo esc_url($deletelink); ?>" class="geodir-delete"
                                                       title="<?php _e('Delete Listing', 'geodirectory'); ?>">
                                                        <?php
                                                        $geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fa fa-close');
                                                        echo '<i class="'. $geodir_listing_delete_icon .'"></i>';
                                                        ?>
                                                        <?php _e('Delete', 'geodirectory'); ?>
                                                    </a>
                                                    <?php
    
                                                    /**
                                                     * Called after the edit post link on the listings view template used on the author page.
                                                     *
                                                     * @since 1.0.0
                                                     * @see 'geodir_before_edit_post_link_on_listing'
                                                     */
                                                    do_action('geodir_after_edit_post_link_on_listing');
                                                } ?>
    											</span>
    
                                    <?php } ?>
    
                                </div>
    

    How would you suggest to make this change, without changing the core files? Is there a hook to manage this in a more update-friendly manner? Or maybe you should change the position in the next update, if there is no other special reason why the stars and the footer DIV get so much space for such little content?

    Kind regards,
    Atilla

    #366952

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #367370

    Atilla Boz
    Full Member
    Post count: 280

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

Viewing 3 posts - 1 through 3 (of 3 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket