); get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']); // BEGIN PBWoW 2 MOD $user_cache[$poster_id] += array( 'avatar_src' => '', 'posts_rank_title' => '', 'posts_rank_image' => '', 'posts_rank_image_src' => '', 'user_special_styling' => '', 'user_special_color' => '', ); get_user_rank(0, $row['user_posts'], $user_cache[$poster_id]['posts_rank_title'], $user_cache[$poster_id]['posts_rank_image'], $user_cache[$poster_id]['posts_rank_image_src']); check_rank_special_styling($row['user_rank'], $user_cache[$poster_id]['user_special_styling'], $user_cache[$poster_id]['user_special_color']); $user_cache[$poster_id]['avatar_src'] = ($user->optionget('viewavatars')) ? get_user_avatar_src($row['user_avatar'], $row['user_avatar_type']) : ''; // END PBWoW 2 MOD if ((!empty($row['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_email')) { $user_cache[$poster_id]['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&u=$poster_id") : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $row['user_email']); } else { $user_cache[$poster_id]['email'] = ''; } if (!empty($row['user_icq'])) { $user_cache[$poster_id]['icq'] = 'http://www.icq.com/people/' . urlencode($row['user_icq']) . '/';
/** * Prepare profile data */ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false) { global $config, $auth, $template, $user, $phpEx, $phpbb_root_path; $username = $data['username']; $user_id = $data['user_id']; $rank_title = $rank_img = $rank_img_src = ''; get_user_rank($data['user_rank'], (($user_id == ANONYMOUS) ? false : $data['user_posts']), $rank_title, $rank_img, $rank_img_src); if ((!empty($data['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_user')) { $email = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&u=' . $user_id) : (($config['board_hide_emails'] && !$auth->acl_get('a_user')) ? '' : 'mailto:' . $data['user_email']); } else { $email = ''; } if ($config['load_onlinetrack']) { $update_time = $config['load_online_time'] * 60; $online = (time() - $update_time < $data['session_time'] && ((isset($data['session_viewonline']) && $data['session_viewonline']) || $auth->acl_get('u_viewonline'))) ? true : false; } else { $online = false; } if ($data['user_allow_viewonline'] || $auth->acl_get('u_viewonline')) { $last_visit = (!empty($data['session_time'])) ? $data['session_time'] : $data['user_lastvisit']; } else { $last_visit = ''; } $age = ''; if ($config['allow_birthdays'] && $data['user_birthday']) { list($bday_day, $bday_month, $bday_year) = array_map('intval', explode('-', $data['user_birthday'])); if ($bday_year) { $now = phpbb_gmgetdate(time() + $user->timezone + $user->dst); $diff = $now['mon'] - $bday_month; if ($diff == 0) { $diff = ($now['mday'] - $bday_day < 0) ? 1 : 0; } else { $diff = ($diff < 0) ? 1 : 0; } $age = max(0, (int) ($now['year'] - $bday_year - $diff)); } } // BEGIN PBWoW 2 MOD $posts_rank_title = $posts_rank_image = $posts_rank_image_src = $user_special_styling = $user_special_color = ''; get_user_rank(0, (($user_id == ANONYMOUS) ? false : $data['user_posts']), $posts_rank_title, $posts_rank_image, $posts_rank_image_src); check_rank_special_styling($data['user_rank'], $user_special_styling, $user_special_color); $avatar_src = get_user_avatar_src($data['user_avatar'], $data['user_avatar_type']); $template->assign_vars(array( 'AVATAR_SRC' => $avatar_src, 'POSTS_RANK_TITLE' => $posts_rank_title, 'POSTS_RANK_IMG' => $posts_rank_image, 'POSTS_RANK_IMG_SRC' => $posts_rank_image_src, 'USER_SPECIAL_STYLING' => $user_special_styling, 'USER_SPECIAL_COLOR' => $user_special_color, )); // END PBWoW 2 MOD // Dump it out to the template return array( 'AGE' => $age, 'RANK_TITLE' => $rank_title, 'JOINED' => $user->format_date($data['user_regdate']), 'VISITED' => (empty($last_visit)) ? ' - ' : $user->format_date($last_visit), 'POSTS' => ($data['user_posts']) ? $data['user_posts'] : 0, 'WARNINGS' => isset($data['user_warnings']) ? $data['user_warnings'] : 0, 'USERNAME_FULL' => get_username_string('full', $user_id, $username, $data['user_colour']), 'USERNAME' => get_username_string('username', $user_id, $username, $data['user_colour']), 'USER_COLOR' => get_username_string('colour', $user_id, $username, $data['user_colour']), 'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $data['user_colour']), 'A_USERNAME' => addslashes(get_username_string('username', $user_id, $username, $data['user_colour'])), 'AVATAR_IMG' => get_user_avatar($data['user_avatar'], $data['user_avatar_type'], $data['user_avatar_width'], $data['user_avatar_height']), 'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : (($online) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')), 'S_ONLINE' => ($config['load_onlinetrack'] && $online) ? true : false, 'RANK_IMG' => $rank_img, 'RANK_IMG_SRC' => $rank_img_src, 'ICQ_STATUS_IMG' => (!empty($data['user_icq'])) ? '<img src="http://web.icq.com/whitepages/online?icq=' . $data['user_icq'] . '&img=5" width="18" height="18" />' : '', 'S_JABBER_ENABLED' => ($config['jab_enable']) ? true : false, 'S_WARNINGS' => ($auth->acl_getf_global('m_') || $auth->acl_get('m_warn')) ? true : false, 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&sr=posts") : '', 'U_NOTES' => ($user_notes_enabled && $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $user_id, true, $user->session_id) : '', 'U_WARN' => ($warn_user_enabled && $auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $user_id, true, $user->session_id) : '', 'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($data['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose&u=' . $user_id) : '', 'U_EMAIL' => $email, 'U_WWW' => (!empty($data['user_website'])) ? $data['user_website'] : '', 'U_SHORT_WWW' => (!empty($data['user_website'])) ? ((strlen($data['user_website']) > 55) ? substr($data['user_website'], 0, 39) . ' ... ' . substr($data['user_website'], -10) : $data['user_website']) : '', 'U_ICQ' => ($data['user_icq']) ? 'http://www.icq.com/people/' . urlencode($data['user_icq']) . '/' : '', 'U_AIM' => ($data['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=aim&u=' . $user_id) : '', 'U_YIM' => ($data['user_yim']) ? 'http://edit.yahoo.com/config/send_webmesg?.target=' . urlencode($data['user_yim']) . '&.src=pg' : '', 'U_MSN' => ($data['user_msnm'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=msnm&u=' . $user_id) : '', 'U_JABBER' => ($data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=jabber&u=' . $user_id) : '', 'LOCATION' => ($data['user_from']) ? $data['user_from'] : '', 'USER_ICQ' => $data['user_icq'], 'USER_AIM' => $data['user_aim'], 'USER_YIM' => $data['user_yim'], 'USER_MSN' => $data['user_msnm'], 'USER_JABBER' => $data['user_jabber'], 'USER_JABBER_IMG' => ($data['user_jabber']) ? $user->img('icon_contact_jabber', $data['user_jabber']) : '', 'L_VIEWING_PROFILE' => sprintf($user->lang['VIEWING_PROFILE'], $username), ); }