Changeset 6439 for extensions/NBM_Subscriber/main.inc.php
- Timestamp:
- Jun 1, 2010, 10:54:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBM_Subscriber/main.inc.php
r6436 r6439 1 1 <?php 2 2 /* 3 Plugin Name: NBM _Subscribe4 Version: 1.0. a5 Description: Permet tre aux visiteurs inscrits de s'inscrire eux-même à la notification par mail (NBM) - To allow the registered users to subscribe themselfto the notification by mail (NBM)6 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=3 Plugin Name: NBM Subscriber 4 Version: 1.0.0 5 Description: Permet aux visiteurs inscrits de gérer eux-même leur abonnement à la notification par mail (NBM) - Allows registered visitors to manage their own subscription to the notification by mail (NBM) 6 Plugin URI: 7 7 Author: Eric 8 8 Author URI: http://www.infernoweb.net … … 40 40 41 41 42 /* Adding NBMS in profile page */ 43 //add_event_handler('loc_begin_profile', 'NBMS_Profile'); 42 /* Saving from profile with added data */ 44 43 add_event_handler('save_profile_from_post', 'NBMS_Save_Profile'); 45 44 46 45 function NBMS_Save_Profile() 47 46 { 48 global $conf ;47 global $conf, $user; 49 48 50 49 if (!empty($_POST['NBM_Subscription']) && in_array( $_POST['NBM_Subscription'], array('true', 'false'))) 51 { 52 $fo=fopen (NBMS_PATH.'log.txt','a') ; 53 fwrite($fo,"======================\n") ; 54 fwrite($fo,'le ' . date('D, d M Y H:i:s') . "\r\n"); 55 fwrite($fo,$to . "\n" . $_POST['NBM_Subscription'] . "\r\n") ; 56 fclose($fo) ; 57 58 $query = ' 50 { 51 $query = ' 59 52 UPDATE '.USER_MAIL_NOTIFICATION_TABLE.' 60 53 SET enabled = \''.$_POST['NBM_Subscription'].'\' 61 54 WHERE user_id = \''.$user['id'].'\';'; 62 55 63 pwg_query($query); 64 } 65 /*if (isset($_POST['NBM_Subscription']) and $_POST['NBM_Subscription'] == 'true') 66 { 67 $query = ' 68 UPDATE '.USER_MAIL_NOTIFICATION_TABLE.' 69 SET enabled = \'true\' 70 WHERE user_id = \''.$user['id'].'\';'; 71 72 pwg_query($query); 56 pwg_query($query); 73 57 } 74 elseif (isset($_POST['NBM_Subscription']) and $_POST['NBM_Subscription'] == 'false')75 {76 $query = '77 UPDATE '.USER_MAIL_NOTIFICATION_TABLE.'78 SET enabled = \'false\'79 WHERE user_id = \''.$user['id'].'\';';80 81 pwg_query($query);82 }*/83 58 } 84 59 60 /* Adding NBMS in profile page */ 85 61 add_event_handler('load_profile_in_template', 'NBMS_Load_Profile'); 86 62 … … 112 88 } 113 89 90 /* Original template modification */ 114 91 function NBMS_prefilter($content, &$smarty) 115 92 { … … 122 99 $addon = '{if $ALLOW_USER_CUSTOMIZATION} 123 100 <fieldset> 124 <legend>{\'NBMS_ Title\'|@translate}</legend>101 <legend>{\'NBMS_Section\'|@translate}</legend> 125 102 <ul> 126 103 <li> 127 <span class="property">{\'NBMS\'|@translate}</span> 128 <span class="property">{$TEST}</span> 104 <span class="property">{\'NBMS_Text\'|@translate}</span> 129 105 {html_radios name=\'NBM_Subscription\' options=$radio_options selected=$NBMS} 130 106 </li> … … 137 113 return str_replace($search, $replacement, $content);; 138 114 } 139 140 115 ?>
Note: See TracChangeset
for help on using the changeset viewer.