Ignore:
Timestamp:
Jun 11, 2012, 10:10:56 PM (9 years ago)
Author:
mistic100
Message:

HUGE update, main features : global subscriptions (all images in an album, all images, all albums), beautyful (!) mails

File:
1 edited

Legend:

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

    r12702 r15641  
    33Plugin Name: Subscribe To Comments
    44Version: auto
    5 Description: This plugin allows you to subscribe to comments by email.
     5Description: This plugin allows to subscribe to comments by email.
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=587
    77Author: Mistic
     
    1313global $prefixeTable;
    1414
    15 define('SUBSCRIBE_TO_DIR' , basename(dirname(__FILE__)));
    16 define('SUBSCRIBE_TO_PATH' , PHPWG_PLUGINS_PATH . SUBSCRIBE_TO_DIR . '/');
     15define('SUBSCRIBE_TO_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
    1716define('SUBSCRIBE_TO_TABLE', $prefixeTable . 'subscribe_to_comments');
    1817
     
    2120function stc_init()
    2221{
     22  global $conf, $user;
     23 
     24  // no comments on luciano
     25  if ($user['theme'] == 'luciano') return;
     26 
     27  load_language('plugin.lang', SUBSCRIBE_TO_PATH);
     28  $conf['Subscribe_to_Comments'] = unserialize($conf['Subscribe_to_Comments']);
     29 
    2330  include_once(SUBSCRIBE_TO_PATH.'include/functions.inc.php');
    2431  include_once(SUBSCRIBE_TO_PATH.'include/subscribe_to_comments.inc.php');
    25 
    26   load_language('plugin.lang', SUBSCRIBE_TO_PATH);
    2732
    2833  // send mails
     
    3237  // subscribe
    3338  add_event_handler('loc_end_picture', 'stc_on_picture');
    34   add_event_handler('loc_begin_index', 'stc_on_album');
     39  add_event_handler('loc_begin_coa', 'stc_on_album');
    3540
    3641  // management
    3742  add_event_handler('loc_end_section_init', 'stc_detect_section');
    38   add_event_handler('loc_end_index', 'stc_load_section');
     43  add_event_handler('loc_begin_page_header', 'stc_load_section');
    3944
    4045  // profile link
    4146  add_event_handler('loc_begin_profile', 'stc_profile_link');
     47 
     48  // config page
     49  add_event_handler('get_admin_plugin_menu_links', 'stc_admin_menu');
     50}
     51
     52function stc_admin_menu($menu)
     53{
     54  array_push($menu, array(
     55    'NAME' => 'Subscribe to Comments',
     56    'URL' => get_root_url().'admin.php?page=plugin-' . basename(dirname(__FILE__))
     57  ));
     58  return $menu;
    4259}
    4360?>
Note: See TracChangeset for help on using the changeset viewer.