Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Members can post comments after 3 uploads  (Read 3682 times)

0 Members and 1 Guest are viewing this topic.

altenae

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 254
Members can post comments after 3 uploads
« on: November 08, 2011, 04:48:38 pm »

Hi,

I want that members can post comments after 3 uploads.

Thanks,

Edward
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Members can post comments after 3 uploads
« Reply #1 on: November 15, 2011, 03:05:43 pm »

Copy the function theme_html_comments to your theme.php file if it doesn't exist. Then, find
Code: [Select]
    if (USER_CAN_POST_COMMENTS && $CURRENT_ALBUM_DATA['comments'] == 'YES') {and replace with
Code: [Select]
    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') {
Logged

altenae

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 254
Re: Members can post comments after 3 uploads
« Reply #2 on: November 15, 2011, 06:08:16 pm »

Thanks.....(again)

Edward
Logged
Pages: [1]   Go Up
 

Page created in 0.029 seconds with 20 queries.