Dotclear


Ignore:
Timestamp:
06/06/10 01:00:49 (13 years ago)
Author:
JcDenis
Message:

dcFilterDuplicate 0.3

  • Switched to DC 2.2
File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/dcFilterDuplicate/_install.php

    r1981 r2305  
    33# This file is part of dcFilterDuplicate, a plugin for Dotclear 2. 
    44#  
    5 # Copyright (c) 2009 JC Denis and contributors 
     5# Copyright (c) 2009-2010 JC Denis and contributors 
    66# jcdenis@gdwd.com 
    77#  
     
    1616$new_version = $core->plugins->moduleInfo('dcFilterDuplicate','version'); 
    1717$old_version = $core->getVersion('dcFilterDuplicate'); 
     18 
    1819# Compare versions 
    1920if (version_compare($old_version,$new_version,'>=')) {return;} 
     21 
    2022# Install or update 
    21 try { 
    22      # Check DC version (dev on) 
    23      if (!version_compare(DC_VERSION,'2.1.5','>=')) { 
    24           throw new Exception('Plugin called dcFilterDuplicate requires Dotclear 2.1.5 or higher.'); 
     23try 
     24{ 
     25     # Check version 
     26     if (version_compare(DC_VERSION,'2.2-beta','<')) 
     27     { 
     28          throw new Exception('dcFilterDuplicate requires Dotclear 2.2'); 
    2529     } 
    26      # Check DC version (new settings) 
    27      if (version_compare(DC_VERSION,'2.2','>=')) { 
    28           throw new Exception('Plugin called dcFilterDuplicate requires Dotclear up to 2.2.'); 
    29      } 
     30      
    3031     # Settings 
    31      $s = null; 
    32      $s =& $core->blog->settings; 
    33      $s->setNameSpace('dcFilterDuplicate'); 
    34      $s->put('dcfilterduplicate_minlen',30,'integer','Minimum lenght of comment to filter',false,true); 
    35      $s->setNameSpace('system'); 
     32     $core->blog->settings->addNamespace('dcFilterDuplicate'); 
     33     $core->blog->settings->dcFilterDuplicate->put('dcfilterduplicate_minlen',30,'integer','Minimum lenght of comment to filter',false,true); 
     34 
    3635     # Version 
    3736     $core->setVersion('dcFilterDuplicate',$new_version); 
    38      # All right baby 
     37 
    3938     return true; 
    4039} 
    41 catch (Exception $e) { 
     40catch (Exception $e) 
     41{ 
    4242     $core->error->add($e->getMessage()); 
    4343     return false; 
Note: See TracChangeset for help on using the changeset viewer.

Sites map