It would be nice to have an API function that can be used to view a list of all users who bookmarked a given node. views_bookmark_get_user_bookmarks() takes a $nid as an argument, but limits it to the current user.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | views_bookmark-who-bookmarked-this-node-169334-3.patch | 1.02 KB | webchick |
| #2 | views_bookmark-who-bookmarked-this-node-169334-2.patch | 893 bytes | webchick |
| #1 | views_bookmark-who-bookmarked-this-node-169334-1.patch | 869 bytes | webchick |
Comments
Comment #1
webchickPatch.
Comment #2
webchickThis is the same patch, but orders the results by timestamp. This way, when displaying results in a block or so, the list will be dynamic where it always shows the person who bookmarked it most recently at the top. I'm trying to think of a situation where this is not desirable, and can't really come up with one. Hopefully committers agree. :)
Comment #3
webchickNew patch, now with static caching and the return results organized a bit better so they make sense.
Comment #4
chadchandler commentedVery nice! Was just posting a support request regarding this. What exactly needs to go in node.tpl.php to get this to work? Thanks again! Much needed addition!
Comment #5
quicksketchThanks webchick! Committed.
@CChandler, you'll be best off creating a view for your needs. But if you just want the raw output in an efficient manner you could use something like this:
Comment #6
(not verified) commented