1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-30 17:50:12 +02:00

Rating and Comments. Like and Dislike buttons are now functional.

This commit is contained in:
CaMer0n
2012-06-16 05:04:22 +00:00
parent e0390c3c1c
commit 3c37643365
12 changed files with 318 additions and 84 deletions

View File

@@ -98,6 +98,7 @@ class comment_shortcodes extends e_shortcode
}
function sc_comment_avatar($parm)
{
$height = e107::getPref("im_height");
@@ -109,18 +110,18 @@ class comment_shortcodes extends e_shortcode
if (vartrue($this->var['user_image']))
{
$img = $tp->thumbUrl(e_MEDIA."avatars/".$this->var['user_image'],"aw=".$width."&ah=".$height);
$text = "<div class='comments-avatar'><img class='comment-avatar' src='".$img."' alt='' /></div>";
$text = "<img class='comment-avatar' src='".$img."' alt='' />";
}
else
{
$img = $tp->thumbUrl(e_IMAGE."generic/blank_avatar.jpg","aw=".$width."&ah=".$height);
$text = "<div class='comments-avatar'><img class='comment-avatar' src='".$img."' alt='' /></div>";
$text = "<img class='comment-avatar' src='".$img."' alt='' />";
}
}
else
{
$img = $tp->thumbUrl(e_IMAGE."generic/blank_avatar.jpg","aw=".$width."&ah=".$height);
$text = "<div class='comments-avatar'><img class='comment-avatar' src='".$img."' alt='' /></div>";
$text = "<img class='comment-avatar' src='".$img."' alt='' />";
}
return $text;
@@ -215,9 +216,21 @@ class comment_shortcodes extends e_shortcode
}
function sc_rate_input($parm)
function sc_comment_rate($parm)
{
return $this->var['rate'];
if($this->var['comment_blocked'] > 0 || $this->var['rating_enabled'] == false)
{
return;
}
$curVal = array(
'up' => $this->var['rate_up'],
'down' => $this->var['rate_down'],
'total' => $this->var['rate_votes']
);
return e107::getRate()->renderLike("comments",$this->var['comment_id'],$curVal);
}