Changeset 1036
- Timestamp:
- 04/18/09 09:51:05 (14 years ago)
- Location:
- plugins/notifications
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/notifications/_define.php
r1024 r1036 18 18 /* Author */ 'Tomtom (http://blog.zenstyle.fr/)', 19 19 /* Version */ '0.3.2', 20 /* Permissions */ ' admin',20 /* Permissions */ 'usage', 21 21 null, 22 22 /* Priority */ 10000 -
plugins/notifications/_prepend.php
r1011 r1036 30 30 31 31 $core->addBehavior('adminDashboardHeaders',array('notificationsBehaviors','headers')); 32 $core->addBehavior('adminDashboardItems',array('notificationsBehaviors','update'));32 //$core->addBehavior('adminDashboardItems',array('notificationsBehaviors','update')); 33 33 34 34 $core->rest->addFunction('getNotifications',array('notificationsRestMethods','getNotifications')); -
plugins/notifications/_services.php
r1024 r1036 47 47 } 48 48 49 notificationsBehaviors::update($core );49 notificationsBehaviors::update($core,(!$rs->isEmpty() ? strtotime($rs->notification_dt) : '')); 50 50 51 51 return $rsp; -
plugins/notifications/inc/class.notifications.behaviors.php
r1024 r1036 135 135 } 136 136 137 public static function update(&$core )137 public static function update(&$core,$ref = '') 138 138 { 139 $strReq = 'SELECT MAX(log_id) FROM '.$core->prefix.'log';139 $strReq = 'SELECT MAX(log_id) as max FROM '.$core->prefix.'log'; 140 140 141 141 $id = $core->con->select($strReq)->f(0) + 1; 142 142 143 $cur = $core->con->openCursor($core->prefix.'log'); 144 $cur->log_id = $id; 145 $cur->user_id = $core->auth->userID(); 146 $cur->log_table = $core->prefix.'notifications'; 147 $cur->log_dt = date('Y-m-d H:i:s',time() + dt::getTimeOffset($core->blog->settings->blog_timezone)); 148 $cur->log_ip = http::realIP(); 149 $cur->log_msg = __('Last visit on administration interface'); 150 $cur->insert(); 143 $strReq = 144 'SELECT log_id, log_dt FROM '.$core->prefix."log WHERE user_id = '". 145 $core->auth->userID()."' GROUP BY log_id"; 146 147 $rs = $core->con->select($strReq); 148 149 if (empty($ref)) { 150 $ref = $rs->isEmpty() ? time() + dt::getTimeOffset($core->blog->settings->blog_timezone) : strtotime($rs->log_dt); 151 } 152 153 $cur = $core->con->openCursor($core->prefix.'log'); 154 $cur->log_id = $rs->isEmpty() ? $id : $rs->log_id; 155 $cur->user_id = $core->auth->userID(); 156 $cur->log_table = $core->prefix.'notifications'; 157 $cur->log_dt = date('Y-m-d H:i:s',$ref); 158 $cur->log_ip = http::realIP(); 159 $cur->log_msg = __('Last visit on administration interface'); 160 161 if ($rs->isEmpty()) { 162 $cur->insert(); 163 } 164 elseif ($rs->log_dt != $ref) { 165 $cur->update("WHERE user_id = '".$core->auth->userID()."'"); 166 } 151 167 } 152 168 }
Note: See TracChangeset
for help on using the changeset viewer.