Hi,

Is it possible to display a custom aggregate function values?
I have values for a custom function stored in the voting api cache, how is it possible to display these values in the rating widget (instead of sum or average)?

Thanks, e_log

Comments

e_log’s picture

Status: Active » Fixed

Yes, with a custom widget and this code:

    $criteria = array(
      'entity_id' => $content_id,
      'entity_type' => $content_type,
      'value_type' => 'points',
      'tag' => 'vote',
      'function' => 'custom_aggregate_function',
    );
    $rating = votingapi_select_results($criteria, $limit = 0);

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.