Changeset 1651

Show
Ignore:
Timestamp:
05/25/2007 05:00:01 PM (20 months ago)
Author:
robertb
Message:

Behandlung negativer Zahlen

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/CommentCloser.jplug.php

    r1650 r1651  
    44 * @author:      Robert Bienert <robertbienert@gmx.net> 
    55 * @version:     1.0 
    6  * @date:        2007-05-22 
     6 * @date:        2007-05-25 
    77 * 
    88 * Dieses Plugin schliesst nach einer bestimmten, festzulegenden 
     
    2828                        $lifeTime = $_POST['commclose_lifetime'] * 
    2929                                        $_POST['commclose_unit']; 
     30                        // keine negative Zeiten 
     31                        if ($lifeTime < 0) 
     32                                $lifeTime = 0; 
    3033 
    3134                        $mask = umask(0); 
     
    7275 
    7376                # TODO 
     77                $q = new Query('UPDATE kolumne_content SET comments=0 ' . 
     78                        'WHERE UNIX_TIMESTAMP(date) < ' . 
     79                                'UNIX_TIMESTAMP(NOW()) - ' . 
     80                                COMMENT_CLOSER_LIFETIME . 
     81                        ' AND comments=1'); 
    7482 
    7583                return $data;