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


PHP GetPtable函数代码示例

本文整理汇总了PHP中GetPtable函数的典型用法代码示例。如果您正苦于以下问题:PHP GetPtable函数的具体用法?PHP GetPtable怎么用?PHP GetPtable使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: get_reply

 function get_reply($uid, $num = 20)
 {
     $pw_posts = GetPtable($GLOBALS['db_ptable']);
     $array = $tTable = $tids = array();
     $query = $this->_db->query("SELECT DISTINCT tid,pid FROM {$pw_posts} WHERE authorid=" . S::sqlEscape($uid) . " AND ifcheck=1 AND fid!=0 ORDER BY postdate DESC " . S::sqlLimit($num));
     while ($rt = $this->_db->fetch_array($query)) {
         $tids[] = $rt['tid'];
         $pids[$rt[tid]][] = $rt['pid'];
     }
     if ($tids) {
         $query = $this->_db->query("SELECT t.tid,t.subject,t.replies,t.hits,t.postdate,f.fid as forumsid,f.name as forums FROM pw_threads t LEFT JOIN pw_forums f ON t.fid=f.fid WHERE t.tid IN(" . S::sqlImplode($tids) . ") ORDER BY t.tid DESC");
         while ($rt = $this->_db->fetch_array($query)) {
             $rt['subject'] = substrs($rt['subject'], 45);
             $rt['forums'] = substrs(stripWindCode($rt['forums']), 100, 'N');
             list($rt['postdate']) = getLastDate($rt['postdate']);
             $rt['pid'] = $pids[$rt[tid]][0];
             $tTable[getTtable($rt['tid'])][] = $rt['tid'];
             $array[$rt['tid']] = $rt;
         }
         foreach ($tTable as $pw_tmsgs => $ids) {
             $query = $this->_db->query("SELECT tid,content FROM {$pw_tmsgs} WHERE tid IN (" . S::sqlImplode($ids) . ')');
             while ($rt = $this->_db->fetch_array($query)) {
                 $array[$rt['tid']]['content'] = substrs(stripWindCode($rt['content']), 100, 'N');
             }
         }
     }
     return $array;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:28,代码来源:usermodedata.class.php

示例2: shieldPost

 function shieldPost($pid, $tid)
 {
     list($pid, $tid) = array(intval($pid), intval($tid));
     if ($pid < 1 || $tid < 1) {
         return $this->buildResponse(POST_INVALID_PARAMS);
     }
     $postTable = GetPtable('N', $tid);
     $GLOBALS['db']->query("UPDATE " . S::sqlMetadata($postTable) . " SET ifshield=1 WHERE pid=" . S::sqlEscape($pid));
     $bool = $GLOBALS['db']->affected_rows();
     return $this->buildResponse($bool == 1 ? 0 : 1);
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:11,代码来源:ver.common.post.php

示例3: getReplaysByUser

 /**
  * @param $uid			用户ID
  * @param $page			当前页数
  * @return unknown_type	返回类型
  */
 function getReplaysByUser($uid, $page = 1)
 {
     global $db_ptable;
     $uid = (int) $uid;
     if (!$uid) {
         return array();
     }
     $pw_posts = GetPtable($db_ptable);
     (int) $page < 1 && ($page = 1);
     $start = ($page - 1) * $this->perPage;
     $limit = pwLimit($start, $this->perPage);
     $sql = "SELECT p.pid,p.postdate,t.tid,t.fid,t.subject,t.authorid,t.author,t.replies,t.hits,t.topped,t.digest,t.ifupload\r\n\t\t\t FROM {$pw_posts} p LEFT JOIN pw_threads t USING(tid) WHERE p.fid != 0 AND p.authorid= " . pwEscape($uid) . " \r\n\t\t\t AND p.fid != '0' ORDER BY p.postdate DESC {$limit}";
     return $this->_query($sql, $start, 're');
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:19,代码来源:myspace.db.php

示例4: update_markinfo

function update_markinfo($fid, $tid, $pid)
{
    global $db;
    $perpage = 10;
    $pid = intval($pid);
    $creditnames = pwCreditNames();
    $whereStr = " fid=" . S::sqlEscape($fid) . " AND tid=" . S::sqlEscape($tid) . " AND pid=" . S::sqlEscape($pid) . " AND ifhide=0 ";
    $count = 0;
    $creditCount = array();
    $query = $db->query("SELECT COUNT(*) AS count,name,SUM(point) AS sum FROM pw_pinglog WHERE {$whereStr} GROUP BY name");
    while ($rt = $db->fetch_array($query)) {
        $count += $rt['count'];
        if (isset($creditnames[$rt['name']])) {
            $creditCount[$rt['name']] += $rt['sum'];
        } elseif (in_array($rt['name'], $creditnames)) {
            $key = array_search($rt['name'], $creditnames);
            $creditCount[$key] += $rt['sum'];
        }
    }
    $markInfo = '';
    if ($count) {
        $query = $db->query("SELECT id FROM pw_pinglog WHERE {$whereStr} ORDER BY id DESC LIMIT 0,{$perpage}");
        $ids = array();
        while ($rt = $db->fetch_array($query)) {
            $ids[] = $rt['id'];
        }
        $markInfo = $count . ":" . implode(",", $ids);
        if ($creditCount) {
            $tmp = array();
            foreach ($creditCount as $key => $value) {
                $tmp[] = $key . '=' . $value;
            }
            $markInfo .= ':' . implode(',', $tmp);
        }
    }
    if ($pid == 0) {
        //* $db->update("UPDATE $pw_tmsgs SET ifmark=" . S::sqlEscape($markInfo) . " WHERE tid=" . S::sqlEscape($tid));
        $pw_tmsgs = GetTtable($tid);
        pwQuery::update($pw_tmsgs, 'tid=:tid', array($tid), array('ifmark' => $markInfo));
    } else {
        $db->update("UPDATE " . GetPtable("N", $tid) . " SET ifmark=" . S::sqlEscape($markInfo) . " WHERE pid=" . S::sqlEscape($pid));
    }
    return $markInfo;
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:44,代码来源:pingfunc.php

示例5: execute

 function execute($postdata)
 {
     global $timestamp, $db_ptable, $onlineip, $db_plist;
     $this->setPostData($postdata);
     if ($db_plist && count($db_plist) > 1) {
         $this->db->update("INSERT INTO pw_pidtmp(pid) VALUES('')");
         $pid = $this->db->insert_id();
     } else {
         $pid = '';
     }
     $ipTable = L::loadClass('IPTable');
     $pwSQL = pwSqlSingle(array('pid' => $pid, 'fid' => $this->data['fid'], 'tid' => $this->tid, 'aid' => $this->data['aid'], 'author' => $this->data['author'], 'authorid' => $this->data['authorid'], 'icon' => $this->data['icon'], 'postdate' => $timestamp, 'subject' => $this->data['title'], 'userip' => $onlineip, 'ifsign' => $this->data['ifsign'], 'ipfrom' => $ipTable->getIpFrom($onlineip), 'ifconvert' => $this->data['convert'], 'ifwordsfb' => $this->data['ifwordsfb'], 'ifcheck' => $this->data['ifcheck'], 'content' => $this->data['content'], 'anonymous' => $this->data['anonymous'], 'ifhide' => $this->data['hideatt']));
     $pw_posts = GetPtable($this->tpcArr['ptable']);
     $this->db->update("INSERT INTO {$pw_posts} SET {$pwSQL}");
     !$pid && ($pid = $this->db->insert_id());
     $this->tpcArr['openIndex'] && $this->setPostFloor($pid);
     $this->pid = $pid;
     if (is_object($this->att) && ($aids = $this->att->getAids())) {
         $this->db->update("UPDATE pw_attachs SET " . pwSqlSingle(array('tid' => $this->tid, 'pid' => $this->pid)) . ' WHERE aid IN(' . pwImplode($aids) . ')');
     }
     if ($this->data['ifcheck'] == 1) {
         $sqladd1 = '';
         $sqladd = array('lastposter' => $this->data['lastposter']);
         $this->tpcArr['locked'] < 3 && $this->tpcArr['lastpost'] < $timestamp && ($sqladd['lastpost'] = $timestamp);
         $this->data['ifupload'] && ($sqladd['ifupload'] = $this->data['ifupload']);
         $ret = $this->sendMail();
         if ($ret & 2) {
             $sqladd['ifmail'] = 4;
         } elseif ($ret & 1) {
             $sqladd1 = "ifmail=ifmail-1,";
         }
         $this->db->update("UPDATE pw_threads SET {$sqladd1}replies=replies+1,hits=hits+1," . pwSqlSingle($sqladd) . " WHERE tid=" . pwEscape($this->tid));
         if (getstatus($this->tpcArr['tpcstatus'], 1)) {
             $this->db->update("UPDATE pw_argument SET lastpost=" . pwEscape($timestamp) . ' WHERE tid=' . pwEscape($this->tid));
         }
     }
     $this->post->updateUserInfo($this->type, $this->creditSet(), $this->data['content']);
     $this->afterReply();
 }
开发者ID:adi00,项目名称:wumaproject,代码行数:39,代码来源:replypost.class.php

示例6: update_markinfo

function update_markinfo($fid, $tid, $pid)
{
    global $db;
    $perpage = 10;
    $pid = intval($pid);
    $whereStr = " fid=" . pwEscape($fid) . " AND tid=" . pwEscape($tid) . " AND pid=" . pwEscape($pid) . " AND ifhide=0 ";
    $count = $db->get_value("SELECT COUNT(*) FROM pw_pinglog WHERE {$whereStr} ");
    $markInfo = "";
    if ($count) {
        $query = $db->query("SELECT id FROM pw_pinglog WHERE {$whereStr} ORDER BY pingdate DESC LIMIT 0,{$perpage}");
        $ids = array();
        while ($rt = $db->fetch_array($query)) {
            $ids[] = $rt['id'];
        }
        $markInfo = $count . ":" . implode(",", $ids);
    }
    if ($pid == 0) {
        $pw_tmsgs = GetTtable($tid);
        $db->update("UPDATE {$pw_tmsgs} SET ifmark=" . pwEscape($markInfo) . " WHERE tid=" . pwEscape($tid));
    } else {
        $db->update("UPDATE " . GetPtable("N", $tid) . " SET ifmark=" . pwEscape($markInfo) . " WHERE pid=" . pwEscape($pid));
    }
    return $markInfo;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:24,代码来源:pingfunc.php

示例7: recycle

function recycle($ids)
{
    global $db, $fid;
    $delids = array();
    foreach ($ids as $key => $value) {
        if (is_numeric($value)) {
            $delids[] = $value;
        }
    }
    if ($delids) {
        $delids = pwImplode($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=" . pwEscape($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=" . pwEscape($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 = pwImplode($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 = pwImplode($pollids);
        $db->update("DELETE FROM pw_polls WHERE tid IN({$pollids})");
    }
    if ($actids) {
        $actids = pwImplode($actids);
        $db->update("DELETE FROM pw_activity WHERE tid IN({$actids})");
        $db->update("DELETE FROM pw_actmember WHERE actid IN({$actids})");
    }
    if ($rewids) {
        $rewids = pwImplode($rewids);
        $db->update("DELETE FROM pw_reward WHERE tid IN({$rewids})");
    }
    if ($delaids) {
        $pw_attachs = L::loadDB('attachs');
        $pw_attachs->delete($delaids);
    }
    $delids = pwImplode($delids);
    if ($delids) {
        # $db->update("DELETE FROM pw_threads	WHERE tid IN($delids)");
        # ThreadManager
        $threadManager = L::loadClass("threadmanager");
        $threadManager->deleteByThreadIds($fid, $delids);
    }
    foreach ($ttable_a as $pw_tmsgs => $val) {
        $val = pwImplode($val);
        $db->update("DELETE FROM {$pw_tmsgs} WHERE tid IN({$val})");
    }
    foreach ($ptable_a as $key => $val) {
        $pw_posts = GetPtable($key);
        $db->update("DELETE FROM {$pw_posts} WHERE tid IN({$delids})");
    }
    delete_tag($delids);
    if ($ids) {
        $ids = pwImplode($ids);
        $db->update("DELETE FROM pw_recycle WHERE tid IN ({$ids})");
    }
    pwFtpClose($GLOBALS['ftp']);
}
开发者ID:adi00,项目名称:wumaproject,代码行数:100,代码来源:forumcp.php

示例8: sendPost

 function sendPost($tid, $uid, $title, $content)
 {
     global $winddb, $winduid, $windid, $groupid, $fid, $timestamp, $pwforum, $pwpost, $_G, $db_uploadfiletype, $uploadcredit, $uploadmoney, $manager, $isBM, $_time;
     $timestamp = time();
     $_time = array('hours' => get_date($timestamp, 'G'), 'day' => get_date($timestamp, 'j'), 'week' => get_date($timestamp, 'w'));
     list($uid, $tid, $title, $content) = array(intval($uid), intval($tid), trim($title), trim($content));
     if ($uid < 1 || $tid < 1 || !$content) {
         return $this->buildResponse(THREAD_INVALID_PARAMS);
     }
     ACloud_Sys_Core_Common::setGlobal('customized_current_uid', $uid);
     $user = $this->getCurrentUser();
     if (!$user->isLogin()) {
         return $this->buildResponse(USER_NOT_LOGIN);
     }
     if ($user->groupid == 6 || getstatus($user->info['userstatus'], PW_USERSTATUS_BANUSER)) {
         return $this->buildResponse(THREAD_USER_NOT_RIGHT);
     }
     $user->initRight();
     $winduid = $user->uid;
     $groupid = $user->groupid;
     $windid = $user->username;
     $winddb = $user->info;
     $_G = $user->_G;
     if ($_G['postlimit'] && $winddb['todaypost'] >= $_G['postlimit']) {
         return $this->buildResponse(POST_GP_LIMIT);
     }
     $tpcarray = $GLOBALS['db']->get_one("SELECT t.tid,t.fid,t.locked,t.ifcheck,t.author,t.authorid,t.postdate,t.lastpost,t.ifmail,t.special,t.subject,t.type,t.ifshield,t.anonymous,t.ptable,t.replies,t.tpcstatus FROM pw_threads t WHERE t.tid=" . pwEscape($tid));
     L::loadClass('forum', 'forum', false);
     $pwforum = new PwForum($tpcarray['fid']);
     if (!$pwforum->isForum()) {
         return $this->buildResponse(THREAD_FORUM_NOT_EXIST);
     }
     $fid = $tpcarray['fid'];
     $isBM = $pwforum->isBM($windid);
     $isGM = S::inArray($windid, $manager);
     if (!$isGM && $tpcarray['locked'] % 3 != 0 && !pwRights($isBM, 'replylock')) {
         return $this->buildResponse(THREAD_LOCKED);
     }
     L::loadClass('post', 'forum', false);
     require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.bbscode.php';
     $pwpost = new PwPost($pwforum);
     $pwpost->errMode = true;
     $pwpost->forumcheck();
     $pwpost->postcheck();
     L::loadClass('replypost', 'forum', false);
     $replypost = new replyPost($pwpost);
     $replypost->setTpc($tpcarray);
     $replypost->check();
     $pw_posts = GetPtable($replypost->tpcArr['ptable']);
     $postdata = new replyPostData($pwpost);
     $postdata->setTitle($title);
     $postdata->setContent($content);
     $postdata->conentCheck();
     if ($pwpost->errMsg && ($msg = reset($pwpost->errMsg))) {
         return $this->buildResponse(THREAD_SYSTEM_ERROR, $msg);
     }
     require_once ACLOUD_VERSION_PATH . '/customized/ver.customized.attupload.php';
     if (PwUpload::getUploadNum()) {
         $_G['uploadtype'] && ($db_uploadfiletype = $_G['uploadtype']);
         $db_uploadfiletype = !empty($db_uploadfiletype) ? is_array($db_uploadfiletype) ? $db_uploadfiletype : unserialize($db_uploadfiletype) : array();
         $postdata->att = new AttUpload($user->uid);
         $return = $postdata->att->check();
         if ($return) {
             $msginfo = getLangInfo('msg', $return);
             return $this->errMessage(THREAD_USER_NOT_RIGHT, $msginfo);
         }
         list($windVersion) = explode(',', WIND_VERSION);
         if ($windVersion && $windVersion < '8.5') {
             $postdata->att->transfer();
             PwUpload::upload($postdata->att);
         }
     }
     $replypost->execute($postdata);
     $pid = $replypost->getNewId();
     return $this->buildResponse(0, array('pid' => $pid));
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:76,代码来源:ver.customized.post.php

示例9: 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

示例10: list

             list($hidefid, $hideforum) = GetHiddenForum();
             $sql = $hidefid ? "fid NOT IN({$hidefid})" : '1';
         }
     } else {
         $forumcache = '';
         $sql = '';
     }
     if ($sql) {
         $sysinfo['tcheck'] = $db->get_value("SELECT COUNT(*) FROM pw_threads WHERE {$sql} AND ifcheck='0'");
         $sysinfo['pcheck'] = 0;
         if ($db_plist && count($db_plist) > 1) {
             foreach ($db_plist as $key => $val) {
                 if ($key == 0) {
                     continue;
                 }
                 $pw_posts = GetPtable($key);
                 $sysinfo['pcheck'] += $db->get_value("SELECT COUNT(*) FROM {$pw_posts} WHERE ifcheck='0' AND {$sql}");
             }
         } else {
             $sysinfo['pcheck'] = $db->get_value("SELECT COUNT(*) FROM pw_posts WHERE ifcheck='0' AND {$sql}");
         }
     } else {
         $sysinfo['tcheck'] = 0;
         $sysinfo['pcheck'] = 0;
     }
     $sysinfo['report'] = $db->get_value("SELECT COUNT(*) FROM pw_report WHERE state=0");
 }
 $lastinfo = $slog = array();
 $userService = L::loadClass('UserService', 'user');
 /* @var $userService PW_UserService */
 $userdb = $userService->getByUserName($admin_name);
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:31,代码来源:admininfo.php

示例11: delforum

function delforum($fid)
{
    global $db, $db_guestdir, $db_guestthread, $db_guestread;
    $foruminfo = $db->get_one("SELECT fid,fup,forumadmin FROM pw_forums WHERE fid=" . S::sqlEscape($fid));
    //$db->update("DELETE FROM pw_forums WHERE fid=".S::sqlEscape($fid));
    pwQuery::delete('pw_forums', 'fid=:fid', array($fid));
    //* $db->update("DELETE FROM pw_forumdata WHERE fid=".S::sqlEscape($fid));
    pwQuery::delete('pw_forumdata', 'fid=:fid', array($fid));
    $db->update("DELETE FROM pw_forumsextra WHERE fid=" . S::sqlEscape($fid));
    $db->update("DELETE FROM pw_permission WHERE fid>'0' AND fid=" . S::sqlEscape($fid));
    if ($foruminfo['forumadmin']) {
        $userService = L::loadClass('UserService', 'user');
        /* @var $userService PW_UserService */
        $forumadmin = explode(",", $foruminfo['forumadmin']);
        foreach ($forumadmin as $key => $value) {
            if ($value) {
                $gid = $userService->getByUserName($value);
                if ($gid['groupid'] == 5 && !ifadmin($value)) {
                    $userService->update($gid['uid'], array('groupid' => -1));
                    admincheck($gid['uid'], $value, $gid['groupid'], '', 'delete');
                }
            }
        }
    }
    if ($db_guestthread || $db_guestread) {
        require_once R_P . 'require/guestfunc.php';
        $db_guestthread && deldir(D_P . "{$db_guestdir}/T_{$fid}");
    }
    //* P_unlink(D_P."data/forums/fid_{$fid}.php");
    pwCache::deleteData(D_P . "data/forums/fid_{$fid}.php");
    require_once R_P . 'require/functions.php';
    require_once R_P . 'require/updateforum.php';
    $pw_attachs = L::loadDB('attachs', 'forum');
    $ttable_a = $ptable_a = array();
    $query = $db->query("SELECT tid,replies,ptable FROM pw_threads WHERE fid=" . S::sqlEscape($fid));
    while ($tpc = $db->fetch_array($query)) {
        $tid = $tpc['tid'];
        $ttable_a[GetTtable($tid)][] = $tid;
        $ptable_a[$tpc['ptable']] = 1;
        $db_guestread && clearguestcache($tid, $tpc['replies']);
        if ($attachdb = $pw_attachs->getByTid($tid)) {
            delete_att($attachdb);
        }
    }
    pwFtpClose($GLOBALS['ftp']);
    foreach ($ttable_a as $pw_tmsgs => $val) {
        //* $val = S::sqlImplode($val,false);
        //* $db->update("DELETE FROM $pw_tmsgs WHERE tid IN($val)");
        pwQuery::delete($pw_tmsgs, 'tid IN(:tid)', array($val));
    }
    # $db->update("DELETE FROM pw_threads WHERE fid=".S::sqlEscape($fid));
    # ThreadManager
    //* $threadManager = L::loadClass("threadmanager", 'forum');
    //* $threadManager->deleteByForumId($fid);
    $threadService = L::loadclass('threads', 'forum');
    $threadService->deleteByForumId($fid);
    //* Perf::gatherInfo('changeThreadWithForumIds', array('fid'=>$fid));
    foreach ($ptable_a as $key => $val) {
        $pw_posts = GetPtable($key);
        //$db->update("DELETE FROM $pw_posts WHERE fid=".S::sqlEscape($fid));
        pwQuery::delete($pw_posts, 'fid=:fid', array($fid));
    }
    updateforum($foruminfo['fup']);
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:64,代码来源:setforum.php

示例12: changeTopicToForum

 /**
  * 改变帖子归属版块
  * @param int $cyid 群组id
  * @param int $ifTopicShowInForum 帖子是否显示在版块中
  * @param int $tocid 目标群组
  * @param int $fromcid 来源群组
  * void
  */
 function changeTopicToForum($cyid, $ifTopicShowInForum, $tocid, $fromcid)
 {
     global $db_plist;
     $tocid = intval($tocid);
     $ifcheck = $tocid > 0 && $ifTopicShowInForum ? 1 : 2;
     $this->_db->update("REPLACE INTO pw_poststopped \r\n\t\t\tSELECT {$tocid},p.tid,p.pid,p.floor,p.uptime,p.overtime \r\n\t\t\tFROM pw_poststopped p \r\n\t\t\tLEFT JOIN pw_argument a ON p.tid=a.tid \r\n\t\t\tWHERE p.fid=" . S::sqlEscape($fromcid) . " AND p.pid=0 AND a.cyid=" . S::sqlEscape($cyid));
     $_sql_Where = $fromcid > 0 ? ' AND t.fid>0' : " AND t.ifcheck='2'";
     /*$this->_db->update("UPDATE pw_argument a LEFT JOIN pw_threads t ON a.tid=t.tid 
     			SET t.fid=" . S::sqlEscape($tocid) . ",t.ifcheck=" . S::sqlEscape($ifcheck) . 
     			" WHERE a.cyid=" . S::sqlEscape($cyid) . $_sql_Where
     		);*/
     $this->_db->update(pwQuery::buildClause("UPDATE :pw_table1 a LEFT JOIN :pw_table2 t ON a.tid=t.tid SET t.fid=:fid,t.ifcheck=:ifcheck WHERE a.cyid=:cyid {$_sql_Where}", array('pw_argument', 'pw_threads', $tocid, $ifcheck, $cyid)));
     $this->_db->update("UPDATE pw_argument a LEFT JOIN pw_posts p ON a.tid=p.tid SET p.fid=" . S::sqlEscape($tocid) . " WHERE a.cyid=" . S::sqlEscape($cyid));
     if ($db_plist && count($db_plist) > 1) {
         foreach ($db_plist as $key => $value) {
             if ($key == 0) {
                 continue;
             }
             $pw_posts = GetPtable($key);
             $this->_db->update("UPDATE pw_argument a LEFT JOIN {$pw_posts} p ON a.tid=p.tid SET p.fid=" . S::sqlEscape($tocid) . " WHERE a.cyid=" . S::sqlEscape($cyid));
         }
     }
     require_once R_P . 'require/updateforum.php';
     if ($tocid > 0) {
         $this->_db->update("UPDATE pw_cnclass SET cnsum=cnsum+1 WHERE fid=" . S::sqlEscape($tocid));
         updateforum($tocid);
     }
     if ($fromcid > 0) {
         $this->_db->update("UPDATE pw_cnclass SET cnsum=cnsum-1 WHERE fid=" . S::sqlEscape($fromcid) . " AND cnsum>0");
         updateforum($fromcid);
     }
     updatetop();
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:41,代码来源:colonys.class.php

示例13: wap_header

     wap_header('post', $db_bbsname);
     require_once PrintEot('wap_post');
     wap_footer();
 } else {
     if (!$tp['ifcheck']) {
         wap_msg('reply_ifcheck');
     }
     if ($tp['locked'] > 0) {
         wap_msg("reply_lockatc");
     }
     InitGP(array('subject', 'content'), 'P', 0);
     wap_check($fid, 'reply');
     $subject = wap_cv($subject);
     $content = wap_cv($content);
     $ipfrom = Char_cv(cvipfrom($onlineip));
     $pw_posts = GetPtable($tp['ptable']);
     if ($db_plist && count($db_plist) > 1) {
         $db->update("INSERT INTO pw_pidtmp(pid) values('')");
         $pid = $db->insert_id();
     } else {
         $pid = '';
     }
     $db->update("INSERT INTO {$pw_posts}" . " SET " . pwSqlSingle(array('pid' => $pid, 'tid' => $tid, 'fid' => $fid, 'ifcheck' => 1, 'subject' => $subject, 'author' => $windid, 'authorid' => $winduid, 'postdate' => $timestamp, 'userip' => $onlineip, 'ipfrom' => $ipfrom, 'content' => $content)));
     !$pid && ($pid = $db->insert_id());
     $db->update("UPDATE pw_threads" . " SET " . pwSqlSingle(array('lastpost' => $timestamp, 'lastposter' => $windid)) . ",replies=replies+1,hits=hits+1" . " WHERE tid=" . pwEscape($tid));
     #增加高楼索引
     if ($openIndex && $pid) {
         $db->update("INSERT INTO pw_postsfloor SET pid=" . pwEscape($pid) . ", tid=" . pwEscape($tid));
     }
     # memcache refresh
     $threadList = L::loadClass("threadlist");
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:post.php

示例14: getPostInfo

 /**
  * 获取帖子信息
  * @param $tid
  * @param $pid
  */
 function getPostInfo($tid, $pid = 0)
 {
     $tid = intval($tid);
     $pid = intval($pid);
     if ($tid > 0) {
         //* $threadService = L::loadClass('threads', 'forum'); /* @var $threadService PW_Threads */
         //* $threadInfo = $threadService->getThreads($tid,true);
         $_cacheService = Perf::gatherCache('pw_threads');
         $threadInfo = $_cacheService->getThreadAndTmsgByThreadId($tid);
         if (!$threadInfo) {
             return false;
         }
         $fid = $threadInfo['fid'];
         $userip = $threadInfo['userip'];
         //回复
         if ($pid > 0) {
             $postTable = GetPtable($threadInfo['ptable']);
             $postInfo = $this->db->get_one("SELECT authorid,userip FROM {$postTable} \n\t\t\t\t\t\tWHERE pid= " . S::sqlEscape($pid) . " \n\t\t\t\t\t\tAND tid=" . S::sqlEscape($tid) . "\n\t\t\t\t\t\tAND authorid= " . S::sqlEscape($uid));
             if (!$postInfo) {
                 return false;
             }
             $userip = $postInfo['userip'];
         }
         return array('fid' => $fid, 'userip' => $userip);
     }
     return false;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:32,代码来源:banuser.class.php

示例15: array

S::gp(array('type', 'stylepath'));
S::gp(array('fpage', 'uid', 'toread'), 'GP', 2);
$_showSmallImg = 5;
$ordertype = S::getGP('ordertype');
$fieldadd = $tablaadd = $sqladd = $fastpost = $special = $ifmagic = $urladd = $fieldinfo = $tableinfo = '';
$_uids = $_pids = array();
$page = S::getGP('page');
//* $threads = L::loadClass('Threads', 'forum');
//* $read = $threads->getThreads($tid);
$_cacheService = Perf::gatherCache('pw_threads');
$read = $_cacheService->getThreadByThreadId($tid);
!$read && Showmsg('illegal_tid');
$_uids[$read['authorid']] = 'UID_' . $read['authorid'];
#用户
list($fid, $ptable, $ifcheck, $openIndex) = array($read['fid'], $read['ptable'], $read['ifcheck'], getstatus($read['tpcstatus'], 2));
$pw_posts = GetPtable($ptable);
/*The app client*/
if ($db_siteappkey && ($db_apps_list['17']['status'] == 1 || is_array($db_threadconfig))) {
    $appclient = L::loadClass('appclient');
    if ($db_apps_list['17']['status'] == 1) {
        $forumappinfo = array();
        $forumappinfo = $appclient->showForumappinfo($fid, 'read', '17');
    }
    if (is_array($db_threadconfig)) {
        $threadright = array();
        $threadright = $appclient->getThreadRight();
    }
}
/*The app client*/
//读取版块信息及权限判断
if (!($foruminfo = L::forum($fid))) {
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:addfloor.php


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