How to display number of flagged comments for each author
Ok so I found a solution although I am not sure it is the best one. The problem was that the databases for the flag module only stores the comment id (when using a comment flag) and not the id of the authoring user. I am implementing the code in a PHP snippet in author pane template where the comment object isn't available. My solution was to do two queries:

$cid_array = db_query("SELECT cid FROM comment WHERE uid = :user", array(':user' =&gt; $account-&gt;uid))-&gt;fetchCol();
$thank_count = db_query("SELECT COUNT(*) FROM flagging WHERE entity_id IN (:cid) AND fid = 2", array(':cid' =&gt; $cid_array))-&gt;fetchField();


Thanks to Felix Eve for supportive comments