Kunena 7.0.4 Released

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

  • C0n
  • C0n's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Only the strongest will survive
More
14 years 4 months ago - 14 years 4 months ago #114425 by C0n
In order to achieve this you are going to need to edit a plugin called "forum protection light".

Download it : joomla.stefysoft.com/downloads/free-exte...light15_download.php

Here is my code
Code:
$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).
Last edit: 14 years 4 months ago by C0n.
The following user(s) said Thank You: yuzef

Please Log in or Create an account to join the conversation.

  • C0n
  • C0n's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Only the strongest will survive
More
14 years 4 months ago #114523 by C0n
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.

Please Log in or Create an account to join the conversation.

Time to create page: 0.266 seconds