Changeset 6825 for extensions/NBM_Subscriber
- Timestamp:
- Aug 31, 2010, 7:08:47 PM (14 years ago)
- Location:
- extensions/NBM_Subscriber
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBM_Subscriber/main.inc.php
r6750 r6825 2 2 /* 3 3 Plugin Name: NBM Subscriber 4 Version: 1.0. 14 Version: 1.0.2 5 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 6 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=397 … … 47 47 global $conf, $user; 48 48 49 if (!empty($_POST['NBM_Subscription']) && in_array( $_POST['NBM_Subscription'], array('true', 'false'))) 49 include_once(PHPWG_ROOT_PATH.'admin/include/functions_notification_by_mail.inc.php'); 50 51 $query = ' 52 SELECT * 53 FROM '.USER_MAIL_NOTIFICATION_TABLE.' 54 WHERE user_id = \''.$user['id'].'\' 55 '; 56 57 $count = pwg_db_num_rows(pwg_query($query)); 58 59 if ($count == 0) 60 { 61 $inserts = array(); 62 $check_key_list = array(); 63 64 // Calculate key 65 $nbm_user['check_key'] = find_available_check_key(); 66 67 // Save key 68 array_push($check_key_list, $nbm_user['check_key']); 69 70 // Insert new nbm_users 71 array_push 72 ( 73 $inserts, 74 array 75 ( 76 'user_id' => $user['id'], 77 'check_key' => $nbm_user['check_key'], 78 'enabled' => 'false' // By default if false, set to true with specific functions 79 ) 80 ); 81 82 mass_inserts(USER_MAIL_NOTIFICATION_TABLE, array('user_id', 'check_key', 'enabled'), $inserts); 83 } 84 elseif ($count != 0 and !empty($_POST['NBM_Subscription']) && in_array($_POST['NBM_Subscription'], array('true', 'false'))) 50 85 { 51 86 $query = '
Note: See TracChangeset
for help on using the changeset viewer.