本文整理汇总了PHP中updatethreadcount函数的典型用法代码示例。如果您正苦于以下问题:PHP updatethreadcount函数的具体用法?PHP updatethreadcount怎么用?PHP updatethreadcount使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了updatethreadcount函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: usesubmit
function usesubmit()
{
global $_G;
if (empty($_G['gp_pid'])) {
showmessage(lang('magic/repent', 'repent_info_nonexistence'));
}
$_G['tid'] = $_G['gp_ptid'];
$post = getpostinfo($_G['gp_pid'], 'pid', array('p.first', 'p.tid', 'p.fid', 'p.authorid', 'p.replycredit', 't.status as thread_status'));
$this->_check($post);
require_once libfile('function/post');
require_once libfile('function/delete');
if ($post['first']) {
if ($have_replycredit = DB::fetch_first("SELECT * FROM " . DB::table('forum_replycredit') . " WHERE tid ='{$post['tid']}' LIMIT 1")) {
if ($replycredit = DB::result_first("SELECT replycredit FROM " . DB::table('forum_thread') . " WHERE tid = '{$post['tid']}'")) {
updatemembercount($post['authorid'], array($_G['setting']['creditstransextra'][10] => $replycredit));
}
DB::delete('forum_replycredit', "tid = '{$post['tid']}'");
DB::delete('common_credit_log', "operation IN ('RCT', 'RCA', 'RCB') AND relatedid IN({$post['tid']})");
}
deletethread(array($post['tid']));
updateforumcount($post['fid']);
} else {
if ($post['replycredit'] > 0) {
updatemembercount($post['authorid'], array($_G['setting']['creditstransextra'][10] => -$post['replycredit']));
DB::delete('common_credit_log', "uid = '{$post['authorid']}' AND operation = 'RCA' AND relatedid IN({$post['tid']})");
}
deletepost(array($_G['gp_pid']));
updatethreadcount($post['tid']);
}
usemagic($this->magic['magicid'], $this->magic['num']);
updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_G['tid']);
showmessage(lang('magic/repent', 'repent_succeed'), $post['first'] ? 'forum.php?mod=forumdisplay&fid=' . $post['fid'] : dreferer(), array(), array('showdialog' => 1, 'locationtime' => true));
}
开发者ID:pan289091315,项目名称:Discuz,代码行数:33,代码来源:magic_repent.php
示例2: usesubmit
function usesubmit()
{
global $_G;
if (empty($_GET['pid'])) {
showmessage(lang('magic/repent', 'repent_info_nonexistence'));
}
$_G['tid'] = $_GET['ptid'];
$post = getpostinfo($_GET['pid'], 'pid', array('p.first', 'p.tid', 'p.fid', 'p.authorid', 'p.replycredit', 't.status as thread_status'));
$this->_check($post);
require_once libfile('function/post');
require_once libfile('function/delete');
if ($post['first']) {
if ($have_replycredit = C::t('forum_replycredit')->fetch($post['tid'])) {
$thread = C::t('forum_thread')->fetch($post['tid']);
if ($thread['replycredit']) {
updatemembercount($post['authorid'], array($_G['setting']['creditstransextra'][10] => $replycredit));
}
C::t('forum_replycredit')->delete($post['tid']);
C::t('common_credit_log')->delete_by_operation_relatedid(array('RCT', 'RCA', 'RCB'), $post['tid']);
}
deletethread(array($post['tid']));
updateforumcount($post['fid']);
} else {
if ($post['replycredit'] > 0) {
updatemembercount($post['authorid'], array($_G['setting']['creditstransextra'][10] => -$post['replycredit']));
C::t('common_credit_log')->delete_by_uid_operation_relatedid($post['authorid'], 'RCA', $post['tid']);
}
deletepost(array($_GET['pid']));
updatethreadcount($post['tid']);
}
usemagic($this->magic['magicid'], $this->magic['num']);
updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_G['tid']);
showmessage(lang('magic/repent', 'repent_succeed'), $post['first'] ? 'forum.php?mod=forumdisplay&fid=' . $post['fid'] : dreferer(), array(), array('alert' => 'right', 'showdialog' => 1, 'locationtime' => true));
}
开发者ID:tang86,项目名称:discuz-utf8,代码行数:34,代码来源:magic_repent.php
示例3: usesubmit
function usesubmit()
{
global $_G;
if (empty($_G['gp_pid'])) {
showmessage(lang('magic/repent', 'repent_info_nonexistence'));
}
$_G['tid'] = $_G['gp_ptid'];
$post = getpostinfo($_G['gp_pid'], 'pid', array('p.first', 'p.tid', 'p.fid', 'p.authorid'));
$this->_check($post);
require_once libfile('function/post');
require_once libfile('function/delete');
if ($post['first']) {
deletethread("tid='{$post['tid']}'");
updateforumcount($post['fid']);
} else {
deletepost("pid='{$_G['gp_pid']}'");
updatethreadcount($post['tid']);
}
usemagic($this->magic['magicid'], $this->magic['num']);
updatemagiclog($this->magic['magicid'], '2', '1', '0', 0, 'tid', $_G['tid']);
showmessage(lang('magic/repent', 'repent_succeed'), $post['first'] ? 'forum.php?mod=forumdisplay&fid=' . $post['fid'] : dreferer(), array(), array('showdialog' => 1, 'locationtime' => 1));
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:22,代码来源:magic_repent.php
示例4: checkreasonpm
}
$modaction = 'SPL';
$reason = checkreasonpm();
$subject = dhtmlspecialchars($_G['gp_subject']);
DB::query("INSERT INTO " . DB::table('forum_thread') . " (fid, posttableid, subject) VALUES ('{$_G['fid']}', '{$posttableid}', '{$subject}')");
$newtid = DB::insert_id();
my_thread_log('split', array('tid' => $_G['tid']));
foreach ((array) explode(',', $pids) as $pid) {
my_post_log('split', array('pid' => $pid));
}
DB::query("UPDATE " . DB::table($posttable) . " SET tid='{$newtid}' WHERE pid IN ({$pids})");
DB::query("UPDATE " . DB::table('forum_attachment') . " SET tid='{$newtid}' WHERE pid IN ({$pids})");
$splitauthors = array();
$query = DB::query("SELECT pid, tid, authorid, subject, dateline FROM " . DB::table($posttable) . " WHERE tid='{$newtid}' AND invisible='0' GROUP BY authorid ORDER BY dateline");
while ($splitauthor = DB::fetch($query)) {
$splitauthor['subject'] = $subject;
$splitauthors[] = $splitauthor;
}
DB::query("UPDATE " . DB::table($posttable) . " SET first='1', subject='{$subject}' WHERE pid='" . $splitauthors[0]['pid'] . "'", 'UNBUFFERED');
$fpost = DB::fetch_first("SELECT pid, author, authorid, dateline FROM " . DB::table($posttable) . " WHERE tid='{$_G['tid']}' ORDER BY dateline LIMIT 1");
DB::query("UPDATE " . DB::table('forum_thread') . " SET author='" . addslashes($fpost['author']) . "', authorid='{$fpost['authorid']}', dateline='{$fpost['dateline']}', moderated='1' WHERE tid='{$_G['tid']}'");
DB::query("UPDATE " . DB::table($posttable) . " SET subject='" . addslashes($thread['subject']) . "' WHERE pid='{$fpost['pid']}'");
$fpost = DB::fetch_first("SELECT author, authorid, dateline, rate FROM " . DB::table($posttable) . " WHERE tid='{$newtid}' ORDER BY dateline ASC LIMIT 1");
DB::query("UPDATE " . DB::table('forum_thread') . " SET author='" . addslashes($fpost['author']) . "', authorid='{$fpost['authorid']}', dateline='{$fpost['dateline']}', rate='" . intval(@($fpost['rate'] / abs($fpost['rate']))) . "', moderated='1' WHERE tid='{$newtid}'");
updatethreadcount($_G['tid']);
updatethreadcount($newtid);
updateforumcount($_G['fid']);
$_G['forum']['threadcaches'] && deletethreadcaches($thread['tid']);
$modpostsnum++;
$resultarray = array('redirect' => "forum.php?mod=forumdisplay&fid={$_G['fid']}", 'reasonpm' => $sendreasonpm ? array('data' => $splitauthors, 'var' => 'thread', 'item' => 'reason_moderate') : array(), 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => stripslashes($reason)), 'modtids' => $thread['tid'] . ',' . $newtid, 'modlog' => array($thread, array('tid' => $newtid, 'subject' => $subject)));
}
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:topicadmin_split.php
示例5: unset
unset($prune['thread'][$pidsthread[$pid]]);
updatemodlog($pidsthread[$pid], 'DEL');
} else {
updatemodlog($pidsthread[$pid], 'DLP');
}
}
}
deletepost($pidsdelete, 'pid', false, $posttableid, true);
}
unset($postlist);
if ($tidsdelete) {
deletethread($tidsdelete, true, true, true);
}
if (!empty($prune)) {
foreach ($prune['thread'] as $tid => $decrease) {
updatethreadcount($tid);
}
foreach (array_unique($prune['forums']) as $fid) {
}
}
if ($_G['setting']['globalstick']) {
updatecache('globalstick');
}
}
$membercount['posts'] = 0;
$membercount['threads'] = 0;
}
if (in_array('follow', $_GET['clear'])) {
C::t('home_follow_feed')->delete_by_uid($member['uid']);
$membercount['feeds'] = 0;
}
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:31,代码来源:admincp_members.php
示例6: define
define('APPTYPEID', 2);
define('CURSCRIPT', 'forum');
require '../source/class/class_core.php';
require '../source/function/function_forum.php';
C::app()->init();
isset($_REQUEST['tid']) ? $tid = $_REQUEST['tid'] : ($res['err'] = 1);
isset($_REQUEST['author']) ? $author = $_REQUEST['author'] : ($res['err'] = 1);
isset($_REQUEST['uid']) ? $uid = $_REQUEST['uid'] : ($res['err'] = 1);
$message = isset($_REQUEST['message']) ? $_REQUEST['message'] : '';
$message = iconv('utf-8', 'gbk', $message);
$author = iconv('utf-8', 'gbk', $author);
if ($res['err'] != 1) {
$pid = insertpost(array('fid' => 1004, 'tid' => $tid, 'first' => '0', 'author' => $author, 'authorid' => $uid, 'subject' => '', 'dateline' => time(), 'message' => $message, 'useip' => $_G['clientip'], 'invisible' => 0, 'anonymous' => 0, 'usesig' => 1, 'htmlon' => 0, 'bbcodeoff' => false, 'smileyoff' => -1, 'parseurloff' => false, 'attachment' => '0', 'tags' => '', 'replycredit' => 0, 'status' => 100));
if ($pid) {
updatethreadcount($tid, 0);
C::t('forum_forum')->update_forum_counter(1005, 0, 1, 1);
$res['tid'] = $tid;
$res['pid'] = $pid;
$res['err'] = 0;
}
}
function updatethreadcount($tid, $updateattach = 0)
{
$replycount = C::t('forum_post')->count_visiblepost_by_tid($tid) - 1;
$lastpost = C::t('forum_post')->fetch_visiblepost_by_tid('tid:' . $tid, $tid, 0, 1);
$lastpost['author'] = $lastpost['anonymous'] ? lang('forum/misc', 'anonymous') : addslashes($lastpost['author']);
$lastpost['dateline'] = !empty($lastpost['dateline']) ? $lastpost['dateline'] : TIMESTAMP;
$data = array('replies' => $replycount, 'lastposter' => $lastpost['author'], 'lastpost' => $lastpost['dateline']);
if ($updateattach) {
$attach = C::t('forum_post')->fetch_attachment_by_tid($tid);
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:30,代码来源:postapi.php
示例7: updatemembercount
updatemembercount($author['authorid'], array($author['extcredits'] => -$author['score']));
$author['score'] = $_G['setting']['extcredits'][$id]['title'] . ' ' . -$author['score'] . ' ' . $_G['setting']['extcredits'][$id]['unit'];
$logs[] = dhtmlspecialchars("{$_G['timestamp']}\t{$_G[member][username]}\t{$_G['adminid']}\t{$author['author']}\t{$author['extcredits']}\t{$author['score']}\t{$thread['tid']}\t{$thread['subject']}\t{$delpostsubmit}");
}
}
}
if (!empty($logs)) {
writelog('ratelog', $logs);
unset($logs);
}
DB::delete('common_credit_log', "operation='PRC' AND relatedid IN({$pids})");
DB::query("DELETE FROM " . DB::table('forum_ratelog') . " WHERE pid IN ({$pids})");
DB::query("DELETE FROM " . DB::table('forum_attachment') . " WHERE pid IN ({$pids})");
DB::query("DELETE FROM " . DB::table('forum_attachmentfield') . " WHERE pid IN ({$pids})");
DB::query("DELETE FROM " . DB::table('forum_postcomment') . " WHERE pid IN ({$pids})");
DB::query("DELETE FROM " . DB::table($posttable) . " WHERE pid IN ({$pids})");
getstatus($thread['status'], 1) && DB::query("DELETE FROM " . DB::table('forum_postposition') . " WHERE pid IN ({$pids})");
$thread['stickreply'] && DB::query("DELETE FROM " . DB::table('forum_poststick') . " WHERE tid='{$thread['tid']}' AND pid IN ({$pids})");
foreach (explode(',', $pids) as $pid) {
my_post_log('delete', array('pid' => $pid));
}
if ($thread['special']) {
DB::query("DELETE FROM " . DB::table('forum_trade') . " WHERE pid IN ({$pids})");
}
updatethreadcount($_G['tid'], 1);
updateforumcount($_G['fid']);
$_G['forum']['threadcaches'] && deletethreadcaches($thread['tid']);
$modaction = 'DLP';
$resultarray = array('redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page={$page}", 'reasonpm' => $sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_delete_post') : array(), 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => stripslashes($reason)), 'modtids' => 0, 'modlog' => $thread);
procreportlog('', $pids, TRUE);
}
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:topicadmin_delpost.php
示例8: foreach
require_once DISCUZ_ROOT . './include/post.func.php';
if ($post['first']) {
foreach (array('threads', 'threadsmod', 'relatedthreads', 'posts', 'polls', 'polloptions', 'trades', 'activities', 'activityapplies', 'attachments', 'favorites', 'debates', 'debateposts', 'typeoptionvars', 'forumrecommend') as $value) {
$db->query("DELETE FROM {$tablepre}{$value} WHERE tid='{$post['tid']}'", 'UNBUFFERED');
}
$query = $db->query("SELECT uid, attachment, dateline, thumb, remote FROM {$tablepre}attachments WHERE tid='{$post['tid']}'");
while ($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
updateforumcount($post['fid']);
} else {
$db->query("DELETE FROM {$tablepre}posts WHERE pid='{$pid}'", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}attachments WHERE pid='{$pid}'", 'UNBUFFERED');
$db->query("DELETE FROM {$tablepre}attachmentfields WHERE pid='{$pid}'", 'UNBUFFERED');
$query = $db->query("SELECT uid, attachment, dateline, thumb, remote FROM {$tablepre}attachments WHERE pid='{$pid}'");
while ($attach = $db->fetch_array($query)) {
dunlink($attach['attachment'], $attach['thumb'], $attach['remote']);
}
updatethreadcount($post['tid']);
}
usemagic($magicid, $magic['num']);
updatemagiclog($magicid, '2', '1', '0', '0', $pid);
showmessage('magics_operation_succeed', '', 1);
}
function showmagic()
{
global $pid, $lang;
magicshowtype($lang['option'], 'top');
magicshowsetting($lang['target_pid'], 'pid', $pid, 'text');
magicshowtype('', 'bottom');
}
开发者ID:lilhorse,项目名称:cocoa,代码行数:31,代码来源:magic_del.inc.php
示例9: recyclebinpostundelete
function recyclebinpostundelete($undeletepids, $posttableid = false)
{
global $_G;
if ($_G['setting']['plugins']['func'][HOOKTYPE]['recyclebinpostundelete']) {
$param = func_get_args();
hookscript('recyclebinpostundelete', 'global', 'funcs', array('param' => $param), 'recyclebinpostundelete');
}
$postsundel = 0;
if (empty($undeletepids)) {
return $postsundel;
}
loadcache('posttableids');
$posttableids = !empty($_G['cache']['posttableids']) ? $posttableid !== false && in_array($posttableid, $_G['cache']['posttableids']) ? array($posttableid) : $_G['cache']['posttableids'] : array('0');
$postarray = $ruidarray = $fidarray = $tidarray = array();
foreach ($posttableids as $ptid) {
foreach (C::t('forum_post')->fetch_all($ptid, $undeletepids, false) as $post) {
if (!$post['first']) {
$ruidarray[$post['fid']][] = $post['authorid'];
}
$fidarray[$post['fid']] = $post['fid'];
$tidarray[$post['tid']] = $post['tid'];
}
}
if (empty($fidarray)) {
return $postsundel;
}
C::t('forum_post')->update($posttableid, $undeletepids, array('invisible' => '0'), true);
include_once libfile('function/post');
if ($ruidarray) {
foreach ($ruidarray as $fid => $ruids) {
updatepostcredits('+', $ruids, 'reply', $fid);
}
}
foreach ($tidarray as $tid) {
updatethreadcount($tid, 1);
}
foreach ($fidarray as $fid) {
updateforumcount($fid);
}
return count($undeletepids);
}
开发者ID:jaideejung007,项目名称:DiscuzxTH,代码行数:41,代码来源:function_misc.php
示例10: _adminTopic
//.........这里部分代码省略.........
if ($act == 'move') {
require_once libfile('function/forumlist');
$forumselect = forumselect(FALSE, 0, $threadlist[$_G['tid']]['fid'], $_G['adminid'] == 1 ? TRUE : FALSE);
}
}
}
} else {
if ($type == 'post') {
if ($act == 'band') {
$resultarray = $this->_topicAdmin_band($fid, $tid, $pid, $act, $type, array('sendreasonpm' => $sendreasonpm, 'thread' => $_G['forum_thread']));
} else {
// 在DISCUZ_ROOT/source/include/topicadmin/topicadmin_delpost.php基础上进行二次开发
$resultarray = array();
$thread = $_G['forum_thread'];
$topiclist = array($pid);
$modpostsnum = 1;
$pids = $posts = $authors = array();
$posttable = getposttablebytid($_G['tid']);
foreach (C::t('forum_post')->fetch_all('tid:' . $_G['tid'], $topiclist, false) as $post) {
if ($post['tid'] != $_G['tid']) {
continue;
}
if ($post['first'] == 1) {
dheader("location: {$_G['siteurl']}forum.php?mod=topicadmin&action=moderate&operation=delete&optgroup=3&fid={$_G['fid']}&moderate[]={$thread['tid']}&inajax=yes" . ($_GET['infloat'] ? "&infloat=yes&handlekey={$_GET['handlekey']}" : ''));
} else {
$authors[$post['authorid']] = 1;
$pids[] = $post['pid'];
$posts[] = $post;
}
}
if (!empty($_POST)) {
$reason = checkreasonpm();
$uidarray = $puidarray = $auidarray = array();
$losslessdel = $_G['setting']['losslessdel'] > 0 ? TIMESTAMP - $_G['setting']['losslessdel'] * 86400 : 0;
if ($pids) {
require_once libfile('function/delete');
if ($_G['forum']['recyclebin']) {
deletepost($pids, 'pid', true, false, true);
manage_addnotify('verifyrecyclepost', $modpostsnum);
} else {
$logs = array();
$ratelog = C::t('forum_ratelog')->fetch_all_by_pid($pids);
$rposts = C::t('forum_post')->fetch_all('tid:' . $_G['tid'], $pids, false);
foreach (C::t('forum_ratelog')->fetch_all_by_pid($pids) as $rpid => $author) {
if ($author['score'] > 0) {
$rpost = $rposts[$rpid];
updatemembercount($rpost['authorid'], array($author['extcredits'] => -$author['score']));
$author['score'] = $_G['setting']['extcredits'][$id]['title'] . ' ' . -$author['score'] . ' ' . $_G['setting']['extcredits'][$id]['unit'];
$logs[] = dhtmlspecialchars("{$_G['timestamp']}\t{$_G[member][username]}\t{$_G['adminid']}\t{$rpost['author']}\t{$author['extcredits']}\t{$author['score']}\t{$thread['tid']}\t{$thread['subject']}\t{$delpostsubmit}");
}
}
if (!empty($logs)) {
writelog('ratelog', $logs);
unset($logs);
}
deletepost($pids, 'pid', true);
}
if ($_GET['crimerecord']) {
include_once libfile('function/member');
foreach ($posts as $post) {
crime('recordaction', $post['authorid'], 'crime_delpost', lang('forum/misc', 'crime_postreason', array('reason' => $reason, 'tid' => $post['tid'], 'pid' => $post['pid'])));
}
}
}
updatethreadcount($_G['tid'], 1);
updateforumcount($_G['fid']);
$_G['forum']['threadcaches'] && deletethreadcaches($thread['tid']);
$modaction = 'DLP';
$resultarray = array('redirect' => "forum.php?mod=viewthread&tid={$_G['tid']}&page={$_GET['page']}", 'reasonpm' => $sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_delete_post', 'notictype' => 'post') : array(), 'reasonvar' => array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason), 'modtids' => 0, 'modlog' => $thread);
}
}
}
}
// 在DISCUZ_ROOT/source/module/forum/forum_topicadmin.php基础上进行二次开发
if ($resultarray) {
if ($resultarray['modtids']) {
updatemodlog($resultarray['modtids'], $modaction, $resultarray['expiration']);
}
updatemodworks($modaction, $modpostsnum);
if (is_array($resultarray['modlog'])) {
if (isset($resultarray['modlog']['tid'])) {
modlog($resultarray['modlog'], $modaction);
} else {
foreach ($resultarray['modlog'] as $thread) {
modlog($thread, $modaction);
}
}
}
if ($resultarray['reasonpm']) {
$modactioncode = lang('forum/modaction');
$modaction = $modactioncode[$modaction];
foreach ($resultarray['reasonpm']['data'] as $var) {
sendreasonpm($var, $resultarray['reasonpm']['item'], $resultarray['reasonvar'], $resultarray['reasonpm']['notictype']);
}
}
// showmessage((isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed'), $resultarray['redirect']);
$this->getController()->redirect(WebUtils::createUrl_oldVersion('index/returnmobileview'));
}
$this->getController()->renderPartial('topicAdmin', array('formUrl' => WebUtils::createUrl_oldVersion('forum/topicadminview', array('fid' => $fid, 'tid' => $tid, 'pid' => $pid, 'act' => $act, 'type' => $type)), 'errorMsg' => $errorMsg, 'action' => $act, '_G' => $_G, 'stickcheck' => $stickcheck, 'digestcheck' => $digestcheck, 'closecheck' => $closecheck, 'forumselect' => WebUtils::u($forumselect)));
}
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:101,代码来源:TopicAdminViewAction.php
示例11: recyclebinpostundelete
function recyclebinpostundelete($undeletepids, $posttableid = false)
{
global $_G;
$postsundel = 0;
if (empty($undeletepids)) {
return $postsundel;
}
foreach ($undeletepids as $pid) {
my_post_log('restore', array('pid' => $pid));
}
$undeletepids = dimplode($undeletepids);
loadcache('posttableids');
$posttableids = !empty($_G['cache']['posttableids']) ? $posttableid !== false && in_array($posttableid, $_G['cache']['posttableids']) ? array($posttableid) : $_G['cache']['posttableids'] : array('0');
$postarray = $ruidarray = $fidarray = $tidarray = array();
foreach ($posttableids as $ptid) {
$query = DB::query('SELECT fid, tid, first, authorid FROM ' . DB::table(getposttable($ptid)) . " WHERE pid IN ({$undeletepids})");
while ($post = DB::fetch($query)) {
$postarray[] = $post;
}
}
if (empty($postarray)) {
return $postsundel;
}
foreach ($postarray as $key => $post) {
if (!$post['first']) {
$ruidarray[] = $post['authorid'];
}
$fidarray[$post['fid']] = $post['fid'];
$tidarray[$post['tid']] = $post['tid'];
}
$postsundel = updatepost(array('invisible' => '0'), "pid IN ({$undeletepids})", true, $posttableid);
include_once libfile('function/post');
if ($ruidarray) {
updatepostcredits('+', $ruidarray, $creditspolicy['reply']);
}
foreach ($tidarray as $tid) {
updatethreadcount($tid, 1);
}
foreach ($fidarray as $fid) {
updateforumcount($fid);
}
return $postsundel;
}
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:43,代码来源:function_misc.php
注:本文中的updatethreadcount函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论