WordPress.org

Ready to get started?Download WordPress

Forums

GD Star Rating
[resolved] MultiStar rating result in comments (10 posts)

  1. Joe
    Member
    Posted 1 year ago #

    Hiya, firstly amazing plugin - congratulations! A few things I can't get my head around despite hours of tinkering:

    1. MultiStar rating result in comments:
    We use the following function for users to submit MultiStar ratings along with a comment (in our case a review) for posts. We then want the ratings they supplied to be shown on the frontend comments of the same post along with their review. How can we achieve this?
    <?php wp_gdsr_comment_integrate_multi_rating ($multi_set_id=1, $template_id=32, $value=0, $stars_set="oxygen", $stars_size=20, $stars_set_ie6="oxygen_gif", $echo=true) ?>
    (that is placed just above the comment textarea code in comments.php)

    The code used to attempt to display the MultiStar rating result is:
    <?php wp_gdsr_comment_integrate_multi_result ($comment_id, $multi_set_id=1, $template_id=32, $stars_set="oxygen", $stars_size=20, $stars_set_ie6="oxygen_gif", $avg_stars_set="oxygen", $avg_stars_size=20, $avg_stars_set_ie6="oxygen_gif", $echo=true) ?>
    ...where exactly should that be placed - I must've done it wrong!

    2. Automatically embedded MultiStar rating result on posts:
    I've no idea how/why but the MultiStar rating box is present at the bottom of all posts. I cannot find a way to disable this in the plugin backend settings - MultiStar does not seem to have this setting. We do not need it at the bottom of posts as it's included in our comments section

    http://wordpress.org/extend/plugins/gd-star-rating/

  2. Joe
    Member
    Posted 1 year ago #

    Resolved issue #2:
    Go to mywebsite.com/wp-admin/admin.php?page=gd-star-rating-multi-sets&gdsr=muedit&id=1 (where 1 is the set I'm referring to) and disable 'Auto Insertion'

    Issue #1 remains unresolved. Thanks!

  3. Joe
    Member
    Posted 1 year ago #

    Another quick thing, I've noticed the 'Aggregated Rating' shows at the Top position of on one of our posts but not all of them. They've all had the same amount of user multiratings. Any ideas? Thanks! We're almost there.

  4. Joe
    Member
    Posted 1 year ago #

    I've finally worked this out. This is for multirating set 1 and template 32... those values may differ for your installation. Add the following code (in our template's case in custom_functions.php) just above the code <?php comment_text() ?>

    Here is the code:

    <?php if (defined("STARRATING_INSTALLED")) : ?>
    <div style="float: right">
    <?php  wp_gdsr_comment_integrate_multi_result(get_comment_ID(), 1, 32, "oxygen", 12); ?><?php endif; ?>
    </div>
  5. kieranmcclung
    Member
    Posted 11 months ago #

    Hello Joe, I hope you're well.

    This is exactly what I am looking for but I'm having some issues getting it working. I've got the plugin installed and comments active on my site, I'm just not sure where to put the code you've presented.

    Any help would be really appreciated.

    Thank you.

  6. kieranmcclung
    Member
    Posted 11 months ago #

    Right, ignore the above message I was being a dummy.

    I have included the rating for each comment however it doesn't show the result on the comments. I have the following code:

    <div class="comment-meta commentmetadata"><a href="<?php echo esc_url(get_comment_link($comment->comment_ID)); ?>">
                   <?php
                   /* translators: 1: date, 2: time */
                   printf(__('%1$s at %2$s'), get_comment_date(), get_comment_time());
                   ?></a><?php edit_comment_link(__('(Edit)'), '  ', '');
                   ?>
             </div>
    
             <?php if (defined("STARRATING_INSTALLED")) : ?>
                <div style="float: right">
                   <?php wp_gdsr_comment_integrate_multi_result($comment_id, 2, 32); ?>
                </div>
             <?php endif; ?>
    
             <?php comment_text() ?>

    and

    <?php if (defined("STARRATING_INSTALLED")) : ?>
                      <p>
                         <?php wp_gdsr_comment_integrate_multi_rating(2, 32); ?>
                      </p>
    <?php endif; ?>

    The 2nd code snippet is placed just before the form textarea when adding a comment. It all works fine, you can select the stars and post the comment but nothing happens.

    The average rating doesn't update and the comment has no results at all. I've managed to show just blank stars but no results. I also have an average at the top of the post that doesn't update either.

    I'm not sure what I am doing wrong?

    p.s. these are just code extracts showing the GDStar reference.

  7. Joe
    Member
    Posted 11 months ago #

    I'm probably not the best at troubleshooting this as it took me a big bag of time to get my head around it - it's gotta be the least intuitive set-up process for a plugin... yet great when it's up and running!

  8. kieranmcclung
    Member
    Posted 11 months ago #

    Ah okay, that's alright Joe. I was hoping you'd have an idea. I'll keep tinkering away.

    Thank you.

  9. Joe
    Member
    Posted 11 months ago #

    We have a custom functions.php file which handles the comment output. I just looked it up and the GD Star Rating result in comments is shown via the following code (obviously tailor it to your requirements)

    <?php wp_gdsr_comment_integrate_multi_result(get_comment_ID(), 1, 32, "oxygen", 12); ?>

    For us it's placed just above this string:

    <?php comment_text() ?>

    ...I hope that gives you a good starting point!

  10. kieranmcclung
    Member
    Posted 11 months ago #

    This has fixed everything! I used it earlier but didn't get any results, I presume it wasn't set up correctly elsewhere.

    Thank you ever so much for your help :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags