You are here

function xmlsitemap_taxonomy_get_node_count in XML sitemap 6.2

Same name and namespace in other branches
  1. 7.2 xmlsitemap_taxonomy/xmlsitemap_taxonomy.module \xmlsitemap_taxonomy_get_node_count()

Find the number of nodes that are associated with a taxonomy term.

Parameters

$term: A taxonomy term object.

Return value

The number of nodes associated with the term.

File

xmlsitemap_taxonomy/xmlsitemap_taxonomy.module, line 218

Code

function xmlsitemap_taxonomy_get_node_count(stdClass $term) {

  // @todo Use db_rewrite_sql() w/ switch user.
  return db_result(db_query_range("SELECT COUNT(tn.nid) FROM {term_node} tn LEFT JOIN {node n} USING (nid) WHERE tn.tid = %d AND n.status = 1", $term->tid, 0, 1));
}