Copy the function theme_html_comments to your theme.php file if it doesn't exist. Then, find
if (USER_CAN_POST_COMMENTS && $CURRENT_ALBUM_DATA['comments'] == 'YES') {
and replace with
if (USER_ID) {
$num_user_comments = mysql_result(cpg_db_query("SELECT COUNT(*) FROM {$CONFIG['TABLE_PICTURES']} WHERE owner_id = ".USER_ID), 0);
}
if (USER_ID && $num_user_comments < 3) {
template_extract_block($template_add_your_comment, 'user_name_input');
if ($CONFIG['enable_smilies'] == 1) {
template_extract_block($template_add_your_comment, 'input_box_smilies');
} else {
template_extract_block($template_add_your_comment, 'input_box_no_smilies');
}
template_extract_block($template_add_your_comment, 'comment_captcha');
template_extract_block($template_add_your_comment, 'smilies');
template_extract_block($template_add_your_comment, 'submit');
$params = array('{ADD_YOUR_COMMENT}' => $lang_display_comments['add_your_comment'],
'{WIDTH}' => $CONFIG['picture_table_width'],
'{LOGIN_TO_COMMENT}' => sprintf("You have to <a href=\"upload.php\">upload</a> more files to use the comment system." , '<a href="login.php?referer='.$REFERER.'">', '</a>'),
'{HELP_ICON}' => '',
);
if ($CONFIG['comments_sort_descending'] == 1) {
$html = '<br />'.template_eval($template_add_your_comment, $params).$html;
} else {
$html .= template_eval($template_add_your_comment, $params);
}
} elseif (USER_CAN_POST_COMMENTS && $CURRENT_ALBUM_DATA['comments'] == 'YES') {