plugins/spamx/DeleteComment.Action.class.php
author Dirk Haun <dirk@haun-online.de>
Thu, 29 Oct 2009 13:00:11 +0100
branchHEAD
changeset 7397 c27e9026f22a
parent 6838 cb1ba8d99085
permissions -rw-r--r--
Fixed inclusion protection
     1 <?php
     2 
     3 /**
     4  * File: DeleteComment.Action.class.php
     5  * This is the Delete Comment Action  for the Geeklog Spam-X plugin
     6  * 
     7  * Copyright (C) 2004-2005 by the following authors:
     8  * Author   Tom Willett     tomw AT pigstye DOT net
     9  * 
    10  * Licensed under GNU General Public License
    11  *
    12  * @package Spam-X
    13  * @subpackage Modules
    14  */
    15 
    16 if (strpos(strtolower($_SERVER['PHP_SELF']), 'deletecomment.action.class.php') !== false) {
    17     die('This file can not be used on its own!');
    18 }
    19 
    20 /**
    21  * Include Abstract Action Class
    22  */
    23 require_once $_CONF['path'] . 'plugins/spamx/' . 'BaseCommand.class.php';
    24 
    25 /**
    26  * Action Class which just discards comment
    27  * 
    28  * @author Tom Willett  tomw@pigstye.net 
    29  * @package Spam-X
    30  *
    31  */
    32 class DeleteComment extends BaseCommand {
    33     /**
    34      * Constructor
    35      * Numbers are always binary digits and added together to make call
    36      */
    37     function DeleteComment()
    38     {
    39         global $num;
    40 
    41         $num = 128;
    42     } 
    43 
    44     function execute($comment)
    45     {
    46         global $result, $_CONF, $_TABLES, $LANG_SX00;
    47         $result = 128;
    48 
    49         // update count of deleted spam posts
    50         DB_change ($_TABLES['vars'], 'value', 'value + 1', 'name', 'spamx.counter', '', true);
    51 
    52         SPAMX_log($LANG_SX00['spamdeleted']);
    53 
    54         return 1;
    55     } 
    56 } 
    57 
    58 ?>