/**
  * 
  * 数据处理
  * @param int $fid
  * @return 
  */
 function _cookData($data)
 {
     if (!S::isArray($data)) {
         return array();
     }
     require_once R_P . 'require/showimg.php';
     foreach ($data as $k => $v) {
         $tem = array();
         $tem['url'] = USER_URL . $v['uid'];
         $tem['title'] = $v['username'];
         $tem['value'] = $v['uid'];
         if (array_key_exists('icon', $v)) {
             $pic = showfacedesign($v['icon'], true, 's');
             if (is_array($pic)) {
                 $tem['image'] = $pic[0];
             } else {
                 $tem['image'] = '';
             }
         } else {
             $tem['image'] = '';
         }
         $tem['addition'] = $v;
         $userInfo[] = $tem;
     }
     return $userInfo;
 }
Example #2
0
 function getInfo($uids, $fields = array())
 {
     if (!$uids) {
         return new ApiResponse(false);
     }
     require_once R_P . 'require/showimg.php';
     $uids = is_numeric($uids) ? array($uids) : explode(",", $uids);
     if (!$fields) {
         $fields = array('uid', 'username', 'icon', 'gender', 'location', 'bday');
     }
     $userService = L::loadClass('UserService', 'user');
     /* @var $userService PW_UserService */
     $users = array();
     foreach ($userService->getByUserIds($uids) as $rt) {
         list($rt['icon']) = showfacedesign($rt['icon'], 1, 'm');
         $rt_a = array();
         foreach ($fields as $field) {
             if (isset($rt[$field])) {
                 $rt_a[$field] = $rt[$field];
             }
         }
         $users[$rt['uid']] = $rt_a;
     }
     return new ApiResponse($users);
 }
Example #3
0
 function getInfo($uids, $fields = array())
 {
     if (!$uids) {
         return new ApiResponse(false);
     }
     if (is_numeric($uids)) {
         $sql = ' uid=' . pwEscape($uids);
     } else {
         $sql = ' uid IN(' . pwImplode(explode(',', $uids)) . ')';
     }
     require_once R_P . 'require/showimg.php';
     $users = array();
     $query = $this->db->query("SELECT uid,username,icon,gender,location,bday FROM pw_members WHERE " . $sql);
     while ($rt = $this->db->fetch_array($query)) {
         list($rt['icon']) = showfacedesign($rt['icon'], 1, 'm');
         if ($fields) {
             $rt_a = array();
             foreach ($fields as $field) {
                 if (isset($rt[$field])) {
                     $rt_a[$field] = $rt[$field];
                 }
             }
         } else {
             $rt_a = $rt;
         }
         $users[$rt['uid']] = $rt_a;
     }
     return new ApiResponse($users);
 }
Example #4
0
/**
 * 组装小名片数据
 *
 * @param int $uid 用户ID
 * @param int $winduid 当前用户id
 * @param bool $username 用户名
 * @return array
 */
function getCardData($uid, $winduid, $username)
{
    extract(pwCache::getData(R_P . "data/bbscache/level.php", false));
    if ($uid < 1 && !trim($username) || $username == '游客' || $username == '匿名') {
        return array('username' => '游客', 'memtitle' => $ltitle[2]);
    }
    $userService = L::loadClass('UserService', 'user');
    if ($uid) {
        $userInfo = $userService->get($uid, true, true);
    } elseif ($username) {
        $userInfo = $userService->getByUserName($username, true, true);
    }
    if (!S::isArray($userInfo)) {
        return array();
    }
    require_once R_P . 'require/showimg.php';
    list($faceimage) = showfacedesign($userInfo['icon'], 1, 's');
    $userInfo['groupid'] == '-1' && ($userInfo['groupid'] = $userInfo['memberid']);
    !array_key_exists($userInfo['groupid'], (array) $lpic) && ($userInfo['groupid'] = 8);
    $online = checkOnline($userInfo['thisvisit']);
    $onlineRead = $online ? getOnlineViewing($userInfo['uid'], $userInfo['username']) : array();
    $user = array('mine' => $userInfo['uid'] == $winduid || !$winduid ? 0 : 1, 'uid' => $userInfo['uid'], 'username' => $userInfo['username'], 'icon' => $faceimage, 'memtitle' => $ltitle[$userInfo['groupid']], 'genderClass' => $userInfo['gender'], 'viewTid' => isset($onlineRead['tid']) && $onlineRead['tid'] ? $onlineRead['tid'] : '', 'viewFid' => isset($onlineRead['fid']) && $onlineRead['fid'] ? $onlineRead['fid'] : '', 'online' => $online ? 1 : 0);
    $user['medals'] = getMedalsByUid($userInfo['uid']);
    // 勋章
    $memberTagsService = L::loadClass('memberTagsService', 'user');
    $user['memberTags'] = $memberTagsService->makeClassTags($memberTagsService->getMemberTagsByUid($userInfo['uid']));
    //标签
    $attentionSerivce = L::loadClass('Attention', 'friend');
    /* @var $attentionSerivce PW_Attention */
    $user['attention'] = $attentionSerivce->isFollow($winduid, $userInfo['uid']) ? 1 : 0;
    //关注
    return $user;
}
Example #5
0
 /**
  * 根据联系人邮件列表获得好友列表
  * @param Array $emailList
  * @return Array:
  */
 function getUsersFromEmailList($emailList)
 {
     $result = array();
     if (!empty($emailList) && is_array($emailList)) {
         $userService = L::loadClass('UserService', 'user');
         /* @var $userService PW_UserService */
         foreach ($userService->getByEmails($emailList) as $rt) {
             $rt['face'] = showfacedesign($rt['icon'], '1', 's');
             $rt['face'] = $rt['face'][0];
             $result[$rt['uid']] = $rt;
         }
     }
     return $result;
 }
 /**
  * 格式化数据统一输出
  * @param array $data
  * @return array
  */
 function _cookData($data)
 {
     $cookData = array();
     foreach ($data as $k => $v) {
         if (isset($v['password'])) {
             unset($v['password']);
         }
         if ($v['topicid']) {
             if (strpos($v['topicname'], '[s:') !== false && strpos($v['topicname'], ']') !== false) {
                 unset($data[$k]);
                 continue;
             }
             $v['title'] = $v['descrip'] = strip_tags($v['topicname']);
             $v['url'] = 'apps.php?q=weibo&do=topics&topic=' . $v['topicname'];
             $v['postdate'] = get_date($v['crtime'], 'Y-m-d');
         } elseif ($v['mid']) {
             $v['url'] = 'apps.php?q=weibo&do=detail&mid=' . $v['mid'] . '&uid=' . $v['uid'];
             $v['title'] = $v['extra']['title'] ? strip_tags($v['extra']['title']) : strip_tags($v['content']);
             $v['descrip'] = strip_tags($v['content']);
             $v['authorurl'] = 'u.php?uid=' . $v['uid'];
             $v['author'] = $v['username'];
             $v['authorid'] = $v['uid'];
             $v['postdate'] = $v['postdate_s'];
             if (S::isArray($v['extra']['photos'])) {
                 $image = $v['extra']['photos'][0];
                 $temp = geturl($image['path']);
                 $v['image'] = $temp[0] ? $temp[0] : '';
             }
             $pic = showfacedesign($v['icon'], true, 's');
             $v['icon'] = S::isArray($pic) ? $pic[0] : '';
         } else {
             $v['url'] = 'u.php?uid=' . $v['uid'];
             $v['title'] = $v['username'];
             $v['uid'] = $v['uid'];
             $v['tags'] = $v['tags'] ? $v['tags'] : "TA还没有标签";
             $v['image'] = $v['icon'] ? $v['icon'] : '';
         }
         if (!$v['title']) {
             unset($data[$k]);
             continue;
         }
         $cookData[$k] = $v;
     }
     return $cookData;
 }
Example #7
0
/**
 * 生成导航条信息
 *
 * @return array
 */
function pwNavBar()
{
    global $winduid, $db_mainnav, $db_menu, $groupid, $winddb, $SCR, $db_modes, $db_mode, $defaultMode, $db_menuinit;
    global $alias;
    $tmpLogin = $tmpNav = array();
    if ($groupid != 'guest') {
        require_once R_P . 'require/showimg.php';
        list($tmpLogin['faceurl']) = showfacedesign($winddb['icon'], 1, 's');
        $tmpLogin['lastlodate'] = get_date($winddb['lastvisit'], 'Y-m-d');
    } else {
        global $db_question, $db_logintype, $db_qcheck, $db_ckquestion;
        if ($db_question) {
            //list(, $tmpLogin['qcheck'],,,$tmpLogin['showq']) = explode("\t", $db_qcheck);
            $tmpLogin['qcheck'] = $db_ckquestion & 2;
            list(, $tmpLogin['showq']) = explode("\t", $db_qcheck);
            if ($tmpLogin['qcheck']) {
                $tmpLogin['qkey'] = array_rand($db_question);
            }
        }
        if ($db_logintype) {
            for ($i = 0; $i < 3; $i++) {
                if ($db_logintype & pow(2, $i)) {
                    $tmpLogin['logintype'][] = $i;
                }
            }
        } else {
            $tmpLogin['logintype'][0] = 0;
        }
    }
    $currentPostion = array();
    $currentPostion['mode'] = $db_mode;
    if (in_array(SCR, array('index', 'cate', 'mode', 'read', 'thread')) || $SCR == 'm_home') {
        $currentPostion['mode'] = empty($db_mode) ? 'bbs' : $db_mode;
    }
    if ($currentPostion['mode'] == 'area' && $alias) {
        $currentPostion['alias'] = $alias;
    }
    $navConfigService = L::loadClass('navconfig', 'site');
    /* @var $navConfigService PW_NavConfig */
    $tmpNav[PW_NAV_TYPE_MAIN] = $navConfigService->findValidNavListByTypeAndPostion(PW_NAV_TYPE_MAIN, $db_mode, $currentPostion);
    $tmpNav[PW_NAV_TYPE_HEAD_LEFT] = $navConfigService->findValidNavListByTypeAndPostion(PW_NAV_TYPE_HEAD_LEFT, $db_mode);
    $tmpNav[PW_NAV_TYPE_HEAD_RIGHT] = $navConfigService->findValidNavListByTypeAndPostion(PW_NAV_TYPE_HEAD_RIGHT, $db_mode);
    $tmpNav[PW_NAV_TYPE_FOOT] = $navConfigService->findValidNavListByTypeAndPostion(PW_NAV_TYPE_FOOT, $db_mode);
    return array($tmpNav, $tmpLogin);
}
Example #8
0
function get_pinglogs($tid, $pingIdArr)
{
    if (empty($pingIdArr)) {
        return;
    }
    global $db, $fid, $creditnames;
    $pingIds = array();
    $pingLogs = array();
    foreach ($pingIdArr as $pid => $markInfo) {
        list($count, $ids, $creditCount) = explode(":", $markInfo);
        $pingLogs[$pid]['count'] = $count;
        $pingLogs[$pid]['creditCount'] = parseCreditCount($creditCount);
        $pingIds = array_merge($pingIds, explode(",", $ids));
    }
    if (!count($pingIds)) {
        return array();
    }
    $query = $db->query("SELECT a.*,b.uid,b.icon FROM pw_pinglog a LEFT JOIN pw_members b ON a.pinger=b.username WHERE a.id IN (" . S::sqlImplode($pingIds) . ") ");
    while ($rt = $db->fetch_array($query)) {
        $rt['pid'] = $rt['pid'] ? $rt['pid'] : 'tpc';
        list($rt['pingtime'], $rt['pingdate']) = getLastDate($rt['pingdate']);
        $rt['record'] = $rt['record'] ? $rt['record'] : "-";
        if ($rt['point'] > 0) {
            $rt['point'] = "+" . $rt['point'];
        }
        $tmp = showfacedesign($rt['icon'], true, 's');
        $rt['icon'] = $tmp[0];
        isset($creditnames[$rt['name']]) && ($rt['name'] = $creditnames[$rt['name']]);
        $pingLogs[$rt['pid']]['data'][$rt['id']] = $rt;
    }
    foreach ($pingLogs as $pid => $data) {
        if (is_array($pingLogs[$pid]['data'])) {
            krsort($pingLogs[$pid]['data']);
        }
    }
    return $pingLogs;
}
Example #9
0
 function htmread($read, $start_limit)
 {
     global $imgpath, $db_ipfrom, $db_windpost, $db_windpic, $db_signwindcode, $db_shield;
     $lpic = L::config('lpic', 'cache_read');
     $ltitle = L::config('ltitle', 'cache_read');
     $_MEDALDB = L::config('_MEDALDB', 'cache_read');
     $read['lou'] = $start_limit;
     $start_limit == $count - 1 && ($read['jupend'] = '<a name=lastatc></a>');
     $read['ifsign'] < 2 && ($read['content'] = str_replace("\n", "<br>", $read['content']));
     $read['groupid'] == '-1' && ($read['groupid'] = $read['memberid']);
     $anonymous = $read['anonymous'] ? 1 : 0;
     if ($read['groupid'] != '' && $anonymous == 0) {
         !$lpic[$read['groupid']] && ($read['groupid'] = 8);
         $read['lpic'] = $lpic[$read['groupid']];
         $read['level'] = $ltitle[$read['groupid']];
         $read['regdate'] = get_date($read['regdate'], "Y-m-d");
         $read['lastlogin'] = get_date($read['lastvisit'], "Y-m-d");
         $read['aurvrc'] = floor($read['rvrc'] / 10);
         $read['author'] = $read['username'];
         $read['ontime'] = (int) ($read['onlinetime'] / 3600);
         $tpc_author = $read['author'];
         list($read['face'], , $httpWidth, $httpHeight, , , , $read['facesize']) = showfacedesign($read['micon'], true, 'm');
         if ($httpWidth > 120 || $httpHeight > 120 || $read['facesize'] == '') {
             $read['facesize'] = ' width="120" height="120"';
         }
         list($read['posttime']) = getLastDate($read['postdate']);
         if ($db_ipfrom == 1) {
             $read['ipfrom'] = ' From:' . $read['ipfrom'];
         }
         if (L::config('md_ifopen', 'cache_read') && $read['medals']) {
             $medals = '';
             $md_a = explode(',', $read['medals']);
             foreach ($md_a as $key => $value) {
                 if ($value) {
                     $medals .= "<img src=\"{$_MEDALDB[$value][smallimage]}\" title=\"{$_MEDALDB[$value][name]}\" /> ";
                 }
             }
             $read['medals'] = $medals . '<br />';
         } else {
             $read['medals'] = '';
         }
         if ($read['ifsign'] == 1 || $read['ifsign'] == 3) {
             global $sign;
             if (!$sign[$read['author']]) {
                 global $db_signmoney, $db_signgroup, $tdtime;
                 if (strpos($db_signgroup, ",{$read['groupid']},") !== false && $db_signmoney) {
                     $read['signature'] = '';
                 } else {
                     if ($db_signwindcode && getstatus($read['userstatus'], PW_USERSTATUS_SIGNCHANGE)) {
                         $read['signature'] = convert($read['signature'], $db_windpic, 2);
                     }
                     $read['signature'] = str_replace("\n", "<br>", $read['signature']);
                 }
                 $sign[$read['author']] = $read['signature'];
             } else {
                 $read['signature'] = $sign[$read['author']];
             }
         } else {
             $read['signature'] = '';
         }
     } else {
         $read['face'] = "{$imgpath}/face/none.gif";
         $read['lpic'] = '8';
         $read['level'] = $read['digests'] = $read['postnum'] = $read['money'] = $read['regdate'] = $read['lastlogin'] = $read['aurvrc'] = $read['credit'] = '*';
         if ($anonymous) {
             $read['signature'] = $read['honor'] = $read['medals'] = $read['ipfrom'] = '';
             $read['author'] = $GLOBALS['db_anonymousname'];
             $read['authorid'] = 0;
             foreach (L::config('customfield', 'cache_read') as $key => $val) {
                 $field = "field_" . (int) $val['id'];
                 $read[$field] = '*';
             }
         }
     }
     $read['postdate'] = get_date($read['postdate']);
     $read['mark'] = '';
     if ($read['ifmark']) {
         $markdb = explode("\t", $read['ifmark']);
         foreach ($markdb as $key => $value) {
             $read['mark'] .= "<li>{$value}</li>";
         }
     }
     if ($read['icon']) {
         $read['icon'] = "<img src=\"{$imgpath}/post/emotion/{$read['icon']}.gif\" align=left border=0>";
     } else {
         $read['icon'] = '';
     }
     /**
      * 动态判断发帖是否需要转换
      */
     $tpc_shield = 0;
     if ($read['ifshield'] || $read['groupid'] == 6 && $db_shield) {
         $read['subject'] = $read['icon'] = '';
         $read['content'] = shield($read['ifshield'] ? $read['ifshield'] == 1 ? 'shield_article' : 'shield_del_article' : 'ban_article');
         $tpc_shield = 1;
     }
     if (!$tpc_shield) {
         $wordsfb = L::loadClass('FilterUtil', 'filter');
         if (!$wordsfb->equal($read['ifwordsfb'])) {
             $read['content'] = $wordsfb->convert($read['content']);
         }
         if ($read['ifconvert'] == 2) {
             $read['content'] = preg_replace("/\\[sell=(.+?)\\]/is", "", $read['content']);
             $read['content'] = preg_replace("/\\[hide=(.+?)\\]/is", "", $read['content']);
             $read['content'] = str_replace(array('[/hide]', '[/sell]', '[post]', '[/post]'), '', $read['content']);
             $read['content'] = convert($read['content'], $db_windpost);
         } else {
             strpos($read['content'], '[s:') !== false && ($read['content'] = showface($read['content']));
         }
         if ($read['aid'] && $this->attachShow->isShow($read['ifhide'], $tid)) {
             $read += $this->attachShow->parseAttachs($read['pid'], $read['content'], false);
         }
     }
     if ($read['remindinfo']) {
         $remind = explode("\t", $read['remindinfo']);
         $remind[0] = str_replace("\n", "<br />", $remind[0]);
         $remind[2] && ($remind[2] = get_date($remind[2]));
         $read['remindinfo'] = $remind;
     }
     $this->forum->foruminfo['copyctrl'] && ($read['content'] = preg_replace("/<br>/eis", "copyctrl('{$read['colour']}')", $read['content']));
     $read['alterinfo'] && ($read['content'] .= "<br><br><br><font color=gray>[ {$read['alterinfo']} ]</font>");
     return $read;
 }
 function getFanByUid($uid, $offset, $limit)
 {
     list($uid, $offset, $limit) = array(intval($uid), intval($offset), intval($limit));
     if ($uid < 1) {
         $this->buildResponse(Friend_INVALID_PARAMS);
     }
     $attentionService = L::loadClass('Attention', 'friend');
     $count = $attentionService->countFans($uid);
     if ($count < 1) {
         return $this->buildResponse(0, array());
     }
     $sqlLimit = $offset > 0 ? ' AND f.uid < ' . S::sqlEscape($offset) : '';
     $sql = "SELECT m.uid,m.username,m.icon as face,m.honor,m.groupid,m.memberid,m.gender,md.thisvisit,md.lastvisit,md.fans FROM pw_attention f LEFT JOIN pw_members m ON f.uid = m.uid" . " LEFT JOIN pw_memberdata md ON f.uid = md.uid" . " WHERE f.friendid=" . S::sqlEscape($uid) . " {$sqlLimit} ORDER BY f.uid DESC LIMIT " . intval($limit);
     $query = $GLOBALS['db']->query($sql);
     require_once R_P . 'require/showimg.php';
     $result = array();
     while ($rt = $GLOBALS['db']->fetch_array($query)) {
         $tmpIcon = showfacedesign($rt['face'], 1, 's');
         $result[$rt['uid']] = array('uid' => $rt['uid'], 'username' => $rt['username'], 'face' => $tmpIcon[0]);
     }
     $currentUid = ACloud_Sys_Core_Common::getGlobal('customized_current_uid', 0);
     $followIds = $this->getUids($attentionService->getFollowList($currentUid), 'friendid');
     $result = $this->buildFriendList($uid, $result, $followIds);
     return $this->buildResponse(0, array('friends' => $result, 'count' => $count));
 }
Example #11
0
    $customfield[$key]['field'] = "field_{$value['id']}";
    if ($value['type'] == 3 && $_POST['step'] != 2) {
        $customfield[$key]['options'] = explode("\n", $value['options']);
    } elseif ($value['type'] == 2) {
        $SCR = 'post';
    }
    $mbadd .= ",mb.field_{$value['id']}";
}
$db_union[7] && ($mbadd .= ',mb.customdata');
$userdb = $db->get_one("SELECT m.email,m.password,m.groupid,m.groups,m.icon,m.gender,m.signature,m.introduce,m.oicq,m.aliww,m.msn,m.yahoo,m.site,m.location,m.honor,m.bday,m.timedf,m.datefm,m.t_num,m.p_num,m.userstatus,md.currency,md.starttime,mb.tradeinfo{$mbadd} FROM pw_members m LEFT JOIN pw_memberdata md USING(uid) LEFT JOIN pw_memberinfo mb USING(uid) WHERE m.uid=" . pwEscape($winduid));
InitGP(array('info_type'));
//浏览页ajax创建商品分类名称
InitGP(array('ajax_create', 'tradeTypeName'), "P");
$ajax_create && createThreadTradeType($tradeTypeName, $winduid);
if (empty($_POST['step'])) {
    list($iconurl, $icontype, $iconwidth, $iconheight, $iconfile, , , $iconsize) = showfacedesign($userdb['icon'], true, 'm');
    include_once D_P . 'data/bbscache/dbreg.php';
    require_once R_P . 'require/forum.php';
    require_once R_P . 'require/credit.php';
    $customdata = $custominfo = $sexselect = $yearslect = $monthslect = $dayslect = array();
    $ifpublic = $groupselect = $httpurl = $email_Y = $email_N = $prosign_Y = $prosign_N = '';
    $ifsign = false;
    !in_array($info_type, array('base', 'trade', 'link', 'face', 'safe', 'binding', 'other')) && ($info_type = 'base');
    getstatus($userdb['userstatus'], 7) && ($ifpublic = 'checked');
    ${'email_' . (getstatus($userdb['userstatus'], 8) ? 'Y' : 'N')} = 'checked';
    ${'prosign_' . (getstatus($userdb['userstatus'], 10) ? 'Y' : 'N')} = 'checked';
    if ($db_selectgroup && $userdb['groups']) {
        $ltitle = L::config('ltitle', 'level');
        $groupselect = $userdb['groupid'] == '-1' ? '<option></option>' : "<option value=\"{$userdb['groupid']}\">" . $ltitle[$userdb['groupid']] . "</option>";
        $groups = explode(',', $userdb['groups']);
        foreach ($groups as $value) {
Example #12
0
$creditnames = pwCreditNames();
//х╗оч
$foruminfo = $db->get_one('SELECT * FROM pw_forums f LEFT JOIN pw_forumsextra fe USING(fid) WHERE f.fid=' . S::sqlEscape($fid));
!$foruminfo && Showmsg('data_error');
$isGM = $isBM = $admincheck = 0;
if ($groupid != 'guest') {
    $isGM = S::inArray($windid, $manager);
    $isBM = admincheck($foruminfo['forumadmin'], $foruminfo['fupadmin'], $windid);
    $admincheck = $isGM || $isBM ? 1 : 0;
}
$count = $db->get_value("SELECT COUNT(*) FROM pw_pinglog WHERE  fid=" . S::sqlEscape($fid) . " AND tid=" . S::sqlEscape($tid) . " AND pid=" . S::sqlEscape($pid) . "  AND ifhide=0");
$total = ceil($count / $perpage);
if ($page < 2) {
    $page = 2;
}
$offset = ($page - 1) * $perpage;
$ping_db = array();
$query = $db->query("SELECT a.*,b.uid,b.icon FROM pw_pinglog a LEFT JOIN pw_members b ON a.pinger=b.username WHERE a.fid=" . S::sqlEscape($fid) . " AND a.tid=" . S::sqlEscape($tid) . " AND a.pid=" . S::sqlEscape($pid) . " AND ifhide=0 ORDER BY a.pingdate DESC LIMIT {$offset},{$perpage}");
while ($rt = $db->fetch_array($query)) {
    list($rt['pingtime'], $rt['pingdate']) = getLastDate($rt['pingdate']);
    $rt['record'] = $rt['record'] ? $rt['record'] : "-";
    if ($rt['point'] > 0) {
        $rt['point'] = "+" . $rt['point'];
    }
    $tmp = showfacedesign($rt['icon'], true);
    $rt['icon'] = $tmp[0];
    isset($creditnames[$rt['name']]) && ($rt['name'] = $creditnames[$rt['name']]);
    $ping_db[] = $rt;
}
require_once PrintEot('ajax');
ajax_footer();
Example #13
0
    require_once PrintEot('u');
    footer();
} elseif ($action == 'show') {
    if (!$winduid && !$_G['allowprofile']) {
        Showmsg('not_login');
    }
    include_once D_P . 'data/bbscache/md_config.php';
    require_once R_P . 'require/credit.php';
    require_once R_P . 'require/forum.php';
    require_once R_P . 'require/postfunc.php';
    $customdata = $custominfo = $colonydb = array();
    $user_icon = explode('|', $userdb['icon']);
    if ($user_icon[4] && $userdb['tooltime'] < $timestamp - 86400) {
        $userdb['icon'] = "{$user_icon['0']}|{$user_icon['1']}|{$user_icon['2']}|{$user_icon['3']}|0";
        $db->update("UPDATE pw_members SET icon=" . pwEscape($userdb['icon'], false) . " WHERE uid=" . pwEscape($userdb['uid']));
        $usericon = showfacedesign($userdb['icon'], true);
    }
    $query = $db->query("SELECT cy.id,cy.cname FROM pw_cmembers c LEFT JOIN pw_colonys cy ON cy.id=c.colonyid WHERE c.uid=" . pwEscape($userdb['uid']));
    while ($rt = $db->fetch_array($query)) {
        $colonydb[] = $rt;
    }
    if ($md_ifopen && $userdb['medals']) {
        include_once D_P . 'data/bbscache/medaldb.php';
        $query = $db->query("SELECT id,awardee,level FROM pw_medalslogs WHERE awardee=" . pwEscape($userdb['username'], false) . " AND action='1' AND state='0' AND timelimit>0 AND {$timestamp}-awardtime>timelimit*2592000");
        if ($db->num_rows($query)) {
            include_once R_P . 'require/msg.php';
            $reason = Char_cv(getLangInfo('other', 'medal_reason'));
            $ids = $medals = $medalslog = array();
            while ($rt = $db->fetch_array($query)) {
                $ids[] = $rt['id'];
                $medals[] = $rt['level'];
Example #14
0
function viewread($read)
{
    global $winduid, $isGM, $pwSystem, $_G, $db_windpost, $tpc_buy, $tpc_pid, $tpc_tag, $tpc_author, $tid;
    $tpc_buy = $read['buy'];
    $tpc_pid = $read['pid'];
    $tpc_tag = NULL;
    $tpc_author = '';
    if ($read['anonymous']) {
        $anonymous = !$isGM && $winduid != $read['authorid'] && !$pwSystem['anonyhide'];
    } else {
        $anonymous = false;
    }
    if (!$anonymous) {
        $tpc_author = $read['author'];
    }
    list($read['face']) = showfacedesign($read['micon'], true, 'm');
    $read['content'] = preg_replace("/\\[quote\\](.*)\\[\\/quote\\]/is", "", $read['content']);
    $read['ifsign'] < 2 && ($read['content'] = str_replace("\n", "<br />", $read['content']));
    $read['leaveword'] && ($read['content'] .= leaveword($read['leaveword'], $read['pid']));
    $read['content'] = preg_replace('/(\\[s:[^]]+\\])+/', '[表情]', $read['content']);
    //face
    $read['content'] = strip_tags(convert($read['content'], '1'));
    if ($read['ifwordsfb'] != $GLOBALS['db_wordsfb']) {
        $read['content'] = wordsConvert($read['content'], array('id' => $tpc_pid == 'tpc' ? $tid : $tpc_pid, 'type' => $tpc_pid == 'tpc' ? 'topic' : 'posts', 'code' => $read['ifwordsfb']));
    }
    $read['content'] = parseReplyContent($read['content']);
    return $read;
}
Example #15
0
         }
         $total = $db->get_value("SELECT COUNT(*) AS sum FROM pw_cmembers cm WHERE cm.colonyid=" . S::sqlEscape($cyid) . $sqlsel);
         if ($total) {
             if (in_array($orderby, array('lastpost', 'lastvisit'))) {
                 $order = $orderby;
                 $urladd = $orderby ? "orderby={$orderby}&" : '';
                 ${'order_' . $orderby} = ' class="current"';
             } else {
                 $order = 'ifadmin';
                 $urladd = '';
             }
             list($pages, $limit) = pwLimitPages($total, $page, "{$basename}&group={$group}&{$urladd}");
             $memdb = array();
             $query = $db->query("SELECT cm.*,m.icon,m.honor,md.thisvisit FROM pw_cmembers cm LEFT JOIN pw_members m ON cm.uid=m.uid LEFT JOIN pw_memberdata md ON m.uid=md.uid WHERE cm.colonyid=" . S::sqlEscape($cyid) . $sqlsel . " ORDER BY cm.{$order} DESC {$limit}");
             while ($rt = $db->fetch_array($query)) {
                 list($rt['icon']) = showfacedesign($rt['icon'], 1);
                 $memdb[$rt['username']] = $rt;
             }
             $colonyOwner = $memdb[$colony['admin']];
             unset($memdb[$colony['admin']]);
             $colonyOwner && array_unshift($memdb, $colonyOwner);
         }
     }
     $urladd = $group ? '&group=' . $group : '';
     require_once PrintEot('thread_member');
     footer();
 } else {
     !$ifadmin && Showmsg('undefined_action');
     S::gp(array('selid'), 'P', 2);
     if (!$selid || !is_array($selid)) {
         Showmsg('id_error');
Example #16
0
 function _getUserInfo($userarr, $isid = false)
 {
     global $winduid;
     if (empty($userarr) || !is_array($userarr)) {
         return array();
     }
     $userInfos = $arr = array();
     $service = L::loadClass('userservice', 'user');
     $attentionService = L::loadClass('Attention', 'friend');
     $list = $service->getUsersWithMemberDataByUserIds($userarr);
     if (!S::isArray($list)) {
         return array();
     }
     foreach ($list as $value) {
         list($icon) = showfacedesign($value['icon'], 1, 's');
         $value['icon'] = $icon;
         $value['isAttention'] = $attentionService->isFollow($winduid, $value['uid']);
         $arr[$value['uid']] = $value;
     }
     foreach ($userarr as $val) {
         $userInfos[] = $arr[$val];
     }
     if ($isid) {
         return $arr;
     }
     return $userInfos;
 }
Example #17
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);
}
Example #18
0
 function _retrieveUsers($userIds)
 {
     if (!$userIds) {
         return array();
     }
     array_unique($userIds);
     $userService = $this->_getUserService();
     $members = $userService->getByUserIds($userIds);
     $tmp = array();
     require_once R_P . 'require/showimg.php';
     foreach ($members as $member) {
         list($member['face']) = showfacedesign($member['icon'], 1, 'm');
         $tmp[$member['uid']] = $member;
     }
     return $tmp;
 }
Example #19
0
        					'formuid' 	=> $winduid,
        					'formname'	=> $windid,
        					'touid'		=> $uid,
        					'content'	=> $data['title'],
        					'sender'    => $windid,
        					'receiver'  => $tousername,
        				)),
        			),
        			'sms_message',
        			'sms_guestbook'
        		);
        		*/
        M::sendNotice(array($tousername), array('create_uid' => $winduid, 'create_username' => $windid, 'title' => getLangInfo('writemsg', 'o_board_success_title', array('formname' => $windid, 'sender' => $windid, 'receiver' => $tousername)), 'content' => getLangInfo('writemsg', 'o_board_success_cotent', array('formuid' => $winduid, 'formname' => $windid, 'touid' => $uid, 'content' => $data['title'], 'sender' => $windid, 'receiver' => $tousername))), 'notice_guestbook', 'notice_guestbook');
        countPosts('+1');
        require_once R_P . 'require/showimg.php';
        list($myface) = showfacedesign($winddb['icon'], 1, 'm');
        //require_once(R_P.'require/bbscode.php');
        if (strpos($title, '[s:') !== false) {
            $title = showface($title);
        }
        //require_once(R_P.'require/bbscode.php');
        $title = convert(stripslashes($title), $db_windpost);
        $postdate = get_date($timestamp);
        require_once printEOT('m_ajax');
        ajax_footer();
    } else {
        Showmsg('undefined_action');
    }
} elseif ($a == 'delboard') {
    S::gp(array('id'), 'P', 2);
    if (!$id) {
Example #20
0
 function _buildUsers($users)
 {
     if (!$users) {
         return false;
     }
     $data = array();
     require_once R_P . 'require/showimg.php';
     // $genders = array (0 => "保密", 1 => "男", 2 => "女" );
     foreach ($users as $t) {
         list($t['face']) = showfacedesign($t['icon'], 1);
         //$t ['gender'] = $genders [$t ['gender']];
         $t['constellation'] = $this->_getConstellation($t['bday']);
         $t['introduce'] = $t['introduce'] ? substrs($t['introduce'], 25, 'N') : '暂无';
         $data[] = $t;
     }
     return $data;
 }
Example #21
0
 function updateIcon($uid)
 {
     global $atc_attachment_name, $db_ifftp;
     $uid = intval($uid);
     if ($uid < 1 || !S::isArray($_FILES)) {
         return $this->buildResponse(USER_INVALID_PARAMS);
     }
     ACloud_Sys_Core_Common::setGlobal('customized_current_uid', $uid);
     $user = $this->getCurrentUser();
     if (!$user->isLogin()) {
         return $this->buildResponse(USER_NOT_LOGIN);
     }
     $ext = strtolower(substr(strrchr($_FILES['icon']['name'], '.'), 1));
     L::loadClass('faceupload', 'upload', false);
     $face = new FaceUpload($user->uid);
     $icondb = PwUpload::upload($face);
     require_once R_P . 'require/showimg.php';
     $udir = str_pad(substr($user->uid, -2), 2, '0', STR_PAD_LEFT);
     if (!in_array(strtolower($ext), array('gif', 'jpg', 'jpeg', 'png', 'bmp'))) {
         return $this->buildResponse(USER_UPLOAD_CONTENT_ERROR);
     }
     $filename = "{$user->uid}.{$ext}";
     $sourceFilename = "{$user->uid}_tmp.{$ext}";
     $sourceDir = "upload/{$udir}/";
     $middleDir = "upload/middle/{$udir}/";
     $smallDir = "upload/small/{$udir}/";
     $img_w = $img_h = 0;
     $sourceFile = PwUpload::savePath($db_ifftp, $sourceFilename, $sourceDir);
     $middleFile = PwUpload::savePath($db_ifftp, $filename, $middleDir);
     PwUpload::createFolder(dirname($middleFile));
     PwUpload::movefile($sourceFile, $middleFile);
     require_once R_P . 'require/imgfunc.php';
     if (!($img_size = GetImgSize($middleFile))) {
         P_unlink($middleFile);
         return $this->buildResponse(USER_UPLOAD_CONTENT_ERROR);
     }
     list($img_w, $img_h) = getimagesize($middleFile);
     $smallFile = PwUpload::savePath($db_ifftp, $filename, $smallDir);
     $s_ifthumb = 0;
     PwUpload::createFolder(dirname($smallFile));
     if ($ext == 'gif') {
         L::loadClass('gifdecoder', 'utility', false);
         L::loadClass('gif', 'utility', false);
         $gifDecoder = new GIFDecoder($data);
         $frames = $gifDecoder->GIFGetFrames();
         if (!empty($frames)) {
             foreach ($frames as $key => $value) {
                 $frames[$key] = makeAvatarGifThumb($value, $img_w, $img_h, 48, 48);
             }
             $anime = new GIFEncoder($frames, $gifDecoder->GIFGetDelays(), $gifDecoder->GIFGetLoop(), $gifDecoder->GIFGetDisposal(), $gifDecoder->GIFGetTransparentR(), $gifDecoder->GIFGetTransparentG(), $gifDecoder->GIFGetTransparentB(), 'bin');
             $newGifData = $anime->getAnimation();
             PwUpload::createFolder(dirname($smallFile));
             writeover($smallFile, $newGifData);
             $s_ifthumb = 1;
         }
     } elseif (MakeThumb($middleFile, $smallFile, 48, 48)) {
         $s_ifthumb = 1;
     }
     if ($db_ifftp) {
         PwUpload::movetoftp($middleFile, $middleDir . $filename);
         $s_ifthumb && PwUpload::movetoftp($smallFile, $smallDir . $filename);
     }
     $user_a = explode('|', $user->icon);
     $user_a[2] = $img_w;
     $user_a[3] = $img_h;
     $usericon = setIcon("{$udir}/{$user->uid}.{$ext}", 3, $user_a);
     $userService = L::loadClass('UserService', 'user');
     /* @var $userService PW_UserService */
     $userService->update($user->uid, array('icon' => $usericon));
     list($iconurl) = showfacedesign($usericon, 1, 's');
     return $this->buildResponse(0, array('icon' => $iconurl));
 }
Example #22
0
function API_Face($uid, $icon = null)
{
    global $setting, $onlineip, $Block;
    include_once $Block['file_showimg'];
    $GLOBALS['attachpath'] = $GLOBALS['db_attachurl'] != 'N' ? $GLOBALS['db_attachurl'] : $GLOBALS['db_attachname'];
    $GLOBALS['imgdir'] = ONEZ_ROOT . './' . $Block['apipath'] . $GLOBALS['db_picpath'];
    $GLOBALS['attachdir'] = ONEZ_ROOT . './' . $Block['apipath'] . $GLOBALS['db_attachname'];
    $GLOBALS['attachpath'] = $GLOBALS['db_attachname'];
    if ($GLOBALS['db_http'] != 'N') {
        $GLOBALS['imgpath'] = $GLOBALS['db_http'];
    } else {
        $GLOBALS['imgpath'] = $GLOBALS['db_picpath'];
    }
    if (empty($icon)) {
        $icon = Conn()->select("members", "icon", "uid='{$uid}'");
    }
    $img = showfacedesign($icon, 1, 'm');
    return strncmp($img[0], 'http', 4) == 0 ? $img[0] : $setting['apiurl'] . '/' . $img[0];
}
Example #23
0
        $colonyServer->mergeColony($tocid, $cyid);
        refreshto("thread.php?cyid={$tocid}", 'operate_success');
    }
} elseif ($t == 'attorn') {
    if (!($windid == $colony['admin'] && $groupRight['allowattorn'] || $groupid == '3')) {
        Showmsg('您没有权限进行转让操作!');
    }
    if (empty($_POST['step'])) {
        $groupManager = array();
        $query = $db->query("SELECT c.uid,m.username,m.groupid,m.memberid,m.icon FROM pw_cmembers c LEFT JOIN pw_members m ON c.uid=m.uid WHERE c.ifadmin='1' AND c.colonyid=" . S::sqlEscape($cyid));
        while ($rt = $db->fetch_array($query)) {
            $rt['groupid'] == '-1' && ($rt['groupid'] = $rt['memberid']);
            if ($rt['username'] == $colony['admin'] || $o_groups && strpos($o_groups, ',' . $rt['groupid'] . ',') === false) {
                continue;
            }
            list($rt['faceurl']) = showfacedesign($rt['icon'], 1, 'm');
            $groupManager[] = $rt;
        }
        require_once PrintEot('thread_set');
        footer();
    } else {
        S::gp(array('password'));
        S::gp(array('newmanager'), 'GP', 2);
        if (!threadSetCheckOwnerPassword($winduid, $password)) {
            Showmsg('您输入的密码不正确!');
        }
        $userdb = $db->get_one("SELECT m.username,m.groupid,m.memberid FROM pw_cmembers c LEFT JOIN pw_members m ON c.uid=m.uid WHERE c.ifadmin='1' AND c.colonyid=" . S::sqlEscape($cyid) . ' AND c.uid=' . S::sqlEscape($newmanager));
        if (empty($userdb)) {
            Showmsg('请选择要转让的用户!');
        }
        $userdb['groupid'] == '-1' && ($userdb['groupid'] = $userdb['memberid']);
Example #24
0
 /**
  * 用户排行
  *
  * @param string $type
  * @param string $fid
  * @param int $num
  * @param int $special
  * @return array
  */
 function userSort($round = 'postnum', $num = 0, $special = true)
 {
     global $_CREDITDB;
     $num = intval($num) ? intval($num) : $this->defaultnum;
     $sorttype = array('money', 'rvrc', 'credit', 'currency', 'todaypost', 'monthpost', 'postnum', 'monoltime', 'onlinetime', 'digests', 'f_num');
     foreach ($_CREDITDB as $key => $val) {
         is_numeric($key) && ($sorttype[] = $key);
     }
     $type = $round;
     !$type && ($type = 'postnum');
     !in_array($type, $sorttype) && Showmsg('undefined_action');
     $sort = array();
     if ($this->ifpwcache & 1) {
         if (!$special) {
             $sql = "SELECT id as uid,addition as title,value FROM pw_elements WHERE type='usersort' AND mark=" . pwEscape($type) . " ORDER BY value DESC " . pwLimit($num);
         } else {
             require_once R_P . 'require/showimg.php';
             $sql = "SELECT e.id as uid,e.addition as title,e.value,m.icon,m.groupid,m.memberid FROM pw_elements e LEFT JOIN pw_members m ON e.id=m.uid WHERE e.type='usersort' AND e.mark=" . pwEscape($type) . " ORDER BY e.value DESC " . pwLimit($num);
         }
         $query = $this->db->query($sql);
         while ($rt = $this->db->fetch_array($query)) {
             $tem = array();
             $tem['url'] = 'u.php?action=show&uid=' . $rt['uid'];
             $tem['title'] = $rt['title'];
             $tem['value'] = $rt['value'];
             if (array_key_exists('icon', $rt)) {
                 $pic = showfacedesign($rt['icon'], true, 's');
                 if (is_array($pic)) {
                     $tem['image'] = $pic[0];
                 } else {
                     $tem['image'] = '';
                 }
             } else {
                 $tem['image'] = '';
             }
             $tem['addition'] = $rt;
             $sort[] = $tem;
         }
     } else {
         $info = $this->singLeton(true, $num);
         $sort = $info->userSort($type, $num);
     }
     return $sort;
 }
Example #25
0
 function jobDetailHandler($userid, $jobid)
 {
     $total = $this->countJobersByJobIdAndUserId($userid, $jobid);
     if (!$total) {
         return array('', 0);
     }
     $others = $this->getJobersByJobIdAndUserId($userid, $jobid);
     $userIds = array();
     foreach ($others as $other) {
         $userIds[] = $other['userid'];
     }
     if (!$userIds) {
         return array('', 0);
     }
     /*获取用户信息*/
     require_once R_P . 'require/showimg.php';
     $userService = $this->_getUserService();
     $users = array();
     foreach ($userService->getByUserIds($userIds) as $rs) {
         list($rs['face']) = showfacedesign($rs['icon'], 1, 's');
         //统一小图标
         $users[] = $rs;
     }
     return array($users, $total);
 }
Example #26
0
<?php

!defined('R_P') && exit('Forbidden');
$db_menuinit .= ",'td_userinfomore' : 'menu_userinfomore'";
require_once R_P . 'require/credit.php';
$creditdb = array('money' => $winddb['money'], 'rvrc' => $userrvrc, 'credit' => $winddb['credit'], 'currency' => $winddb['currency']);
$creditdb += (array) $credit->get($winduid, 'CUSTOM');
/*SEO*/
bbsSeoSettings();
S::gp(array('action'));
require_once R_P . 'require/showimg.php';
list($faceurl) = showfacedesign($winddb['icon'], 1, 's');
$pro_tab = 'userpay';
if (empty($action)) {
    $orderdb = array();
    $query = $db->query("SELECT * FROM pw_clientorder WHERE uid=" . S::sqlEscape($winduid) . " ORDER BY date DESC LIMIT 5");
    while ($rt = $db->fetch_array($query)) {
        $rt['date'] = get_date($rt['date']);
        $orderdb[] = $rt;
    }
    require_once GetLang('logtype');
    $query = $db->query("SELECT * FROM pw_creditlog WHERE uid=" . S::sqlEscape($winduid) . " ORDER BY id DESC LIMIT 5");
    while ($rt = $db->fetch_array($query)) {
        $rt['adddate'] = get_date($rt['adddate']);
        $rt['descrip'] = descriplog($rt['descrip']);
        $logdb[] = $rt;
    }
    !$db_creditpay && ($db_creditpay = array());
    $paycredit = key($db_creditpay);
    $pay_link = "<span class=\"btn\"><span><button onClick=\"location.href='userpay.php?action=buy';\">马上充值</button></span></span>";
    //* include_once pwCache::getPath(D_P.'data/bbscache/ol_config.php');
Example #27
0
 }
 $usergroup = "<ul class=\"list_A list_160\">";
 $groupselect = "<option value='-1' {$selected['member']}>" . getLangInfo('all', 'reg_member') . "</option>";
 $query = $db->query("SELECT gid,gptype,grouptitle FROM pw_usergroups WHERE gid>2 AND gptype<>'member' ORDER BY gid");
 while ($rt = $db->fetch_array($query)) {
     $gid = $rt['gid'];
     $groupselect .= "<option value='{$gid}' {$selected[$gid]}>{$rt['grouptitle']}</option>";
     if ($rt['gid'] != $groupid) {
         $num++;
         $htm_tr = $num % 3 == 0 ? '' : '';
         $ifchecked = ${'check_' . $rt['gid']};
         $usergroup .= "<li><input type='checkbox' name='groups[]' value='{$rt['gid']}' {$ifchecked}>{$rt['grouptitle']}</li>{$htm_tr}";
     }
 }
 $usergroup .= "</ul>";
 list($iconurl, $icontype, $iconwidth, $iconheight, $iconfile, $iconpig) = showfacedesign($icon, true, 'm');
 $iconsize = $httpurl = '';
 $disabled = 'disabled';
 $width2 = $width3 = $iconwidth;
 $height2 = $height3 = $iconheight;
 $iconsize = $iconwidth ? " width=\"{$iconwidth}\"" : " width=\"75\"";
 $iconsize .= $iconheight ? " height=\"{$iconheight}\"" : " height=\"100\"";
 if ($icontype == 2) {
     $httpurl = $iconurl;
     $width3 = $height3 = '';
 } elseif ($icontype == 3) {
     $width2 = $height2 = $disabled = '';
 }
 $ifselected = false;
 $fp = opendir($imgdir . '/face/');
 while ($facefile = readdir($fp)) {
Example #28
0
 function getUserInfoWithFace($uids)
 {
     if (!S::isArray($uids)) {
         return array();
     }
     require_once R_P . 'require/showimg.php';
     $usersInfo = array();
     $users = $this->getByUserIds($uids);
     //'m.uid','m.username','m.icon','m.groupid'
     foreach ($users as $key => $value) {
         list($value['icon']) = showfacedesign($value['icon'], 1, 's');
         $usersInfo[$value['uid']] = $value;
     }
     return $usersInfo;
 }
Example #29
0
function viewread($read, $start_limit)
{
    global $db, $_G, $isGM, $pwSystem, $groupid, $attach_url, $winduid, $tablecolor, $tpc_author, $tpc_buy, $tpc_pid, $tpc_tag, $count, $orderby, $pageinverse, $timestamp, $db_onlinetime, $attachdir, $attachpath, $readcolorone, $readcolortwo, $lpic, $ltitle, $imgpath, $db_ipfrom, $db_showonline, $stylepath, $db_windpost, $db_windpic, $db_signwindcode, $fid, $tid, $pid, $db_md_ifopen, $_MEDALDB, $rewardtype, $db_shield, $db_iftag, $db_readtag, $viewpic;
    global $ping_logs;
    if ($read['istop'] == 'topped') {
        $read['lou'] = $read['floor'];
    } else {
        $read['lou'] = $count - $start_limit;
    }
    $read['jupend'] = $start_limit == $count - 1 ? "<a name=a></a><a name={$read['pid']}></a>" : "<a name={$read['pid']}></a>";
    $tpc_buy = $read['buy'];
    $tpc_pid = $read['pid'];
    $tpc_tag = NULL;
    $tpc_shield = 0;
    $read['ifsign'] < 2 && ($read['content'] = str_replace("\n", "<br />", $read['content']));
    if ($read['anonymous']) {
        $anonymous = !$isGM && $winduid != $read['authorid'] && !$pwSystem['anonyhide'];
        $read['anonymousname'] = $GLOBALS['db_anonymousname'];
    } else {
        $anonymous = false;
        $read['anonymousname'] = $read['username'];
    }
    $read['ipfrom'] = $db_ipfrom == 1 && $_G['viewipfrom'] ? $read['ipfrom'] : '';
    $read['ip'] = $isGM || $pwSystem['viewip'] ? 'IP:' . $read['userip'] : '';
    if ($read['groupid'] && !$anonymous) {
        $read['groupid'] == '-1' && ($read['groupid'] = $read['memberid']);
        !array_key_exists($read['groupid'], (array) $lpic) && ($read['groupid'] = 8);
        $read['lpic'] = $lpic[$read['groupid']];
        $read['level'] = $ltitle[$read['groupid']];
        $read['regdate'] = get_date($read['regdate'], "Y-m-d");
        $read['lastlogin'] = get_date($read['lastvisit'], "Y-m-d");
        $read['rvrc'] = floor($read['rvrc'] / 10);
        $read['author'] = $read['username'];
        $tpc_author = $read['author'];
        if (!empty($GLOBALS['showfield'])) {
            $customdata = $read['customdata'] ? (array) unserialize($read['customdata']) : array();
            $read['customdata'] = array();
            foreach ($customdata as $key => $val) {
                if ($val && in_array($key, $GLOBALS['showfield'])) {
                    $read['customdata'][$key] = $val;
                }
            }
        }
        $read['ontime'] = (int) ($read['onlinetime'] / 3600);
        $read['groupid'] == 6 && ($read['honor'] = '');
        if ($read['groupid'] != 6 && ($read['ifsign'] == 1 || $read['ifsign'] == 3)) {
            global $sign;
            if (!$sign[$read['author']]) {
                global $db_signmoney, $db_signgroup, $tdtime, $db_signcurtype;
                if ($db_signmoney && strpos($db_signgroup, ",{$read['groupid']},") !== false && (!getstatus($read['userstatus'], PW_USERSTATUS_SHOWSIGN) || !$read['starttime'] || $read[$db_signcurtype] < ($tdtime - $read['starttime']) / 86400 * $db_signmoney)) {
                    $read['signature'] = '';
                } else {
                    if ($db_signwindcode && getstatus($read['userstatus'], PW_USERSTATUS_SIGNCHANGE)) {
                        if ($GLOBALS['gp_right'][$read['groupid']]['imgwidth'] && $GLOBALS['gp_right'][$read['groupid']]['imgheight']) {
                            $db_windpic['picwidth'] = $GLOBALS['gp_right'][$read['groupid']]['imgwidth'];
                            $db_windpic['picheight'] = $GLOBALS['gp_right'][$read['groupid']]['imgheight'];
                        }
                        if ($GLOBALS['gp_right'][$read['groupid']]['fontsize']) {
                            $db_windpic['size'] = $GLOBALS['gp_right'][$read['groupid']]['fontsize'];
                        }
                        $read['signature'] = convert($read['signature'], $db_windpic, 2);
                    }
                    $read['signature'] = str_replace("\n", "<br />", $read['signature']);
                }
                $sign[$read['author']] = $read['signature'];
            } else {
                $read['signature'] = $sign[$read['author']];
            }
        } else {
            $read['signature'] = '';
        }
    } else {
        $read['lpic'] = $lpic['2'];
        $read['level'] = $read['digests'] = $read['postnum'] = $read['money'] = $read['currency'] = '*';
        $read['rvrc'] = $read['lastlogin'] = $read['credit'] = $read['regdate'] = '*';
        $read['honor'] = $read['signature'] = $read['micon'] = $read['aliww'] = '';
        if ($anonymous) {
            $read['oicq'] = $read['ip'] = $read['medals'] = $read['ipfrom'] = '';
            $read['author'] = $GLOBALS['db_anonymousname'];
            $read['authorid'] = 0;
            foreach ($GLOBALS['customfield'] as $key => $val) {
                $field = "field_" . (int) $val['id'];
                $read[$field] = '*';
            }
        }
    }
    list($read['face'], , $httpWidth, $httpHeight, , , , $read['facesize']) = showfacedesign($read['micon'], true, 'm');
    if ($httpWidth > 120 || $httpHeight > 120 || $read['facesize'] == '') {
        $read['facesize'] = ' width="120" height="120"';
    }
    list($read['posttime'], $read['postdate']) = getLastDate($read['postdate']);
    $read['mark'] = $read['reward'] = $read['tag'] = NULL;
    if ($read['ifmark']) {
        $ping_logs[$read['pid']] = $read['ifmark'];
    }
    if ($rewardtype != null) {
        if ($read['lou'] == 0 || $read['ifreward'] > 0 || $rewardtype == '0' && $winduid == $GLOBALS['authorid'] && $winduid != $read['authorid']) {
            $read['reward'] = Getrewhtml($read['lou'], $read['ifreward'], $read['pid']);
        }
    }
    if ($read['icon']) {
        $read['icon'] = "<img src=\"{$imgpath}/post/emotion/{$read['icon']}.gif\" align=\"left\" border=\"0\" />";
    } else {
        $read['icon'] = '';
    }
    if ($db_md_ifopen && $read['medals']) {
        $medals = $ifMedalNotExist = '';
        $md_a = explode(',', $read['medals']);
        foreach ($md_a as $key => $value) {
            if ($value && $_MEDALDB[$value]) {
                $medals .= "<a href=\"apps.php?q=medal\" target=\"_blank\"><img src=\"{$_MEDALDB[$value][smallimage]}\" width=\"30\" height=\"30\"  title=\"{$_MEDALDB[$value][name]}\" /></a>";
            } else {
                unset($md_a[$key]);
                $ifMedalNotExist = 1;
            }
        }
        if ($ifMedalNotExist == 1) {
            $newMedalInfo = implode(',', $md_a);
            $userService = L::loadClass('UserService', 'user');
            /* @var $userService PW_UserService */
            $userService->update($read['authorid'], array('medals' => $newMedalInfo));
        }
        $read['medals'] = $medals . '<br />';
    } else {
        $read['medals'] = '';
    }
    $read['leaveword'] && ($read['content'] .= leaveword($read['leaveword'], $read['pid']));
    if ($read['ifshield'] || $read['groupid'] == 6 && $db_shield) {
        if ($read['ifshield'] == 2) {
            $read['content'] = shield('shield_del_article');
            $read['subject'] = '';
            $tpc_shield = 1;
        } else {
            if ($groupid == '3') {
                $read['subject'] = shield('shield_title');
            } else {
                $read['content'] = shield($read['ifshield'] ? 'shield_article' : 'ban_article');
                $read['subject'] = '';
                $tpc_shield = 1;
            }
        }
        $read['icon'] = '';
    }
    if (!$tpc_shield) {
        if ($read['ifwordsfb'] != $GLOBALS['db_wordsfb']) {
            $read['content'] = wordsConvert($read['content'], array('id' => $tpc_pid == 'tpc' ? $tid : $tpc_pid, 'type' => $tpc_pid == 'tpc' ? 'topic' : 'posts', 'code' => $read['ifwordsfb']));
        }
        if ($read['ifconvert'] == 2) {
            $read['content'] = convert($read['content'], $db_windpost);
        } else {
            $tpc_tag && ($read['content'] = relatetag($read['content'], $tpc_tag));
            strpos($read['content'], '[s:') !== false && ($read['content'] = showface($read['content']));
        }
        if ($read['aid'] && $GLOBALS['attachShow']->isShow($read['ifhide'], $tid)) {
            $read += $GLOBALS['attachShow']->parseAttachs($read['pid'], $read['content'], $winduid == $read['authorid']);
        }
    }
    /**
     * convert the post content
     */
    $read['alterinfo'] && ($read['content'] .= "<div id=\"alert_{$read['pid']}\" style=\"color:gray;margin-top:30px\">[ {$read['alterinfo']} ]</div>");
    if ($read['remindinfo']) {
        $remind = explode("\t", $read['remindinfo']);
        $remind[0] = str_replace("\n", "<br />", $remind[0]);
        $remind[2] && ($remind[2] = get_date($remind[2]));
        $read['remindinfo'] = $remind;
    }
    if ($_GET['keyword']) {
        $keywords = explode("|", $_GET['keyword']);
        foreach ($keywords as $key => $value) {
            if ($value) {
                $read['content'] = preg_replace("/(?<=[\\s\"\\]>()]|[-�]|^)(" . preg_quote($value, '/') . ")([.,:;-?!()\\s\"<\\[]|[-�]|\$)/siU", "<u><font color=\"red\">\\1</font></u>\\2", $read['content']);
            }
        }
    }
    //$GLOBALS['foruminfo']['copyctrl'] && $read['content'] = preg_replace("/<br \/>/eis","copyctrl()",$read['content']);
    return $read;
}
Example #30
0
 function _getreplys($tid, $offset, $limit, $order = 'asc')
 {
     global $db_windpost, $pwforum;
     require_once R_P . 'require/showimg.php';
     $pw_posts = $this->getCustomizedCommonService()->getPtable($tid);
     $array = array();
     $order = strtolower($order);
     !in_array($order, array('asc', 'desc')) && ($order = 'asc');
     $direct = $order == 'asc' ? '>' : '<';
     $sqlLimit = $offset > 0 ? " AND p.pid {$direct} " . intval($offset) : '';
     $query = $GLOBALS['db']->query("SELECT p.*,m.uid,m.icon,m.groupid,m.userstatus FROM {$pw_posts} p LEFT JOIN pw_members m ON p.authorid=m.uid WHERE p.tid=" . S::sqlEscape($tid) . " AND p.ifcheck='1' {$sqlLimit} ORDER BY p.postdate {$order} LIMIT " . intval($limit));
     while ($rt = $GLOBALS['db']->fetch_array($query)) {
         list($_icon) = showfacedesign($rt['icon'], '1', 's');
         $udb[$rt['uid']] = array('uid' => $rt['uid'], 'userstatus' => $rt['userstatus'], 'groupid' => $rt['groupid']);
         $array[$rt['pid']] = array('pid' => $rt['pid'], 'aid' => $rt['aid'], 'tid' => $rt['tid'], 'author' => $rt['author'], 'authorid' => $rt['authorid'], 'icon' => $_icon, 'postdate' => $rt['postdate'], 'subject' => $rt['subject'], 'content' => $rt['content']);
     }
     $bandb = $pwforum->forumBan($udb);
     foreach ($array as $key => $value) {
         $GLOBALS['tpc_buy'] = $value['buy'];
         $GLOBALS['tpc_author'] = $value['author'];
         $GLOBALS['tpc_pid'] = $value['pid'];
         isset($bandb[$value['authorid']]) && ($value['groupid'] = 6);
         $attachlist = $this->getCustomizedCommonService()->parseImgInContent($value);
         $content = $this->getCustomizedCommonService()->parsePostContent($value);
         $content = $this->getCustomizedCommonService()->clearHtmlTag($content, '<br>');
         $array[$key]['content'] = $content;
         $array[$key]['attachlist'] = $attachlist;
     }
     return $array;
 }