Let Nodereview add more than one review per node from one user

Equ - August 12, 2009 - 19:59

Is it possible to let Nodereview add more than one review per node from one user?

Code hack

Valentin Matresu - August 13, 2009 - 00:15

Hi!

Try changing this (in sites\all\modules\nodereview\nodereview.module) line 332 (only one line changes, rest is just for locating the code)

function node_add_review_load($arg) {
  global $user;
  $add_review = FALSE;
  $current_node = node_load($arg);
  $type =$current_node->type;
  $axes_count = db_result(db_query("SELECT COUNT(*) FROM {nodereview_axes} WHERE node_type='%s'", $type));
  if (variable_get('nodereview_use_' . $type, 0) && $axes_count) {
    $add_review = db_result(db_query("SELECT n.nid FROM {node} n INNER JOIN {nodereview} nr ON n.nid=nr.nid WHERE uid=%d AND reviewed_nid=%d", $user->uid, $arg));
  }
  return $add_review ? FALSE : $arg;
}

to this

function node_add_review_load($arg) {
  global $user;
  $add_review = FALSE;
  $current_node = node_load($arg);
  $type =$current_node->type;
  $axes_count = db_result(db_query("SELECT COUNT(*) FROM {nodereview_axes} WHERE node_type='%s'", $type));
  if (variable_get('nodereview_use_' . $type, 0) && $axes_count) {
    $add_review = TRUE;
  }
  return $add_review ? FALSE : $arg;
}

Can you test and let me know if you get errors when editing reviews ?

Thanks,

Valentin

Hi, Valentin! Thanks for you

Equ - August 13, 2009 - 06:51

Hi, Valentin!

Thanks for your reply! I tried your suggestion, but now it says "Access denied" (before it was 404 error).

I think it's a little bit more complicated, because the module creates only one path for adding your review. Let's say I want to add review for node 15. The path would look like www.site.com/node/15/addreview. When you want to edit you review the path is www.site.com/node/15/editreview.

So if I want to add the second review, I don't know how the path is going to look like...

deleted

Equ - August 19, 2009 - 01:13

deleted

 
 

Drupal is a registered trademark of Dries Buytaert.