Members can post comments after 3 uploads Members can post comments after 3 uploads
 

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]

Main Menu

Members can post comments after 3 uploads

Started by altenae, November 08, 2011, 04:48:38 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

altenae

Hi,

I want that members can post comments after 3 uploads.

Thanks,

Edward

ΑndrĂ©

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') {

altenae