How about adding an RSS feed which users can subscribe to. This will be a subset of the 'all blogs' feed. Here is the function. Not sure where the link should be displayed.
function buddylist_feed() {
global $user;
$buddies = implode(',' $_SESSION['buddylist']);
$result = db_query_range("SELECT n.nid, n.title, n.teaser, n.created, u.name, u.uid FROM {node} n INNER JOIN {users} u ON n.uid = u.uid WHERE n.type = 'blog' AND n.status = 1 AND n.uid IN ($buddies) ORDER BY n.nid DESC", 0, 30);
$channel["title"] = t("%name buddy blogs", array ('%name' => $user->name));
$channel["link"] = url("buddylist/feed");
$channel["description"] = '';
node_feed($result, $channel);
}
P.S. Something is changing the square brackets into slashes, or stripping them entirely in the code above. Grrr.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | buddylist.patch2 | 12.24 KB | javanaut |
Comments
Comment #1
javanaut commentedGreetings weitzman,
It looks to me like that feed would only work if you were logged in. Most of the RSS readers that I use don't behave as though you were logged in, nor do they give you any way of sending arbitrary authentication data. One option would be to accept an optional uid as a parameter, then pull the data from the DB instead of the session. The code could look something like:
WARNING: all square brackets appear to have been removed from the preview screen in the following code.
I tested the code above on my CVS setup and it appears to work. I also added a menu() call in the buddylist_links() function:
..and I made the channel link point to the new buddy list page that I previously submitted.
I fixed some deprecated calls to
session_register()andsession_is_registered().I added a "maintain buddy list" permission:
For simplicity, I have attached a patch against the same CVS version that my previous patch was against (all previous additions/mods are relatively untouched, but nonetheless also included).
Comment #2
drummI believe this functionality made it into CVS.
Comment #3
(not verified) commented