function fivestar_comment_load in Fivestar 6.2
Same name and namespace in other branches
- 5 fivestar_comment.module \fivestar_comment_load()
- 6 fivestar_comment.module \fivestar_comment_load()
Get a current rating(s) for a comment.
2 calls to fivestar_comment_load()
- fivestar_comment in ./
fivestar_comment.module - Implementation of hook_comment().
- fivestar_comment_form_alter in ./
fivestar_comment.module - Form alter specification for comments.
File
- ./
fivestar_comment.module, line 200
Code
function fivestar_comment_load($cid, $nid, $reset = FALSE) {
global $user;
static $cids = array();
if (!isset($cids[$cid]) || $reset) {
$result = db_query('SELECT * FROM {fivestar_comment} WHERE cid = %d', $cid);
while ($data = db_fetch_array($result)) {
$cids[$cid][$data['tag']] = $data;
}
}
return $cids[$cid];
}