Exemple #1
0
// Generate page
//
$profile_user_id = $profiledata['user_id'] == $userdata['user_id'];
$signature = $bb_cfg['allow_sig'] && $profiledata['user_sig'] ? $profiledata['user_sig'] : '';
if (bf($profiledata['user_opt'], 'user_opt', 'dis_sig')) {
    if ($profile_user_id) {
        $signature = $lang['SIGNATURE_DISABLE'];
    } else {
        $signature = '';
    }
} else {
    if ($signature) {
        $signature = bbcode2html($signature);
    }
}
$template->assign_vars(array('PAGE_TITLE' => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']), 'USERNAME' => $profiledata['username'], 'PROFILE_USER_ID' => $profiledata['user_id'], 'PROFILE_USER' => $profile_user_id, 'USER_REGDATE' => bb_date($profiledata['user_regdate'], 'Y-m-d H:i', false), 'POSTER_RANK' => $poster_rank ? "<span class=\"{$rank_style}\">" . $poster_rank . "</span>" : $lang['USER'], 'RANK_IMAGE' => $rank_image, 'RANK_SELECT' => $rank_select, 'POSTS' => $profiledata['user_posts'], 'PM' => '<a href="' . PM_URL . '?mode=post&amp;' . POST_USERS_URL . '=' . $profiledata['user_id'] . '">' . $lang['SEND_PRIVATE_MESSAGE'] . '</a>', 'EMAIL' => $email, 'WWW' => $profiledata['user_website'], 'ICQ' => $profiledata['user_icq'], 'LAST_VISIT_TIME' => $profiledata['user_lastvisit'] ? bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_lastvisit'], 'Y-m-d H:i', false) : $lang['NEVER'], 'LAST_ACTIVITY_TIME' => $profiledata['user_session_time'] ? bf($profiledata['user_opt'], 'user_opt', 'user_viewonline') && !IS_ADMIN ? $lang['HIDDEN_USER'] : bb_date($profiledata['user_session_time'], 'Y-m-d H:i', false) : $lang['NEVER'], 'USER_ACTIVE' => $profiledata['user_active'], 'LOCATION' => $profiledata['user_from'], 'OCCUPATION' => $profiledata['user_occ'], 'INTERESTS' => $profiledata['user_interests'], 'SKYPE' => $profiledata['user_skype'], 'TWITTER' => $profiledata['user_twitter'], 'USER_POINTS' => $profiledata['user_points'], 'GENDER' => $bb_cfg['gender'] ? $lang['GENDER_SELECT'][$profiledata['user_gender']] : '', 'BIRTHDAY' => $bb_cfg['birthday_enabled'] && $profiledata['user_birthday'] != '0000-00-00' ? $profiledata['user_birthday'] : '', 'AGE' => $bb_cfg['birthday_enabled'] && $profiledata['user_birthday'] != '0000-00-00' ? birthday_age($profiledata['user_birthday']) : '', 'L_VIEWING_PROFILE' => sprintf($lang['VIEWING_USER_PROFILE'], $profiledata['username']), 'L_MY_PROFILE' => sprintf($lang['VIEWING_MY_PROFILE'], 'profile.php?mode=editprofile'), 'U_SEARCH_USER' => "search.php?search_author=1&amp;uid={$profiledata['user_id']}", 'U_SEARCH_TOPICS' => "search.php?uid={$profiledata['user_id']}&amp;myt=1", 'U_SEARCH_RELEASES' => "tracker.php?rid={$profiledata['user_id']}#results", 'AVATAR_IMG' => get_avatar($profiledata['user_id'], $profiledata['avatar_ext_id'], !bf($profiledata['user_opt'], 'user_opt', 'dis_avatar')), 'SIGNATURE' => $signature, 'SHOW_PASSKEY' => IS_ADMIN || $profile_user_id, 'SHOW_ROLE' => IS_AM || $profile_user_id || $profiledata['user_active'], 'GROUP_MEMBERSHIP' => false, 'TRAF_STATS' => !(IS_AM || $profile_user_id)));
if (IS_ADMIN) {
    $group_membership = array();
    $sql = "\n\t\tSELECT COUNT(g.group_id) AS groups_cnt, g.group_single_user, ug.user_pending\n\t\tFROM " . BB_USER_GROUP . " ug\n\t\tLEFT JOIN " . BB_GROUPS . " g USING(group_id)\n\t\tWHERE ug.user_id = {$profiledata['user_id']}\n\t\tGROUP BY ug.user_id, g.group_single_user, ug.user_pending\n\t\tORDER BY NULL\n\t";
    if ($rowset = DB()->fetch_rowset($sql)) {
        $member = $pending = $single = 0;
        foreach ($rowset as $row) {
            if (!$row['group_single_user'] && !$row['user_pending']) {
                $member = $row['groups_cnt'];
            } else {
                if (!$row['group_single_user'] && $row['user_pending']) {
                    $pending = $row['groups_cnt'];
                } else {
                    if ($row['group_single_user']) {
                        $single = $row['groups_cnt'];
                    }
Exemple #2
0
     $datastore->enqueue(array('stats'));
     if ($stats['birthday_week_list']) {
         foreach ($stats['birthday_week_list'] as $week) {
             $html[] = profile_url($week) . ' <span class="small">(' . birthday_age($week['user_birthday']) . ')</span>';
         }
         $html = sprintf($lang['BIRTHDAY_WEEK'], $bb_cfg['birthday_check_day'], join(', ', $html));
     } else {
         $html = sprintf($lang['NOBIRTHDAY_WEEK'], $bb_cfg['birthday_check_day']);
     }
     break;
 case 'birthday_today':
     $stats = $datastore->get('stats');
     $datastore->enqueue(array('stats'));
     if ($stats['birthday_today_list']) {
         foreach ($stats['birthday_today_list'] as $today) {
             $html[] = profile_url($today) . ' <span class="small">(' . birthday_age($today['user_birthday']) . ')</span>';
         }
         $html = $lang['BIRTHDAY_TODAY'] . join(', ', $html);
     } else {
         $html = $lang['NOBIRTHDAY_TODAY'];
     }
     break;
 case 'get_forum_mods':
     $forum_id = (int) $this->request['forum_id'];
     $datastore->enqueue(array('moderators'));
     $moderators = array();
     $mod = $datastore->get('moderators');
     if (isset($mod['mod_users'][$forum_id])) {
         foreach ($mod['mod_users'][$forum_id] as $user_id) {
             $moderators[] = '<a href="' . PROFILE_URL . $user_id . '">' . $mod['name_users'][$user_id] . '</a>';
         }