Пример #1
0
list(, $messageNumber, $noticeNumber, $requestNumber, $groupsmsNumber) = $messageServer->countAllByUserId($winduid);
$updateUserMessageTip = $updateUserDataMessageTip = array();
$winddb['newpm'] != 0 && $messageNumber + $groupsmsNumber != $winddb['newpm'] && ($updateUserMessageTip['newpm'] = $winddb['newpm'] = $messageNumber + $groupsmsNumber);
$winddb['newnotice'] != 0 && $noticeNumber != $winddb['newnotice'] && ($updateUserDataMessageTip['newnotice'] = $winddb['newnotice'] = $noticeNumber);
$winddb['newrequest'] != 0 && $requestNumber != $winddb['newrequest'] && ($updateUserDataMessageTip['newrequest'] = $winddb['newrequest'] = $requestNumber);
$messageNumber = $messageNumber ? '(' . $messageNumber . ')' : '';
$noticeNumber = $noticeNumber ? '(' . $noticeNumber . ')' : '';
$requestNumber = $requestNumber ? '(' . $requestNumber . ')' : '';
$groupsmsNumber = $groupsmsNumber ? '(' . $groupsmsNumber . ')' : '';
$totalMessage = $max = 0;
if ($_G['maxmsg']) {
    $numbers = $messageServer->statisticUsersNumbers(array($winduid));
    $totalMessage = isset($numbers[$winduid]) ? $numbers[$winduid] : 0;
    $max = (int) $_G['maxmsg'];
    $percent = round($totalMessage / $max, 4) * 100 >= 100 ? '100' . '%' : round($totalMessage / $max, 4) * 100 . '%';
    $percentTip = ',最多可存消息' . $_G['maxmsg'] . '条,' . '空间使用率' . $percent;
}
/* load u header */
$newSpace = new PwSpace($winduid);
if (!($space =& $newSpace->getInfo())) {
    Showmsg('您访问的空间不存在!');
}
if (S::isArray($updateUserMessageTip) || S::isArray($updateUserDataMessageTip)) {
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
    $userService->update($winduid, $updateUserMessageTip, $updateUserDataMessageTip);
}
//* include_once pwCache::getPath(D_P . 'data/bbscache/o_config.php');
pwCache::getData(D_P . 'data/bbscache/o_config.php');
require_once uTemplate::printEot('header');
require messageEot('leftmenu');
Пример #2
0
    /* @var $weiboLoginService PW_WeiboLoginService */
    $isNotResetPassword = $weiboLoginService->isLoginUserNotResetPassword($winduid);
    if (!$isNotResetPassword) {
        Showmsg('你已经创建密码,不需要再次创建');
    }
    PostCheck();
    InitGP(array('resetpwd', 'resetpwd_repeat'), 'P');
    $isSuccess = weiboResetUserPassword($winduid, $resetpwd, $resetpwd_repeat);
    if (!$isSuccess) {
        Showmsg('你已创建密码,或者新旧密码相同');
    }
    refreshto('profile.php?action=weibobind', '创建密码成功!', 2, true);
} elseif ($t == 'bindsuccess') {
    extract(L::style('', $skinco));
    $msg_info = '绑定帐号成功(窗口将自动关闭)';
    require_once uTemplate::printEot('profile_privacy_bindsuccess');
    pwOutPut();
} elseif ($t == 'callback') {
    $userBindService = L::loadClass('WeiboUserBindService', 'sns/weibotoplatform/service');
    /* @var $userBindService PW_WeiboUserBindService */
    $params = array_merge($_GET, $_POST);
    unset($params['action'], $params['t']);
    $isSuccess = $userBindService->callback($winduid, $params);
    if (true !== $isSuccess) {
        Showmsg($isSuccess ? $isSuccess : '绑定失败,请重试');
    }
    ObHeader('profile.php?action=weibobind&t=bindsuccess');
}
function ifchecked($out, $var)
{
    $GLOBALS[$out] = $var ? ' checked' : '';
Пример #3
0
    !$space['spacestyle'] && ($space['spacestyle'] = 2);
    !$space['spacetype'] && ($space['spacetype'] = 0);
    $sel_basic = $sel_skin = $sel_model = $ifcheck_0 = $ifcheck_1 = $ifcheck_2 = $ifcheck_3 = $ifcheckstyle_2 = $ifcheckstyle_3 = '';
    $style_basic = $style_skin = $style_model = 'none';
    ${'sel_' . $modeSel} = ' class="current"';
    ${'style_' . $modeSel} = '';
    ${'ifcheck_' . $space['spacetype']} = ' checked';
    ${'spacethemes_' . $space['spacetype']} = 'class="current"';
    ${'ifcheckstyle_' . $space['spacestyle']} = ' checked';
    ${'spacestyle_' . $space['spacestyle']} = 'class="current"';
    $maxuploadsize = ini_get('upload_max_filesize');
    //$privacy = $newSpace->getPrivacy();
    !$o_uskin && ($o_uskin = array('default85' => 'default85'));
    $space['namelength'] = strlen($space['name']);
    $space['desclength'] = strlen($space['descript']);
    require_once uTemplate::printEot('space_set');
    pwOutPut();
} else {
    S::gp(array('name', 'spaceskin', 'domain', 'descript'));
    S::gp(array('spacestyle', 'spacetype', 'ifopen', 'privacy', 'shownum'), 'GP', 2);
    if (strlen(pwHtmlspecialchars_decode($title)) > 80) {
        Showmsg('space_name_toolong');
    }
    if (strlen(pwHtmlspecialchars_decode($title)) > 255) {
        Showmsg('space_descript_toolong');
    }
    $modelset = array();
    $layout = "";
    if (intval($space['spacetype']) == $spacetype) {
        foreach ($spaceModel as $key => $value) {
            (!$shownum[$value] || $shownum[$value] < 1) && ($shownum[$value] = 1);
Пример #4
0
        $tovisitors = $db->get_value("SELECT tovisitors FROM pw_space WHERE uid=" . S::sqlEscape($winduid));
    }
    $tovisitors = unserialize($tovisitors);
    is_array($tovisitors) || ($tovisitors = array());
    if (!isset($tovisitors[$uid]) || $timestamp - $tovisitors[$uid] > 900) {
        $tovisitors[$uid] = $timestamp;
        arsort($tovisitors);
        if (count($tovisitors) > 12) {
            array_pop($tovisitors);
        }
        //$db->update("UPDATE pw_space SET tovisits=tovisits+'1',tovisitors=" . S::sqlEscape(serialize($tovisitors),false) .  " WHERE uid=" . S::sqlEscape($winduid));
        $db->update(pwQuery::buildClause("UPDATE :pw_table SET tovisits=tovisits+1,tovisitors=:tovisitors WHERE uid=:uid", array('pw_space', serialize($tovisitors), $winduid)));
    }
    //猪头回收
    $user_icon = explode('|', $space['icon']);
    if ($user_icon[4] && $space['tooltime'] < $timestamp - 86400) {
        $space['icon'] = "{$user_icon['0']}|{$user_icon['1']}|{$user_icon['2']}|{$user_icon['3']}|0";
        /**
        		$db->update("UPDATE pw_members SET icon=".S::sqlEscape($space['icon'],false)." WHERE uid=".S::sqlEscape($space['uid']));
        		**/
        pwQuery::update('pw_members', 'uid =:uid', array($space['uid']), array('icon' => $space['icon']));
    }
}
$isSpace = true;
$spaceTemplate = "";
$spacestyle = $space['spacestyle'] === '2' || $space['spacestyle'] === '3' ? $space['spacestyle'] : 2;
$spaceTemplate = 'space_' . $spacestyle . '_index';
//var_dump($spaceTemplate);
//require_once(uTemplate::printEot(($space['spacetype'] || !$indexRight) ? 'space_blog_index' : 'space_index'));
require_once uTemplate::printEot($spaceTemplate);
pwOutPut();
Пример #5
0
require_once R_P . 'u/lib/space.class.php';
$newSpace = new PwSpace($uid);
if (!($space =& $newSpace->getInfo())) {
    Showmsg('用户不存在!');
}
$indexRight = $newSpace->viewRight('index');
$indexValue = $newSpace->getPrivacyByKey('index');
$infoRight = $indexRight == true ? $newSpace->viewRight('info') : false;
$infoValue = $indexValue != 2 ? $newSpace->getPrivacyByKey('info') : '2';
//* include_once pwCache::getPath(D_P . 'data/bbscache/level.php');
pwCache::getData(D_P . 'data/bbscache/level.php');
$newSpace->getDetailInfo();
$newSpace->initSet();
$isSpace = true;
$customerService = L::loadClass('CustomerFieldService', 'user');
$customerValues = $customerService->getCustomerValues($uid);
require_once uTemplate::printEot('user_info');
pwOutPut();
function getOptions($options)
{
    if (!$options) {
        return array();
    }
    $array = array();
    $options = explode("\n", $options);
    foreach ($options as $key => $option) {
        list($k, $v) = explode('=', $option);
        $array[$k] = $v;
    }
    return $array;
}
Пример #6
0
            $birthdayLink = 'education';
            break;
        case 'other':
            $birthdayLink = 'other';
            break;
    }
    $friendsService = L::loadClass('Friend', 'friend');
    /* @var $friendsService PW_Friend */
    $friendsBirthday = $friendsService->findUserFriendsBirthdayInPage($winduid, 20, 1, 25);
}
if ($space == 1) {
    require_once R_P . 'require/credit.php';
    list($userdb, $ismyfriend, $friendcheck, $usericon, $usercredit, $totalcredit, $appcount, $p_list) = getAppleftinfo($u);
} else {
}
require_once uTemplate::printEot('friend_index');
pwOutPut();
/**
 * 数组里随机取几个
 *
 * @param array $dealArray
 * @param int $num
 * return array()
 */
function randArray($dealArray, $num)
{
    if (!is_array($dealArray)) {
        return "";
    }
    if ($num >= count($dealArray)) {
        return $dealArray;
Пример #7
0
    $basic_app_with_privacy = array('diary', 'photos');
    foreach ($all_basic_app as $key => $value) {
        if (!getIfopenOfApp($value)) {
            continue;
        }
        ${$value . '_isshow'} = in_array($value, $isshowdb) ? 1 : 0;
        ${$value . '_privacy'} = in_array($value, $basic_app_with_privacy) ? ${$value . '_privacy'} : 0;
        $name = getLangInfo('other', $value);
        $showchecked = ${$value . '_isshow'} ? 'checked' : '';
        if (in_array($value, $basic_app_with_privacy)) {
            $privacy = ${$value . '_privacy'};
            ${'privace_' . $value . '_' . $privacy} = 'selected';
        }
        $basic_app_array[$value] = array('name' => $name, 'isshow' => ${$value . '_isshow'}, 'privacy' => ${$value . '_privacy'}, 'showchecked' => $showchecked);
    }
    require_once uTemplate::printEot('myapp');
    pwOutPut();
} elseif ($action == 'del') {
    define('AJAX', 1);
    S::gp(array('id'));
    //$db->update("DELETE FROM pw_userapp WHERE uid=" . S::sqlEscape($winduid) . ' AND appid=' . S::sqlEscape($id));
    $appclient = L::loadClass('appclient');
    $appclient->deleteUserAppByUidAndAppid($winduid, $id);
    if ($db->affected_rows()) {
        if (!$db_appifopen || !$db_siteappkey) {
            Showmsg('app_close');
        }
        /*** userapp **/
        $appclient = L::loadClass('appclient');
        $url = $appclient->MoveAppsList($id);
        /*** userapp **/
Пример #8
0
        $postlast = $squareService->getLastPostUser(6);
        require_once PrintEot('m_browse_ajax');
        ajax_footer();
        break;
    case 'maxfans':
        $maxfans = $squareService->getFansDescUser(6);
        require_once PrintEot('m_browse_ajax');
        ajax_footer();
        break;
    case 'thread':
        $threadList = $squareService->getLastThread(20);
        require_once PrintEot('m_browse_ajax');
        ajax_footer();
        break;
    case 'weibo':
        $weiboList = $squareService->getWeiboLives(20);
        require_once PrintEot('m_browse_ajax');
        ajax_footer();
        break;
    default:
        $postlast = $squareService->getLastPostUser(6);
        $maxfans = $squareService->getFansDescUser(6);
        $threadList = $squareService->getLastThread(20);
        break;
}
$brandlist = $squareService->getFansBrand(10, $clTime);
$upgradelist = $squareService->getLastUpgradeUser(10);
require_once PrintEot('header');
require_once PrintEot('m_browse');
require_once uTemplate::printEot('footer');
pwOutPut();
Пример #9
0
<?php

!defined('R_P') && exit('Forbidden');
empty($space) && Showmsg('您访问的空间不存在!');
if (!$newSpace->viewRight('index')) {
    Showmsg('该空间设置隐私,您没有权限查看!');
}
$basename = "u.php?a={$a}&uid={$uid}&";
$count = 0;
$friendsService = L::loadClass('Friend', 'friend');
/* @var $friendsService PW_Friend */
/* 找出登录者的好友array(0=>uid1,1=>uid2,.......n=>uidn)*/
$uids = array();
$count = (int) $friendsService->countUserFriends($uid);
$page > ceil($count / $db_perpage) && ($page = ceil($count / $db_perpage));
$friends = $count ? $friendsService->findUserFriendsInPage($uid, $page, $db_perpage) : array();
foreach ($friends as $key => $friend) {
    $uids[] = $friend['uid'];
}
$attentionSerivce = L::loadClass('attention', 'friend');
/* @var $attentionSerivce PW_Attention */
$myAttentionUids = $attentionSerivce->getUidsInFollowListByFriendids($winduid, $uids);
foreach ($friends as $key => $friend) {
    if (!S::inArray($friend['uid'], $myAttentionUids)) {
        continue;
    }
    $friends[$key]['attention'] = true;
}
$pages = numofpage($count, $page, ceil($count / $db_perpage), "{$basename}");
require_once uTemplate::printEot('space_friend');
pwOutPut();
Пример #10
0
    /* @var $userBindService PW_WeiboUserBindService */
    $userBindList = $userBindService->getBindList($winduid);
    $isUserBindOne = $userBindService->isBindOne($winduid);
}
/*个人中心与消息中心的互动*/
//新消息中心消息数目统计
/*
$messageServer = L::loadClass('message', 'message');
list($messageNumber,$noticeNumber,$requestNumber,$groupsmsNumber) = $messageServer->getUserStatistics($winduid);
$messageNum = $messageNumber+$noticeNumber+$requestNumber+$groupsmsNumber;
$messageNumber = $messageNumber ? '('.$messageNumber.')' : '';
$noticeNumber = $noticeNumber ? '('.$noticeNumber.')' : '';
$requestNumber = $requestNumber ? '('.$requestNumber.')' : '';
$groupsmsNumber = $groupsmsNumber ? '('.$groupsmsNumber.')' : '';
*/
require_once uTemplate::printEot('user_home');
pwOutPut();
function getMemberInfoFinishPercentage($userId)
{
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
    $data = $userService->get($userId, true, false, true);
    $needFields = array('introduce', 'oicq', 'aliww', 'signature', 'msn', 'yahoo', 'site', 'location', 'honor', 'bday');
    foreach (L::config('customfield', 'customfield') as $field) {
        $needFields[] = 'field_' . $field['id'];
    }
    $total = count($needFields);
    $finish = 0;
    foreach ($needFields as $field) {
        if ('' != $data[$field]) {
            $finish++;