atrsimilar_result_count

Versions
6.1
atrsimilar_result_count($rid)

Cound how many results there are for a review.

Parameters

$rid The RID of the review for which to count the results.

Return value

An integer with the amount of results.

Code

atr/modules/atrsimilar/includes/atrsimilar.result.inc, line 17

<?php
function atrsimilar_result_count($rid) {
  $count = db_result(db_query("SELECT COUNT(*)
  FROM {atrsimilar_string} ss
  JOIN {atr_string} s_a ON ss.sid_a = s_a.sid
  JOIN {atr_string} s_b ON ss.sid_b = s_b.sid
  WHERE s_a.rid = %d", $rid));

  return array(
    'number' => $count,
    'text' => t('!count similar texts', array('!count' => $count)),
  );
}
?>