I would like to create a Restaurant Review Content Type for my site. I enabled this module but it allows users to create reviews for ALL content types, not just the desired content type. For example, users can now write reviews for Events, Blogs, Forums, etc. I only want users to be able to write reviews for "Restaurant Review" content type.

How can this be achieved? I don not want to turn off comments for the other content types.

thanks

Comments

smk-ka’s picture

Category: support » feature

This has yet to be developed. When I was publishing the module I was pretty sure that this feature request would come up sooner or later. Shouldn't be too hard to implement. Would you be able to do it? Or are you able to sponsor its development for a small fee?

tnguyen85’s picture

i cannot implement this feature myself. how much would it cost?

thanks

smk-ka’s picture

No big deal, say 50 bucks?

tnguyen85’s picture

I can pay $50. Tell me how I can pay. Thanks

smk-ka’s picture

Assigned: Unassigned » smk-ka

Code is now in CVS.

tnguyen85’s picture

does this new version allow me to select the content type to provide a rating?

thanks

smk-ka’s picture

Yes, of course! As I wrote in my email before: just open Content management -> Content types, edit a content type and check the box in the workflow settings named "Enable simple review functionality".

tnguyen85’s picture

I get the following errors after i write a comment. the vote and comments get saved but these errors appear. Seems to be a problem with the DB tables.

warning: Invalid argument supplied for foreach() in /home/content/t/n/g/tnguyen85/html/viet/modules/node/node.module on line 521.
warning: implode(): Bad arguments. in /home/content/t/n/g/tnguyen85/html/viet/modules/node/node.module on line 525.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /home/content/t/n/g/tnguyen85/html/viet/includes/database.mysql.inc on line 172.
warning: Invalid argument supplied for foreach() in /home/content/t/n/g/tnguyen85/html/viet/modules/node/node.module on line 521.
warning: implode(): Bad arguments. in /home/content/t/n/g/tnguyen85/html/viet/modules/node/node.module on line 525.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /home/content/t/n/g/tnguyen85/html/viet/includes/database.mysql.inc on line 172.
user warning: Column count doesn't match value count at row 1 query: INSERT INTO activity VALUES (5, 49, 'votingapi', '1', 'mark', 'a:6:{s:7:\"user-id\";s:2:\"49\";s:9:\"user-name\";s:6:\"btrinh\";s:7:\"node-id\";s:3:\"343\";s:10:\"node-title\";s:10:\"Huong Viet\";s:12:\"rating-value\";s:2:\"40\";s:11:\"rating_type\";s:7:\"percent\";}', 1201055818) in /home/content/t/n/g/tnguyen85/html/viet/includes/database.mysql.inc on line 172.
warning: Invalid argument supplied for foreach() in /home/content/t/n/g/tnguyen85/html/viet/modules/node/node.module on line 521.
warning: implode(): Bad arguments. in /home/content/t/n/g/tnguyen85/html/viet/modules/node/node.module on line 525.
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 query: SELECT n.nid, n.vid, n.type, n.status, n.created, n.changed, n.comment, n.promote, n.sticky, r.timestamp AS revision_timestamp, r.title, r.body, r.teaser, r.log, r.format, u.uid, u.name, u.picture, u.data FROM node n INNER JOIN users u ON u.uid = n.uid INNER JOIN node_revisions r ON r.vid = n.vid WHERE in /home/content/t/n/g/tnguyen85/html/viet/includes/database.mysql.inc on line 172.

smk-ka’s picture

Status: Active » Needs review

CVS is updated. This has been fixed by moving the node loading to the proper locations.

tnguyen85’s picture

I updaetd the module with your latest version and get the following when i create a review:

user warning: Column count doesn't match value count at row 1 query: INSERT INTO activity VALUES (6, 1, 'votingapi', '1', 'mark', 'a:6:{s:7:\"user-id\";s:1:\"1\";s:9:\"user-name\";s:9:\"tnguyen85\";s:7:\"node-id\";s:3:\"343\";s:10:\"node-title\";s:10:\"Huong Viet\";s:12:\"rating-value\";s:2:\"20\";s:11:\"rating_type\";s:7:\"percent\";}', 1201141639) in /home/content/t/n/g/tnguyen85/html/viet/includes/database.mysql.inc on line 172.

smk-ka’s picture

This isn't related to Simple Review. Look at the database table name: do you have Activity installed? From the error message it looks like your database schema is outdated. Did you perhaps update that module recently and forgot to visit update.php?

tnguyen85’s picture

yes, i have been having trouble with the Activity module and had to revert back to an older version. that must be it, thanks!

one thing i did notice was that Simple Review allowed me to vote more than once. I voted in a comment, and then replied to someone else's comment and voted again.

smk-ka’s picture

Normally, the first bit of the overridden theme_comment() should remove the 'reply' link:

function yourtheme_comment($comment, $links = array()) {
  // Remove reply link
  if (isset($comment->rating) && !empty($links)) {
    unset($links['comment_reply']);
  }
  ...

Thus, you shouldn't be able to reply at all. Just to be sure: you did copy that function to your template.php, named it accordingly and didn't remove above lines?

tnguyen85’s picture

yes, i did exactly as prescribed in the README file. it seems that the "reply" link is only removed from the comments that I created. I can still reply to comments that other people write.