Changeset 6312 for branches/2.1/include
- Timestamp:
- May 24, 2010, 1:31:58 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.1/include/functions_user.inc.php
r6311 r6312 268 268 $userdata = array(); 269 269 270 // retrieve basic user data 270 271 $query = ' 271 272 SELECT '; … … 290 291 $row = pwg_db_fetch_assoc(pwg_query($query)); 291 292 292 while (true) 293 { 294 $query = ' 295 SELECT ui.*, uc.*, t.name AS theme_name 293 // retrieve additional user data 294 $query = ' 295 SELECT 296 COUNT(1) AS counter, 297 ui.*, 298 uc.*, 299 t.name AS theme_name 296 300 FROM '.USER_INFOS_TABLE.' AS ui 297 301 LEFT JOIN '.USER_CACHE_TABLE.' AS uc ON ui.user_id = uc.user_id 298 302 LEFT JOIN '.THEMES_TABLE.' AS t ON t.id = ui.theme 299 WHERE ui.user_id = \''.$user_id.'\''; 303 WHERE ui.user_id = \''.$user_id.'\' 304 ;'; 305 $result = pwg_query($query); 306 $user_infos_row = pwg_db_fetch_assoc($result); 307 if (0 == $user_infos_row['counter']) { 308 create_user_infos($user_id); 309 300 310 $result = pwg_query($query); 301 if ($result) 302 { 303 break; 304 } 305 else 306 { 307 create_user_infos($user_id); 308 } 309 } 310 311 $row = array_merge($row, pwg_db_fetch_assoc($result)); 311 $user_infos_row = pwg_db_fetch_assoc($result); 312 } 313 314 // then merge basic + additional user data 315 $row = array_merge($row, $user_infos_row); 312 316 313 317 foreach ($row as $key => $value)
Note: See TracChangeset
for help on using the changeset viewer.