当前位置: 首页>>代码示例>>PHP>>正文


PHP Perf::gatherInfo方法代码示例

本文整理汇总了PHP中Perf::gatherInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP Perf::gatherInfo方法的具体用法?PHP Perf::gatherInfo怎么用?PHP Perf::gatherInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Perf的用法示例。


在下文中一共展示了Perf::gatherInfo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateForumCount

function updateForumCount($fid, $topic, $replies, $tpost = 0)
{
    global $db, $db_fcachenum;
    $fm = $db->get_one("SELECT fup,type,password,allowvisit,f_type FROM pw_forums WHERE fid=" . S::sqlEscape($fid));
    if ($fm['type'] == 'category') {
        return false;
    }
    delfcache($fid, $db_fcachenum);
    $topic = intval($topic);
    $article = $topic + intval($replies);
    $tpost = intval($tpost);
    $lastpost = '';
    $lt = $db->get_one("SELECT tid,author,postdate,lastpost,lastposter,subject FROM pw_threads WHERE fid=" . S::sqlEscape($fid) . " AND specialsort='0' AND ifcheck='1' AND lastpost>0 ORDER BY lastpost DESC LIMIT 1");
    if ($lt) {
        if ($lt['postdate'] == $lt['lastpost']) {
            $subject = substrs($lt['subject'], 26);
        } else {
            $subject = 'Re:' . substrs($lt['subject'], 26);
        }
        $lastpost = ",lastpost=" . S::sqlEscape($subject . "\t" . $lt['lastposter'] . "\t" . $lt['lastpost'] . "\t" . "read.php?tid={$lt['tid']}&page=e#a");
    }
    $db->update("UPDATE pw_forumdata SET article=article+'{$article}',topic=topic+'{$topic}',tpost=tpost+'{$tpost}'{$lastpost} WHERE fid=" . S::sqlEscape($fid));
    Perf::gatherInfo('changeForumData', array('fid' => $fid));
    if (($fm['type'] == 'sub' || $fm['type'] == 'sub2') && ($fids = getUpFids($fid))) {
        if ($fm['password'] != '' || $fm['allowvisit'] != '' || $fm['f_type'] == 'hidden') {
            $lastpost = '';
        }
        $db->update("UPDATE pw_forumdata SET article=article+'{$article}',subtopic=subtopic+'{$topic}',tpost=tpost+'{$tpost}'{$lastpost} WHERE fid IN(" . S::sqlImplode($fids) . ')');
        Perf::gatherInfo('changeForumData', array('fid' => $fids));
    }
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:updateforum.php

示例2: _postThread

 function _postThread($id, $postAudit, $expand)
 {
     $postVerifyService = $this->getPostVerifyService();
     $postVerifyService->insertPostVerify(1, $id, 0);
     $GLOBALS['db']->query("UPDATE pw_threads SET ifcheck=0 WHERE tid=" . CLOUDWIND_SECURITY_SERVICE::sqlEscape($id));
     if (class_exists("Perf")) {
         Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $expand['fid']));
         // 8.3+
     } else {
         $threadList = L::loadClass("threadlist", 'forum');
         $threadList && $threadList->refreshThreadIdsByForumId($expand['fid']);
     }
     return true;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:14,代码来源:defend.generaloperate.class.php

示例3: shieldThread

 function shieldThread($tid, $fid)
 {
     list($tid, $fid) = array(intval($tid), intval($fid));
     if ($tid < 1 || $fid < 1) {
         return $this->buildResponse(THREAD_INVALID_PARAMS);
     }
     $GLOBALS['db']->query("UPDATE pw_threads SET ifcheck=0 WHERE tid=" . S::sqlEscape($tid));
     if (class_exists("Perf")) {
         Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid));
     } else {
         $threadList = L::loadClass("threadlist", 'forum');
         $threadList && $threadList->refreshThreadIdsByForumId($fid);
     }
     return $this->buildResponse(0);
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:15,代码来源:ver.common.thread.php

示例4: recycle

function recycle($ids)
{
    global $db, $fid;
    $delids = array();
    foreach ($ids as $key => $value) {
        if (is_numeric($value)) {
            $delids[] = $value;
        }
    }
    if ($delids) {
        $delids = S::sqlImplode($delids);
    } else {
        Showmsg('forumcp_recycle_nodata');
    }
    $query = $db->query("SELECT r.*,t.special,t.ifshield,t.ifupload,t.ptable,t.replies,t.fid AS ckfid FROM pw_recycle r LEFT JOIN pw_threads t ON r.tid=t.tid WHERE r.tid IN ({$delids}) AND r.pid='0' AND r.fid=" . S::sqlEscape($fid));
    $taid_a = $ttable_a = $ptable_a = array();
    $delids = $pollids = $actids = $delaids = $rewids = $ids = array();
    while (@extract($db->fetch_array($query))) {
        $ids[] = $tid;
        ($ifshield != '2' || $replies == '0' || $ckfid == '0') && ($delids[] = $tid);
        $special == 1 && ($pollids[] = $tid);
        $special == 2 && ($actids[] = $tid);
        $special == 3 && ($rewids[] = $tid);
        if ($ifshield != '2' || $replies == '0' || $ckfid == '0') {
            $ptable_a[$ptable] = 1;
            $ttable_a[GetTtable($tid)][] = $tid;
        }
        if ($ifupload) {
            $taid_a[GetTtable($tid)][] = $tid;
            if ($ifshield != '2' || $replies == '0' || $ckfid == '0') {
                $pw_posts = GetPtable($ptable);
                $query2 = $db->query("SELECT aid FROM {$pw_posts} WHERE tid=" . S::sqlEscape($tid) . " AND aid!=''");
                while (@extract($db->fetch_array($query2))) {
                    if (!$aid) {
                        continue;
                    }
                    $attachs = unserialize(stripslashes($aid));
                    foreach ($attachs as $key => $value) {
                        is_numeric($key) && ($delaids[] = $key);
                        pwDelatt($value['attachurl'], $GLOBALS['db_ifftp']);
                        $value['ifthumb'] && pwDelatt("thumb/{$value['attachurl']}", $GLOBALS['db_ifftp']);
                    }
                }
            }
        }
    }
    foreach ($taid_a as $pw_tmsgs => $value) {
        $value = S::sqlImplode($value);
        $query = $db->query("SELECT aid FROM {$pw_tmsgs} WHERE tid IN({$value}) AND aid!=''");
        while (@extract($db->fetch_array($query))) {
            if (!$aid) {
                continue;
            }
            $attachs = unserialize(stripslashes($aid));
            foreach ($attachs as $key => $value) {
                is_numeric($key) && ($delaids[] = $key);
                pwDelatt($value['attachurl'], $GLOBALS['db_ifftp']);
                $value['ifthumb'] && pwDelatt("thumb/{$value['attachurl']}", $GLOBALS['db_ifftp']);
            }
        }
    }
    if ($pollids) {
        $pollids = S::sqlImplode($pollids);
        $db->update("DELETE FROM pw_polls WHERE tid IN({$pollids})");
    }
    if ($actids) {
        $actids = S::sqlImplode($actids);
        $db->update("DELETE FROM pw_activity WHERE tid IN({$actids})");
        $db->update("DELETE FROM pw_actmember WHERE actid IN({$actids})");
    }
    if ($rewids) {
        $rewids = S::sqlImplode($rewids);
        $db->update("DELETE FROM pw_reward WHERE tid IN({$rewids})");
    }
    if ($delaids) {
        $pw_attachs = L::loadDB('attachs', 'forum');
        $pw_attachs->delete($delaids);
    }
    //$delids  = S::sqlImplode($delids);
    if ($delids) {
        # $db->update("DELETE FROM pw_threads	WHERE tid IN($delids)");
        # ThreadManager
        //* $threadManager = L::loadClass("threadmanager", 'forum');
        //* $threadManager->deleteByThreadIds($fid,$delids);
        $threadService = L::loadclass('threads', 'forum');
        $threadService->deleteByThreadIds($delids);
        Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid));
    }
    foreach ($ttable_a as $pw_tmsgs => $val) {
        //* $val = S::sqlImplode($val);
        //* $db->update("DELETE FROM $pw_tmsgs WHERE tid IN($val)");
        pwQuery::delete($pw_tmsgs, 'tid IN(:tid)', array($val));
    }
    foreach ($ptable_a as $key => $val) {
        $pw_posts = GetPtable($key);
        //$db->update("DELETE FROM $pw_posts WHERE tid IN($delids)");
        pwQuery::delete($pw_posts, 'tid IN(:tid)', array($delids));
    }
    delete_tag(S::sqlImplode($delids));
    if ($ids) {
//.........这里部分代码省略.........
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:101,代码来源:forumcp.php

示例5: deletePing

 /**
  * 取消评分
  * @param $tid
  * @param $pids
  * @param $params
  */
 function deletePing($params = array())
 {
     global $groupid, $windid, $winduid, $credit, $onlineip, $timestamp, $gp_gptype;
     //* $threadService = L::loadClass("threads", 'forum');
     require_once R_P . 'require/credit.php';
     foreach ($this->postData as $pid => $atc) {
         $rpid = $pid == 'tpc' ? '0' : $pid;
         // delete pinglog
         $pingdata = $this->db->get_one('SELECT * FROM pw_pinglog WHERE tid=' . S::sqlEscape($this->tid) . ' AND pid=' . S::sqlEscape($rpid) . ' AND pinger=' . S::sqlEscape($windid) . ' ORDER BY pingdate DESC LIMIT 1');
         //$this->db->update('DELETE FROM pw_pinglog WHERE id=' . S::sqlEscape($pingdata['id']));
         pwQuery::delete('pw_pinglog', 'id=:id', array($pingdata['id']));
         $this->update_markinfo($this->tid, $rpid);
         //* $threadService->clearTmsgsByThreadId($this->tid);
         Perf::gatherInfo('changeTmsgWithThreadIds', array('tid' => $this->tid));
         $addpoint = $pingdata['point'];
         if (!($cid = $credit->getCreditTypeByName($pingdata['name']))) {
             continue;
         }
         $cName = $credit->cType[$cid];
         $addpoint = $addpoint > 0 ? -$addpoint : abs($addpoint);
         !$atc['subject'] && ($atc['subject'] = substrs(strip_tags(convert($atc['content'])), 35));
         $credit->addLog('credit_delping', array($cid => $addpoint), array('uid' => $atc['authorid'], 'username' => $atc['author'], 'ip' => $onlineip, 'operator' => $windid, 'tid' => $this->tid, 'subject' => $atc['subject'], 'reason' => $params['atc_content']));
         $credit->set($atc['authorid'], $cid, $addpoint);
         if (!is_numeric($pid)) {
             //* $this->db->update('UPDATE pw_threads SET ifmark=ifmark+'.S::sqlEscape($addpoint).' WHERE tid='.S::sqlEscape($tid));
             $this->db->update(pwQuery::buildClause("UPDATE :pw_table SET ifmark=ifmark+:ifmark WHERE tid=:tid", array('pw_threads', $addpoint, $this->tid)));
         }
         if ($params['ifmsg'] && !$atc['anonymous'] && $atc['author'] != $windid) {
             //发消息
             $title = getLangInfo('writemsg', 'delping_title', array('sender' => $windid, 'receiver' => $atc['author']));
             $content = getLangInfo('writemsg', 'delping_content', array('manager' => $windid, 'fid' => $atc['fid'], 'tid' => $this->tid, 'pid' => $pid, 'subject' => $atc['subject'], 'postdate' => get_date($atc['postdate']), 'forum' => strip_tags($this->forum->foruminfo['name']), 'affect' => "{$cName}:{$addpoint}", 'admindate' => get_date($timestamp), 'reason' => stripslashes($params['atc_content']), 'sender' => $windid, 'receiver' => $atc['author']));
             $this->sendMessage($atc['author'], $title, $content);
         }
         if ($gp_gptype == 'system') {
             require_once R_P . 'require/writelog.php';
             $log = array('type' => 'credit', 'username1' => $atc['author'], 'username2' => $windid, 'field1' => $atc['fid'], 'field2' => '', 'field3' => '', 'descrip' => 'creditdel_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip, 'tid' => $this->tid, 'forum' => strip_tags($this->forum->foruminfo['name']), 'subject' => $atc['subject'], 'affect' => "{$name}:{$addpoint}", 'reason' => $params['atc_content']);
             writelog($log);
         }
         $pingLog[$pid] = $pingdata['id'];
     }
     $credit->runsql();
     defined('AJAX') && ($GLOBALS['pingLog'] = $pingLog);
     //GLOBAL
     if ($this->forum->foruminfo['allowhtm'] && $_REQUEST['page'] == 1) {
         $StaticPage = L::loadClass('StaticPage');
         $StaticPage->update($this->tid);
     }
     return true;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:55,代码来源:ping.class.php

示例6: deleteThreadsHander

function deleteThreadsHander($tidarray)
{
    global $windid, $manager, $groupid, $SYSTEM;
    PostCheck();
    (!$SYSTEM['superright'] || !$SYSTEM['delatc']) && Showmsg('mawhole_right');
    if ($tidarray == "") {
        Showmsg('data_error');
    }
    $tidarray = explode("|", $tidarray);
    if (!is_array($tidarray)) {
        Showmsg('data_error');
    }
    $forums = $threadIds = array();
    foreach ($tidarray as $v) {
        if ($v == "") {
            continue;
        }
        if (intval($v) < 0) {
            continue;
        }
        $threadIds[] = $v;
    }
    /**
    	$threadManager = L::loadclass('threadmanager', 'forum');
    	foreach($forums as $fid=>$threadIds){
    		$threadManager->deleteByThreadIds($fid,$threadIds);
    	}**/
    $threadService = L::loadclass('threads', 'forum');
    foreach ($forums as $fid => $_threadIds) {
        $threadService->deleteByThreadIds($_threadIds);
        Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid));
    }
    $delarticle = L::loadClass('DelArticle', 'forum');
    $delarticle->delTopicByTids($threadIds, true);
    echo getLangInfo('other', 'search_manager_success');
    ajax_footer();
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:37,代码来源:mawhole.php

示例7: _clearMembersCache

function _clearMembersCache($id)
{
    global $db;
    $query = $db->query("SELECT uid FROM pw_userbinding WHERE id =" . S::sqlEscape($id));
    $uid = array();
    while ($rt = $db->fetch_array($query)) {
        $uid[] = $rt['uid'];
    }
    Perf::gatherInfo('changeMembersWithUserIds', array('uid' => $uid));
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:10,代码来源:info_binding.php

示例8: afterReply

 function afterReply()
 {
     global $db_ifpwcache, $timestamp, $db_readperpage;
     if ($this->data['ifcheck'] == 1) {
         if ($this->forum->foruminfo['allowhtm'] && !$this->forum->foruminfo['cms'] && $this->tpcArr['replies'] < $db_readperpage) {
             $StaticPage = L::loadClass('StaticPage');
             $StaticPage->update($this->tid);
         }
         if ($this->tpcArr['ifcheck'] == 1) {
             $lastpost = array('subject' => $this->data['title'] ? substrs($this->data['title'], 26) : 'Re:' . substrs($this->tpcArr['subject'], 26), 'author' => $this->data['lastposter'], 'lastpost' => $timestamp, 'tid' => $this->tid, 't_date' => $this->tpcArr['postdate']);
             $this->forum->lastinfo('reply', '+', $lastpost);
         }
         //Start Here pwcache
         if ($db_ifpwcache & 270) {
             L::loadClass('elementupdate', '', false);
             $elementupdate = new ElementUpdate($this->forum->fid);
             $elementupdate->special = $this->tpcArr['special'];
             if ($db_ifpwcache & 14) {
                 $elementupdate->replySortUpdate($this->tid, $this->forum->fid, $this->tpcArr['postdate'], $this->tpcArr['replies'] + 1);
             }
             if ($db_ifpwcache & 256) {
                 $elementupdate->newReplyUpdate($this->tid, $this->forum->fid, $this->tpcArr['postdate']);
             }
             $elementupdate->updateSQL();
         }
         require_once R_P . 'require/functions.php';
         updateDatanalyse($this->data['authorid'], 'memberThread', 1);
         updateDatanalyse($this->tid, 'threadPost', 1);
         // memcache refresh
         // $threadsObj = L::loadclass("threads", 'forum');
         // $threadsObj->clearThreadByThreadId($this->tid);
         // memcache refresh
         // $threadlistObj = L::loadclass("threadlist", 'forum');
         // $threadlistObj->updateThreadIdsByForumId($this->forum->fid, $this->tid);
         Perf::gatherInfo('changeThreadWithThreadIds', array('tid' => $this->tid));
         Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $this->forum->fid));
     }
     if ($this->postdata->filter->filter_weight > 1) {
         $this->postdata->filter->insert($this->tid, $this->pid, implode(',', $this->postdata->filter->filter_word), $this->postdata->filter->filter_weight);
     }
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:41,代码来源:replypost.class.php

示例9: array

        $timelimit < 0 && ($timelimit = 24);
        $downtime = $timelimit * 3600;
        $msgdb = $logdb = array();
        //* $threadList = L::loadClass("threadlist", 'forum');
        $query = $db->query("SELECT tid,fid,postdate,author,authorid,subject,locked FROM pw_threads WHERE tid IN(" . S::sqlImplode($selids) . ")");
        while ($rt = $db->fetch_array($query)) {
            $sql = "locked='" . ($ifpush ? $rt['locked'] % 3 + 3 : $rt['locked'] % 3) . "'";
            $db->update("UPDATE pw_argument SET lastpost=lastpost-" . S::sqlEscape($downtime) . " WHERE tid=" . S::sqlEscape($rt['tid']));
            //$db->update("UPDATE pw_threads SET $sql WHERE tid=".S::sqlEscape($rt['tid']));
            $db->update(pwQuery::buildClause("UPDATE :pw_table SET {$sql} WHERE tid=:tid", array('pw_threads', $rt['tid'])));
            if ($ifmsg) {
                $msgdb[] = array('toUser' => $rt['author'], 'title' => getLangInfo('writemsg', 'down_title'), 'content' => getLangInfo('writemsg', 'down_content', array('manager' => $windid, 'timelimit' => $timelimit, 'fid' => $fid, 'tid' => $rt['tid'], 'subject' => $rt['subject'], 'postdate' => get_date($rt['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content))));
            }
            $logdb[] = array('type' => 'down', 'username1' => $rt['author'], 'username2' => $windid, 'field1' => $fid, 'field2' => $rt['tid'], 'field3' => '', 'descrip' => 'down_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip, 'tid' => $rt['tid'], 'subject' => substrs($rt['subject'], 28), 'forum' => $forum[$fid]['name'], 'reason' => stripslashes($atc_content));
            //* $threadList->updateThreadIdsByForumId($fid,$rt['tid'],$downtime);
            Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid));
        }
        sendMawholeMessages($msgdb);
        foreach ($logdb as $key => $val) {
            writelog($val);
        }
        refreshto("apps.php?q=group&a=thread&cyid={$cyid}", 'downtopic_success');
    }
} elseif ($action == 'highlight') {
    if (empty($_POST['step'])) {
        if (is_numeric($seltid)) {
            $rt = $db->get_one("SELECT a.titlefont,t.author FROM pw_argument a LEFT JOIN pw_threads t ON a.tid=t.tid WHERE a.tid=" . S::sqlEscape($seltid));
            $titledetail = explode("~", $rt['titlefont']);
            $titlecolor = $titledetail[0];
            if ($titlecolor && !preg_match('/\\#[0-9A-F]{6}/is', $titlecolor)) {
                $titlecolor = '';
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:m_topicadmin.php

示例10: lastinfo

/**
 * 发表、回复、修改帖子后更新帖子数、回复时间和生成静态页面访问地址的函数
 *
 * @param int $fid 所属版块
 * @param int $allowhtm 是否允许生成静态页
 * @param string $type new:发表新帖、reply:回复
 * @param string $sys_type:现无用
 */
function lastinfo($fid, $allowhtm = 0, $type = '', $sys_type = '')
{
    global $db, $R_url, $db_readdir, $foruminfo, $tid, $windid, $timestamp, $atc_title, $t_date, $replytitle;
    if ($type == 'new') {
        $rt['tid'] = $tid;
        $rt['postdate'] = $timestamp;
        $rt['lastpost'] = $timestamp;
        $author = $windid;
        $subject = substrs($atc_title, 26);
        $topicadd = ",tpost=tpost+1,article=article+1,topic=topic+1 ";
        $fupadd = "subtopic=subtopic+1,tpost=tpost+1,article=article+1";
    } elseif ($type == 'reply') {
        $rt['tid'] = $tid;
        $rt['postdate'] = $t_date;
        $rt['lastpost'] = $timestamp;
        $author = $windid;
        $subject = $atc_title ? substrs($atc_title, 26) : 'Re:' . addslashes(substrs($replytitle, 26));
        $topicadd = ",tpost=tpost+1,article=article+1 ";
        $fupadd = "tpost=tpost+1,article=article+1 ";
    } else {
        $rt = $db->get_one("SELECT tid,author,postdate,subject,lastpost,lastposter FROM pw_threads WHERE fid=" . S::sqlEscape($fid) . " AND specialsort=0 AND ifcheck=1 AND lastpost>0 ORDER BY lastpost DESC LIMIT 0,1");
        if ($rt['postdate'] == $rt['lastpost']) {
            $subject = addslashes(substrs($rt['subject'], 26));
            $author = $rt['author'];
        } else {
            $subject = 'Re:' . addslashes(substrs($rt['subject'], 26));
            $author = $rt['lastposter'];
        }
        $topicadd = $fupadd = "";
    }
    $GLOBALS['anonymous'] && ($author = $GLOBALS['db_anonymousname']);
    $htmurl = $db_readdir . '/' . $fid . '/' . date('ym', $rt['postdate']) . '/' . $rt['tid'] . '.html';
    $new_url = file_exists(R_P . $htmurl) && $allowhtm && $sys_type != '1B' ? "{$R_url}/{$htmurl}" : "read.php?tid={$rt['tid']}&page=e#a";
    $lastpost = $subject . "\t" . addslashes($author) . "\t" . $rt['lastpost'] . "\t" . $new_url;
    //* $db->update("UPDATE pw_forumdata SET lastpost=".S::sqlEscape($lastpost).$topicadd." WHERE fid=".S::sqlEscape($fid));
    $db->update(pwQuery::buildClause("UPDATE :pw_table SET lastpost=:lastpost {$topicadd} WHERE fid=:fid", array('pw_forumdata', $lastpost, $fid)));
    if ($foruminfo['type'] == 'sub' || $foruminfo['type'] == 'sub2') {
        if ($foruminfo['password'] != '' || $foruminfo['allowvisit'] != '' || $foruminfo['f_type'] == 'hidden') {
            $lastpost = '';
        } else {
            $lastpost = "lastpost=" . S::sqlEscape($lastpost);
        }
        if ($lastpost && $fupadd) {
            $lastpost .= ', ';
        }
        if ($lastpost || $fupadd) {
            $db->update("UPDATE pw_forumdata SET {$lastpost} {$fupadd} WHERE fid=" . S::sqlEscape($foruminfo['fup']));
            Perf::gatherInfo('changeForumData', array('fid' => $foruminfo['fup']));
            if ($foruminfo['type'] == 'sub2') {
                $rt1 = $db->get_one("SELECT fup FROM pw_forums WHERE fid=" . S::sqlEscape($foruminfo['fup']));
                $db->update("UPDATE pw_forumdata SET {$lastpost} {$fupadd} WHERE fid=" . S::sqlEscape($rt1['fup']));
                Perf::gatherInfo('changeForumData', array('fid' => $rt1['fup']));
            }
        }
    }
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:64,代码来源:postfunc.php

示例11: lastinfo

 function lastinfo($type, $action = '+', $lastpost = array())
 {
     global $db_readdir, $R_url;
     $lp = $topicadd = $fupadd = '';
     $_arrTopicAdd = $_arrFupAdd = $_arrLp = array();
     $_num = intval($action . '1');
     if ($action == '+' || $action == '-') {
         if ($type == 'topic') {
             $topicadd = "tpost=tpost{$action}'1',article=article{$action}'1',topic=topic{$action}'1' ";
             $fupadd = "tpost=tpost{$action}'1',article=article{$action}'1',subtopic=subtopic{$action}'1' ";
             $_arrTopicAdd = array('tpost' => $_num, 'article' => $_num, 'topic' => $_num);
             $_arrFupAdd = array('tpost' => $_num, 'article' => $_num, 'subtopic' => $_num);
         } else {
             $topicadd = "tpost=tpost{$action}'1',article=article{$action}'1' ";
             $fupadd = "tpost=tpost{$action}'1',article=article{$action}'1' ";
             $_arrTopicAdd = $_arrFupAdd = array('tpost' => $_num, 'article' => $_num);
         }
     }
     if ($lastpost) {
         $newurl = "read.php?tid={$lastpost['tid']}&page=e#a";
         if ($this->foruminfo['allowhtm']) {
             $htmurl = $db_readdir . '/' . $this->fid . '/' . date('ym', $lastpost['t_date']) . '/' . $lastpost['tid'] . '.html';
             if (file_exists(R_P . $htmurl)) {
                 $newurl = "{$R_url}/{$htmurl}";
             }
         }
         $lp = "lastpost=" . S::sqlEscape($lastpost['subject'] . "\t" . $lastpost['author'] . "\t" . $lastpost['lastpost'] . "\t" . $newurl);
         $_arrLp = array('lastpost' => $lastpost['subject'] . "\t" . $lastpost['author'] . "\t" . $lastpost['lastpost'] . "\t" . $newurl);
     }
     if ($topicadd || $lp) {
         $sql = trim($topicadd . ',' . $lp, ',');
         $this->db->update("UPDATE pw_forumdata SET {$sql} WHERE fid=" . S::sqlEscape($this->fid));
         Perf::gatherInfo('changeForumDataWithForumId', array(array_merge($_arrTopicAdd, $_arrLp, array('fid' => $this->fid))));
         //*$this->db->update(pwQuery::updateClause("UPDATE :pw_table SET $sql WHERE fid=:fid", array('pw_forumdata',$this->fid)));
     }
     if ($this->foruminfo['type'] == 'sub' || $this->foruminfo['type'] == 'sub2') {
         !$this->isOpen() && ($lp = '');
         if ($lp || $fupadd) {
             $sql = trim($fupadd . ',' . $lp, ',');
             $this->db->update("UPDATE pw_forumdata SET {$sql} WHERE fid=" . S::sqlEscape($this->foruminfo['fup']));
             Perf::gatherInfo('changeForumDataWithForumId', array(array_merge($_arrFupAdd, $_arrLp, array('fid' => $this->foruminfo['fup']))));
             if ($this->foruminfo['type'] == 'sub2') {
                 $rt1 = $this->db->get_one("SELECT fup FROM pw_forums WHERE fid=" . S::sqlEscape($this->foruminfo['fup']));
                 $this->db->update("UPDATE pw_forumdata SET {$sql} WHERE fid=" . S::sqlEscape($rt1['fup']));
                 Perf::gatherInfo('changeForumDataWithForumId', array(array_merge($_arrFupAdd, $_arrLp, array('fid' => $rt1['fup']))));
             }
         }
     }
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:49,代码来源:forum.class.php

示例12: MAX

 }
 !$lines && ($lines = 200);
 !$tstart && ($tstart = 0);
 $ftable = $tfrom ? 'pw_posts' . $tfrom : 'pw_posts';
 $ttable = $tto ? 'pw_posts' . $tto : 'pw_posts';
 if (!$tend) {
     @extract($db->get_one("SELECT MAX(tid) AS tend FROM {$ftable}"));
 }
 $end = $tstart + $lines;
 $end > $tend && ($end = $tend);
 $db->update("INSERT INTO {$ttable} SELECT * FROM {$ftable} WHERE tid>=" . S::sqlEscape($tstart) . 'AND tid<=' . S::sqlEscape($end));
 //$db->update("DELETE FROM $ftable WHERE tid>".S::sqlEscape($tstart)."AND tid<=".S::sqlEscape($end));
 pwQuery::delete($ftable, 'tid>=:tid1 AND tid<=:tid2', array($tstart, $end));
 //$db->update("UPDATE pw_threads SET ptable=".S::sqlEscape($tto)."WHERE tid>".S::sqlEscape($tstart)."AND tid<=".S::sqlEscape($end)."AND ptable=".S::sqlEscape($tfrom));
 pwQuery::update('pw_threads', 'tid>=:tid AND tid<=:end AND ptable=:ptable', array($tstart, $end, $tfrom), array('ptable' => $tto));
 Perf::gatherInfo('changeThreadListWithThreadIds', array('tid' => $tstart + 1));
 if ($end < $tend) {
     $step++;
     $end++;
     $j_url = "{$basename}&action={$action}&step={$step}&tstart={$end}&tend={$tend}&tfrom={$tfrom}&tto={$tto}&lines={$lines}";
     adminmsg('table_change', EncodeUrl($j_url), 2);
 } else {
     //* $_cache = getDatastore();
     //* $_cache->flush();
     $_cacheService = perf::gatherCache('pw_membersdbcache');
     $_cacheService->flush();
     if (Perf::checkMemcache()) {
         $_cacheService = L::loadClass('cacheservice', 'utility');
         $_cacheService->flush(PW_CACHE_MEMCACHE);
     }
     $db->query('OPTIMIZE TABLE ' . S::sqlMetadata($ftable));
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:bakup.php

示例13: array

 //回复数
 if ($oldLastPostInfo) {
     $db->query("UPDATE pw_threads SET replies = replies - {$pidNum},lastpost = " . S::sqlEscape($oldLastPostInfo['postdate']) . ",lastposter = " . S::sqlEscape($oldLastPostInfo['author']) . " WHERE  tid = " . S::sqlEscape($tid));
 } else {
     $db->query("UPDATE pw_threads SET replies = replies - {$pidNum},lastpost = " . S::sqlEscape($splitThread['postdate']) . ",lastposter = " . S::sqlEscape($splitThread['author']) . " WHERE  tid = " . S::sqlEscape($tid));
 }
 Perf::gatherInfo('changeThreads', array('tid' => $tid));
 //拆到的帖子
 if ($splittype == 0 && $pidNum > 1) {
     $pidNum = $pidNum - 1;
 }
 if ($lastPostInfo) {
     $db->query("UPDATE pw_threads SET replies = replies + {$pidNum},lastpost = " . S::sqlEscape($lastPostInfo['postdate']) . ",lastposter = " . S::sqlEscape($lastPostInfo['author']) . " WHERE  tid = " . S::sqlEscape($splitid));
     //拆到 回复数 最后发帖人
 }
 Perf::gatherInfo('changeThreads', array('tid' => $splitid));
 //评分操作
 if ($pidsStr) {
     //$db->update("UPDATE pw_pinglog SET tid = ".S::sqlEscape($splitid)." WHERE tid = ".S::sqlEscape($tid)." AND  pid in ($pidsStr)");
     pwQuery::update('pw_pinglog', 'tid=:tid  AND pid IN(:pid)', array($tid, $pids), array('tid' => $splitid));
 }
 if ($splittype == 0) {
     //$db->update("UPDATE pw_pinglog SET tid = ".S::sqlEscape($splitid)." , pid = 0 WHERE tid = ".S::sqlEscape($splitid)." AND  pid = ".S::sqlEscape($postInfo['pid']));
     pwQuery::update('pw_pinglog', 'tid=:tid  AND pid =:pid', array($tid, $postInfo['pid']), array('tid' => $splitid, 'pid' => 0));
 }
 $pingService->update_markinfo($fid, $tid, 0);
 $pingService->update_markinfo($fid, $splitid, 0);
 //附件操作
 if ($pidsStr) {
     $db->update("UPDATE pw_attachs SET tid = " . S::sqlEscape($splitid) . " WHERE tid = " . S::sqlEscape($tid) . " AND  pid in ({$pidsStr})");
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:masingle.php

示例14: afterModify

 function afterModify()
 {
     global $page;
     $replies = '';
     $pwSQL = array();
     if ($this->data['anonymous'] != $this->atcdb['anonymous']) {
         $lt = $this->db->get_one("SELECT pid FROM {$this->pw_posts} WHERE tid=" . S::sqlEscape($this->tid) . " ORDER BY postdate DESC LIMIT 1");
         if ($this->pid == $lt['pid']) {
             $pwSQL['lastposter'] = $this->data['lastposter'];
         }
     }
     $this->data['ifupload'] && ($pwSQL['ifupload'] = $this->data['ifupload']);
     $threadService = L::loadClass('threads', 'forum');
     $threadService->updateAtUsers($this->tid, $this->atcdb['pid'], $this->data['atusers']);
     if ($this->data['ifcheck'] && $this->forum->foruminfo['allowhtm'] && !$this->forum->foruminfo['cms'] && $page == 1) {
         $StaticPage = L::loadClass('StaticPage');
         $StaticPage->update($this->tid);
     }
     if ($this->data['ifcheck'] != $this->atcdb['ifcheck']) {
         $action = $this->atcdb['ifcheck'] == 1 ? '-' : '+';
         $this->forum->lastinfo('reply', $action);
         $replies = "replies=replies{$action}'1'";
     }
     if ($pwSQL || $replies) {
         $sql = trim(S::sqlSingle($pwSQL) . ',' . $replies, ',');
         $this->db->update("UPDATE pw_threads SET {$sql} WHERE tid=" . S::sqlEscape($this->tid));
         Perf::gatherInfo('changeThreads', array('tid' => $this->tid));
     }
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:29,代码来源:postmodify.class.php

示例15: recountTopic

 function recountTopic($read, $ifdel, $recycle)
 {
     global $db_anonymousname, $timestamp;
     $ret = 0;
     $tid = $read['tid'];
     $pw_posts = GetPtable($read['ptable']);
     $replies = $this->db->get_value("SELECT COUNT(*) AS replies FROM {$pw_posts} WHERE tid='{$tid}' AND ifcheck='1'");
     if (!$replies) {
         $read['anonymous'] && ($read['author'] = $db_anonymousname);
         if ($ifdel) {
             if ($recycle) {
                 //$this->db->update("UPDATE pw_threads SET fid='0',ifshield='0' WHERE tid='$tid'");
                 pwQuery::update('pw_threads', 'tid = :tid', array($tid), array('fid' => 0, 'ifshield' => 0));
             } else {
                 //* $threadManager = L::loadClass("threadmanager", 'forum');
                 //* $threadManager->deleteByThreadId($read['fid'], $tid);
                 $threadService = L::loadclass('threads', 'forum');
                 $threadService->deleteByThreadId($tid);
                 Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $read['fid']));
                 $pw_tmsgs = GetTtable($tid);
                 //* $this->db->update("DELETE FROM $pw_tmsgs WHERE tid='$tid'");
                 pwQuery::delete($pw_tmsgs, 'tid=:tid', array($tid));
             }
             $ret = 1;
         } else {
             $pwSQL = array('replies' => 0, 'lastposter' => $read['author']);
             !($read['lastpost'] > $timestamp || $read['locked'] > 2) && ($pwSQL['lastpost'] = $read['postdate']);
             //$this->db->update("UPDATE pw_threads SET " . S::sqlSingle($pwSQL) . " WHERE tid=" . S::sqlEscape($tid));
             pwQuery::update('pw_threads', 'tid = :tid', array($tid), $pwSQL);
         }
     } else {
         $pt = $this->db->get_one("SELECT postdate,author,anonymous FROM {$pw_posts} WHERE tid='{$tid}' ORDER BY postdate DESC LIMIT 1");
         $pt['anonymous'] && ($pt['author'] = $db_anonymousname);
         $pwSQL = array('replies' => $replies, 'lastposter' => $pt['author']);
         !($read['lastpost'] > $timestamp || $read['locked'] > 2) && ($pwSQL['lastpost'] = $pt['postdate']);
         //$this->db->update("UPDATE pw_threads SET " . S::sqlSingle($pwSQL) . " WHERE tid=" . S::sqlEscape($tid));
         pwQuery::update('pw_threads', 'tid = :tid', array($tid), $pwSQL);
     }
     return $ret;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:40,代码来源:delarticle.class.php


注:本文中的Perf::gatherInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。