--- nodecomment.module	2010-07-19 17:23:03.000000000 +0300
+++ ../nodecomment-live/nodecomment.module	2010-10-22 20:14:17.394177998 +0300
@@ -1452,3 +1452,40 @@ function theme_nodecomment_comment_count
 function theme_nodecomment_new_comment_count($count, $type) {
   return format_plural($count, '1 new comment', '@count new comments');
 }
+
+/**
+ * Generate relevant tokens
+ * 
+ */
+function nodecomment_token_values($type, $object = NULL, $options = array()) {
+  $values = array();
+  switch ($type) {
+    case 'node':
+      // Nodecomments have themselves listed as comment types
+      if ( $object->type == $object->comment_type ) { 
+        $values['node-comment-parent-nid']      = $object->nid;
+        $values['node-comment-parent-path']     = drupal_lookup_path('alias', 'node/'.$object->comment_target_nid);
+        
+        // Get the page the comment is located at
+        $page = nodecomment_page_count($object);
+        if($page) { 
+          $page_path = '?page='.$page;
+        } else {
+          $page_path = "";
+        }
+        $values['node-comment-forumstyle-path'] = $values['node-comment-parent-path'].$page_path.'#comment-'.$object->nid;
+      } 
+    break;
+  }
+
+  return $values;
+}
+
+function nodecomment_token_list($type = 'all') {
+  if ($type == 'node' || $type == 'all') {
+    $tokens['node']['node-comment-parent-path']       = t('The path to the parent of this node comment.');
+    $tokens['node']['node-comment-parent-nid']        = t('The node id of the parent node.');
+    $tokens['node']['node-comment-forumstyle-path']   = t('The path to the comment based on the parent node.');
+    return $tokens;
+  }
+}
