Ignore:
Timestamp:
Mar 10, 2013, 5:12:50 PM (11 years ago)
Author:
mistic100
Message:

some code corrections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Subscribe_to_comments/main.inc.php

    r21340 r21441  
    99*/
    1010
     11/*
     12 * potential problem : if the permissions of a user change, he receives notifications
     13 * about photos and albums he can't see anymore
     14 */
     15
    1116if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
    1217
    1318global $prefixeTable;
    1419
    15 define('SUBSCRIBE_TO_PATH' ,   PHPWG_PLUGINS_PATH . 'Subscribe_to_Comments/');
     20defined('SUBSCRIBE_TO_ID') or define('SUBSCRIBE_TO_ID', basename(dirname(__FILE__)));
     21define('SUBSCRIBE_TO_PATH' ,   PHPWG_PLUGINS_PATH . SUBSCRIBE_TO_ID . '/');
    1622define('SUBSCRIBE_TO_TABLE',   $prefixeTable . 'subscribe_to_comments');
    1723define('SUBSCRIBE_TO_VERSION', 'auto');
     
    3137  if (
    3238    SUBSCRIBE_TO_VERSION == 'auto' or
    33     $pwg_loaded_plugins['Subscribe_to_Comments']['version'] == 'auto' or
    34     version_compare($pwg_loaded_plugins['Subscribe_to_Comments']['version'], SUBSCRIBE_TO_VERSION, '<')
     39    $pwg_loaded_plugins[SUBSCRIBE_TO_ID]['version'] == 'auto' or
     40    version_compare($pwg_loaded_plugins[SUBSCRIBE_TO_ID]['version'], SUBSCRIBE_TO_VERSION, '<')
    3541  )
    3642  {
     
    3844    stc_install();
    3945   
    40     if ( $pwg_loaded_plugins['Subscribe_to_Comments']['version'] != 'auto' and SUBSCRIBE_TO_VERSION != 'auto' )
     46    if ( $pwg_loaded_plugins[SUBSCRIBE_TO_ID]['version'] != 'auto' and SUBSCRIBE_TO_VERSION != 'auto' )
    4147    {
    4248      $query = '
    4349UPDATE '. PLUGINS_TABLE .'
    4450SET version = "'. SUBSCRIBE_TO_VERSION .'"
    45 WHERE id = "Subscribe_to_Comments"';
     51WHERE id = "'. SUBSCRIBE_TO_ID .'"';
    4652      pwg_query($query);
    4753     
    48       $pwg_loaded_plugins['Subscribe_to_Comments']['version'] = SUBSCRIBE_TO_VERSION;
     54      $pwg_loaded_plugins[SUBSCRIBE_TO_ID]['version'] = SUBSCRIBE_TO_VERSION;
    4955     
    5056      if (defined('IN_ADMIN'))
     
    9298  array_push($menu, array(
    9399    'NAME' => 'Subscribe to Comments',
    94     'URL' => get_root_url().'admin.php?page=plugin-' . basename(dirname(__FILE__))
     100    'URL' => get_root_url().'admin.php?page=plugin-' . SUBSCRIBE_TO_ID,
    95101  ));
    96102  return $menu;
Note: See TracChangeset for help on using the changeset viewer.