forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 permissions => Topic started by: altenae on November 08, 2011, 04:48:38 pm

Title: Members can post comments after 3 uploads
Post by: altenae on November 08, 2011, 04:48:38 pm
Hi,

I want that members can post comments after 3 uploads.

Thanks,

Edward
Title: Re: Members can post comments after 3 uploads
Post by: Αndré 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') {
Title: Re: Members can post comments after 3 uploads
Post by: altenae on November 15, 2011, 06:08:16 pm
Thanks.....(again)

Edward