3 This plugin blocks any contribution that contains chinese characters
4 (as HTML entities). This is not meant to be impolite or discriminate
5 Chinese, but because there are a few very aggressive web/link spammers
6 this is currently the best workaround for primarily English sites.
8 IMPORTANT: this plugin must be loaded together with (before) the
9 'fragments/head/meta.php' code snippets.
12 $ewiki_plugins["handler"][] = "ewiki_block_cjk_spam";
13 $ewiki_plugins["view_final"][] = "ewiki_warn_cjk_spam";
16 function ewiki_cjk_entities($html) {
17 if (preg_match_all("/&#(x?[0-9a-f]+)/i", $html, $uu))
18 foreach ($uu[1] as $char) {
19 $char = strtolower($char);
21 $char = hexdec(substr($char, 1));
24 if ( ($char >= 0x3200) && ($char <= 0x9999) // CJK A+Unified+..
25 or ($char >= 0x2E80) && ($char <= 0x303F) )
34 function ewiki_block_cjk_spam($id, &$data, $action) {
37 if (ewiki_cjk_entities($data["content"])) {
39 $data["meta"]["meta"]["robots"] = "NOINDEX,NOFOLLOW,NOPAGERANK,NOCOUNT,NOARCHIVE";
43 function ewiki_warn_cjk_spam(&$o, $id, &$data, $action) {
47 <div class="system-message" style="background:#883333; color:#ffffff; border:2px solid #554444; padding:3px; margin:5px;">
48 <big><b style="color:#ffffcc"><META name="ROBOTS" content="<blink>NOINDEX</blink>,NOFOLLOW"></b></big>
50 <b>ATTENTION</b>: This page will <u>no longer be indexed by Google</u> and other
51 search engines. This is because it contains Chinese characters, and we have
52 been link-spammed too much in the last time. Apologies if you just wanted