Changeset 28836


Ignore:
Timestamp:
06/29/14 16:18:10 (5 years ago)
Author:
mistic100
Message:

use new maintain class

Location:
extensions/comments_blacklist
Files:
1 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/comments_blacklist/admin.php

    r26113 r28836  
    1414     
    1515  file_put_contents(COMM_BLACKLIST_FILE, $_POST['content']); 
    16   conf_update_param('comments_blacklist', serialize($conf['comments_blacklist'])); 
     16  conf_update_param('comments_blacklist', $conf['comments_blacklist']); 
    1717  $page['infos'][] = l10n('Information data registered in database'); 
    1818} 
  • extensions/comments_blacklist/main.inc.php

    r26113 r28836  
    1111defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 
    1212 
    13 define('COMM_BLACKLIST_ID',      basename(dirname(__FILE__))); 
    14 define('COMM_BLACKLIST_PATH' ,   PHPWG_PLUGINS_PATH . COMM_BLACKLIST_ID . '/'); 
    15 define('COMM_BLACKLIST_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . COMM_BLACKLIST_ID); 
    16 define('COMM_BLACKLIST_FILE',    PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'comments_blacklist.txt'); 
    17 define('COMM_BLACKLIST_VERSION', 'auto'); 
     13global $conf; 
     14 
     15define('COMM_BLACKLIST_ID',    basename(dirname(__FILE__))); 
     16define('COMM_BLACKLIST_PATH' , PHPWG_PLUGINS_PATH . COMM_BLACKLIST_ID . '/'); 
     17define('COMM_BLACKLIST_ADMIN', get_root_url() . 'admin.php?page=plugin-' . COMM_BLACKLIST_ID); 
     18define('COMM_BLACKLIST_FILE',  PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'comments_blacklist.txt'); 
    1819 
    1920 
    20 add_event_handler('init', 'comm_blacklist_init'); 
     21$conf['comments_blacklist'] = safe_unserialize($conf['comments_blacklist']); 
     22 
    2123 
    2224if (defined('IN_ADMIN')) 
     
    2931} 
    3032 
    31  
    32 /** 
    33  * plugin initialization 
    34  */ 
    35 function comm_blacklist_init() 
    36 { 
    37   global $conf; 
    38    
    39   include_once(COMM_BLACKLIST_PATH . 'maintain.inc.php'); 
    40   $maintain = new comments_blacklist_maintain(COMM_BLACKLIST_ID); 
    41   $maintain->autoUpdate(COMM_BLACKLIST_VERSION, 'install'); 
    42    
    43   $conf['comments_blacklist'] = unserialize($conf['comments_blacklist']); 
    44 } 
    4533 
    4634/** 
Note: See TracChangeset for help on using the changeset viewer.