Changeset 25459
- Timestamp:
- Nov 11, 2013, 6:30:39 PM (10 years ago)
- Location:
- trunk/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions.inc.php
r25427 r25459 599 599 if ($show_day_name) 600 600 { 601 $print.= $lang['day'][ $date->format('w') ] ;601 $print.= $lang['day'][ $date->format('w') ].' '; 602 602 } 603 603 604 $print.= ' '.$date->format('d');604 $print.= $date->format('j'); 605 605 $print.= ' '.$lang['month'][ $date->format('n') ]; 606 606 $print.= ' '.$date->format('Y'); -
trunk/include/ws_functions/pwg.users.php
r25281 r25459 85 85 'username','email','status','level','groups','language','theme', 86 86 'nb_image_page','recent_period','expand','show_nb_comments','show_nb_hits', 87 'enabled_high', 87 'enabled_high','registration_date','registration_date_string', 88 'registration_date_since', 'last_visit', 'last_visit_string', 89 'last_visit_since' 88 90 )); 89 91 } … … 106 108 $ui_fields = array( 107 109 'status','level','language','theme','nb_image_page','recent_period','expand', 108 'show_nb_comments','show_nb_hits','enabled_high', 110 'show_nb_comments','show_nb_hits','enabled_high','registration_date' 109 111 ); 110 112 foreach ($ui_fields as $field) … … 164 166 { 165 167 $users[ $row['user_id'] ]['groups'][] = $row['group_id']; 168 } 169 } 170 171 if (count($users) > 0 and in_array('registration_date_string', $params['display'])) 172 { 173 foreach ($users as $cur_user) 174 { 175 $users[ $cur_user['id'] ]['registration_date_string'] = format_date($cur_user['registration_date'], false, false); 176 } 177 } 178 179 if (count($users) > 0 and in_array('registration_date_since', $params['display'])) 180 { 181 foreach ($users as $cur_user) 182 { 183 $users[ $cur_user['id'] ]['registration_date_since'] = time_since($cur_user['registration_date'], 'month'); 184 } 185 } 186 187 if (count($users) > 0 and in_array('last_visit', $params['display'])) 188 { 189 $query = ' 190 SELECT 191 MAX(id) as history_id 192 FROM '.HISTORY_TABLE.' 193 WHERE user_id IN ('.implode(',', array_keys($users)).') 194 GROUP BY user_id 195 ;'; 196 $history_ids = array_from_query($query, 'history_id'); 197 198 if (count($history_ids) == 0) 199 { 200 $history_ids[] = -1; 201 } 202 203 $query = ' 204 SELECT 205 user_id, 206 date, 207 time 208 FROM '.HISTORY_TABLE.' 209 WHERE id IN ('.implode(',', $history_ids).') 210 ;'; 211 $result = pwg_query($query); 212 while ($row = pwg_db_fetch_assoc($result)) 213 { 214 $last_visit = $row['date'].' '.$row['time']; 215 $users[ $row['user_id'] ]['last_visit'] = $last_visit; 216 217 if (in_array('last_visit_string', $params['display'])) 218 { 219 $users[ $row['user_id'] ]['last_visit_string'] = format_date($last_visit, false, false); 220 } 221 222 if (in_array('last_visit_since', $params['display'])) 223 { 224 $users[ $row['user_id'] ]['last_visit_since'] = time_since($last_visit, 'day'); 225 } 166 226 } 167 227 }
Note: See TracChangeset
for help on using the changeset viewer.