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

Excellent update! Just for everybody else to note, the new feature basically shows the difference between someone with lots of likes and someone who posts relatively good content, irrespective of quantity.
 
Just bought this, it's awesome but I have a minor issue.

When I click the Like button (only the like button, all the rest of them work), I get this error.

fd6d99173d499a424579eb058e0aa546.png
MyPoints v1.0.3b has been released to address this issue thanks to DarkImmortal pointing out my coding mistake. :)
 
Thanks for the update Dark!

Everything seems to be working well so far, been running it for about 6-8 hours now. The only issue I noticed is if a member has 0 ratings total, and you have the 'bar total' enabled, on their profile it will throw a Division by zero error.

Template Errors: dark_postrating_member_totals

  1. Division by zero in /var/www/-snip-/htdocs/internal_data/templates/S.14,L.1,dark_postrating_member_totals.php, line 59
  2. Division by zero in /var/www/-snip-/htdocs/internal_data/templates/S.14,L.1,dark_postrating_member_totals.php, line 63

When I disable the "Display bar total on member profile" option the errors do not appear.
 
Normally there is a 'Followers' and 'Following' box of the same style as the post ratings box, admittedly without that (for whatever reason) it does look quite out of place.

Replace the content of template dark_postrating_member with:

Code:
<xen:require css="dark_postrating.css" />
 
<div class="section infoBlock">
<h3>
<span class="text">{xen:phrase dark_post_ratings}</span>
</h3>
<div style="padding:0">
 
<table class="dark_postrating_member" style="border:0">
<tr>
<th></th>
<th>{xen:phrase dark_received}:</th>
<th>{xen:phrase dark_given}:</th>
</tr>
 
<xen:foreach loop="$postrating_ratings_out" value="$rating" key="$id">
<xen:if is="!{$rating.disabled}">
<tr>
<td class='muted'><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:else />{$rating.title}</xen:if></td>
 
<td<xen:if is="{$rating.type} == 1"> class="dark_postrating_positive"</xen:if><xen:if is="{$rating.type} == 0"> class="dark_postrating_neutral"</xen:if><xen:if is="{$rating.type} == -1"> class="dark_postrating_negative"</xen:if>>{xen:number $rating.received}</td>
<td<xen:if is="{$rating.type} == 1"> class="dark_postrating_positive"</xen:if><xen:if is="{$rating.type} == 0"> class="dark_postrating_neutral"</xen:if><xen:if is="{$rating.type} == -1"> class="dark_postrating_negative"</xen:if>>{xen:number $rating.given}</td>
 
</tr>
</xen:if>
</xen:foreach>
 
</table>
</div>
</div>

Give or take some CSS changes it should achieve the same look :)
Thank you very much for your suggestion. However, I didn't managed to get it right with the code that you submitted. You haven't thought about harmonizing the side bar module with the other modules on the profile page?
 
Not sure if this is my fault or not but I get this when viewing a member's profile:
  1. Division by zeroin /public_html/library/XenForo/Template/Abstract.php(265) : eval()'d code, line 59:
    58: {
    59: $__compilerVar1 .= '<div class="dark_postrating_bar_positive" title="' . XenForo_Template_Helper_Core::numberFormat($postrating_ratings_total['positive'], '0') . '" style="width:' . ($postrating_ratings_total['positive'] / $postrating_ratings_total['all'] * 100) . '%"></div>';
    60: }
  2. Division by zeroin /public_html/library/XenForo/Template/Abstract.php(265) : eval()'d code, line 63:
    62: {
    63: $__compilerVar1 .= '<div class="dark_postrating_bar_neutral" title="' . XenForo_Template_Helper_Core::numberFormat($postrating_ratings_total['neutral'], '0') . '" style="width:' . ($postrating_ratings_total['neutral'] / $postrating_ratings_total['all'] * 100) . '%"></div>';
    64: }
 
Does the latest version require any new template editions? My current forum is not using TMS, so I'm interested to know about this :)
 
Top Bottom