Esempio n. 1
0
function bbspostguide($type = 'Post')
{
    global $db, $creditset, $db_creditset, $db_upgrade, $db_hour, $groupid, $windid, $winduid, $winddb, $timestamp, $fid, $tid, $tdtime, $db_autochange, $db_tcheck, $atc_content, $_G, $credit;
    if ($db_autochange) {
        if (file_exists(D_P . "data/bbscache/set_cache.php")) {
            list(, $set_control) = explode("|", readover(D_P . "data/bbscache/set_cache.php"));
        } else {
            $set_control = 0;
        }
        if ($timestamp - $set_control > $db_hour * 3600) {
            require_once R_P . 'require/postconcle.php';
        }
    }
    if ($groupid != 'guest') {
        require_once R_P . 'require/credit.php';
        $creditset = $credit->creditset($creditset, $db_creditset);
        $winddb['todaypost']++;
        $winddb['monthpost']++;
        $winddb['lastpost'] = $timestamp;
        $winddb['postnum']++;
        $winddb['rvrc'] += $creditset[$type]['rvrc'];
        $winddb['money'] += $creditset[$type]['money'];
        $winddb['credit'] += $creditset[$type]['credit'];
        $winddb['currency'] += $creditset[$type]['currency'];
        $usercredit = array('postnum' => $winddb['postnum'], 'digests' => $winddb['digests'], 'rvrc' => $winddb['rvrc'], 'money' => $winddb['money'], 'credit' => $winddb['credit'], 'currency' => $winddb['currency'], 'onlinetime' => $winddb['onlinetime']);
        $upgradeset = unserialize($db_upgrade);
        foreach ($upgradeset as $key => $val) {
            if (is_numeric($key) && $val) {
                foreach ($credit->get($winduid, 'CUSTOM') as $key => $value) {
                    $usercredit[$key] = $value;
                }
                break;
            }
        }
        require_once R_P . 'require/functions.php';
        $userService = L::loadClass('UserService', 'user');
        /* @var $userService PW_UserService */
        $memberid = getmemberid(CalculateCredit($usercredit, $upgradeset));
        if ($winddb['memberid'] != $memberid) {
            $userService->update($winduid, array('memberid' => $memberid));
        }
        $credit->addLog('topic_' . $type, $creditset[$type], array('uid' => $winduid, 'username' => $windid, 'ip' => $GLOBALS['onlineip'], 'fname' => $GLOBALS['forum'][$fid]['name']));
        $credit->sets($winduid, $creditset[$type], false);
        $credit->runsql();
        $updateMemberData = array('postnum' => $winddb['postnum'], 'todaypost' => $winddb['todaypost'], 'monthpost' => $winddb['monthpost'], 'lastpost' => $winddb['lastpost'], 'uploadtime' => $winddb['uploadtime'], 'uploadnum' => $winddb['uploadnum']);
        if ($db_tcheck) {
            $updateMemberData['postcheck'] = tcheck($atc_content);
        }
        $userService->update($winduid, array(), $updateMemberData);
    } else {
        Cookie('userlastptime', $timestamp);
    }
}
Esempio n. 2
0
    }
    if ($ismessage) {
        require_once A_P . 'weibo/require/sendmessage.php';
    }
    $extra = array();
    if ($uploadPic && is_array($uploadPic)) {
        $array = array();
        $query = $db->query("SELECT p.* FROM pw_cnphoto p LEFT JOIN pw_cnalbum a ON p.aid=a.aid WHERE p.pid IN (" . S::sqlImplode($uploadPic) . ")");
        while ($rt = $db->fetch_array($query)) {
            $array[$rt['pid']] = $rt;
        }
        $extra['photos'] = $array;
    }
    if ($weiboService->send($winduid, $atc_content, $type, 0, $extra)) {
        if ($db_tcheck) {
            $userInfo['postcheck']['weibo'] = tcheck($atc_content);
            $userService->update($winduid, array(), array('postcheck' => serialize($userInfo['postcheck'])));
        }
        weibocredit('weibo_Post');
        Showmsg('mode_o_write_success');
    } else {
        Showmsg('undefined_action');
    }
} elseif ($do == 'my') {
    S::gp(array('createtopic'), 'G');
    $count = $weiboService->getUserWeibosCount($winduid);
    $pageCount = ceil($count / $perpage);
    $page = validatePage($page, $pageCount);
    $weiboList = $weiboService->getUserWeibos($winduid, $page, $perpage);
    $pages = numofpage($count, $page, $pageCount, 'apps.php?q=weibo&do=my&', null, 'weiboList.my');
} elseif ($do == 'attention') {
Esempio n. 3
0
     Showmsg('diary_title_wordsfb');
 }
 if (($banword = $wordsfb->comprise($_POST['atc_content'], false)) !== false) {
     Showmsg('diary_content_wordsfb');
 }
 if (!$atc_title) {
     $_POST['atc_title'] = get_date($timestamp, 'Y.m.d') . ' 日志';
 }
 list($atc_title, $atc_content, $ifconvert, $ifwordsfb) = check_data('new');
 $userService = L::loadClass('UserService', 'user');
 /* @var $userService PW_UserService */
 if ($db_tcheck) {
     //内容验证
     $userDataInfo = $userService->get($winduid, false, true, false);
     $postcheck = unserialize($userDataInfo['postcheck']);
     $postcheck['diary'] == ($diaryCheck = tcheck($atc_content)) && Showmsg('diary_content_same');
 }
 //$db_tcheck && $winddb['postcheck'] == tcheck($atc_content) && Showmsg('diary_content_same'); //内容验证
 $dtid = (int) $dtid;
 $privacy = (int) $privacy;
 $ifcopy = (int) $ifcopy;
 $ifupload = 0;
 //		!$privacy && $ifcopy = 1;
 $aids = $attachs = array();
 L::loadClass('diaryupload', 'upload', false);
 if (PwUpload::getUploadNum() || $flashatt) {
     S::gp(array('savetoalbum', 'albumid'), 'P', 2);
     $diaryUpload = new DiaryUpload($winduid, $flashatt, $savetoalbum, $albumid);
     $diaryUpload->check();
     PwUpload::upload($diaryUpload);
     $aids = $diaryUpload->getAids();
Esempio n. 4
0
function bbspostguide($type = 'Post')
{
    global $db, $creditset, $db_creditset, $db_upgrade, $db_hour, $groupid, $windid, $winduid, $winddb, $timestamp, $fid, $tid, $tdtime, $db_autochange, $db_tcheck, $atc_content, $_G, $credit;
    if ($db_autochange) {
        if (file_exists(D_P . "data/bbscache/set_cache.php")) {
            list(, $set_control) = explode("|", readover(D_P . "data/bbscache/set_cache.php"));
        } else {
            $set_control = 0;
        }
        if ($timestamp - $set_control > $db_hour * 3600) {
            require_once R_P . 'require/postconcle.php';
        }
    }
    if ($groupid != 'guest') {
        require_once R_P . 'require/credit.php';
        $creditset = $credit->creditset($creditset, $db_creditset);
        $winddb['todaypost']++;
        $winddb['monthpost']++;
        $winddb['lastpost'] = $timestamp;
        $winddb['postnum']++;
        $winddb['rvrc'] += $creditset[$type]['rvrc'];
        $winddb['money'] += $creditset[$type]['money'];
        $winddb['credit'] += $creditset[$type]['credit'];
        $winddb['currency'] += $creditset[$type]['currency'];
        $usercredit = array('postnum' => $winddb['postnum'], 'digests' => $winddb['digests'], 'rvrc' => $winddb['rvrc'], 'money' => $winddb['money'], 'credit' => $winddb['credit'], 'currency' => $winddb['currency'], 'onlinetime' => $winddb['onlinetime']);
        $upgradeset = unserialize($db_upgrade);
        foreach ($upgradeset as $key => $val) {
            if (is_numeric($key) && $val) {
                foreach ($credit->get($winduid, 'CUSTOM') as $key => $value) {
                    $usercredit[$key] = $value;
                }
                break;
            }
        }
        $memberid = getmemberid(CalculateCredit($usercredit, $upgradeset));
        if ($winddb['memberid'] != $memberid) {
            $db->update("UPDATE pw_members SET memberid=" . pwEscape($memberid) . " WHERE uid=" . pwEscape($winduid));
        }
        $credit->addLog('topic_' . $type, $creditset[$type], array('uid' => $winduid, 'username' => $windid, 'ip' => $GLOBALS['onlineip'], 'fname' => $GLOBALS['forum'][$fid]['name']));
        $credit->sets($winduid, $creditset[$type], false);
        $credit->runsql();
        $sqladd = '';
        $db_tcheck && ($sqladd .= "postcheck='" . tcheck($atc_content) . "',");
        $pwSQL = $sqladd . pwSqlSingle(array('postnum' => $winddb['postnum'], 'todaypost' => $winddb['todaypost'], 'monthpost' => $winddb['monthpost'], 'lastpost' => $winddb['lastpost'], 'uploadtime' => $winddb['uploadtime'], 'uploadnum' => $winddb['uploadnum']));
        $db->update("UPDATE pw_memberdata SET {$pwSQL} WHERE uid=" . pwEscape($winduid));
    } else {
        Cookie('userlastptime', $timestamp);
    }
}