Ejemplo n.º 1
0
 function getDetailInfo()
 {
     global $customfield, $winduid, $groupid;
     $customfield = L::config('customfield', 'customfield');
     !is_array($customfield) && ($customfield = array());
     foreach ($customfield as $key => $value) {
         if ($value['viewright'] && $winduid != $this->uid && strpos(",{$value['viewright']},", ",{$groupid},") === false) {
             unset($customfield[$key]);
             continue;
         }
         $customfield[$key]['id'] = $value['id'] = (int) $value['id'];
         $customfield[$key]['field'] = "field_{$value['id']}";
     }
     $userService = L::loadClass('UserService', 'user');
     /* @var $userService PW_UserService */
     if ($detail = $userService->get($this->uid, true, true, true)) {
         $days = max(1, ceil(($GLOBALS['timestamp'] - $detail['regdate']) / 86400));
         $detail['lastpost'] < $GLOBALS['tdtime'] && ($detail['todaypost'] = 0);
         $detail['averagepost'] = round($detail['postnum'] / $days, 2);
         $detail['onlinetime_s'] = floor($detail['onlinetime'] / 3600);
         $detail['regdate'] = get_date($detail['regdate'], 'Y-m-d');
         $detail['lastvisit_s'] = get_date($detail['lastvisit'], 'Y-m-d');
         $this->info = array_merge($this->info, $detail);
         if ($GLOBALS['db_signwindcode'] && $this->info['signature'] && getstatus($this->info['userstatus'], PW_USERSTATUS_SIGNCHANGE)) {
             require_once R_P . 'require/bbscode.php';
             $this->info['signature'] = convert($this->info['signature'], $GLOBALS['db_windpic'], 2);
         }
         $this->info['signature'] = str_replace("\n", "<br/>", $this->info['signature']);
         $this->info['introduce'] = str_replace("\n", "<br/>", $this->info['introduce']);
     }
 }
Ejemplo n.º 2
0
 function getData($invokename, $title, $loopid = 0)
 {
     $temp = $this->_getDataFromCache($invokename, $title, $loopid);
     if ($temp === false) {
         if (L::config('area_static_ifon', 'area_config') != 1) {
             $this->index++;
         }
         $temp = $this->_getDataFromBBS($invokename, $title, $loopid);
     }
     return $temp;
 }
Ejemplo n.º 3
0
 function getInstance($uid, $aid, $num)
 {
     $saveAttach = null;
     L::loadClass('photo', 'colony', false);
     $photoService = new PW_Photo($uid, 0, 1, 0);
     $albumInfo = $photoService->getAlbumInfo($aid);
     $photonums = $albumInfo['photonum'];
     $GLOBALS += L::config(null, 'o_config');
     if ($albumInfo && (!$GLOBALS['o_maxphotonum'] || $albumInfo['photonum'] + $num <= $GLOBALS['o_maxphotonum'])) {
         L::loadClass('photoupload', 'upload', false);
         $saveAttach = new saveAttach(new PhotoUpload($aid));
     }
     return $saveAttach;
 }
Ejemplo n.º 4
0
function checkEditAdmin($name, $cid)
{
    if (isGM($name)) {
        return true;
    }
    if (!$name) {
        return false;
    }
    $area_editadmin = L::config('area_editadmin', 'area_config');
    if (!$area_editadmin) {
        return false;
    }
    $area_editadmin = explode(',', $area_editadmin[$cid]);
    return in_array($name, $area_editadmin);
}
Ejemplo n.º 5
0
 function get_info($uid, $num = 0)
 {
     require_once R_P . 'require/showimg.php';
     $array = array();
     list($array['faceurl']) = showfacedesign($this->spaceinfo['icon'], 1, 'm');
     $ltitle = L::config('ltitle', 'level');
     $array['systitle'] = $this->spaceinfo['groupid'] == '-1' ? '' : $ltitle[$this->spaceinfo['groupid']];
     $array['memtitle'] = $ltitle[$this->spaceinfo['memberid']];
     $array['thisvisit'] = $this->spaceinfo['thisvisit'];
     $array['regdate'] = $this->spaceinfo['regdate'];
     $array['lastvisit_s'] = get_date($this->spaceinfo['lastvisit'], 'Y-m-d');
     $array['totalcredit'] = $this->_getUserTotalCredit();
     $array = array_merge($array, $this->_getDetailInfo($uid));
     return $array;
 }
Ejemplo n.º 6
0
function checkEditAdmin($name, $cid, $pushtype = '')
{
    if (isGM($name)) {
        return true;
    }
    if (!$name) {
        return false;
    }
    if ($pushtype == 'show') {
        $area_editadmin = L::config('show_editadmin', 'show_config');
    } else {
        $area_editadmin = L::config('area_editadmin', 'area_config');
    }
    if (!$area_editadmin) {
        return false;
    }
    $area_editadmin = explode(',', $area_editadmin[$cid]);
    return in_array($name, $area_editadmin);
}
Ejemplo n.º 7
0
 function _getClassidAdd($classID)
 {
     $classID = (int) $classID;
     if (!$classID) {
         return '';
     }
     $o_styledb = L::config('o_styledb', 'o_config');
     if (!isset($o_styledb[$classID])) {
         return '';
     }
     if ($o_styledb[$classID]['upid'] != '0') {
         return ' AND c.styleid=' . S::sqlEscape($classID);
     }
     $array = array();
     foreach ($o_styledb as $k => $v) {
         if ($v['upid'] == $classID) {
             $array[] = $k;
         }
     }
     return $array ? ' AND c.styleid IN(' . S::sqlImplode($array) . ')' : ' AND c.styleid=' . S::sqlEscape($classID);
 }
Ejemplo n.º 8
0
/**
 * 检查用户是否有管理文章权限
 * @param unknown_type $name
 * @param unknown_type $cid
 * @return string|string|string|boolean
 */
function checkEditPurview($name, $cid = '')
{
    if (isGM($name)) {
        return true;
    }
    if (!$name) {
        return false;
    }
    $cms_editadmin = L::config('cms_editadmin', 'cms_config');
    if (!S::isArray($cms_editadmin)) {
        return false;
    }
    if (empty($cid)) {
        $_keys = array_keys($cms_editadmin);
        foreach ($_keys as $key) {
            if (S::inArray($name, $cms_editadmin[$key])) {
                return true;
            }
        }
        return false;
    }
    return S::inArray($name, $cms_editadmin[$cid]);
}
Ejemplo n.º 9
0
 /**
  * 注意关联函数 apps/groups/lib/colony.class.php
  * @param $info
  */
 function _calculateCredit($info)
 {
     require_once R_P . 'require/functions.php';
     $info['pnum'] -= $info['tnum'];
     return CalculateCredit($info, L::config('o_groups_upgrade', 'o_config'));
 }
Ejemplo n.º 10
0
 /**
  * @return unknown_type
  */
 function setResult(&$result)
 {
     $dcache = L::config(null, $this->filename);
     $result = $dcache['_result'];
 }
Ejemplo n.º 11
0
!$_G['allowhonor'] && Showmsg('抱歉,你没有编辑个性签名的权限');
if (empty($_POST['step'])) {
    require_once PrintEot('ajax');
    ajax_footer();
} else {
    PostCheck();
    S::gp(array('content'), 'P');
    $content = trim(str_replace("\n", '', $content));
    strlen($content) > 90 && ($content = substrs($content, 90));
    $wordsfb = L::loadClass('FilterUtil', 'filter');
    $banword = $wordsfb->comprise(stripslashes($content));
    if ($banword !== false) {
        Showmsg('content_wordsfb');
    }
    if ($winddb['honor'] != stripslashes($content)) {
        $userService = L::loadClass('UserService', 'user');
        /* @var $userService PW_UserService */
        $userService->update($winduid, array('honor' => $content));
        //* $_cache = getDatastore();
        //* $_cache->delete('UID_'.$winduid);
        if (L::config('o_weibopost', 'o_config')) {
            $weiboService = L::loadClass('weibo', 'sns');
            if ($weiboService->sendCheck($content, $groupid)) {
                $weiboService->send($winduid, $content, 'honor');
            }
        }
    }
    //require_once (R_P . 'require/postfunc.php');
    echo "success\t" . stripslashes($content);
    ajax_footer();
}
Ejemplo n.º 12
0
        list($authStep, $remainTime, $waitTime, $mobile) = $authService->getStatus('register');
        $authStep_1 = $authStep_2 = 'none';
        ${'authStep_' . $authStep} = '';
    }
    !$rg_config['rg_timestart'] && ($rg_config['rg_timestart'] = 1960);
    !$rg_config['rg_timeend'] && ($rg_config['rg_timeend'] = 2000);
    $img = @opendir(S::escapeDir("{$imgdir}/face"));
    while ($imagearray = @readdir($img)) {
        if ($imagearray != "." && $imagearray != ".." && $imagearray != "" && $imagearray != "none.gif") {
            $imgselect .= "<option value='{$imagearray}'>{$imagearray}</option>";
        }
    }
    @closedir($img);
    //require_once(R_P.'require/header.php');
    $custominfo = unserialize($db_union[7]);
    $customfield = L::config('customfield', 'customfield');
    if ($customfield) {
        $customfieldService = L::loadClass('CustomerFieldService', 'user');
    }
    require_once PrintEot('register');
    footer();
} elseif ($step == 2) {
    PostCheck(0, $db_gdcheck & 1, $db_ckquestion & 1 && $db_question, 0);
    if ($_GET['method'] || !($db_gdcheck & 1) && $_POST['gdcode'] || !($db_ckquestion & 1) && ($_POST['qanswer'] || $_POST['qkey'])) {
        Showmsg('undefined_action');
    }
    S::gp(array('regreason', 'regname', 'regpwd', 'regpwdrepeat', 'regemail', 'customdata', 'regemailtoall', 'rgpermit', 'authmobile', 'authverify'), 'P');
    S::gp(array('question', 'customquest', 'answer'), 'P');
    if ($db_authstate && $db_authreg) {
        $authService = L::loadClass('Authentication', 'user');
        $status = $authService->checkverify($authmobile, ip2long($onlineip), $authverify);
Ejemplo n.º 13
0
} else {
    $uid = $uid ? intval($uid) : $winduid;
}
if ($uid) {
    //* $_cache = getDatastore();
    //* $_cache->delete(array("UID_$uid","UID_CREDIT_$uid","UID_GROUP_$uid"));
    //* perf::gatherInfo('changeMembersWithUserIds', array('uid'=>$uid));
    //* perf::gatherInfo('changeMemberCreditWithUserIds', array('uid'=>$uid));
    //* perf::gatherInfo('changeCmemberAndColonyWithUserIds', array('uid'=>$uid));
}
require_once R_P . 'u/lib/space.class.php';
$newSpace = new PwSpace($uid);
if (!($space =& $newSpace->getInfo())) {
    Showmsg('您访问的空间不存在!');
}
$inv_config = L::config(null, 'inv_config');
if (GetCookie('userads') && $inv_linkopen && $inv_linktype == '0') {
    list($uid, $a) = explode("\t", GetCookie('userads'));
    if (is_numeric($uid) || $a && strlen($a) < 16) {
        require_once R_P . 'require/userads.php';
    }
}
$newSpace->initSet();
$indexRight = $newSpace->viewRight('index');
$indexValue = $newSpace->getPrivacyByKey('index');
if ($indexRight) {
    $data = $newSpace->layout();
    //var_dump($data);
} else {
    $data = array(0 => $newSpace->getSpaceData(array('info' => 1)));
}
Ejemplo n.º 14
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'];
         $read['face'] = showfacedesign($read['micon']);
         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=\"hack/medal/image/{$_MEDALDB[$value][picurl]}\" title=\"{$_MEDALDB[$value][name]}\" alt=\"{$_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'], 9)) {
                         $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'] = "<br>";
         $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;
     }
     $creditnames = pwCreditNames();
     if (!$tpc_shield) {
         $attachs = $aids = array();
         if ($read['aid'] && !$read['ifhide']) {
             $attachs = $read['aid'];
             $aids = attachment($read['content']);
         }
         $wordsfb = L::loadClass('FilterUtil');
         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 ($attachs && is_array($attachs) && !$read['ifhide']) {
             foreach ($attachs as $at) {
                 $atype = '';
                 $rat = array();
                 if ($at['type'] == 'img' && $at['needrvrc'] == 0) {
                     $a_url = geturl($at['attachurl'], 'show');
                     if (is_array($a_url)) {
                         $atype = 'pic';
                         $dfurl = '<br>' . cvpic($a_url[0], 1, $db_windpost['picwidth'], $db_windpost['picheight'], $at['ifthumb']);
                         $rat = array('aid' => $at['aid'], 'img' => $dfurl, 'dfadmin' => 0, 'desc' => $at['desc']);
                     } elseif ($a_url == 'imgurl') {
                         $atype = 'picurl';
                         $rat = array('aid' => $at['aid'], 'name' => $at['name'], 'dfadmin' => 0, 'verify' => md5("showimg{$read[tid]}{$read[pid]}{$read[fid]}{$at[aid]}{$GLOBALS[db_hash]}"));
                     }
                 } else {
                     $atype = 'downattach';
                     if ($at['needrvrc'] > 0) {
                         !$at['ctype'] && ($at['ctype'] = $at['special'] == 2 ? 'money' : 'rvrc');
                         $at['special'] == 2 && $GLOBALS['db_sellset']['price'] > 0 && ($at['needrvrc'] = min($at['needrvrc'], $GLOBALS['db_sellset']['price']));
                     }
                     $rat = array('aid' => $at['aid'], 'name' => $at['name'], 'size' => $at['size'], 'hits' => $at['hits'], 'needrvrc' => $at['needrvrc'], 'special' => $at['special'], 'cname' => $creditnames[$at['ctype']], 'type' => $at['type'], 'dfadmin' => 0, 'desc' => $at['desc'], 'ext' => strtolower(substr(strrchr($at['name'], '.'), 1)));
                 }
                 if (!$atype) {
                     continue;
                 }
                 if (in_array($at['aid'], $aids)) {
                     $read['content'] = attcontent($read['content'], $atype, $rat);
                 } else {
                     $read[$atype][$at['aid']] = $rat;
                 }
             }
         }
     }
     $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;
 }
Ejemplo n.º 15
0
 function getSaveDir($ext)
 {
     $o_attachdir = L::config('o_attachdir', 'o_config');
     $savedir = 'diary/';
     if ($o_attachdir) {
         if ($o_attachdir == 1) {
             $savedir .= "Type_{$ext}/";
         } elseif ($o_attachdir == 2) {
             $savedir .= 'Mon_' . date('ym') . '/';
         } elseif ($o_attachdir == 3) {
             $savedir .= 'Day_' . date('ymd') . '/';
         }
     }
     return $savedir;
 }
Ejemplo n.º 16
0
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) {
            $ltitle = is_array($ltitle) ? $ltitle : array($ltitle);
            if ($value && array_key_exists($value, $ltitle)) {
                $groupselect .= "<option value=\"{$value}\">{$ltitle[$value]}</option>";
            }
        }
    }
    $db_union[7] && (list($customdata, $custominfo) = Getcustom($userdb['customdata']));
    $sexselect[(int) $userdb['gender']] = 'checked';
    !$rg_timestart && ($rg_timestart = 1960);
    !$rg_timeend && ($rg_timeend = 2000);
    $getbirthday = explode('-', $userdb['bday']);
    $yearslect[(int) $getbirthday[0]] = $monthslect[(int) $getbirthday[1]] = $dayslect[(int) $getbirthday[2]] = 'selected';
Ejemplo n.º 17
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;
 }
Ejemplo n.º 18
0
 //* include_once S::escapePath(D_P."data/style/$tskin.php");
 extract(pwCache::getData(S::escapePath(D_P . "data/style/{$tskin}.php"), false));
 if (!file_exists(R_P . "template/{$tplpath}/{$readtpl}.htm")) {
     //* include_once S::escapePath(D_P."data/style/$db_defaultstyle.php");
     extract(pwCache::getData(S::escapePath(D_P . "data/style/{$db_defaultstyle}.php"), false));
     if (!file_exists(R_P . "template/{$tplpath}/{$readtpl}.htm")) {
         $tplpath = 'wind';
     }
 }
 if (file_exists(D_P . "data/style/{$tplpath}_css.htm")) {
     $css_path = D_P . "data/style/{$tplpath}_css.htm";
 } else {
     $css_path = D_P . 'data/style/wind_css.htm';
 }
 if ($db_md_ifopen) {
     $_MEDALDB = L::config('_MEDALDB', 'cache_read');
 }
 $fieldadd = $tablaadd = '';
 foreach ($customfield as $key => $val) {
     $val['id'] = (int) $val['id'];
     $fieldadd .= ",mb.field_{$val['id']}";
 }
 $fieldadd && ($tablaadd = "LEFT JOIN pw_memberinfo mb ON mb.uid=t.authorid");
 $S_sql = ',tm.*,m.uid,m.username,m.oicq,m.groupid,m.memberid,m.icon AS micon ,m.hack,m.honor,m.signature,m.regdate,m.medals,m.userstatus,md.onlinetime,md.postnum,md.digests,md.rvrc,md.money,md.credit,md.currency,md.starttime,md.thisvisit,md.lastvisit,p.voteopts,p.modifiable,p.previewable,p.multiple,p.mostvotes,p.voters,p.timelimit,p.leastvotes,p.regdatelimit,p.creditlimit,p.postnumlimit';
 $pw_tmsgs = GetTtable($tid);
 $J_sql = "LEFT JOIN {$pw_tmsgs} tm ON t.tid=tm.tid LEFT JOIN pw_members m ON m.uid=t.authorid LEFT JOIN pw_memberdata md ON md.uid=t.authorid LEFT JOIN pw_polls p ON p.tid=t.tid";
 $usehtm = 1;
 $read = $db->get_one("SELECT t.* {$S_sql} {$fieldadd} FROM pw_threads t {$J_sql} {$tablaadd} WHERE t.tid=" . S::sqlEscape($tid));
 if (!$read) {
     $usehtm = 0;
 }
Ejemplo n.º 19
0
 /**
  * @return unknown_type
  */
 function getResult()
 {
     $dcache = L::config(null, $this->filename);
     return $dcache['_result'];
 }
Ejemplo n.º 20
0
 function addColonyUser($uid, $username, $frombbs = false)
 {
     global $credit;
     require_once R_P . 'require/credit.php';
     //积分变动
     $o_groups_creditset = L::config('o_groups_creditset', 'o_config');
     if (!empty($o_groups_creditset['Joingroup'])) {
         require_once R_P . 'u/require/core.php';
         $credit->appendLogSet(L::config('o_groups_creditlog', 'o_config'), 'groups');
         $creditset = getCreditset($o_groups_creditset['Joingroup'], false);
         $credit->addLog('groups_Joingroup', $creditset, array('uid' => $uid, 'username' => $username, 'ip' => $GLOBALS['onlineip']));
         $credit->sets($uid, $creditset);
     }
     /**
     		$this->_db->update("INSERT INTO pw_cmembers SET " . S::sqlSingle(array(
     			'uid'		=> $uid,
     			'username'	=> $username,
     			'ifadmin'	=> $this->info['ifcheck'] == 2 ? '0' : '-1',
     			'colonyid'	=> $this->cyid,
     			'addtime'	=> $GLOBALS['timestamp']
     		)));
     		**/
     pwQuery::insert('pw_cmembers', array('uid' => $uid, 'username' => $username, 'ifadmin' => $this->info['ifcheck'] == 2 ? '0' : '-1', 'colonyid' => $this->cyid, 'addtime' => $GLOBALS['timestamp']));
     if ($this->info['ifcheck'] == 2) {
         $this->updateInfoCount(array('members' => 1));
     }
     $this->_sendJoinMsg($frombbs);
     if ($this->info['ifcheck'] == 2) {
         updateUserAppNum($uid, 'group');
         return 'colony_joinsuccess';
     }
     return 'colony_joinsuccess_check';
 }
Ejemplo n.º 21
0
 function _adminDiv($string, $id)
 {
     $temp = '<div class="view-hover">';
     if (L::config('area_static_ifon', 'area_config') == 1) {
         $temp .= $this->_getEditLink($id) . "\n";
     } else {
         $temp .= "\nEOT;\nif(\$ifEditAdmin){\nprint <<<EOT\n" . $this->_getEditLink($id) . "\n";
         $temp .= "\nEOT;\n}print <<<EOT\n";
     }
     $temp .= $string;
     $temp .= '</div>';
     return $temp;
 }
Ejemplo n.º 22
0
 function forum($fid)
 {
     return L::config('foruminfo', 'fid_' . intval($fid), 'forums', false);
 }
Ejemplo n.º 23
0
function updateMemberid($uid, $isown = true)
{
    require_once R_P . 'require/functions.php';
    global $db, $winddb, $creditset, $db_upgrade, $credit, $lneed;
    if (!is_object($credit)) {
        require_once R_P . 'require/credit.php';
    }
    $lneed || ($lneed = L::config('lneed', 'level'));
    if ($isown == true) {
        $userdb = $winddb;
    } else {
        $userService = L::loadClass('UserService', 'user');
        /* @var $userService PW_UserService */
        $userdb = $userService->get($uid, true, true);
    }
    $userdb['rvrc'] += $creditset['rvrc'];
    $userdb['money'] += $creditset['money'];
    $userdb['credit'] += $creditset['credit'];
    $userdb['currency'] += $creditset['currency'];
    $usercredit = array('postnum' => $userdb['postnum'], 'digests' => $userdb['digests'], 'rvrc' => $userdb['rvrc'], 'money' => $userdb['money'], 'credit' => $userdb['credit'], 'currency' => $userdb['currency'], 'onlinetime' => $userdb['onlinetime']);
    $upgradeset = unserialize($db_upgrade);
    foreach ($upgradeset as $key => $val) {
        if (is_numeric($key) && $val) {
            foreach ($credit->get($uid, 'CUSTOM') as $key => $value) {
                $usercredit[$key] = $value;
            }
            break;
        }
    }
    $memberid = getmemberid(CalculateCredit($usercredit, $upgradeset));
    if ($userdb['memberid'] != $memberid) {
        $userService = L::loadClass('UserService', 'user');
        /* @var $userService PW_UserService */
        $userService->update($uid, array('memberid' => $memberid));
        //* $_cache = getDatastore();
        //* $_cache->delete('UID_'.$uid);
    }
}
Ejemplo n.º 24
0
 function get_colony($uid, $num = 20)
 {
     require_once R_P . 'require/bbscode.php';
     require_once R_P . 'apps/groups/lib/colony.class.php';
     $o_styledb = L::config('o_styledb', 'o_config');
     $array = array();
     $query = $this->_db->query("SELECT c.* FROM pw_cmembers cm LEFT JOIN pw_colonys c ON cm.colonyid=c.id WHERE cm.uid=" . S::sqlEscape($uid) . " AND cm.ifadmin <> '-1' ORDER BY cm.colonyid DESC " . S::sqlLimit($num));
     while ($rt = $this->_db->fetch_array($query)) {
         if ($rt['cnimg']) {
             list($rt['cnimg']) = geturl("cn_img/{$rt['cnimg']}", 'lf');
         } else {
             $rt['cnimg'] = $GLOBALS['imgpath'] . '/g/groupnopic.gif';
         }
         $rt['descrip'] && ($rt['descrip'] = convert($rt['descrip'], array()));
         $rt['stylename'] = $o_styledb[$rt['styleid']]['cname'];
         $rt['colonyNums'] = PwColony::calculateCredit($rt);
         $rt['createtime'] = get_date($rt['createtime'], 'Y-m-d');
         $array[] = $rt;
     }
     return $array;
 }
Ejemplo n.º 25
0
function getmemberNeed($memberid)
{
    global $lneed;
    $lneed || ($lneed = L::config('lneed', 'level'));
    arsort($lneed);
    reset($lneed);
    return (int) $lneed[$memberid];
}
Ejemplo n.º 26
0
<?php

!defined('A_P') && exit('Forbidden');
S::gp(array('do'));
!$winduid && Showmsg('not_login');
$USCR = 'user_weibo';
S::gp(array('s'));
if ($s) {
    //底部快捷
    require_once R_P . 'require/showimg.php';
    list($faceurl) = showfacedesign($winddb['icon'], 1, 'm');
    require_once PrintEot('m_weibo_bottom');
    pwOutPut();
}
extract(L::config(null, 'o_config'));
$whilelist = array('post', 'my', 'attention', 'refer', 'comment', 'lookround', 'filterweibo', 'ajax', 'transmit', 'postcomment', 'deletecomment', 'receive', 'replay', 'deleteweibo', 'conloy', 'topics', 'posttopic', 'page');
if (!in_array($do, $whilelist)) {
    $do = 'my';
}
$nav = !in_array($do, array('receive')) ? array($do => 'class="current"') : array('refer' => 'class="current"');
$perpage = 20;
if ($do == 'post') {
    PostCheck();
    S::gp(array('atc_content'), 'GP');
    S::gp(array('uploadPic', 'ismessage', 'type'), 'GP');
    $type != 'sendweibo' && ($type = 'weibo');
    if ($o_weibourl != 1) {
        preg_match('/http:\\/\\//i', $atc_content) && Showmsg('weibo_link_close');
    }
    $userService = L::loadClass('UserService', 'user');
    /* @var $userService PW_UserService */
Ejemplo n.º 27
0
 function checkInv($invcode)
 {
     global $timestamp;
     if (empty($invcode)) {
         Showmsg('invcode_empty');
     }
     $inv_days = L::config('inv_days', 'inv_config') * 86400;
     $this->inv = $this->db->get_one("SELECT id,uid FROM pw_invitecode WHERE invcode=" . S::sqlEscape($invcode) . " AND ifused<'1' AND createtime>" . S::sqlEscape($timestamp - $inv_days));
     !$this->inv && Showmsg('illegal_invcode');
 }
Ejemplo n.º 28
0
 /**
  * 获得用户有管理权限的栏目
  * @param unknown_type $username
  * @return Ambigous <multitype:, unknown>
  */
 function getAllPurviewColumns($username)
 {
     $cms_editadmin = L::config('cms_editadmin', 'cms_config');
     $cms_editadmin = is_array($cms_editadmin) ? $cms_editadmin : array();
     $_keys = array_keys($cms_editadmin);
     $columns = array();
     foreach ($_keys as $key) {
         if (in_array($username, $cms_editadmin[$key])) {
             $columns[] = $key;
         }
     }
     return $columns;
 }
Ejemplo n.º 29
0
function updateMemberid($uid, $isown = true)
{
    global $db, $winddb, $creditset, $db_upgrade, $credit, $lneed;
    $lneed || ($lneed = L::config('lneed', 'level'));
    if ($isown == true) {
        $userdb = $winddb;
    } else {
        $userdb = $db->get_one("SELECT m.memberid,md.rvrc,md.money,md.credit,md.currency,md.postnum,md.digests,md.onlinetime FROM pw_members m LEFT JOIN pw_memberdata md ON m.uid=md.uid WHERE m.uid=" . pwEscape($uid));
    }
    $userdb['rvrc'] += $creditset['rvrc'];
    $userdb['money'] += $creditset['money'];
    $userdb['credit'] += $creditset['credit'];
    $userdb['currency'] += $creditset['currency'];
    $usercredit = array('postnum' => $userdb['postnum'], 'digests' => $userdb['digests'], 'rvrc' => $userdb['rvrc'], 'money' => $userdb['money'], 'credit' => $userdb['credit'], 'currency' => $userdb['currency'], 'onlinetime' => $userdb['onlinetime']);
    $upgradeset = unserialize($db_upgrade);
    foreach ($upgradeset as $key => $val) {
        if (is_numeric($key) && $val) {
            foreach ($credit->get($uid, 'CUSTOM') as $key => $value) {
                $usercredit[$key] = $value;
            }
            break;
        }
    }
    $memberid = getmemberid(CalculateCredit($usercredit, $upgradeset));
    if ($userdb['memberid'] != $memberid) {
        $db->update("UPDATE pw_members SET memberid=" . pwEscape($memberid) . " WHERE uid=" . pwEscape($uid));
        $_cache = getDatastore();
        $_cache->delete('UID_' . $uid);
    }
}
Ejemplo n.º 30
0
     if (strpos($db_stopicdir, $db_htmdir) === 0) {
         $db_stopicdir = substr($db_stopicdir, strlen($db_htmdir) + 1);
     }
     if (strpos($db_readdir, $db_htmdir) === 0) {
         $db_readdir = substr($db_readdir, strlen($db_htmdir) + 1);
     }
     ifcheck($db_autochange, 'autochange');
     ${'hour_' . (int) $db_hour} = 'SELECTED';
     !$db_http && ($db_http = 'N');
     !$db_attachurl && ($db_attachurl = 'N');
     //safe
     ${'cc_' . (int) $db_cc} = 'CHECKED';
     $db_loadavg = (int) $db_loadavg;
     ifcheck($db_ipcheck, 'ipcheck');
     ifcheck($db_ifsafecv, 'ifsafecv');
     $db_xforwardip = L::config("db_xforwardip");
     /*have overwrite*/
     ifcheck($db_xforwardip, 'xforwardip');
     $safegroup = '';
     $num = 0;
     foreach ($ltitle as $key => $value) {
         if ($key != 1 && $key != 2) {
             $num++;
             $htm_tr = $num % 3 == 0 ? '' : '';
             $s_checked = strpos($db_safegroup, ',' . $key . ',') !== false ? 'CHECKED' : '';
             $safegroup .= '<li><input type="checkbox" name="safegroup[]" value="' . $key . '" ' . $s_checked . '>' . $value . '</li>' . $htm_tr;
         }
     }
     $safegroup && ($safegroup = '<ul class="list_A list_120">' . $safegroup . '</li>');
 }
 if ($admintype == 'att' || $settingdb['att']) {