If user leave comment, print "You have already written a comment"
Try this

function custom_cv_node_view($node, $view_mode, $langcode) {
 global $user;
  if ($view_mode == 'teaser') { /* Teaser */
      $cid = db_query('SELECT cid FROM {comment} WHERE uid= :uid AND nid = :nid', array(':uid' =&gt; $user-&gt;uid, ':nid' =&gt; $node-&gt;nid))-&gt;fetch();
      if($cid) {
          $node-&gt;title = $node-&gt;title.' (Commented)';
      }
  }
}