Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By AstaC on
I have a blog site whit several blogs. In one block I show the bloggers categories with the help of a snippet. And it works. It shows this bloggers categories and how many post there is by this author and this categorie. But if you click on the link you get ALL posts with this categorie, not only from this one blogger.
Anyone who can fix this snippet so that the link will give me only the posts from one blogger??
<?php
if (user_access('access content')) {
$accountid = arg(1);
$result = db_query(db_rewrite_sql("SELECT term_data.tid, term_data.name, COUNT(*) AS count FROM {vocabulary_node_types} INNER JOIN {term_data} USING (vid) INNER JOIN {term_node} USING (tid) INNER JOIN {node} USING (nid) WHERE node.status = 1 AND vocabulary_node_types.type = 'blog' AND node.uid = '$accountid' GROUP BY term_data.tid, term_data.name ORDER BY term_data.name"));
$items = array();
while ($category = db_fetch_object($result)) {
$items[] = l($category->name .' ('. $category->count .')', 'taxonomy/term/'. $category->tid);
}
return theme('item_list', $items);
}
?>
Comments
Noone who can se what's
Noone who can se what's wrong in the code?
Please?
Please?
Just asking one more time
Just asking one more time