$roles = variable_get('comment_roles', array());
$score = 0;
foreach (array_intersect(array_keys($roles), array_keys($user->roles)) as $rid) {
$score = max($roles[$rid], $score);
}
$users = serialize(array(0 => $score));
I understand that this serializing the $users field in the comments->users field of the database, but what I can't figure out is WHAT is being serialized and/or how to get the data/variables within, out. Basically, I want to call out and/or COUNT some of the variables/data serialized there for some new comment-moderation-functionality I've been working on. There's a good chunk of it working already, and if I can get this last part together I'll post it all in a "Php Snippets" or something like that for anyone that would like to use it. The concept is to show the average comment score (down to 2 decimal places) for each comment (which I've done already), the number of users who moderated the comment (still working on).
It will look something like this when I'm done:
(5.50/from 3 votes)
Finally, I want to make the output linkable to a page that will show which users voted on the comment, and what they each voted.
Thanks ahead of time for any new information anyone can share about how the comment->users field is created or how I can get the info there out...