I did use search also Google, but we foreigners, sometimes use one word wrong (higher vs. upper) and don't find it anymore. Very kind you answered anyhow!
The filter works like "capital" punishment, which is OK in some communities to keep people in line. Now I have seen how easy it is to include a filter, I will have a look for a filter that can also do uppercase letters with tildes. I found an alternative method on the CVS attic and updated it to present day filters:
function noshout_filter($op, $delta = 0, $format = -1, $text = '') {
switch ($op) {
case 'list':
return array(0 => t('Enable to convert text with too many uppercase characters to lowercase.'));
case 'process':
$no_blanks = preg_replace("/\W|[0-9]/", "", $text);
$lower = strtolower($no_blanks);
$nolower = preg_replace("/[a-z]/", "", $no_blanks);
if (strlen($lower) > 10 && strlen($nolower) > strlen($lower)*0.4) {
return strtolower($text);
}
else {
return $text;
}
default:
return $text;
}
}
It's not a problem for me, but then I run a website with only four authorised contributors. I guess that if you have a wider pool of contributors it might be more of an issue.
However, it would be a little risky to deploy a crude one. Consider the following:
These are international organisations:
EU, WEU, EFTA, UN, UNICEF, WTO, ASEAN, ECOMOG, NAFTA, UNIDIR, UNIFIL, WHO, WAO, IOC, UNRWA, UNHCR, UNISDR, ICTR, OHCHR, UNEP, UNDP, WMO, INO, WIPO, ITU, ICAO, UNESCO
What would such a filter do with the bulleted paragraph, which is legitimately all upercase?
I suspect that the best that any such filter could do would be to detect posts with more than a given threshold of uppercase words, and hold them back for moderation.
Comments
Easy
Will only do ASCII. Name it uppercase.module, and enable it. Untested.
--
If you have a problem, please search before posting a question.
I did use search also
I did use search also Google, but we foreigners, sometimes use one word wrong (higher vs. upper) and don't find it anymore. Very kind you answered anyhow!
I will try to work on it and post back.
"Capital" punishment
The filter works like "capital" punishment, which is OK in some communities to keep people in line. Now I have seen how easy it is to include a filter, I will have a look for a filter that can also do uppercase letters with tildes. I found an alternative method on the CVS attic and updated it to present day filters:
what about node title?
Nice one ...thx for the code!
Any ideas how to modify this code to also change node title to lowercase?
Ok, i got it. Now i just
Ok, i got it. Now i just have to figure out how to execute this code only when the filter is active.
Not a simple issue
It's not a problem for me, but then I run a website with only four authorised contributors. I guess that if you have a wider pool of contributors it might be more of an issue.
However, it would be a little risky to deploy a crude one. Consider the following:
What would such a filter do with the bulleted paragraph, which is legitimately all upercase?
I suspect that the best that any such filter could do would be to detect posts with more than a given threshold of uppercase words, and hold them back for moderation.