_abuse_get_offence_count

Definition

_abuse_get_offence_count($uid)
abuse/abuse.module, line 1092

Code

<?php
function _abuse_get_offence_count($uid) {
  $count = db_result(db_query("SELECT COUNT(*) FROM {node} n INNER JOIN {abuse_status} a ON a.oid = n.nid WHERE a.type = 'node' AND n.uid = %d AND a.status = %d", $uid, ABUSE_REMOVED));
  $count+= db_result(db_query("SELECT COUNT(*) FROM {comments} c INNER JOIN {abuse_status} a ON a.oid = c.cid WHERE a.type = 'comment' AND c.uid = %d AND a.status = %d", $uid, ABUSE_REMOVED));
  return $count;
}
?>