Ejemplo n.º 1
0
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once './global.php';
// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################
if (STYLE_TYPE == 'mobile' and (!defined('VB_API') or VB_API !== true)) {
    exec_header_redirect('forum.php' . $vbulletin->session->vars['sessionurl_q']);
}
if ($_POST['do'] == 'loadactivitytab') {
    require_once DIR . '/includes/class_userprofile.php';
    require_once DIR . '/includes/class_profileblock.php';
    require_once DIR . '/includes/functions_user.php';
    $fetch_userinfo_options = FETCH_USERINFO_AVATAR | FETCH_USERINFO_LOCATION | FETCH_USERINFO_PROFILEPIC | FETCH_USERINFO_SIGPIC | FETCH_USERINFO_USERCSS | FETCH_USERINFO_ISFRIEND;
    $vbulletin->input->clean_array_gpc('p', array('userid' => TYPE_UINT));
    $userinfo = verify_id('user', $vbulletin->GPC['userid'], false, true, $fetch_userinfo_options);
    $profileobj = new vB_UserProfile($vbulletin, $userinfo);
    $blockfactory = new vB_ProfileBlockFactory($vbulletin, $profileobj);
    $profileblock =& $blockfactory->fetch('friends');
    $activity = new vB_ActivityStream_View_MembertabAjax($vbphrase, $profileblock->visitor_can_view('friends', $vbulletin->userinfo));
    $activity->process();
} else {
    $activity = new vB_ActivityStream_View_Home($vbphrase);
    $activity->process();
}
/*======================================================================*\
|| ####################################################################
|| # Downloaded: 03:13, Sat Sep 7th 2013
|| # CVS: $RCSfile$ - $Revision: 16016 $
|| ####################################################################
\*======================================================================*/
Ejemplo n.º 2
0
$profileobj->prepare_blogurl();
// Add birthday and age to the response VBIV-15751
if (defined('VB_API') and VB_API === true) {
    $profileobj->prepare_birthday();
}
$blockfactory = new vB_ProfileBlockFactory($vbulletin, $profileobj);
$prepared =& $profileobj->prepared;
$blocks = array();
$tabs = array();
$tablinks = array();
$blocklist = array('stats_mini' => array('class' => 'MiniStats', 'title' => $vbphrase['mini_statistics']), 'friends_mini' => array('class' => 'Friends', 'title' => $vbphrase['friends']), 'albums' => array('class' => 'Albums', 'title' => $vbphrase['albums']), 'visitors' => array('class' => 'RecentVisitors', 'title' => $vbphrase['recent_visitors'], 'options' => array('profilemaxvisitors' => $vbulletin->options['profilemaxvisitors'])), 'groups' => array('class' => 'Groups', 'title' => $vbphrase['group_memberships']), 'visitor_messaging' => array('class' => 'VisitorMessaging', 'title' => $vbphrase['visitor_messages_tab'], 'options' => array('pagenumber' => $vbulletin->GPC['pagenumber'], 'tab' => $vbulletin->GPC['tab'], 'vmid' => $vbulletin->GPC['vmid'], 'showignored' => $vbulletin->GPC['showignored'])), 'stats' => array('class' => 'Statistics', 'title' => $vbphrase['statistics']), 'aboutme' => array('class' => 'AboutMe', 'title' => $vbphrase['about_me'], 'options' => array('simple' => $vbulletin->GPC['simple'])), 'contactinfo' => array('class' => 'ContactInfo', 'title' => $vbphrase['contact_info']), 'friends' => array('class' => 'Friends', 'title' => $vbphrase['friends'], 'type' => 'tab', 'options' => array('fetchamount' => $vbulletin->options['friends_per_page'], 'membertemplate' => 'memberinfo_small', 'template_override' => 'memberinfo_block_friends', 'pagenumber' => $vbulletin->GPC['pagenumber'], 'tab' => $vbulletin->GPC['tab'], 'fetchorder' => 'asc')), 'infractions' => array('class' => 'Infractions', 'title' => $vbphrase['infractions'], 'options' => array('pagenumber' => $vbulletin->GPC['pagenumber'], 'tab' => $vbulletin->GPC['tab'])), 'profile_picture' => array('class' => 'ProfilePicture'), 'reputation' => array('wrap' => false, 'class' => 'Reputation', 'title' => $vbphrase['reputation'], 'options' => array('tab' => $vbulletin->GPC['tab'], 'comments' => $vbulletin->options['member_rep_comments'], 'showraters' => $permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseeownrep'])), 'activitystream' => array('class' => 'ActivityStream', 'title' => $userinfo['userid'] == $vbulletin->userinfo['userid'] ? $vbphrase['my_activity'] : construct_phrase($vbphrase['x_activity'], $userinfo['username']), 'options' => array('tab' => $vbulletin->GPC['tab'], 'type' => $vbulletin->GPC['type'], 'pagenumber' => $vbulletin->GPC['pagenumber'])));
if (!empty($vbulletin->GPC['tab']) and !empty($vbulletin->GPC['perpage']) and isset($blocklist["{$vbulletin->GPC['tab']}"])) {
    $blocklist["{$vbulletin->GPC['tab']}"]['options']['perpage'] = $vbulletin->GPC['perpage'];
}
$vbulletin->GPC['simple'] = $prepared['myprofile'] ? $vbulletin->GPC['simple'] : false;
$profileblock =& $blockfactory->fetch('ProfileFields');
$profileblock->build_field_data($vbulletin->GPC['simple']);
foreach ($profileblock->locations as $profilecategoryid => $location) {
    if ($location) {
        if (strpos($location, 'profile_tabs') !== false) {
            $wrap = false;
        } else {
            $wrap = true;
        }
        $blocklist["profile_cat{$profilecategoryid}"] = array('class' => 'ProfileFields', 'title' => $vbphrase["category{$profilecategoryid}_title"], 'options' => array('category' => $profilecategoryid, 'simple' => $vbulletin->GPC['simple']), 'hook_location' => $location, 'wrap' => $wrap);
    }
}
if ($vbulletin->userinfo['options'] & $vbulletin->bf_misc_useroptions['showusercss']) {
    $show['showusercss'] = 1;
    $usercss_switch_phrase = $vbphrase['hide_user_customizations'];
} else {
Ejemplo n.º 3
0
function do_get_profile()
{
    global $vbulletin, $db, $show, $vbphrase, $permissions, $imodcache;
    $vbulletin->input->clean_array_gpc('r', array('userid' => TYPE_UINT));
    if (!$vbulletin->userinfo['userid'] && !$vbulletin->GPC['userid']) {
        json_error(ERR_INVALID_LOGGEDIN, RV_NOT_LOGGED_IN);
    }
    if (!($permissions['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview']) or !($permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canviewmembers'])) {
        json_error(ERR_NO_PERMISSION);
    }
    if (!$vbulletin->GPC['userid']) {
        $vbulletin->GPC['userid'] = $vbulletin->userinfo['userid'];
    }
    $fetch_userinfo_options = FETCH_USERINFO_AVATAR | FETCH_USERINFO_LOCATION | FETCH_USERINFO_PROFILEPIC | FETCH_USERINFO_SIGPIC | FETCH_USERINFO_USERCSS | FETCH_USERINFO_ISFRIEND;
    $userinfo = verify_id('user', $vbulletin->GPC['userid'], 1, $fetch_userinfo_options);
    if ($userinfo['usergroupid'] == 4 and !($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])) {
        json_error(ERR_NO_PERMISSION);
    }
    $posts = $userinfo['posts'];
    $joindate = vbdate($vbulletin->options['dateformat'], $userinfo['joindate']);
    $out = array('username' => html_entity_decode($userinfo['username']), 'online' => fetch_online_status($userinfo, false), 'avatar_upload' => $vbulletin->options['avatarenabled'] && $permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canuseavatar'], 'posts' => $posts, 'joindate' => $joindate);
    $avatarurl_info = fetch_avatar_url($userinfo['userid']);
    if ($avatarurl_info) {
        $out['avatarurl'] = process_avatarurl($avatarurl_info[0]);
    }
    cache_moderators();
    $canbanuser = ($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] or can_moderate(0, 'canbanusers'));
    if ($canbanuser) {
        $out['ban'] = true;
    }
    $groups = array();
    // About
    $out_group = array('name' => 'about', 'values' => array(array('name' => prepare_utf8_string($vbphrase['posts']), 'value' => strval(vb_number_format($userinfo['posts']))), array('name' => prepare_utf8_string($vbphrase['join_date']), 'value' => vbdate($vbulletin->options['dateformat'], $userinfo['joindate']))));
    if (function_exists('itrader_user')) {
        itrader_user($userinfo);
        $out_group['values'][] = array('name' => 'iTrader', 'value' => vb_number_format($userinfo['tradescore']) . ', ' . $userinfo['tradepcnt'] . '%');
        $out += array('itrader_score' => vb_number_format($userinfo['tradescore']), 'itrader_percent' => $userinfo['tradepcnt'] . '%');
    }
    $groups[] = $out_group;
    $profileobj = new vB_UserProfile($vbulletin, $userinfo);
    $blockfactory = new vB_ProfileBlockFactory($vbulletin, $profileobj);
    $profileblock =& $blockfactory->fetch('ProfileFields');
    $profileblock->build_field_data(false);
    $profile = $profileblock->categories[0];
    // Additional information
    if (count($profile)) {
        $out_group = array('name' => 'additional');
        foreach ($profile as $profilefield) {
            $field_value = $userinfo["field{$profilefield['profilefieldid']}"];
            fetch_profilefield_display($profilefield, $field_value);
            if (!strlen(trim($field_value))) {
                continue;
            }
            $out_group['values'][] = array('name' => prepare_utf8_string($profilefield['title']), 'value' => prepare_utf8_string($profilefield['value']));
        }
        if (count($out_group['values'])) {
            $groups[] = $out_group;
        }
    }
    $out['groups'] = $groups;
    return $out;
}