本文整理汇总了PHP中deletethread函数的典型用法代码示例。如果您正苦于以下问题:PHP deletethread函数的具体用法?PHP deletethread怎么用?PHP deletethread使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了deletethread函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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));
}
示例2: 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));
}
示例3: _handleEvilPost
protected function _handleEvilPost($tid, $pid, $evilType, $evilLevel = 1) {
/*vot*/ include_once DISCUZ_ROOT.'./source/language/'.DISCUZ_LANG.'/lang_admincp_cloud.php';
$securityService = Cloud::loadClass('Service_Security');
$securityService->writeLog($pid, 'pid');
$evilPost = C::t('#security#security_evilpost')->fetch($pid);
if (count($evilPost)) {
return true;
} else {
require_once libfile('function/delete');
require_once libfile('function/forum');
require_once libfile('function/post');
$data = array('pid' => $pid, 'tid' => $tid, 'evilcount' => 1, 'eviltype' => $evilType, 'createtime' => TIMESTAMP);
$post = get_post_by_pid($pid);
if (is_array($post) && count($post) > 0) {
if ($tid != $post['tid']) {
return false;
}
$thread = get_thread_by_tid($tid);
if ($post['first']) {
$data['type'] = 1;
if ($this->_checkThreadIgnore($tid)) {
return false;
}
C::t('#security#security_evilpost')->insert($data, false, true);
$this->_updateEvilCount('thread');
deletethread(array($tid), true, true, true);
updatemodlog($tid, 'DEL', 0, 1, $extend_lang['security_modreason']);
} else {
$data['type'] = 0;
if ($this->_checkPostIgnore($pid, $post)) {
return false;
}
C::t('#security#security_evilpost')->insert($data, false, true);
$this->_updateEvilCount('post');
deletepost(array($pid), 'pid', true, false, true);
}
if(!empty($post['authorid'])) {
$data = array('uid' => $post['authorid'], 'createtime' => TIMESTAMP);
C::t('#security#security_eviluser')->insert($data, false, true);
}
} else {
$data['operateresult'] = 2;
C::t('#security#security_evilpost')->insert($data, false, true);
}
}
return true;
}
示例4: deleteThreadAndSeed
function deleteThreadAndSeed($tid)
{
$tbl = DB::table("ngpt_seed");
$sql = <<<SQL
DELETE FROM {$tbl} WHERE tid={$tid};
SQL;
DB::query($sql);
deletethread(array($tid));
}
示例5: 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));
}
示例6: elseif
?>
');parent.$('rbsearchform').searchsubmit.click();</script>
<?php
}
} elseif ($operation == 'clean') {
if (!submitcheck('rbsubmit')) {
shownav('topic', 'nav_recyclebin');
showsubmenu('nav_recyclebin', array(array('recyclebin_list', 'recyclebin', 0), array('search', 'recyclebin&operation=search', 0), array('clean', 'recyclebin&operation=clean', 1)));
showformheader('recyclebin&operation=clean');
showtableheader('recyclebin_clean');
showsetting('recyclebin_clean_days', 'days', '30', 'text');
showsubmit('rbsubmit');
showtablefooter();
showformfooter();
} else {
$deletetids = array();
$timestamp = TIMESTAMP;
$query = DB::query("SELECT tm.tid FROM " . DB::table('forum_threadmod') . " tm, " . DB::table('forum_thread') . " t\n\t\t\tWHERE tm.action='DEL' AND tm.dateline<{$timestamp}-" . intval($_G['gp_days']) * 86400 . " AND t.tid=tm.tid AND t.displayorder='-1'");
while ($thread = DB::fetch($query)) {
$deletetids[] = $thread['tid'];
}
require_once libfile('function/delete');
$threadsdel = deletethread($deletetids);
$threadsundel = 0;
if ($threadsdel) {
cpmsg('recyclebin_succeed', 'action=recyclebin&operation=clean', 'succeed', array('threadsdel' => $threadsdel, 'threadsundel' => $threadsundel));
} else {
cpmsg('recyclebin_nothread', 'action=recyclebin&operation=clean', 'error');
}
}
}
示例7: foreach
}
foreach ($pidsdelete as $key => $pid) {
if (in_array($pidsthread[$pid], $tidsdelete)) {
unset($pidsdelete[$key]);
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;
}
示例8: array
$recyclebintids .= ',' . $thread['tid'];
} else {
$deletetids[] = $thread['tid'];
}
if ($thread['authorid'] && $thread['authorid'] != $_G['uid']) {
$pmlist[] = array('act' => 'modthreads_delete', 'notevar' => array('reason' => dhtmlspecialchars($_GET['reason']), 'threadsubject' => $thread['subject']), 'authorid' => $thread['authorid']);
}
}
if ($recyclebintids) {
$rows = C::t('forum_thread')->update(explode(',', $recyclebintids), array('displayorder' => -1, 'moderated' => 1));
updatemodworks('MOD', $rows);
C::t('forum_post')->update_by_tid(0, explode(',', $recyclebintids), array('invisible' => -1), true);
updatemodlog($recyclebintids, 'DEL');
}
require_once libfile('function/delete');
deletethread($deletetids);
updatemoderate('tid', $moderation['delete'], 2);
}
if ($validatetids = dimplode($moderation['validate'])) {
$tids = $moderatedthread = array();
foreach (C::t('forum_thread')->fetch_all_by_tid_displayorder($moderation['validate'], $pstat, '=', $modfids ? explode(',', $modfids) : null) as $thread) {
$tids[] = $thread['tid'];
$poststatus = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid']);
$poststatus = $poststatus['status'];
if (getstatus($poststatus, 3) == 0) {
updatepostcredits('+', $thread['authorid'], 'post', $thread['fid']);
$attachcount = C::t('forum_attachment_n')->count_by_id('tid:' . $thread['tid'], 'tid', $thread['tid']);
updatecreditbyaction('postattach', $thread['authorid'], array(), '', $attachcount, 1, $thread['fid']);
}
$validatedthreads[] = $thread;
if ($thread['authorid'] && $thread['authorid'] != $_G['uid']) {
示例9: multi
}
$multipage = multi($threadcount, $lpp, $page, $mpurl, 0, 3);
}
showformheader('threadtypes&operation=content');
showtableheader('admin', 'fixpadding');
showsubtitle(array('', 'subject', 'forum', 'author', 'threads_replies', 'threads_views', 'threads_lastpost'));
echo $threads;
echo $multipage;
showsubmit('', '', '', "<input type=\"submit\" class=\"btn\" name=\"delsortsubmit\" value=\"{$lang[threadtype_content_delete]}\"/>");
showtablefooter();
showformfooter();
} elseif (submitcheck('delsortsubmit')) {
require_once libfile('function/post');
if ($_G['gp_tidsarray']) {
require_once libfile('function/delete');
deletethread($_G['gp_tidsarray']);
if ($_G['setting']['globalstick']) {
updatecache('globalstick');
}
if ($_G['gp_fidsarray']) {
foreach (explode(',', $_G['gp_fidsarray']) as $fid) {
updateforumcount(intval($fid));
}
}
}
cpmsg('threadtype_content_delete_succeed', 'action=threadtypes&operation=content', 'succeed');
}
}
} elseif ($operation == 'classlist') {
$classoptions = '';
$classidarray = array();
示例10: multi
$multipage = multi($threadcount, $lpp, $page, $mpurl, 0, 3);
}
}
showformheader('threadtypes&operation=content');
showtableheader('admin', 'fixpadding');
showsubtitle(array('', 'subject', 'forum', 'author', 'threads_replies', 'threads_views', 'threads_lastpost'));
echo $threads;
echo $multipage;
showsubmit('', '', '', "<input type=\"submit\" class=\"btn\" name=\"delsortsubmit\" value=\"{$lang[threadtype_content_delete]}\"/>");
showtablefooter();
showformfooter();
} elseif (submitcheck('delsortsubmit')) {
require_once libfile('function/post');
if ($_GET['tidsarray']) {
require_once libfile('function/delete');
deletethread($_GET['tidsarray']);
if ($_G['setting']['globalstick']) {
updatecache('globalstick');
}
if ($_GET['fidsarray']) {
foreach (explode(',', $_GET['fidsarray']) as $fid) {
updateforumcount(intval($fid));
}
}
}
cpmsg('threadtype_content_delete_succeed', 'action=threadtypes&operation=content', 'succeed');
}
}
} elseif ($operation == 'classlist') {
$classoptions = '';
$classidarray = array();
示例11: _adminTopic
//.........这里部分代码省略.........
updatecreditbyaction('digest', $thread['authorid'], $extsql, '', $digestlevel - $thread['digest']);
}
}
$modaction = $digestlevel ? $expiration ? 'EDI' : 'DIG' : 'UDG';
C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('DIG', 'UDI', 'EDI', 'UED'), array('status' => 0));
$stampstatus = 2;
break;
case 'delete':
if (!$_G['group']['allowdelpost']) {
// showmessage('no_privilege_delpost');
$this->_exitWithHtmlAlert('no_privilege_delpost');
}
loadcache('threadtableids');
$stickmodify = 0;
$deleteredirect = $remarkclosed = array();
foreach ($threadlist as $thread) {
if ($thread['digest']) {
updatecreditbyaction('digest', $thread['authorid'], array('digestposts' => -1), '', -$thread['digest']);
}
if (in_array($thread['displayorder'], array(2, 3))) {
$stickmodify = 1;
}
if ($_G['forum']['status'] == 3 && $thread['closed'] > 1) {
$deleteredirect[] = $thread['closed'];
}
if ($thread['isgroup'] == 1 && $thread['closed'] > 1) {
$remarkclosed[] = $thread['closed'];
}
}
$modaction = 'DEL';
require_once libfile('function/delete');
$tids = array_keys($threadlist);
if ($_G['forum']['recyclebin']) {
deletethread($tids, true, true, true);
manage_addnotify('verifyrecycle', $modpostsnum);
} else {
deletethread($tids, true, true);
$updatemodlog = FALSE;
}
$forumstickthreads = $_G['setting']['forumstickthreads'];
$forumstickthreads = !empty($forumstickthreads) ? dunserialize($forumstickthreads) : array();
$delkeys = array_keys($threadlist);
foreach ($delkeys as $k) {
unset($forumstickthreads[$k]);
}
C::t('common_setting')->update('forumstickthreads', $forumstickthreads);
C::t('forum_forum_threadtable')->delete_none_threads();
if (!empty($deleteredirect)) {
deletethread($deleteredirect);
}
if (!empty($remarkclosed)) {
C::t('forum_thread')->update($remarkclosed, array('closed' => 0));
}
if ($_G['setting']['globalstick'] && $stickmodify) {
require_once libfile('function/cache');
updatecache('globalstick');
}
updateforumcount($_G['fid']);
if ($_GET['crimerecord']) {
include_once libfile('function/member');
foreach ($threadlist as $thread) {
crime('recordaction', $thread['authorid'], 'crime_delpost', lang('forum/misc', 'crime_postreason', array('reason' => $reason, 'tid' => $thread['tid'], 'pid' => 0)));
}
}
break;
case 'close':
示例12: handleEvilPost
function handleEvilPost($tid, $pid, $evilType, $evilLevel = 1)
{
global $_G;
if (notOpenService()) {
return false;
}
include_once DISCUZ_ROOT . './source/language/lang_admincp_cloud.php';
loadSecLog($pid, 'pid');
$evilPost = DB::fetch_first("SELECT * FROM " . DB::table('security_evilpost') . " WHERE pid='{$pid}'");
if (is_array($evilPost)) {
$data = $evilPost;
$data['evilcount'] = $evilPost['evilcount'] + 1;
} else {
require_once libfile('function/delete');
require_once libfile('function/forum');
require_once libfile('function/post');
$data = array('pid' => $pid, 'tid' => $tid, 'evilcount' => 1, 'eviltype' => $evilType, 'createtime' => TIMESTAMP);
$post = get_post_by_pid($pid);
if (is_array($post) && count($post) > 0) {
if ($tid != $post['tid']) {
return false;
}
if ($post['first']) {
$data['type'] = 1;
if (checkThreadIgnore($tid)) {
return false;
}
DB::insert('security_evilpost', $data, 0, 1);
updateEvilCount('thread');
DB::query("UPDATE " . DB::table('forum_thread') . " SET displayorder='-1', digest='0', moderated='1' WHERE tid = '" . $tid . "'");
deletethread(array($tid), true, true, true);
updatepost(array('invisible' => '-1'), "tid = '" . $tid . "'");
updatemodlog($tid, 'DEL', 0, 1, $extend_lang['security_modreason']);
} else {
$data['type'] = 0;
if (checkPostIgnore($pid, $post)) {
return false;
}
DB::insert('security_evilpost', $data, 0, 1);
updateEvilCount('post');
deletepost(array($pid), 'pid', true, false, true);
}
} else {
$data['operateresult'] = 2;
DB::insert('security_evilpost', $data, 0, 1);
}
}
return true;
}
示例13: foreach
$log_handler = Cloud::loadClass('Cloud_Service_SearchHelper');
foreach ($_GET['tidarray'] as $tid) {
$log_handler->myThreadLog('move', array('tid' => $tid, 'otherid' => $_GET['toforum']));
}
$cpmsg = cplang('threads_succeed');
} elseif ($optype == 'movesort') {
if ($_GET['tosort'] != 0) {
if (!C::t('forum_threadtype')->fetch($_GET['tosort'])) {
cpmsg('threads_move_invalid', '', 'error');
}
}
C::t('forum_thread')->update($tidsarray, array('sortid' => $_GET['tosort']));
$cpmsg = cplang('threads_succeed');
} elseif ($optype == 'delete') {
require_once libfile('function/delete');
deletethread($tidsarray, !$_GET['donotupdatemember'], !$_GET['donotupdatemember']);
if ($_G['setting']['globalstick']) {
updatecache('globalstick');
}
foreach (explode(',', $_GET['fids']) as $fid) {
updateforumcount(intval($fid));
}
$log_handler = Cloud::loadClass('Cloud_Service_SearchHelper');
foreach ($_GET['tidarray'] as $tid) {
$log_handler->myThreadLog('delete', array('tid' => $tid));
}
$cpmsg = cplang('threads_succeed');
} elseif ($optype == 'deleteattach') {
require_once libfile('function/delete');
deleteattach($tidsarray, 'tid');
C::t('forum_thread')->update($tidsarray, array('attachment' => 0));
示例14: libfile
}
if ($member['uid']) {
require_once libfile('function/post');
$pidsdelete = $tidsdelete = '0';
$postarray = getfieldsofposts('pid, fid, tid, first', "authorid='{$member['uid']}'");
foreach ($postarray as $post) {
$prune['forums'][] = $post['fid'];
$prune['thread'][$post['tid']]++;
if ($post['first']) {
$tidsdelete .= ",{$post['tid']}";
}
$pidsdelete .= ",{$post['pid']}";
}
deletepost("pid IN ({$pidsdelete})");
deletepost("tid IN ({$tidsdelete})");
deletethread("tid IN ({$tidsdelete})");
if (!empty($prune)) {
foreach ($prune['thread'] as $tid => $decrease) {
updatethreadcount($tid);
}
foreach (array_unique($prune['forums']) as $fid) {
updateforumcount($fid);
}
}
if ($_G['setting']['globalstick']) {
updatecache('globalstick');
}
}
}
if ($_G['gp_delblog']) {
DB::query("DELETE FROM " . DB::table('home_blog') . " WHERE uid='{$member['uid']}'");
示例15: unserialize
}
}
}
$updatemodlog = FALSE;
}
$forumstickthreads = $_G['setting']['forumstickthreads'];
$forumstickthreads = !empty($forumstickthreads) ? unserialize($forumstickthreads) : array();
$delkeys = array_keys($threadlist);
foreach ($delkeys as $k) {
unset($forumstickthreads[$k]);
}
$forumstickthreads = serialize($forumstickthreads);
DB::query("UPDATE " . DB::table('common_setting') . " SET svalue='{$forumstickthreads}' WHERE skey='forumstickthreads'");
DB::delete('forum_forum_threadtable', "threads='0'");
if (!empty($deleteredirect)) {
deletethread("tid IN (" . dimplode($deleteredirect) . ")");
}
if (!empty($remarkclosed)) {
DB::update('forum_thread', array('closed' => 0), "tid IN (" . dimplode($remarkclosed) . ")");
}
if ($_G['setting']['globalstick'] && $stickmodify) {
require_once libfile('function/cache');
updatecache('globalstick');
}
updateforumcount($_G['fid']);
} elseif ($operation == 'close') {
if (!$_G['group']['allowclosethread']) {
showmessage('undefined_action');
}
$expiration = checkexpiration($_G['gp_expirationclose'], $operation);
$modaction = $expiration ? 'ECL' : 'CLS';