Ignore:
Timestamp:
Mar 7, 2013, 10:06:42 PM (11 years ago)
Author:
mistic100
Message:

too many changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/Subscribe_to_comments/include/subscribe_to_comments.inc.php

    r17350 r21340  
    77function stc_detect_section()
    88{
    9   global $tokens, $page;
     9  global $tokens, $page, $conf;
    1010 
    1111  if ($tokens[0] == 'subscriptions')
    1212  {
     13    add_event_handler('loc_begin_page_header', 'stc_page_header');
     14   
    1315    $page['section'] = 'subscriptions';
    1416    $page['title'] = l10n('Comments notifications');
    15   }
     17    $page['section_title'] = '<a href="'.get_absolute_root_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].l10n('Comments notifications');
     18  }
     19}
     20
     21function stc_page_header()
     22{
     23  global $page;
     24  $page['body_id'] = 'theSubscriptionsPage';
    1625}
    1726
     
    4958        {
    5059          case 'all-images':
    51             subscribe_to_comments(@$_POST['stc_mail'], 'all-images');
     60            subscribe_to_comments(@$_POST['email'], 'all-images');
    5261            break;
    5362          case 'album-images':
    5463            if (empty($page['category']['id'])) break;
    55             subscribe_to_comments(@$_POST['stc_mail'], 'album-images', $page['category']['id']);
     64            subscribe_to_comments(@$_POST['email'], 'album-images', $page['category']['id']);
    5665            break;
    5766          case 'image':
    58             subscribe_to_comments(@$_POST['stc_mail'], 'image', $comm['image_id']);
     67            subscribe_to_comments(@$_POST['email'], 'image', $comm['image_id']);
    5968            break;
    6069        }
     
    6574        {
    6675          case 'all-albums':
    67             subscribe_to_comments(@$_POST['stc_mail'], 'all-albums');
     76            subscribe_to_comments(@$_POST['email'], 'all-albums');
    6877            break;
    6978          case 'album':
    70             subscribe_to_comments(@$_POST['stc_mail'], 'album', $comm['category_id']);
     79            subscribe_to_comments(@$_POST['email'], 'album', $comm['category_id']);
    7180            break;
    7281        }
     
    7685    {
    7786      $template->assign('STC_MODE', $_POST['stc_mode']);
    78       $template->assign('STC_MAIL', @$_POST['stc_mail']);
    7987    }
    8088  }
     
    239247  }
    240248 
    241   $template->assign('STC_ON_PICTURE', true);
    242   if ( !empty($page['category']['id']) ) $template->assign('STC_ALLOW_ALBUM_IMAGES', true);
    243   if ( $conf['Subscribe_to_Comments']['allow_global_subscriptions'] or is_admin() ) $template->assign('STC_ALLOW_GLOBAL', true);
     249  $template->assign(array(
     250    'STC_ON_PICTURE' => true,
     251    'STC_ALLOW_ALBUM_IMAGES' => !empty($page['category']['id']),
     252    'STC_ALLOW_GLOBAL' => $conf['Subscribe_to_Comments']['allow_global_subscriptions'] || is_admin(),
     253    'SUBSCRIBE_TO_PATH' => SUBSCRIBE_TO_PATH,
     254    ));
    244255 
    245256  $template->set_prefilter('picture', 'stc_main_prefilter');
     
    263274  }
    264275 
     276        // standalone subscription
    265277  if (isset($_POST['stc_submit']))
    266278  {
     
    346358  }
    347359 
    348   $template->assign('STC_ON_ALBUM', true);
    349   if ( $conf['Subscribe_to_Comments']['allow_global_subscriptions'] or is_admin() ) $template->assign('STC_ALLOW_GLOBAL', true);
     360  $template->assign(array(
     361    'STC_ON_ALBUM' => true,
     362    'STC_ALLOW_GLOBAL' => $conf['Subscribe_to_Comments']['allow_global_subscriptions'] || is_admin(),
     363    'SUBSCRIBE_TO_PATH' => SUBSCRIBE_TO_PATH,
     364    ));
    350365
    351366  $template->set_prefilter('comments_on_albums', 'stc_main_prefilter');
Note: See TracChangeset for help on using the changeset viewer.