? 511026_node_comment_count.patch
Index: token_node.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/token/Attic/token_node.inc,v
retrieving revision 1.5.4.14
diff -u -p -r1.5.4.14 token_node.inc
--- token_node.inc	14 May 2009 16:09:15 -0000	1.5.4.14
+++ token_node.inc	6 Jul 2009 01:00:35 -0000
@@ -24,17 +24,19 @@ function node_token_values($type, $objec
       $node = $object;
       $account = db_fetch_object(db_query("SELECT name, mail FROM {users} WHERE uid = %d", $node->uid));
 
-      $values['nid']              = $node->nid;
-      $values['type']             = $node->type;
-      $values['type-name']        = node_get_types('name', $node->type);
-      $values['language']         = filter_xss_admin($node->language);
-      $values['title']            = check_plain($node->title);
-      $values['title-raw']        = $node->title;
-      $values['author-uid']       = $node->uid;
-      $values['author-name']      = check_plain($account->name);
-      $values['author-name-raw']  = $account->name;
-      $values['author-mail']      = check_plain($account->mail);
-      $values['author-mail-raw']  = $account->mail;
+      $values['nid']                = $node->nid;
+      $values['type']               = $node->type;
+      $values['type-name']          = node_get_types('name', $node->type);
+      $values['language']           = filter_xss_admin($node->language);
+      $values['title']              = check_plain($node->title);
+      $values['title-raw']          = $node->title;
+      $values['author-uid']         = $node->uid;
+      $values['author-name']        = check_plain($account->name);
+      $values['author-name-raw']    = $account->name;
+      $values['author-mail']        = check_plain($account->mail);
+      $values['author-mail-raw']    = $account->mail;
+      $values['node_comment_count'] = $node->comment_count;
+
       if (isset($node->created)) {
         $date = (int)$node->created;
         $values['yyyy']           = date('Y', $date);
@@ -182,7 +184,7 @@ function node_token_list($type = 'all') 
     $tokens['node']['author-name-raw'] = t("Node author's user name. WARNING - raw user input.");
     $tokens['node']['author-mail']     = t("Node author's e-mail.");
     $tokens['node']['author-mail-raw'] = t("Node author's e-mail. WARNING - raw user input.");
-
+    $tokens['node']['node_comment_count'] = t("The number of comments on a node.");
 
     $tokens['node']['term']            = t("Name of top taxonomy term");
     $tokens['node']['term-raw']        = t("Unfiltered name of top taxonomy term. WARNING - raw user input.");
