I have used this peice of code http://drupal.org/node/7414 to make a block that shows a list of the blogs running on my site.
here;
http://womynsvoices.ca/en/blog
however I would like it if the most recent post for each user showed up. Sometimes users will post things only other regisetered users can see. I have arranged for that using the taxonomy access module.
What I would like to know is how exactly I can make it so that the snippet I am using is checking the taxo-access module to show the post titles according to the access level of the user browsing the site.
The user names can appear regardless.
this is the code I am using so far..
global $user;
if (user_access("access content")) {
$blogs = "";
$queryResult = db_query_range("SELECT n.uid, u.name, max(n.nid) FROM {node} n INNER JOIN {users} u ON u.uid = n.uid WHERE n.type = 'blog' AND n.status = 1 GROUP BY n.uid, u.name ORDER BY 3 DESC", 0, 20);
while ($node = db_fetch_object($queryResult)) {
$blogs .= l(t("%username", array("%username" => $node->name)), "blog/$node->uid", array("title" => t("Read %username's latest blog entries.", array("%username" => $node->name))));
$blogs .= node_title_list(db_query_range("SELECT n.title, n.nid FROM {node} n WHERE n.type = 'blog' AND n.status = 1 AND n.uid = " . $node->uid . " ORDER BY n.nid DESC", 0, 1));
}
return $blogs