The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0
This category contains miscellaneous, uncategorised user contributions, (templates, modules, plugins and hacks) relating to older versions of Kunena that are no longer supported.
The topics in this category are for historical interest only. Owing to the structural changes that occurred in K 1.7, many of the ideas in these topics will not work with later versions and, for that reason, the topics are locked.
Question
Kunena Block All Uppercase A-Z Topic/Thread Titles
$check1 = JRequest::getVar('subject');
$maximum_percent_allowed='40';//you can cange this percent with your own
preg_match_all('/[A-Z]/', $check1, $match) ;
$total_upper_case_count = count($match [0]);
$total_characters= strlen($check1);
$up_leters_percent=ceil(($total_upper_case_count*100)/$total_characters);
if ($up_leters_percent>$maximum_percent_allowed) {
$spam['spam'] = true;
$spam['error'] .= 'Please refrain from using all uppercase letters in your Thread titles.<br />';
}
Once you have instaled, enabled and setup there plugin you want to add my code to the following location. "/plugins/system/forums_protection_light.php" (Lines : 90-96)
Code:
$bdreplace = $params->get('bdreplace', '-_-');
$check1 = JRequest::getVar('subject');
$maximum_percent_allowed='40';//you can cange this percent with your own
preg_match_all('/[A-Z]/', $check1, $match) ;
$total_upper_case_count = count($match [0]);
$total_characters= strlen($check1);
$up_leters_percent=ceil(($total_upper_case_count*100)/$total_characters);
if ($up_leters_percent>$maximum_percent_allowed) {
$spam['spam'] = true;
$spam['error'] .= 'Please refrain from using all uppercase letters in your Thread titles.<br />';
}
if ($usebadword == 1)
Feel free to change the pecentage "$maximum_percent_allowed='40';" With you'r own. Basicly it allows you to choose if you want to block thread/topic titles that look like this "ALL UPPERCASE" (100% uppercase) or that look like this "All uPeRcAsE" (50% uppercase).
You can apply the same code to the topic contents itself too.
Code:
$check = JRequest::getVar('message');
Code:
$check = JRequest::getVar('message');
$maximum_percent_allowed='50';//you can cange this percent with your own
preg_match_all('/[A-Z]/', $check, $match) ;
$total_upper_case_count = count($match [0]);
$total_characters= strlen($check);
$up_leters_percent=ceil(($total_upper_case_count*100)/$total_characters);
if ($up_leters_percent>$maximum_percent_allowed)
{
$spam['spam'] = true;
$spam['error'] .= 'Please refrain from using all uppercase letters in your posts.<br />';
}
So if the contents of there post is more than 50% uppercase it is considered spam and blocked.