WordPress.org

Support

Support » Plugins and Hacks » GD Star Rating » How to display only individual user rating?

How to display only individual user rating?

  • Landapixel

    @landapixel

    Hello,

    Is there any way to only show the rating for each individual user as they are voting?

    I don’t want users seeing other users ratings.

    For example, if I go and rate a post with a 4 star out of 5, the rating result should show a 4 star. I want this same post to show as if nobody has rated it for the next user, and if they rate it a 5 star, I want the post to show 5 stars for that user, and so on…

    I will really appreciate any help I can get with this.

    Thank you in advance.

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

Viewing 15 replies - 1 through 15 (of 17 total)
  • widecast

    @widecast

    I’m also looking for this functionality. Has anyone figured this out? I’d be willing to pay for someone to customize the plugin if necessary…

    bhbilbao

    @bhbilbao

    +1
    I asked for that 3 threads before.
    I think GD star rating works stupidily, too much options and code to make the same things.

    widecast

    @widecast

    I’ve figured out how to display the overall rating as text, like this:

    if (function_exists('wp_gdsr_render_article')) {
    	$gp_gdsr = wp_gdsr_rating_article();
    	$text_rating = $gp_gdsr->rating; //get the post's rating
    	if ($text_rating != 0) {
    		echo '<span>' . $text_rating . '/5.0' . '</span> - ';
    	}
    }

    If you can find a way to show blank stars to the user until they have personally voted, this would be resolved.

    bhbilbao

    @bhbilbao

    @widecast, i dont know the way you are asking for.

    The way I said before is to modift the functionality of this:
    <?php wp_gdsr_render_comment() ?>
    1. only the user can vote himself in comments.
    2 then, we echo the result from database.

    widecast

    @widecast

    @bhbilbao, wp_gdsr_render_comment only works in the comment loop and I’m trying to use this functionality in the regular post loop.

    bhbilbao

    @bhbilbao

    I know what you are looking for. There is a function that list the ratings of all users, but it takes the ratings of the commets loop, not the regular rating from the post loop.
    For that I suggest not to modify the regular post fuctionality.
    Modify the comment loop:
    1. only the user can vote himself in comments(with stars, the thumbs remains same).
    2 then, we echo the result from database.

    widecast

    @widecast

    I’m actually just trying to have the stars at the top of the post (not in comments) display as if there were no votes until they vote. Then the stars render with their vote.

    Maybe I’m not understanding your suggestion.

    bhbilbao

    @bhbilbao

    The way Im telling you, in comments, we have the THUMBS to vote users. And the STARS that is the user rating for the article. (This is a vote that the user made himself and only one time).

    The we can echo the vote of that specific user in his comment, or list all votes in top of the page.

    bhbilbao

    @bhbilbao

    The actual problem is that Thumbs and Stars makes the same thing in comments!
    I suggest to modify the stars function(mod it!). Then you can echo the result in comments or on top of the article.
    I think is better in comment because you see who is the person, his vote and his avatar.

    widecast

    @widecast

    I really want the vote at the top, not in comments. The functionality I want is exactly like this:

    http://www.imdb.com/title/tt1671513/?ref_=fn_al_tt_1

    Display the overall rating (7.5) and then next to that, “Your rating:” with blank stars next to it.

    I don’t think I have the technical skills to mod the stars function so much. If you’re available for freelance work, maybe you can do it for me.

    bhbilbao

    @bhbilbao

    Yeah, i saw it. But is the same i said before. The users are who make the ratings, but in that page the vote system is on top of the page not in the comments.

    I will look for it, give me some days.

    bhbilbao

    @bhbilbao

    Now I am looking the code, and the first problem is that the user MUST make a comment in order to vote stars appear.
    I think the way is to create a function code in top with empty stars that creates and empty(hidden) comment when the user vote in top.

    Tomorrow I will look for it.

    bhbilbao

    @bhbilbao

    after <h1><?php the_title(); ?></h1> place this in top:

    
    
    <?php
    if (function_exists(wp_gdsr_new_comment_review)) {
    echo '<label>imdb Rating</label>';
    wp_gdsr_new_comment_review();
    ?>
    <form action="<?php echo site_url( '/wp-comments-post.php' ); ?>" method="post" id="<?php echo esc_attr( $args['id_form'] ); ?>">
    	<p class="form-submit">
    		<input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="IMDB RATING<?php echo esc_attr( $args['label_submit'] ); ?>" />
    		<?php comment_id_fields( $post_id ); ?>
    	</p>
    	<?php do_action( 'comment_form2', $post_id ); ?>
    </form>
    <?php
    }
    ?>

    In comments-template.php line about 1500
    function comment_form( $args = array(), $post_id = null ) { ..
    You must create a new comment_form2 based in that code for the imdb button avoiding to introduce a comment.(Making a comment is a MUST, for that, I suggest an empty-hide comment only for the vote).

    bhbilbao

    @bhbilbao

    My apologies to the plugin´s author, Millan. The pluging works well.
    I finally see the code that prints the particular vote.
    In comment loop:

    <php wp_gdsr_show_comment_review($comment_id = 0, $zero_render = false, $size = 16, $style = "soft", $echo = true); ?>
    

    And then, just before the submit button(comments-template.php):

    
    <?php
    if (function_exists(wp_gdsr_new_comment_review)) {
    echo '<label>Your Rating</label>';
    wp_gdsr_new_comment_review();
    }
    ?>
    

    I dont know why nobody helped me ¿?

    widecast

    @widecast

    Thanks, bhbilbao. I will try this out!

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘How to display only individual user rating?’ is closed to new replies.
Skip to toolbar