Esempio n. 1
0
/**
 * 获取个人空间左侧栏信息
 */
function getAppleftinfo($u, $type = false)
{
    global $db, $db_plist, $winduid, $db_upgrade, $credit;
    $userdb = array();
    $userdb = $db->get_one("SELECT m.uid,m.username,m.email,m.groupid,m.icon,md.rvrc,md.money,md.credit,md.currency,md.digests,md.postnum,md.lastpost,md.onlinetime,ud.diarynum,ud.photonum,ud.owritenum,ud.groupnum,ud.sharenum,ud.diary_lastpost,ud.photo_lastpost,ud.owrite_lastpost,ud.group_lastpost,ud.share_lastpost FROM pw_members m LEFT JOIN pw_memberdata md ON m.uid=md.uid LEFT JOIN pw_ouserdata ud ON m.uid=ud.uid WHERE m.uid=" . pwEscape($u));
    $ismyfriend = isFriend($winduid, $u);
    $friendcheck = getstatus($userdb['userstatus'], 3, 3);
    //	$usericon = showfacedesign($userdb['icon'],true);
    list($usericon) = showfacedesign($userdb['icon'], 1, 'm');
    $usercredit = array('postnum' => $userdb['postnum'], 'digests' => $userdb['digests'], 'rvrc' => $userdb['rvrc'], 'money' => $userdb['money'], 'credit' => $userdb['credit'], 'currency' => $userdb['currency'], 'onlinetime' => $userdb['onlinetime']);
    foreach ($credit->get($userdb['uid'], 'CUSTOM') as $key => $value) {
        $usercredit[$key] = $value;
    }
    $totalcredit = CalculateCredit($usercredit, unserialize($db_upgrade));
    $userdb['rvrc'] /= 10;
    $app_with_count = array('topic', 'diary', 'photo', 'owrite', 'group', 'share');
    foreach ($app_with_count as $key => $value) {
        $postnum = $posttime = '';
        $appcount[$value] = getPostnumByType($value, $userdb, true);
    }
    $p_list = $db_plist && count($db_plist) > 1 ? $db_plist : array();
    return array($userdb, $ismyfriend, $friendcheck, $usericon, $usercredit, $totalcredit, $appcount, $p_list);
}
Esempio n. 2
0
            if (!$isGM && $groupid != '3' && $winduid != $userdb['uid']) {
                continue;
            }
            $userdb[$value] = $userdb[$value][0];
        } elseif ($value == 'gender') {
            $userdb[$value] = getLangInfo('other', 'gender_' . $userdb[$value]);
        }
    }
    $user_profile[$value] = array(getLangInfo('other', 'profile_' . $value), $userdb[$value]);
}
$userdb['site'] = $userdb['site'] ? '<a href="' . $userdb['site'] . '" target="_blank" >' . $userdb['site'] . '</a>' : '';
//用户app统计
$app_with_count = array('topic', 'diary', 'photo', 'owrite', 'group', 'share');
foreach ($app_with_count as $key => $value) {
    $postnum = $posttime = '';
    $appcount[$value] = getPostnumByType($value);
}
list($latest_action_time, $latest_action_date) = getLastDate($userdb['thisvisit']);
if ($privacy['index']) {
    InitGP(array('f_type'));
    $feeds = array();
    $addwhere = '';
    if (in_array($f_type, array('friend', 'share', 'photo', 'write', 'colony', 'post', 'diary'))) {
        $addwhere = ' AND f.type=' . pwEscape($f_type);
    }
    if (!$db_dopen) {
        $addwhere .= " AND f.type!='diary'";
    }
    if (!$db_phopen) {
        $addwhere .= " AND f.type!='photo'";
    }
Esempio n. 3
0
 }
 /*app*/
 /*个人数据*/
 require_once R_P . 'require/showimg.php';
 @(include_once D_P . 'data/bbscache/level.php');
 $userdb = array();
 $app_with_count = array('topic', 'diary', 'photo', 'owrite', 'group', 'share');
 $query = $db->query("SELECT m.uid,m.username,m.groupid,m.memberid,m.icon,m.oicq,m.aliww,m.honor,md.lastpost,md.thisvisit,md.f_num,ud.visits,ud.tovisits,ud.diary_lastpost,ud.photo_lastpost,ud.owrite_lastpost,ud.group_lastpost,ud.share_lastpost FROM pw_members m LEFT JOIN pw_memberdata md ON m.uid=md.uid LEFT JOIN pw_ouserdata ud ON m.uid=ud.uid WHERE m.uid IN(" . pwImplode($uids) . ")");
 while ($rt = $db->fetch_array($query)) {
     list($rt['icon']) = showfacedesign($rt['icon'], 1, 's');
     $rt['ismyfriend'] = 0;
     $rt['systitle'] = $rt['groupid'] == '-1' ? '' : $ltitle[$rt['groupid']];
     $rt['memtitle'] = $ltitle[$rt['memberid']];
     foreach ($app_with_count as $key => $value) {
         $posttime = '';
         $rt['appcount'][$value] = getPostnumByType($value, $rt);
     }
     $userdb[$rt['uid']] = $rt;
 }
 $query = $db->query("SELECT friendid FROM pw_friends WHERE uid=" . pwEscape($winduid) . " AND friendid IN(" . pwImplode($uids) . ") AND status='0'");
 while ($rt = $db->fetch_array($query)) {
     $userdb[$rt['friendid']]['ismyfriend'] = 1;
 }
 /*个人数据*/
 /*帖子、相册、日志、记录*/
 $userinfo = array();
 $pids = '';
 $usercache = L::loadDB('Usercache');
 $userinfo = $usercache->getByUid($uids);
 foreach ($userinfo as $uid => $value) {
     if ($value['photos']) {
Esempio n. 4
0
require_once R_P . 'require/showimg.php';
//* include_once pwCache::getPath(D_P . 'data/bbscache/level.php');
pwCache::getData(D_P . 'data/bbscache/level.php');
$userdb = array();
$app_with_count = array('topic', 'diary', 'photo', 'owrite', 'group', 'share');
$info = $db->get_one("SELECT m.uid,m.username,m.groupid,m.memberid,m.icon,m.oicq,m.aliww,m.honor,md.lastpost,md.thisvisit,md.f_num, s.visits,s.tovisits, ud.diary_lastpost,ud.photo_lastpost,ud.owrite_lastpost,ud.group_lastpost,ud.share_lastpost FROM pw_members m LEFT JOIN pw_memberdata md ON m.uid=md.uid LEFT JOIN pw_ouserdata ud ON m.uid=ud.uid LEFT JOIN pw_space s ON m.uid=s.uid WHERE m.uid=" . S::sqlEscape($uid));
list($info['icon']) = showfacedesign($info['icon'], 1, 's');
$friendService = L::loadClass('Friend', 'friend');
/* @var $friendService PW_Friend  */
$info['ismyfriend'] = $friendService->isFriend($winduid, $uid);
$attentionService = L::loadClass('Attention', 'friend');
/* @var $attentionService PW_Attention */
$info['isMyAttention'] = $attentionService->isFollow($winduid, $uid);
$info['systitle'] = $info['groupid'] == '-1' ? '' : $ltitle[$info['groupid']];
$info['memtitle'] = $ltitle[$info['memberid']];
foreach ($app_with_count as $key => $value) {
    $posttime = '';
    list(, $info['appcount'][$value]) = getPostnumByType($value, $info, true);
}
/*个人数据*/
$userCache = L::loadClass('Usercache', 'user');
$info['appinfo'] = $userCache->get($uid, array('cardtopic' => 1, 'carddiary' => 1, 'cardphoto' => 4));
uasort($info['appinfo'], "appcmp");
$info['app'] = $db_appsdb;
/*数据合并*/
require_once PrintEot('ajax');
ajax_footer();
function appcmp($a, $b)
{
    return $a['postdate'] == $b['postdate'] ? 0 : ($a['postdate'] > $b['postdate'] ? -1 : 1);
}