Post Ratings - taking likes to the next level [Deleted]

Someone might have asked this already and I couldn't find it but is there a way to disable the Listing feature from members and only allow Staff Members to see who "upvoted" and "downvoted" a post?
You can hide "List" for everyone except moderators and admins with a template edit.

Open the dark_postrating_output template

Replace
HTML:
<li> <a href="{xen:link posts/ratings, $post}" class="dark_postrating_list OverlayTrigger" data-cacheOverlay="false">{xen:phrase dark_list}</a></li>
with
HTML:
<xen:if is="{$visitor.is_moderator} OR {$visitor.is_admin}"><li> <a href="{xen:link posts/ratings, $post}" class="dark_postrating_list OverlayTrigger" data-cacheOverlay="false">{xen:phrase dark_list}</a></li></xen:if>
 
@Darkimmortal:

I tried to mod the look of the ratings as follows:
darkratings.webp
This is the code I used:

Template: dark_postrating_input

Replace:
HTML:
<xen:require css="dark_postrating.css" />
<xen:require js="js/dark/postrating.js?{xen:raw $postrating_js_modification}" />
 
<script type="text/javascript">
var dark_postrating_minimum_opacity = {$postrating_minimum_opacity};
</script>
 
<ul class="dark_postrating_inputlist {xen:if $postrating_has_rated, 'dark_postrating_inputlist_undo'}">
    <xen:if is="{$postrating_can_rate}">
        <xen:if is="{$postrating_has_rated}">
            <li><a href="{xen:link posts/rate, $post, 'rating=del','_xfToken={$visitor.csrf_token_page}'}">{xen:phrase dark_undo_rating}</a></li>
        <xen:else />
            <xen:foreach loop="$postrating_ratings" value="$rating" key="$id">
                <xen:if is="!{$rating.disabled}">
                    <xen:if is="{$rating.name}">                                     
                        <li><a href="{xen:link posts/rate, $post, 'rating={$id}','_xfToken={$visitor.csrf_token_page}'}" class="Tooltip" data-offsetY="-13" data-offsetX="-8" title="{$rating.title}"><xen:if is="{$rating.sprite_mode}"><img src="styles/default/xenforo/clear.png" alt="{$rating.title}" style="background: url('styles/dark/ratings/{$rating.name}') no-repeat {$rating.sprite_params.x}px {$rating.sprite_params.y}px; width: {$rating.sprite_params.w}px; height: {$rating.sprite_params.h}px;" /><xen:else /><img src="styles/dark/ratings/{$rating.name}" alt="{$rating.title}" /></xen:if></a></li>
                    <xen:else />
                        <li class='dark_postrating_textonly'><a href="{xen:link posts/rate, $post, 'rating={$id}','_xfToken={$visitor.csrf_token_page}'}">{$rating.title}</a></li>
                    </xen:if>
                </xen:if>
            </xen:foreach>
        </xen:if>
    </xen:if>
</ul>

with:
HTML:
<xen:require css="dark_postrating.css" />
<xen:require js="js/dark/postrating.js?{xen:raw $postrating_js_modification}" />   
 
<script type="text/javascript">
var dark_postrating_minimum_opacity = {$postrating_minimum_opacity};
</script>
 
<ul class="dark_postrating_inputlist {xen:if $postrating_has_rated, 'dark_postrating_inputlist_undo'}">
    <xen:if is="{$postrating_can_rate}">
        <xen:if is="{$postrating_has_rated}">
            <li><a href="{xen:link posts/rate, $post, 'rating=del','_xfToken={$visitor.csrf_token_page}'}">{xen:phrase dark_undo_rating}</a></li>
        <xen:else />
        <div class="Popup">
            <span style="display:inline" rel="Menu">Rate</span>
            <div class="Menu JsOnly formPopup">
                <xen:foreach loop="$postrating_ratings" value="$rating" key="$id">
                    <xen:if is="!{$rating.disabled}">
                        <xen:if is="{$rating.name}">                                           
                            <li><a href="{xen:link posts/rate, $post, 'rating={$id}','_xfToken={$visitor.csrf_token_page}'}" class="Tooltip" data-offsetY="-13" data-offsetX="-8" title="{$rating.title}"><xen:if is="{$rating.sprite_mode}"><img src="styles/default/xenforo/clear.png" alt="{$rating.title}" style="background: url('styles/dark/ratings/{$rating.name}') no-repeat {$rating.sprite_params.x}px {$rating.sprite_params.y}px; width: {$rating.sprite_params.w}px; height: {$rating.sprite_params.h}px;" /><xen:else /><img src="styles/dark/ratings/{$rating.name}" alt="{$rating.title}" /></xen:if></a></li>
                        <xen:else />
                            <li class='dark_postrating_textonly'><a href="{xen:link posts/rate, $post, 'rating={$id}','_xfToken={$visitor.csrf_token_page}'}">{$rating.title}</a></li>
                        </xen:if>
                    </xen:if>
                </xen:foreach>
            </div>
        </div>
        </xen:if>
    </xen:if>
</ul>

However this code is not perfect and needs to be fixed. When I rate a post, the whole page refreshes. This can discourage people from rating. Can you please help me fix this?
 
Well, this is a user option in /account/alert-preferences. You would have to force the "Receive an alert when someone Likes your message" to be unchecked for all users via an sql query and then edit the option out with a template edit. But you better want to wait for a response from Darkimmortal. Perhaps he can add a global toggle off/on option for rating alerts to his add-on.
 
Here is a simple mod of mine. If you want your ratings to look like this (to save space etc.):
alt.webp

rather than this:
alt2.webp

you have to make a small template edit. For this I highly recommend using TMS.

Template: dark_postrating_output

Replace:
HTML:
<xen:require css="dark_postrating.css" />
<xen:require js="js/dark/postrating.js?{xen:raw $postrating_js_modification}" />   
<xen:if is="{$postrating_hide_post}">
    <div class='dark_postrating_hide_post'>
        <div class="placeholderContent">
            <xen:avatar user="$message" size="s" img="true" />           
            <div class="messageInfo primaryContent">
                <div>
                    {xen:phrase dark_this_message_by_x_has_been_hidden_due_to_negative_ratings, 'name={xen:helper username, $message}'} (<a href='#' class='dark_postrating_show_post'>{xen:phrase dark_show_post_anyway}</a>)                   
                </div>
               
            </div>           
        </div>
    </div>
</xen:if>
<ul class="dark_postrating_outputlist">
<xen:if hascontent="true">
    <xen:contentcheck>
        <xen:foreach loop="$postrating_ratings_out" value="$rating" key="$id">
            <li>
                <xen:if is="{$rating.name}"><xen:if is="{$rating.sprite_mode}"><img src="styles/default/xenforo/clear.png" alt="{$rating.title}" title="{$rating.title}" style="background: url('styles/dark/ratings/{$rating.name}') no-repeat {$rating.sprite_params.x}px {$rating.sprite_params.y}px; width: {$rating.sprite_params.w}px; height: {$rating.sprite_params.h}px;" /><xen:else /><img src="styles/dark/ratings/{$rating.name}" alt="{$rating.title}" title="{$rating.title}" /></xen:if></xen:if><xen:if is="!{$postrating_ratings_lots} || !{$rating.name}"> {$rating.title} </xen:if> x <strong>{xen:number $rating.count}</strong>
            </li>
        </xen:foreach>
    </xen:contentcheck>
    <li> <a href="{xen:link posts/ratings, $post}" class="dark_postrating_list OverlayTrigger" data-cacheOverlay="false">{xen:phrase dark_list}</a></li>
</xen:if>
    </ul>

with
HTML:
<xen:require css="dark_postrating.css" />
<xen:require js="js/dark/postrating.js?{xen:raw $postrating_js_modification}" />   
<xen:if is="{$postrating_hide_post}">
    <div class='dark_postrating_hide_post'>
        <div class="placeholderContent">
            <xen:avatar user="$message" size="s" img="true" />           
            <div class="messageInfo primaryContent">
                <div>
                    {xen:phrase dark_this_message_by_x_has_been_hidden_due_to_negative_ratings, 'name={xen:helper username, $message}'} (<a href='#' class='dark_postrating_show_post'>{xen:phrase dark_show_post_anyway}</a>)                   
                </div>
               
            </div>           
        </div>
    </div>
</xen:if>
<ul class="dark_postrating_outputlist">
<xen:if hascontent="true">
    <xen:contentcheck>
        <xen:foreach loop="$postrating_ratings_out" value="$rating" key="$id">
            <li>
                <xen:if is="{$rating.name}"><xen:if is="{$rating.sprite_mode}"><img class="Tooltip" data-offsetY="-13" data-offsetX="-8" src="styles/default/xenforo/clear.png" alt="{$rating.title}" title="{$rating.title}" style="background: url('styles/dark/ratings/{$rating.name}') no-repeat {$rating.sprite_params.x}px {$rating.sprite_params.y}px; width: {$rating.sprite_params.w}px; height: {$rating.sprite_params.h}px;" /><xen:else /><img class="Tooltip" data-offsetY="-13" data-offsetX="-8" src="styles/dark/ratings/{$rating.name}" alt="{$rating.title}" title="{$rating.title}" /></xen:if></xen:if><xen:if is="!{$postrating_ratings_lots} || !{$rating.name}"></xen:if> x <strong>{xen:number $rating.count}</strong>
            </li>
        </xen:foreach>
    </xen:contentcheck>
    <li> <a href="{xen:link posts/ratings, $post}" class="dark_postrating_list OverlayTrigger" data-cacheOverlay="false">{xen:phrase dark_list}</a></li>
</xen:if>
    </ul>
 
Sorry if this has been asked before.

Is there an option to make post ratings anonymous for a usergroup?
I'd like to have a specified usergroup not to be able to see who gave them post ratings.

Thanks in advance

Anyone? :X3:
 

You could do that with a couple of if conditions via template edits - more info here

The conditional would go round the 'list' link in dark_postrating_output as well as pretty much all of dark_postrating_detail

Edit: Oops, semi-ninja'd above :P
Would be best to cover the _detail template though just in case
 
Someone might have asked this already and I couldn't find it but is there a way to disable the Listing feature from members and only allow Staff Members to see who "upvoted" and "downvoted" a post?

You could use template edits as explained in the post above for now - a separate permission for listing ratings is definitely something that will be added in the future.
 
However this code is not perfect and needs to be fixed. When I rate a post, the whole page refreshes. This can discourage people from rating. Can you please help me fix this?

Completely missed this bit of your post, sorry! :oops:

This should do the trick, along with the attached modified copy of js/dark/postrating.js:

Code:
<xen:require css="dark_postrating.css" />
<xen:require js="js/dark/postrating.js?{xen:raw $postrating_js_modification}" /> 
 
<script type="text/javascript">
var dark_postrating_minimum_opacity = {$postrating_minimum_opacity};
</script>
 
<ul class="dark_postrating_inputlist {xen:if $postrating_has_rated, 'dark_postrating_inputlist_undo'}">
    <xen:if is="{$postrating_can_rate}">
        <xen:if is="{$postrating_has_rated}">
            <li><a href="{xen:link posts/rate, $post, 'rating=del','_xfToken={$visitor.csrf_token_page}'}">{xen:phrase dark_undo_rating}</a></li>
        <xen:else />
        <div class="Popup">
            <span style="display:inline" rel="Menu">Rate</span>
            <div class="Menu JsOnly formPopup">
                <div class="dark_postrating_popup" data-post="{$post.post_id}">
                    <xen:foreach loop="$postrating_ratings" value="$rating" key="$id">
                        <xen:if is="!{$rating.disabled}">
                            <xen:if is="{$rating.name}">                                         
                                <li><a href="{xen:link posts/rate, $post, 'rating={$id}','_xfToken={$visitor.csrf_token_page}'}" class="Tooltip" data-offsetY="-13" data-offsetX="-8" title="{$rating.title}"><xen:if is="{$rating.sprite_mode}"><img src="styles/default/xenforo/clear.png" alt="{$rating.title}" style="background: url('styles/dark/ratings/{$rating.name}') no-repeat {$rating.sprite_params.x}px {$rating.sprite_params.y}px; width: {$rating.sprite_params.w}px; height: {$rating.sprite_params.h}px;" /><xen:else /><img src="styles/dark/ratings/{$rating.name}" alt="{$rating.title}" /></xen:if></a></li>
                            <xen:else />
                                <li class='dark_postrating_textonly'><a href="{xen:link posts/rate, $post, 'rating={$id}','_xfToken={$visitor.csrf_token_page}'}">{$rating.title}</a></li>
                            </xen:if>
                        </xen:if>
                    </xen:foreach>
                </div>
            </div>
        </div>   
        </xen:if>
    </xen:if>
</ul>
 

Attachments

Well, this is a user option in /account/alert-preferences. You would have to force the "Receive an alert when someone Likes your message" to be unchecked for all users via an sql query and then edit the option out with a template edit. But you better want to wait for a response from Darkimmortal. Perhaps he can add a global toggle off/on option for rating alerts to his add-on.

Definitely something for the to-do list, pretty certain this option isn't obeyed for anything but likes
 
I had an issue with a member abusing the ratings on my forums a number of months ago giving everyone a negative rating and I'm still catching those ratings to this day. I was wondering if there's a way for let's say an admin group to get alerted when a member negatively rates a minimum of 5 in a short time span <x amount of minutes>. If there's something i think can be improved quite significantly is those situations where it is easy for admins and staff to be notified when the rating system is being abused. At this time it's pot luck finding the ratings by the member who abused the system. Perhaps a "find all ratings by this member" feature would be good.
 
I had an issue with a member abusing the ratings on my forums a number of months ago giving everyone a negative rating and I'm still catching those ratings to this day. I was wondering if there's a way for let's say an admin group to get alerted when a member negatively rates a minimum of 5 in a short time span <x amount of minutes>. If there's something i think can be improved quite significantly is those situations where it is easy for admins and staff to be notified when the rating system is being abused. At this time it's pot luck finding the ratings by the member who abused the system. Perhaps a "find all ratings by this member" feature would be good.
+1 on this, if at all possible :)
 
Thank you DarkImmortal and Luxus. I'll elaborate my first question further.
Similar to Redspades, I would like to remove the listing feature for a specified usergroup but also have:

1) Alerts/News Feed - When a member receives a rating, they will see the alert but will be given by an "Anonymous" user
2) Likes You Received Page - Same here, when a member receives rating, it will be from an "Anonymous" user
3) Recent Activity - Same here, by "Anonymous" user. **When another user (in the same specified usergroup) views your recent activity, it should show "Anonymous" for both received and given rating (make the post anonymous?). I'm not sure about given rating.
4) Your News Feed - Same here

This way, the specified usergroup receives alerts and account info that someone has rated their post but does not know who gave it to them.


Edit : +1 @ Shelley
 
Another idea worth considering is adding a flood check. Like allowing members to rate only X times a day.
Also there should be an option to quickly ban members from doing ratings.
 
Is there an upcoming update that will implement anonymous rating AND ability to turn off the alert system with this mod?

Never thought it made much sense for bad ratings to show the names publicly because it would cause a bit of drama between the two members and the other member might just fight back and place a bad rating for the other member. Then you get a **** storm between members after that. Well, I got a gaming community forum so competition can tend to act up. :P
 
I'm still getting occasional duplicate entries in the Activity Stream (at least a few a day) that I've reported before, but they've been definitely reduced since you tried fixing it. It's still occurring however, so maybe another look-over would be warranted? :)

Another example:

916e42483c.png


I also had it occur with my own account (to make sure it wasn't someone just undoing their rating then re-rating it), and it happened to me too.
Been getting this a lot lately myself, seems it went away in a past update but now it's returned. Wasn't this the race condition bug leading to double entries? Users are getting dupe alerts about them too.
Just curious if there's been any progress on this duplicate entries bug. It's pretty common it seems - I see it often on various areas of my forums (recent activity, profiles, alerts, etc).

Thanks Dark, appreciate your hard work.
 
Great add-on but one issue i have noticed, on Whos Online List it lists the ratings twice, next to each other..

Messages: 179 Ratings Received: +6 / 0 / -0 Ratings Received: +6 / 0 / -0 Trophy Points: 18
 
Great add-on but one issue i have noticed, on Whos Online List it lists the ratings twice, next to each other..

Could you please post the contents of your member_list_item template? I suspect the template edit has been applied twice or is conflicting with another template edit.

Just curious if there's been any progress on this duplicate entries bug. It's pretty common it seems - I see it often on various areas of my forums (recent activity, profiles, alerts, etc).

Thanks Dark, appreciate your hard work.

The update is still on the way - I've been a little sidetracked with developing other addons but it's at the top of my to-do list now :)
 
Could you please post the contents of your member_list_item template? I suspect the template edit has been applied twice or is conflicting with another template edit.



The update is still on the way - I've been a little sidetracked with developing other addons but it's at the top of my to-do list now :)

HTML:
<xen:require css="xenforo_member_list_item.css" />
 
<li class="primaryContent memberListItem{xen:if $extended, ' extended'}"{xen:if $id, ' id="{$id}"'}>
 
    <xen:avatar user="$user" size="s" class="{xen:if $noOverlay, 'NoOverlay'}" />
 
    <xen:if is="{$extraTemplate}"><div class="extra">{xen:raw $extraTemplate}</div></xen:if>
 
    <div class="member">
   
        <xen:if is="{$user.user_id}">
       
            <h3 class="username"><xen:username user="$user" rich="true" class="StatusTooltip{xen:if $noOverlay, ' NoOverlay'}" title="{xen:string censor, $user.status}" /></h3>
            <xen:hook name="dark_member_list_info" params="{xen:array 'user={$user}'}">
            <div class="userInfo">
                <div class="userBlurb dimmed">{xen:helper userBlurb, $user}</div>
                <dl class="userStats pairsInline">
                    <dt title="{xen:phrase total_messages_posted_by_x, 'name={$user.username}'}">{xen:phrase messages}:</dt> <dd>{xen:number $user.message_count}</dd>
                    <dt title="{xen:phrase number_of_times_something_posted_by_x_has_been_liked, 'name={$user.username}'}">{xen:phrase likes_received}:</dt> <dd>{xen:number $user.like_count}</dd>
                    <dt>{xen:phrase trophy_points}:</dt> <dd title="{xen:phrase trophy_points}">{xen:number $user.trophy_points}</dd>
                </dl>
            </div>
            </xen:hook>
        <xen:else />
            <h3 class="username guest dimmed">{xen:phrase guest}</h3>
        </xen:if>
       
        <xen:if hascontent="true">
            <div class="contentInfo"><xen:contentcheck>{xen:raw $contentTemplate}</xen:contentcheck></div>
        </xen:if>
       
    </div>
   
</li>
 
Top Bottom