Limit number of user comment a day
Author: DimKA
Bonus query: +1
DO IT
Open file engine/modules/addcomments.php
Find
if( $comments == '' ) {
$stop[] = $lang['news_err_11'];
$CN_HALT = TRUE;
}
$stop[] = $lang['news_err_11'];
$CN_HALT = TRUE;
}
BELOW add
$limit="10"; // Number of comments to limit
$com_num_day=$db->super_query("SELECT COUNT(*)as count FROM ".PREFIX."_comments WHERE autor='$name' AND date LIKE '".date('Y-m-d', time())."%'");
if ($com_num_day['count'] >=$limit){
$stop[] = "Today you can post {$limit} comments! Now you have {$com_num_day['count']} comments!";
$CN_HALT = TRUE;
}
$com_num_day=$db->super_query("SELECT COUNT(*)as count FROM ".PREFIX."_comments WHERE autor='$name' AND date LIKE '".date('Y-m-d', time())."%'");
if ($com_num_day['count'] >=$limit){
$stop[] = "Today you can post {$limit} comments! Now you have {$com_num_day['count']} comments!";
$CN_HALT = TRUE;
}

Updates
Dle templates English


