From f9eb5648430624cb0f4e143aee3358ccc8146f4e Mon Sep 17 00:00:00 2001 From: steven-danz Date: Mon, 8 Aug 2005 06:50:34 +0200 Subject: subscribe_changes.patch Updates to the subscription patch to add a configuration option to enable/disable the feature, move the messages to the language files, and general cleanup darcs-hash:20050808045034-4c315-88a72dc8d2b22fdd9af8caa0505ef5c737965c86.gz --- inc/template.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index 9f39b6b79..3937d99d2 100644 --- a/inc/template.php +++ b/inc/template.php @@ -118,12 +118,6 @@ function tpl_content(){ case 'admin': tpl_admin(); break; - case 'track': - html_track(); - break; - case 'ignore': - html_ignore(); - break; default: msg("Failed to handle command: ".hsc($ACT),-1); } @@ -342,7 +336,7 @@ function tpl_button($type){ print html_backtomedia_button(array('ns' => $NS),'b'); break; case 'subscription': - if($conf['useacl'] && $ACT == 'show'){ + if($conf['useacl'] && $ACT == 'show' && $conf['subscribers'] == 1){ if($_SERVER['REMOTE_USER']){ if($INFO['subscribed']){ print html_btn('unsubscribe',$ID,'',array('do' => 'unsubscribe',)); @@ -438,13 +432,13 @@ function tpl_actionlink($type,$pre='',$suf=''){ if($INFO['perm'] == AUTH_ADMIN) tpl_link(wl($ID,'do=admin'),$pre.$lang['btn_admin'].$suf,'class="action"'); break; - case 'track': - if($conf['useacl'] && $ACT == 'show'){ + case 'subscribe': + if($conf['useacl'] && $ACT == 'show' && $conf['subscribers'] == 1){ if($_SERVER['REMOTE_USER']){ - if(tracking($ID,$_SERVER['REMOTE_USER'])){ - tpl_link(wl($ID,'do=ignore'),$pre.$lang['btn_ignore'].$suf,'class="action"'); + if($info['subscribed']) { + tpl_link(wl($ID,'do=unsubscribe'),$pre.$lang['btn_unsubscribe'].$suf,'class="action"'); } else { - tpl_link(wl($ID,'do=track'),$pre.$lang['btn_track'].$suf,'class="action"'); + tpl_link(wl($ID,'do=subscribe'),$pre.$lang['btn_subscribe'].$suf,'class="action"'); } } } -- cgit v1.2.3