// USER reputation funk
function userrinka($user_id, $post_id="", $type="") {
global $db_prefix;
$result = dbquery("SELECT
SUM(IF(type=1,1,-1)) as total FROM ".$db_prefix."rinka WHERE to_id = '$user_id' GROUP BY to_id");
if (dbrows($result) != 0) {
$data = dbarray($result);
$total = $data['total'];
$info = "Rinka:".($total<=0?"":"+")."$total";
} else {
$info = "Reputacija: 0 Pakelti";
}
return $info;
}