$sk = 0;
$result = dbquery("SELECT * FROM ".$db_prefix."user_ratings WHERE rate_subject = '".$userdata['user_id']."'");
if (dbrows($result)) {
while ($data = dbarray($result)) $sk = $sk+$data['rate_opt'];
}
$vert = (dbrows($result) > 0 ? round($sk/dbrows($result),2) : "Nėra");
echo"<img src='".BASEDIR."images/vertinimas.gif' border='0'> Vid. įvertinimas: $vert</a><br>";