差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン前のリビジョン
次のリビジョン
前のリビジョン
nucleus:np_typepadantispam [2008/06/06 15:43] osamunucleus:np_typepadantispam [2008/06/06 16:41] (現在) osamu
行 17: 行 17:
 NP_Moderateの日本語ランゲージファイルも用意しました。このランゲージファイルを "moderata/language" ディレクトリにコピーしてから、プラグインのインストールを行ってください。 NP_Moderateの日本語ランゲージファイルも用意しました。このランゲージファイルを "moderata/language" ディレクトリにコピーしてから、プラグインのインストールを行ってください。
  
-{{nucleus:np_typepadantispam.php.zip|}}+{{nucleus:np_typepadantispam.0.2.zip|Download NP_TypePadAntiSpam}} 
 + 
 +{{nucleus:np_moderate_japanese.zip|Download Japanese language files for NP_Moderate}} 
 + 
 +===== Source Code =====
  
 <code php> <code php>
行 23: 行 27:
    /* ========================================================================    /* ========================================================================
     * NP_TypePadAntiSpam -- TypePad AntiSpam Plugin for Nucleus CMS     * NP_TypePadAntiSpam -- TypePad AntiSpam Plugin for Nucleus CMS
-    * Copyright (C) 2008 Osamu Higuchi+    * Copyright (C) 2008 Niels Leenheer, Matt Mullenweg, and Osamu Higuchi
     * ------------------------------------------------------------------------     * ------------------------------------------------------------------------
- * This program is free software; you can redistribute it and/or +    * This program is free software; you can redistribute it and/or 
- * modify it under the terms of the GNU General Public License +    * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation; either version 2 +    * as published by the Free Software Foundation; either version 2 
- * of the License, or (at your option) any later version. +    * of the License, or (at your option) any later version. 
-+    
- * This program is distributed in the hope that it will be useful, +    * This program is distributed in the hope that it will be useful, 
- * but WITHOUT ANY WARRANTY; without even the implied warranty of +    * but WITHOUT ANY WARRANTY; without even the implied warranty of 
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the +    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
-  * GNU General Public License for more details.+    * GNU General Public License for more details.
     *     *
     * You should have received a copy of the GNU General Public License along     * You should have received a copy of the GNU General Public License along
行 42: 行 46:
     * By Osamu Higuchi http://www.higuchi.com/     * By Osamu Higuchi http://www.higuchi.com/
     * Based on NP_Akismet by Niels Leenheer and Matt Mullenweg     * Based on NP_Akismet by Niels Leenheer and Matt Mullenweg
-    * and NP_AddSpamCheckEvent by hsur 
     * ------------------------------------------------------------------------     * ------------------------------------------------------------------------
     * Version History     * Version History
     * 0.1 May 30, 2008 : Prototype     * 0.1 May 30, 2008 : Prototype
 +    * 0.2 May 30, 2008 : Prototype
     * ========================================================================     * ========================================================================
     */     */
行 53: 行 57:
  function getAuthor()    { return 'Osamu Higuchi'; }  function getAuthor()    { return 'Osamu Higuchi'; }
  function getURL()  { return 'http://www.higuchi.com/'; }  function getURL()  { return 'http://www.higuchi.com/'; }
- function getVersion()   { return '0.1'; } + function getVersion()   { return '0.2'; } 
- function getDescription() { return 'Check for spam with TypePad AntiSpam'; }+ function getDescription() { return 'Spam Check with TypePad AntiSpam'; }
   
  function supportsFeature($what) {  function supportsFeature($what) {
行 66: 行 70:
   
  function getEventList() {  function getEventList() {
- return array('SpamCheck', 'SpamMark', 'SpamPlugin', 'ValidateForm');+ return array('SpamCheck', 'SpamMark', 'SpamPlugin');
  }  }
  
行 73: 行 77:
      $this->createOption('Privacy', 'Privacy protection', 'select', 'normal', 'Paranoid|high|Moderate|normal|None|low');      $this->createOption('Privacy', 'Privacy protection', 'select', 'normal', 'Paranoid|high|Moderate|normal|None|low');
  }  }
- 
-// Borrowed from NP_AddSpamCheckEvent  
- function event_ValidateForm(& $data) { 
- global $manager, $member; 
- if ($member->isLoggedIn()) 
- return; 
-  
- $spamcheck = array(); 
- switch( $data['type'] ){ 
- case 'membermail': 
- $spamcheck = array ( 
- 'type' => 'membermail',  
- 'data' => postVar('frommail')."\n".postVar('message'),  
- 'live' => true,  
- 'return' => true, 
- ); 
- break; 
- case 'comment': 
- $spamcheck = array ( 
- 'type' => 'comment',  
- 'body' => postVar('body'),  
- 'author' => $data['comment']['user'],  
- 'url' => $data['comment']['userid'],  
- 'id' => intval($data['comment']['itemid']),  
- 'live' => true,  
- 'return' => true, 
- //SpamCheck API1 Compat 
- 'data' => postVar('body')."\n".$data['comment']['user']."\n".$data['comment']['userid'], 
- ); 
- break; 
- default: 
- return; 
- } 
- 
- $manager->notify('SpamCheck', array ('spamcheck' => & $spamcheck)); 
- if (isset($spamcheck['result']) && $spamcheck['result'] == true) { 
- if ($manager->pluginInstalled('NP_Blacklist')) { 
- $plugin = & $manager->getPlugin('NP_Blacklist'); 
- $plugin->_redirect($plugin->getOption('redirect')); 
- } else { 
- $this->_showForbiddenMessage($spamcheck['message']); 
- } 
- } 
- } 
- 
- function _showForbiddenMessage($message = '') { 
- header("HTTP/1.0 403 Forbidden"); 
- header("Status: 403 Forbidden"); 
- echo '<html><header><title>403 Forbidden</title></header><body><h1>403 Forbidden</h1><p>'.$message.'</p></body></html>'; 
- exit; 
- } 
- 
-// Borrowed from NP_Akismet 
  
  function event_SpamPlugin(&$data) {  function event_SpamPlugin(&$data) {
nucleus/np_typepadantispam.1212734601.txt.gz · 最終更新: 2008/06/06 15:43 by osamu
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0