I've created a simple block in a D6 site that is designed to do nothing more than present the total number of nodes of a given content type that are tagged with a specific taxonomy term.
The code in the block is:
//term "rural" / tid=226
$term->tid = 226;
$count = taxonomy_term_count_nodes($term->tid, 'shop_profile');
where 'shop_profile' is the content type I'm interested in (the term is only available to be used for this content type).
The block gives the correct result (285) for logged in users, but gives a different count (321) for unauthenticated users. The content type is visible to non-logged in users.
I'm very much a PHP novice, and would welcome some help to understand what's going on here and to fix it so that the results are consistent and accurate for all users.