For Drupal 6, can someone please help me write php code for the CCK fivestar voting...

Paul

New member
...target? I am in the process of finishing a review website and am looking for some php code for the fivestar voting target. I have two content types which include Review and Location. In the Location content type I am using the node comments module. With this module, the core drupal comments are replaced with the review content type. When a user decides to review a location, they select the "add a new review" link on that particular location node which opens the review content type. The Review content type includes a single CCK field which includes each day of the week and another field which contains a single CCK fivestar voting widget. When filling out a review, I would like the person to select the day of the week they visited a particular location as well as a rating for that particular day. After submitting the review, I would like the vote to be saved to the parent node with a tag corresponding to the day of the week which was selected by the user. In CCK fivestar there is a voting target box which allows you to input custom php code to designate where the vote is saved. I was thinking I add 7 "if" statements in this box, one for each day of the week. Something similar to this:

If field_dayofweek='sunday'
then save to parent node id with sunday tag or voting axis

If field_dayofweek='monday'
then save to parent node id with monday tag or voting axis

If field_dayofweek='tuesday'
then save to parent node id with tuesday tag or voting axis

etc...

I believe that something similar to this would work, but am having difficulty in determining what the correct syntax would be. If you have any experience with php and drupal I would really appreciate some assistance. This is the last feature that needs to be implemented before the site goes live. Any assistance at all would be very helpful.

Thank you.
 
Back
Top