@@ -451,35 +451,37 @@ public function base($image_id, $page = 0)
451451
452452 $ this ->load_users_data ();
453453
454- $ this ->users_data_array [$ this ->data ['image_user_id ' ]]['username ' ] = ($ this ->data ['image_username ' ]) ? $ this ->data ['image_username ' ] : $ this ->language ->lang ('GUEST ' );
454+ $ user_id = $ this ->data ['image_user_id ' ];
455+ $ this ->users_data_array [$ user_id ]['username ' ] = ($ this ->data ['image_username ' ]) ? $ this ->data ['image_username ' ] : $ this ->language ->lang ('GUEST ' );
456+ $ user_data = $ this ->users_data_array [$ user_id ] ?? [];
455457 $ this ->template ->assign_vars (array (
456- 'POSTER_FULL ' => get_username_string ('full ' , $ this -> data [ ' image_user_id ' ] , $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' username ' ] , $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' user_colour ' ] ),
457- 'POSTER_COLOUR ' => get_username_string ('colour ' , $ this -> data [ ' image_user_id ' ] , $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' username ' ] , $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' user_colour ' ] ),
458- 'POSTER_USERNAME ' => get_username_string ('username ' , $ this -> data [ ' image_user_id ' ] , $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' username ' ] , $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' user_colour ' ] ),
459- 'U_POSTER ' => get_username_string ('profile ' , $ this -> data [ ' image_user_id ' ] , $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' username ' ] , $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' user_colour ' ] ),
460-
461- 'POSTER_SIGNATURE ' => $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' sig ' ] ,
462- 'POSTER_RANK_TITLE ' => $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' rank_title ' ] ,
463- 'POSTER_RANK_IMG ' => $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' rank_image ' ] ,
464- 'POSTER_RANK_IMG_SRC ' => $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' rank_image_src ' ] ,
465- 'POSTER_JOINED ' => $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' joined ' ] ,
466- 'POSTER_POSTS ' => $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' posts ' ],
467- 'POSTER_AVATAR ' => $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' avatar ' ] ,
468- 'POSTER_WARNINGS ' => $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' warnings ' ],
469- 'POSTER_AGE ' => $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' age ' ] ,
470-
471- 'POSTER_ONLINE_IMG ' => ($ this -> data [ ' image_user_id ' ] == ANONYMOUS || !$ this ->config ['load_onlinetrack ' ]) ? '' : (($ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' online ' ]) ? $ this ->user ->img ('icon_user_online ' , 'ONLINE ' ) : $ this ->user ->img ('icon_user_offline ' , 'OFFLINE ' )),
472- 'S_POSTER_ONLINE ' => ($ this -> data [ ' image_user_id ' ] == ANONYMOUS || !$ this ->config ['load_onlinetrack ' ]) ? false : (($ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' online ' ]) ? true : false ),
473-
474- //'U_POSTER_PROFILE' => $this->users_data_array[$this->data['image_user_id']]['profile'] ,
475- 'U_POSTER_SEARCH ' => $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' search ' ] ,
476- 'U_POSTER_PM ' => ($ this -> data [ ' image_user_id ' ] != ANONYMOUS && $ this ->config ['allow_privmsg ' ] && $ this ->auth ->acl_get ('u_sendpm ' ) && ($ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' allow_pm ' ] || $ this ->auth ->acl_gets ('a_ ' , 'm_ ' ))) ? append_sid ('./ucp.php ' , 'i=pm&mode=compose&u= ' . $ this -> data [ ' image_user_id ' ] ) : '' ,
477- 'U_POSTER_EMAIL ' => ($ this ->auth ->acl_gets ('a_ ' ) || !$ this ->config ['board_hide_emails ' ]) ? $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' email ' ] : false ,
478- 'U_POSTER_JABBER ' => $ this -> users_data_array [ $ this -> data [ ' image_user_id ' ]][ ' jabber ' ] ,
479-
480- //'U_POSTER_GALLERY' => $this->users_data_array[$this->data['image_user_id']]['gallery_album'] ,
481- //'POSTER_GALLERY_IMAGES' => $this->users_data_array[$this->data['image_user_id']]['gallery_images'] ,
482- //'U_POSTER_GALLERY_SEARCH' => $this->users_data_array[$this->data['image_user_id']]['gallery_search'] ,
458+ 'POSTER_FULL ' => get_username_string ('full ' , $ user_id , $ user_data [ ' username ' ] ?? '' , $ user_data [ ' user_colour ' ] ?? '' ),
459+ 'POSTER_COLOUR ' => get_username_string ('colour ' , $ user_id , $ user_data [ ' username ' ] ?? '' , $ user_data [ ' user_colour ' ] ?? '' ),
460+ 'POSTER_USERNAME ' => get_username_string ('username ' , $ user_id , $ user_data [ ' username ' ] ?? '' , $ user_data [ ' user_colour ' ] ?? '' ),
461+ 'U_POSTER ' => get_username_string ('profile ' , $ user_id , $ user_data [ ' username ' ] ?? '' , $ user_data [ ' user_colour ' ] ?? '' ),
462+
463+ 'POSTER_SIGNATURE ' => $ user_data [ ' sig ' ] ?? '' ,
464+ 'POSTER_RANK_TITLE ' => $ user_data [ ' rank_title ' ] ?? '' ,
465+ 'POSTER_RANK_IMG ' => $ user_data [ ' rank_image ' ] ?? '' ,
466+ 'POSTER_RANK_IMG_SRC ' => $ user_data [ ' rank_image_src ' ] ?? '' ,
467+ 'POSTER_JOINED ' => $ user_data [ ' joined ' ] ?? '' ,
468+ 'POSTER_POSTS ' => $ user_data [ ' posts ' ] ?? 0 ,
469+ 'POSTER_AVATAR ' => $ user_data [ ' avatar ' ] ?? '' ,
470+ 'POSTER_WARNINGS ' => $ user_data [ ' warnings ' ] ?? 0 ,
471+ 'POSTER_AGE ' => $ user_data [ ' age ' ] ?? '' ,
472+
473+ 'POSTER_ONLINE_IMG ' => ($ user_id == ANONYMOUS || !$ this ->config ['load_onlinetrack ' ]) ? '' : (($ user_data [ ' online ' ] ?? false ) ? $ this ->user ->img ('icon_user_online ' , 'ONLINE ' ) : $ this ->user ->img ('icon_user_offline ' , 'OFFLINE ' )),
474+ 'S_POSTER_ONLINE ' => ($ user_id == ANONYMOUS || !$ this ->config ['load_onlinetrack ' ]) ? false : (($ user_data [ ' online ' ] ?? false ) ? true : false ),
475+
476+ //'U_POSTER_PROFILE' => $user_data['profile'] ?? '' ,
477+ 'U_POSTER_SEARCH ' => $ user_data [ ' search ' ] ?? '' ,
478+ 'U_POSTER_PM ' => ($ user_id != ANONYMOUS && $ this ->config ['allow_privmsg ' ] && $ this ->auth ->acl_get ('u_sendpm ' ) && (( $ user_data [ ' allow_pm ' ] ?? false ) || $ this ->auth ->acl_gets ('a_ ' , 'm_ ' ))) ? append_sid ('./ucp.php ' , 'i=pm&mode=compose&u= ' . $ user_id ) : '' ,
479+ 'U_POSTER_EMAIL ' => ($ this ->auth ->acl_gets ('a_ ' ) || !$ this ->config ['board_hide_emails ' ]) ? ( $ user_data [ ' email ' ] ?? false ) : false ,
480+ 'U_POSTER_JABBER ' => $ user_data [ ' jabber ' ] ?? '' ,
481+
482+ //'U_POSTER_GALLERY' => $user_data['gallery_album'] ?? '' ,
483+ //'POSTER_GALLERY_IMAGES' => $user_data['gallery_images'] ?? '' ,
484+ //'U_POSTER_GALLERY_SEARCH' => $user_data['gallery_search'] ?? '' ,
483485 ));
484486
485487 // Add ratings
@@ -1262,7 +1264,11 @@ protected function load_users_data()
12621264 unset($ profile_fields_tmp );
12631265
12641266 // Get the list of users who can receive private messages
1265- $ this ->can_receive_pm_list = $ this ->auth ->acl_get_list (array_keys ($ this ->users_data_array ), 'u_readpm ' );
1267+ $ this ->can_receive_pm_list = [];
1268+ if (is_array ($ this ->users_data_array ))
1269+ {
1270+ $ this ->can_receive_pm_list = $ this ->auth ->acl_get_list (array_keys ($ this ->users_data_array ), 'u_readpm ' );
1271+ }
12661272 $ this ->can_receive_pm_list = (empty ($ this ->can_receive_pm_list ) || !isset ($ this ->can_receive_pm_list [0 ]['u_readpm ' ])) ? array () : $ this ->can_receive_pm_list [0 ]['u_readpm ' ];
12671273
12681274 }
0 commit comments