Hi, thanks for this module. I want to make a sorting algorithm like the used by Hackernews or Digg. It will have two variables: the age of the node and the sum of the votes. I want the result of this calculation in a CCK field, and after that, I will sort the nodes using views.

I have already created a computed field for the age of the node, here is the code:

$entity_type = 'node';
$created = $entity->created;
$now = time();
$age = ($now-$created);
$entity_field[0]['value'] = $age; 

I have a Fivestar field, with only one star. The users can vote the nodes they like. I would like to create another computed field, which displays the sum of the votes. I have tried several ways but I'm not able to do it.

Thanks for your help.

Comments

colan’s picture

Status: Active » Postponed (maintainer needs more info)

There is no CCK in Drupal 7. Perhaps you have the Version set wrong here?

federico’s picture

Sorry, I meant node field (It will be a computed field). I'm coming from D6.

colan’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Postponed (maintainer needs more info) » Active
colan’s picture

Issue summary: View changes

edit

dqd’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Due to the Drupal core life cycle policy and security support advisery, Drupal 6 is no longer supported. So issues for Drupal 6 cannot be longer maintained. The project maintainer has asked for closing all D6 issues to clean up the issue queue. Feel free to reopen the issue if required or set it to "needs to be ported" and latest D8 dev version, if the issue discusses a still missing feature which can be implemented in the D8 version.

dqd’s picture

Status: Closed (won't fix) » Closed (outdated)