Прикольная мысль, мне пока не понятно зачем, но завтра залезу в код и скажу как сделать. 
Делать нужно так, чтобы комментарии пользователь видел только свои!
Делается это по идее, добавлением ещё одного условия в MySQL запрос (где комментарий принадлежит пользователю).
Принцип поиска нужно куска кода для изменения:1. Открываем файл, в котором отображается одиночное изображение:
displayimage.php2. Ищем кусок кода отвечающий за вывод комментариев:
$comments = theme_html_comments($CURRENT_PIC_DATA['pid']);
3. Видем, что нам нужна функция
theme_html_comments4. Открываем файл с данной функцией:
themes.inc.php5. Находим нужный кусок кода с данной функцией:
// Displays comments for a specific picture
if (!function_exists('theme_html_comments')) { //{THEMES}
function theme_html_comments($pid)
{
global $CONFIG, $USER, $CURRENT_ALBUM_DATA, $comment_date_fmt, $HTML_SUBST;
global $template_image_comments, $template_add_your_comment, $lang_display_comments;
$html = '';
// report to moderator buttons
if (!(($CONFIG['report_post']==1) && (USER_CAN_SEND_ECARDS))) {
template_extract_block($template_image_comments, 'report_comment_button');
}
if (!$CONFIG['enable_smilies']) {
$tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_no_smilies', '{EDIT}');
template_extract_block($template_image_comments, 'edit_box_smilies');
template_extract_block($template_add_your_comment, 'input_box_smilies');
} else {
$tmpl_comment_edit_box = template_extract_block($template_image_comments, 'edit_box_smilies', '{EDIT}');
template_extract_block($template_image_comments, 'edit_box_no_smilies');
template_extract_block($template_add_your_comment, 'input_box_no_smilies');
}
$tmpl_comments_buttons = template_extract_block($template_image_comments, 'buttons', '{BUTTONS}');
$tmpl_comments_ipinfo = template_extract_block($template_image_comments, 'ipinfo', '{IPINFO}');
if ($CONFIG['comments_sort_descending'] == 1) {
$comment_sort_order = 'DESC';
} else {
$comment_sort_order = 'ASC';
}
$result = cpg_db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip, pid FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id $comment_sort_order");
while ($row = mysql_fetch_array($result)) {
$user_can_edit = (GALLERY_ADMIN_MODE) || (USER_ID && USER_ID == $row['author_id'] && USER_CAN_POST_COMMENTS) || (!USER_ID && USER_CAN_POST_COMMENTS && ($USER['ID'] == $row['author_md5_id']));
$comment_buttons = $user_can_edit ? $tmpl_comments_buttons : '';
$comment_edit_box = $user_can_edit ? $tmpl_comment_edit_box : '';
$comment_ipinfo = ($row['msg_raw_ip'] && GALLERY_ADMIN_MODE)?$tmpl_comments_ipinfo : '';
if ($CONFIG['enable_smilies']) {
$comment_body = process_smilies(make_clickable($row['msg_body']));
$smilies = generate_smilies("f{$row['msg_id']}", 'msg_body');
} else {
$comment_body = make_clickable($row['msg_body']);
$smilies = '';
}
$ip = $row['msg_hdr_ip'];
if ($row['msg_hdr_ip'] != $row['msg_raw_ip']) {
$ip .= ' [' . $row['msg_raw_ip'] . ']';
}
$params = array('{EDIT}' => &$comment_edit_box,
'{BUTTONS}' => &$comment_buttons,
'{IPINFO}' => &$comment_ipinfo
);
$template = template_eval($template_image_comments, $params);
$params = array('{MSG_AUTHOR}' => stripslashes($row['msg_author']),
'{MSG_ID}' => $row['msg_id'],
'{PID}' => $row['pid'],
'{EDIT_TITLE}' => &$lang_display_comments['edit_title'],
'{CONFIRM_DELETE}' => &$lang_display_comments['confirm_delete'],
'{MSG_DATE}' => localised_date($row['msg_date'], $comment_date_fmt),
'{MSG_BODY}' => bb_decode($comment_body),
'{MSG_BODY_RAW}' => $row['msg_body'],
'{OK}' => &$lang_display_comments['OK'],
'{SMILIES}' => $smilies,
'{IP}' => $ip,
'{REPORT_COMMENT_TITLE}' => &$lang_display_comments['report_comment_title'],
'{WIDTH}' => $CONFIG['picture_table_width']
);
$html .= template_eval($template, $params);
}
if (USER_CAN_POST_COMMENTS && $CURRENT_ALBUM_DATA['comments'] == 'YES') {
if (USER_ID) {
$user_name_input = '<tr><td><input type="hidden" name="msg_author" value="' . stripslashes(USER_NAME) . '" /></td>';
template_extract_block($template_add_your_comment, 'user_name_input', $user_name_input);
$user_name = '';
} else {
if (isset($USER['name'])) {
$user_name = strtr($USER['name'], $HTML_SUBST);
} else {
$user_name = $lang_display_comments['your_name'];
}
}
$params = array('{ADD_YOUR_COMMENT}' => $lang_display_comments['add_your_comment'],
// Modified Name and comment field
'{NAME}' => $lang_display_comments['name'],
'{COMMENT}' => $lang_display_comments['comment'],
'{PIC_ID}' => $pid,
'{USER_NAME}' => $user_name,
'{MAX_COM_LENGTH}' => $CONFIG['max_com_size'],
'{OK}' => $lang_display_comments['OK'],
'{SMILIES}' => '',
'{WIDTH}' => $CONFIG['picture_table_width'],
);
if ($CONFIG['enable_smilies']){
$params['{SMILIES}'] = generate_smilies();
} else {
template_extract_block($template_add_your_comment, 'smilies');
}
$html .= template_eval($template_add_your_comment, $params);
}
return $html;
}
} //{THEMES}
6. Этот кусок кода нужно скопировать в файл:
themes\classic\theme.phpP.S. В соответствии с инструкциями описанными тут ->
http://forum.coppermine-gallery.net/index.php?topic=43678.0P.S.S. Т.е. мы
не должны копироватьстроку:if (!function_exists('theme_html_comments')) { //{THEMES}
и строку:} //{THEMES}
7. В скопированном и вставленном коде
меняем строку (код):$result = cpg_db_query("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip, pid FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' ORDER BY msg_id $comment_sort_order");
на строку (код):$result = cpg_db_query(sprintf("SELECT msg_id, msg_author, msg_body, UNIX_TIMESTAMP(msg_date) AS msg_date, author_id, author_md5_id, msg_raw_ip, msg_hdr_ip, pid FROM {$CONFIG['TABLE_COMMENTS']} WHERE pid='$pid' AND (author_id='%s' OR author_id='%s') ORDER BY msg_id $comment_sort_order",USER_ID,$USER['ID']));
8. Сохраняем
Оттестировано. Работает.+
Нужно помнить, что по ссылке "
Последние комментарии" отображаются последний комментарий для изображения.
Его тоже нужно прятать, по идее...
Для этого нужно
Открыть файл:include\functions.inc.phpНайти блок кода: if ($row['author_id']) {
$caption .= '<span class="thumb_caption"><a href ="profile.php?uid='.$row['author_id'].'">'.$row['msg_author'].'</a>: '.$msg_body.'</span>';
} else {
$caption .= '<span class="thumb_caption">'.$row['msg_author'].': '.$msg_body.'</span>';
}
Заменить на блок кода: if ($row['author_id'] == USER_ID) {
$caption .= '<span class="thumb_caption"><a href ="profile.php?uid='.$row['author_id'].'">'.$row['msg_author'].'</a>: '.$msg_body.'</span>';
} else {
//do nothing
}