get_var("SELECT SUM(Rating) FROM Message".$cc_env['Class_ID']." WHERE Object_Sub_Class_ID=".$scID." AND Object_ID=".$objID.""); } if($userID) { $user_rat = $db->get_row("SELECT COUNT(*) AS RatingCount, SUM(Rating) AS RatingSum FROM Message".$cc_env['Class_ID']." WHERE Object_Author_ID=".$userID."", ARRAY_A); if($user_rat['RatingSum'] && $user_rat['RatingCount']) $user_rating = ceil($user_rat['RatingSum']/$user_rat['RatingCount']); } ?>