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


PHP deletethreadcaches函数代码示例

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


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

示例1: explode

     $_G['forum']['lastpost'] = explode("\t", $_G['forum']['lastpost']);
     if ($orig['dateline'] == $_G['forum']['lastpost'][2] && ($orig['author'] == $_G['forum']['lastpost'][3] || $_G['forum']['lastpost'][3] == '' && $orig['anonymous'])) {
         $lastthread = daddslashes(DB::fetch_first("SELECT tid, subject, lastpost, lastposter FROM " . DB::table('forum_thread') . "\r\n\t\t\t\tWHERE fid='{$_G['fid']}' AND displayorder>='0' ORDER BY lastpost DESC LIMIT 1"), 1);
         $forumadd .= ", lastpost='{$lastthread['tid']}\t{$lastthread['subject']}\t{$lastthread['lastpost']}\t{$lastthread['lastposter']}'";
     }
     DB::query("UPDATE " . DB::table('forum_forum') . " SET {$forumadd} WHERE fid='{$_G['fid']}'", 'UNBUFFERED');
 }
 if ($specialextra) {
     @(include_once DISCUZ_ROOT . './source/plugin/' . $_G['setting']['threadplugins'][$specialextra]['module'] . '.class.php');
     $classname = 'threadplugin_' . $specialextra;
     if (class_exists($classname) && method_exists($threadpluginclass = new $classname(), 'editpost_submit_end')) {
         $threadpluginclass->editpost_submit_end($_G['fid'], $_G['tid']);
     }
 }
 if ($_G['forum']['threadcaches']) {
     deletethreadcaches($_G['tid']);
 }
 $param = array('fid' => $_G['fid'], 'tid' => $_G['tid'], 'pid' => $pid);
 dsetcookie('clearUserdata', 'forum');
 if ($_G['forum_auditstatuson']) {
     if ($audit == 1) {
         updatemoderate($isfirstpost ? 'tid' : 'pid', $isfirstpost ? $_G['tid'] : $pid, '2');
         showmessage('auditstatuson_succeed', $redirecturl, $param);
     } else {
         updatemoderate($isfirstpost ? 'tid' : 'pid', $isfirstpost ? $_G['tid'] : $pid);
         showmessage('audit_edit_succeed', '', $param);
     }
 } else {
     if (!empty($_G['gp_delete']) && $isfirstpost) {
         my_thread_log('delete', array('tid' => $_G['tid']));
         showmessage('post_edit_delete_succeed', "forum.php?mod=forumdisplay&fid={$_G['fid']}", $param);
开发者ID:kleitz,项目名称:sports,代码行数:31,代码来源:post_editpost.php

示例2: intval

 }
 C::t('forum_post')->increase_rate_by_pid('tid:' . $_G['tid'], $_GET['pid'], $rate, $ratetimes);
 if ($post['first']) {
     $threadrate = intval(@($post['rate'] + $rate) / abs($post['rate'] + $rate));
     C::t('forum_thread')->update($_G['tid'], array('rate' => $threadrate));
 }
 require_once libfile('function/discuzcode');
 $sqlvalues = $comma = '';
 $sqlreason = censor(trim($_GET['reason']));
 $sqlreason = cutstr(dhtmlspecialchars($sqlreason), 40, '.');
 foreach ($creditsarray as $id => $addcredits) {
     $insertarr = array('pid' => $_GET['pid'], 'uid' => $_G['uid'], 'username' => $_G['username'], 'extcredits' => $id, 'dateline' => $_G['timestamp'], 'score' => $addcredits, 'reason' => $sqlreason);
     C::t('forum_ratelog')->insert($insertarr);
 }
 include_once libfile('function/post');
 $_G['forum']['threadcaches'] && @deletethreadcaches($_G['tid']);
 $reason = dhtmlspecialchars(censor(trim($reason)));
 if ($sendreasonpm) {
     $ratescore = $slash = '';
     foreach ($creditsarray as $id => $addcredits) {
         $ratescore .= $slash . $_G['setting']['extcredits'][$id]['title'] . ' ' . ($addcredits > 0 ? '+' . $addcredits : $addcredits) . ' ' . $_G['setting']['extcredits'][$id]['unit'];
         $slash = ' / ';
     }
     sendreasonpm($post, 'rate_reason', array('tid' => $thread['tid'], 'pid' => $_GET['pid'], 'subject' => $thread['subject'], 'ratescore' => $ratescore, 'reason' => $reason, 'from_id' => 0, 'from_idtype' => 'rate'));
 }
 $logs = array();
 foreach ($creditsarray as $id => $addcredits) {
     $logs[] = dhtmlspecialchars("{$_G['timestamp']}\t{$_G[member][username]}\t{$_G['adminid']}\t{$post['author']}\t{$id}\t{$addcredits}\t{$_G['tid']}\t{$thread['subject']}\t{$reason}");
 }
 update_threadpartake($post['tid']);
 C::t('forum_postcache')->delete($_GET['pid']);
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:31,代码来源:forum_misc.php

示例3: deletethreadcaches

 }
 if ($specialextra) {
     @(include_once DISCUZ_ROOT . './plugins/' . $threadplugins[$specialextra]['module'] . '.class.php');
     $classname = 'threadplugin_' . $specialextra;
     if (method_exists($classname, 'editpost_submit_end')) {
         $threadpluginclass = new $classname();
         $threadpluginclass->editpost_submit_end($fid, $tid);
     }
 }
 // debug: update thread caches ?
 if ($forum['threadcaches']) {
     if ($isfirstpost || $page == 1 || $thread['replies'] < $_DCACHE['pospperpage'] || !empty($delete)) {
         $forum['threadcaches'] && deletethreadcaches($tid);
     } else {
         if ($db->result_first("SELECT COUNT(*) FROM {$tablepre}posts WHERE tid='{$tid}' AND pid<'{$pid}'") < $_DCACHE['settings']['postperpage']) {
             $forum['threadcaches'] && deletethreadcaches($tid);
         }
     }
 }
 if ($auditstatuson) {
     if ($audit == 1) {
         showmessage('auditstatuson_succeed', $redirecturl);
     } else {
         showmessage('audit_edit_succeed');
     }
 } else {
     if (!empty($delete) && $isfirstpost) {
         showmessage('post_edit_delete_succeed', "forumdisplay.php?fid={$fid}");
     } elseif (!empty($delete)) {
         showmessage('post_edit_delete_succeed', "viewthread.php?tid={$tid}&page={$page}&extra={$extra}" . ($vid && $isfirstpost ? "&vid={$vid}" : ''));
     } else {
开发者ID:lilhorse,项目名称:cocoa,代码行数:31,代码来源:editpost.inc.php

示例4: addslashes

        $postsmerged = $db->affected_rows();
        $db->query("UPDATE {$tablepre}attachments SET tid='{$tid}' WHERE tid='{$othertid}'");
        $db->query("DELETE FROM {$tablepre}threads WHERE tid='{$othertid}'");
        $db->query("DELETE FROM {$tablepre}threadsmod WHERE tid='{$othertid}'");
        $db->query("DELETE FROM {$tablepre}mythreads WHERE tid='{$othertid}'");
        $db->query("DELETE FROM {$tablepre}myposts WHERE tid='{$othertid}'");
        $firstpost = $db->fetch_first("SELECT pid, fid, authorid, author, subject, dateline FROM {$tablepre}posts WHERE tid='{$tid}' AND invisible='0' ORDER BY dateline LIMIT 1");
        $db->query("UPDATE {$tablepre}posts SET first=(pid='{$firstpost['pid']}'), fid='{$firstpost['fid']}' WHERE tid='{$tid}'");
        $db->query("UPDATE {$tablepre}threads SET authorid='{$firstpost['authorid']}', author='" . addslashes($firstpost['author']) . "', subject='" . addslashes($firstpost['subject']) . "', dateline='{$firstpost['dateline']}', views=views+{$other['views']}, replies=replies+{$other['replies']}, moderated='1' WHERE tid='{$tid}'");
        if ($fid == $other['fid']) {
            $db->query("UPDATE {$tablepre}forums SET threads=threads-1 WHERE fid='{$fid}'");
        } else {
            $db->query("UPDATE {$tablepre}forums SET threads=threads-1, posts=posts-{$postsmerged} WHERE fid='{$other['fid']}'");
            $db->query("UPDATE {$tablepre}forums SET posts={$posts}+{$postsmerged} WHERE fid='{$fid}'");
        }
        $forum['threadcaches'] && deletethreadcaches($thread['tid']);
        $modpostsnum++;
        $resultarray = array('redirect' => "forumdisplay.php?fid={$fid}", 'reasonpm' => $sendreasonpm ? array('data' => array($thread), 'var' => 'thread', 'item' => 'reason_merge') : array(), 'modtids' => $thread['tid'], 'modlog' => array($thread, $other));
    }
} elseif ($action == 'copy' && $thread) {
    if (!submitcheck('copysubmit')) {
        require_once DISCUZ_ROOT . './include/forum.func.php';
        $forumselect = forumselect();
        include template('topicadmin_copy');
    } else {
        $modaction = 'CPY';
        checkreasonpm();
        $query = $db->query("SELECT fid, name, modnewposts FROM {$tablepre}forums WHERE fid='{$copyto}' AND status>0 AND type<>'group'");
        if (!($toforum = $db->fetch_array($query))) {
            showmessage('admin_copy_invalid');
        } else {
开发者ID:jonycookie,项目名称:projectm2,代码行数:31,代码来源:topicadmin.php

示例5: dheader

                                }
                                if ($have == 0) {
                                    dheader("Location: " . ADMINSCRIPT . "?action=threads&operation=postposition&do=add&srchthreadsubmit=yes&replies={$r_replies}&page=" . ($page + 1));
                                }
                            }
                        }
                    }
                }
                $multipage = isset($multipage) ? $multipage : '';
                showsubmit('addpositionsubmit', 'addposition', 'select_all', '', $multipage);
                showtablefooter();
                showformfooter();
            }
        }
    }
    $_G['gp_tids'] && deletethreadcaches($_G['gp_tids']);
    $cpmsg = $cpmsg ? "alert('{$cpmsg}');" : '';
    echo '<script type="text/JavaScript">' . $cpmsg . 'if(parent.$(\'threadforum\')) parent.$(\'threadforum\').searchsubmit.click();</script>';
}
function delete_position($select)
{
    if (empty($select) || !is_array($select)) {
        cpmsg('select_thread_empty', '', 'error');
    }
    $tids = dimplode($select);
    DB::query("DELETE FROM " . DB::table('forum_postposition') . " WHERE tid IN({$tids})");
    DB::query("UPDATE " . DB::table('forum_thread') . " SET status=status & '1111111111111110' WHERE tid IN ({$tids})");
}
function create_position(&$select, $lastpid = 0)
{
    if (empty($select) || !is_array($select)) {
开发者ID:pan289091315,项目名称:Discuz,代码行数:31,代码来源:admincp_threads.php

示例6: _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

示例7: replyPost


//.........这里部分代码省略.........
         $feedid = C::t('home_follow_feed')->insert($followfeed, true);
         C::t('common_member_count')->increase($_G['uid'], array('feeds' => 1));
     }
     if ($thread['replycredit'] > 0 && !$modnewreplies && $thread['authorid'] != $_G['uid'] && $_G['uid']) {
         $replycredit_rule = C::t('forum_replycredit')->fetch($_G['tid']);
         if (!empty($replycredit_rule['times'])) {
             $have_replycredit = C::t('common_credit_log')->count_by_uid_operation_relatedid($_G['uid'], 'RCA', $_G['tid']);
             if ($replycredit_rule['membertimes'] - $have_replycredit > 0 && $thread['replycredit'] - $replycredit_rule['extcredits'] >= 0) {
                 $replycredit_rule['extcreditstype'] = $replycredit_rule['extcreditstype'] ? $replycredit_rule['extcreditstype'] : $_G['setting']['creditstransextra'][10];
                 if ($replycredit_rule['random'] > 0) {
                     $rand = rand(1, 100);
                     $rand_replycredit = $rand <= $replycredit_rule['random'] ? true : false;
                 } else {
                     $rand_replycredit = true;
                 }
                 if ($rand_replycredit) {
                     updatemembercount($_G['uid'], array($replycredit_rule['extcreditstype'] => $replycredit_rule['extcredits']), 1, 'RCA', $_G[tid]);
                     C::t('forum_post')->update('tid:' . $_G['tid'], $pid, array('replycredit' => $replycredit_rule['extcredits']));
                     $updatethreaddata[] = DB::field('replycredit', $thread['replycredit'] - $replycredit_rule['extcredits']);
                 }
             }
         }
     }
     ($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) && ($_GET['attachnew'] || $special == 2 && $_GET['tradeaid']) && updateattach($thread['displayorder'] == -4 || $modnewreplies, $_G['tid'], $pid, $_GET['attachnew']);
     $replymessage = 'post_reply_succeed';
     if ($special == 2 && $_G['group']['allowposttrade'] && $thread['authorid'] == $_G['uid'] && !empty($_GET['trade']) && !empty($_GET['item_name'])) {
         require_once libfile('function/trade');
         trade_create(array('tid' => $_G['tid'], 'pid' => $pid, 'aid' => $_GET['tradeaid'], 'item_expiration' => $_GET['item_expiration'], 'thread' => $thread, 'discuz_uid' => $_G['uid'], 'author' => $author, 'seller' => empty($_GET['paymethod']) && $_GET['seller'] ? dhtmlspecialchars(trim($_GET['seller'])) : '', 'item_name' => $_GET['item_name'], 'item_price' => $_GET['item_price'], 'item_number' => $_GET['item_number'], 'item_quality' => $_GET['item_quality'], 'item_locus' => $_GET['item_locus'], 'transport' => $_GET['transport'], 'postage_mail' => $_GET['postage_mail'], 'postage_express' => $_GET['postage_express'], 'postage_ems' => $_GET['postage_ems'], 'item_type' => $_GET['item_type'], 'item_costprice' => $_GET['item_costprice'], 'item_credit' => $_GET['item_credit'], 'item_costcredit' => $_GET['item_costcredit']));
         $replymessage = 'trade_add_succeed';
         if (!empty($_GET['tradeaid'])) {
             convertunusedattach($_GET['tradeaid'], $_G['tid'], $pid);
         }
     }
     $_G['forum']['threadcaches'] && deletethreadcaches($_G['tid']);
     include_once libfile('function/stat');
     updatestat($thread['isgroup'] ? 'grouppost' : 'post');
     $param = array('fid' => $_G['fid'], 'tid' => $_G['tid'], 'pid' => $pid, 'from' => $_GET['from'], 'sechash' => !empty($_GET['sechash']) ? $_GET['sechash'] : '');
     if ($feedid) {
         $param['feedid'] = $feedid;
     }
     dsetcookie('clearUserdata', 'forum');
     if ($modnewreplies) {
         updatemoderate('pid', $pid);
         unset($param['pid']);
         if ($updatethreaddata) {
             C::t('forum_thread')->update($_G['tid'], $updatethreaddata, false, false, 0, true);
         }
         C::t('forum_forum')->update_forum_counter($_G['fid'], 0, 0, 1, 1);
         $url = empty($_POST['portal_referer']) ? "forum.php?mod=viewthread&tid={$thread[tid]}" : $_POST['portal_referer'];
         manage_addnotify('verifypost');
         // if(!isset($inspacecpshare)) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_reply_mod_succeed', array('noError' => 1));
         //showmessage('post_reply_mod_succeed', $url, $param);
         // }
     } else {
         $fieldarr = array('lastposter' => array($author), 'replies' => 1);
         if ($thread['lastpost'] < $_G['timestamp']) {
             $fieldarr['lastpost'] = array($_G['timestamp']);
         }
         $row = C::t('forum_threadaddviews')->fetch($_G['tid']);
         if (!empty($row)) {
             C::t('forum_threadaddviews')->update($_G['tid'], array('addviews' => 0));
             $fieldarr['views'] = $row['addviews'];
         }
         $updatethreaddata = array_merge($updatethreaddata, C::t('forum_thread')->increase($_G['tid'], $fieldarr, false, 0, true));
         if ($thread['displayorder'] != -4) {
开发者ID:caidongyun,项目名称:CS,代码行数:67,代码来源:TopicAdminAction.php

示例8: newreply

 public function newreply($parameters)
 {
     $this->_init_parameters($parameters);
     if ($this->thread['closed'] && !$this->forum['ismoderator'] && !$this->thread['isgroup']) {
         return $this->showmessage('post_thread_closed');
     } elseif (!$this->thread['isgroup'] && ($post_autoclose = checkautoclose($this->thread))) {
         return $this->showmessage($post_autoclose, '', array('autoclose' => $this->forum['autoclose']));
     }
     if (trim($this->param['subject']) == '' && trim($this->param['message']) == '' && $this->thread['special'] != 2) {
         return $this->showmessage('post_sm_isnull');
     } elseif ($post_invalid = checkpost($this->param['subject'], $this->param['message'], $this->param['special'] == 2 && $this->group['allowposttrade'])) {
         return $this->showmessage($post_invalid, '', array('minpostsize' => $this->setting['minpostsize'], 'maxpostsize' => $this->setting['maxpostsize']));
     } elseif (checkflood()) {
         return $this->showmessage('post_flood_ctrl', '', array('floodctrl' => $this->setting['floodctrl']));
     } elseif (checkmaxperhour('pid')) {
         return $this->showmessage('post_flood_ctrl_posts_per_hour', '', array('posts_per_hour' => $this->group['maxpostsperhour']));
     }
     $heatthreadset = update_threadpartake($this->thread['tid'], true);
     $bbcodeoff = checkbbcodes($this->param['message'], !empty($this->param['bbcodeoff']));
     $smileyoff = checksmilies($this->param['message'], !empty($this->param['smileyoff']));
     $parseurloff = !empty($this->param['parseurloff']);
     $htmlon = $this->group['allowhtml'] && !empty($this->param['htmlon']) ? 1 : 0;
     $usesig = !empty($this->param['usesig']) && $this->group['maxsigsize'] ? 1 : 0;
     $this->param['isanonymous'] = $this->group['allowanonymous'] && !empty($this->param['isanonymous']) ? 1 : 0;
     $author = empty($this->param['isanonymous']) ? $this->member['username'] : '';
     list(, $this->param['modnewreplies']) = threadmodstatus($this->param['subject'] . "\t" . $this->param['message'] . $this->param['extramessage']);
     if ($this->thread['displayorder'] == -4) {
         $this->param['modnewreplies'] = 0;
     }
     $pinvisible = $this->param['modnewreplies'] ? -2 : ($this->thread['displayorder'] == -4 ? -3 : 0);
     $this->param['message'] = preg_replace('/\\[attachimg\\](\\d+)\\[\\/attachimg\\]/is', '[attach]\\1[/attach]', $this->param['message']);
     if (!empty($this->param['noticetrimstr'])) {
         $this->param['message'] = $this->param['noticetrimstr'] . "\n\n" . $this->param['message'];
         $bbcodeoff = false;
     }
     $status = defined('IN_MOBILE') ? 8 : 0;
     if ($this->param['modstatus']) {
         foreach ($this->param['modstatus'] as $modbit => $modvalue) {
             $status = setstatus($modbit, $modvalue, $status);
         }
     }
     $this->pid = insertpost(array('fid' => $this->forum['fid'], 'tid' => $this->thread['tid'], 'first' => '0', 'author' => $this->member['username'], 'authorid' => $this->member['uid'], 'subject' => $this->param['subject'], 'dateline' => $this->param['timestamp'] ? $this->param['timestamp'] : getglobal('timestamp'), 'message' => $this->param['message'], 'useip' => $this->param['clientip'] ? $this->param['clientip'] : getglobal('clientip'), 'port' => $this->param['remoteport'] ? $this->param['remoteport'] : getglobal('remoteport'), 'invisible' => $pinvisible, 'anonymous' => $this->param['isanonymous'], 'usesig' => $usesig, 'htmlon' => $htmlon, 'bbcodeoff' => $bbcodeoff, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => '0', 'status' => $status));
     $this->param['updatethreaddata'] = $heatthreadset ? $heatthreadset : array();
     $this->param['maxposition'] = C::t('forum_post')->fetch_maxposition_by_tid($this->thread['posttableid'], $this->thread['tid']);
     $this->param['updatethreaddata'][] = DB::field('maxposition', $this->param['maxposition']);
     useractionlog($this->member['uid'], 'pid');
     if ($this->param['geoloc'] && IN_MOBILE == 2) {
         list($mapx, $mapy, $location) = explode('|', $this->param['geoloc']);
         if ($mapx && $mapy && $location) {
             C::t('forum_post_location')->insert(array('pid' => $this->pid, 'tid' => $this->thread['tid'], 'uid' => $this->member['uid'], 'mapx' => $mapx, 'mapy' => $mapy, 'location' => $location));
         }
     }
     $nauthorid = 0;
     if (!empty($this->param['noticeauthor']) && !$this->param['isanonymous'] && !$this->param['modnewreplies']) {
         list($ac, $nauthorid) = explode('|', authcode($this->param['noticeauthor'], 'DECODE'));
         if ($nauthorid != $this->member['uid']) {
             if ($ac == 'q') {
                 notification_add($nauthorid, 'post', 'reppost_noticeauthor', array('tid' => $this->thread['tid'], 'subject' => $this->thread['subject'], 'fid' => $this->forum['fid'], 'pid' => $this->pid, 'from_id' => $this->pid, 'from_idtype' => 'quote'));
             } elseif ($ac == 'r') {
                 notification_add($nauthorid, 'post', 'reppost_noticeauthor', array('tid' => $this->thread['tid'], 'subject' => $this->thread['subject'], 'fid' => $this->forum['fid'], 'pid' => $this->pid, 'from_id' => $this->thread['tid'], 'from_idtype' => 'post'));
             }
         }
     }
     if ($this->thread['authorid'] != $this->member['uid'] && getstatus($this->thread['status'], 6) && empty($this->param['noticeauthor']) && !$this->param['isanonymous'] && !$this->param['modnewreplies']) {
         $thapost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($this->thread['tid'], 0);
         notification_add($thapost['authorid'], 'post', 'reppost_noticeauthor', array('tid' => $this->thread['tid'], 'subject' => $this->thread['subject'], 'fid' => $this->forum['fid'], 'pid' => $this->pid, 'from_id' => $this->thread['tid'], 'from_idtype' => 'post'));
     }
     $this->forum['threadcaches'] && deletethreadcaches($this->thread['tid']);
     include_once libfile('function/stat');
     updatestat($this->thread['isgroup'] ? 'grouppost' : 'post');
     $this->param['showmsgparam']['fid'] = $this->forum['fid'];
     $this->param['showmsgparam']['tid'] = $this->thread['tid'];
     $this->param['showmsgparam']['pid'] = $this->pid;
     $this->param['showmsgparam']['from'] = $this->param['from'];
     $this->param['showmsgparam']['sechash'] = !empty($this->param['sechash']) ? $this->param['sechash'] : '';
     dsetcookie('clearUserdata', 'forum');
     if ($this->thread['replies'] <= 0) {
         C::t('forum_sofa')->delete($this->thread['tid']);
     }
     if ($this->param['modnewreplies']) {
         updatemoderate('pid', $this->pid);
         unset($this->param['showmsgparam']['pid']);
         if ($this->param['updatethreaddata']) {
             C::t('forum_thread')->update($this->thread['tid'], $this->param['updatethreaddata'], false, false, 0, true);
         }
         C::t('forum_forum')->update_forum_counter($this->forum['fid'], 0, 0, 1, 1);
         manage_addnotify('verifypost');
         return 'post_reply_mod_succeed';
     } else {
         $fieldarr = array('lastposter' => array($author), 'replies' => 1);
         if ($this->thread['lastpost'] < getglobal('timestamp')) {
             $fieldarr['lastpost'] = array(getglobal('timestamp'));
         }
         $row = C::t('forum_threadaddviews')->fetch($this->thread['tid']);
         if (!empty($row)) {
             C::t('forum_threadaddviews')->update($this->thread['tid'], array('addviews' => 0));
             $fieldarr['views'] = $row['addviews'];
         }
         $this->param['updatethreaddata'] = array_merge($this->param['updatethreaddata'], C::t('forum_thread')->increase($this->thread['tid'], $fieldarr, false, 0, true));
         if ($this->thread['displayorder'] != -4) {
//.........这里部分代码省略.........
开发者ID:MCHacker,项目名称:docker-discuz,代码行数:101,代码来源:model_forum_post.php

示例9: elseif

	} elseif($operation == 'addstatus') {

		$db->query("UPDATE {$tablepre}threads SET closed='$status' WHERE $tidsadd");

		eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");

	} elseif($operation == 'supe_pushsetting' && $supe['status']) {

		$db->query("UPDATE {$tablepre}threads SET supe_pushstatus='$supe_pushstatus' WHERE $tidsadd");

		eval("\$cpmsg = \"".$msglang['threads_succeed']."\";");

	}

	$tids && deletethreadcaches($tids);
	$cpmsg = $cpmsg ? "alert('$cpmsg');" : '';

?>
<script><?=$cpmsg?>parent.$('threadforum').searchsubmit.click();</script>
<?

}

if(submitcheck('searchsubmit')) {

	$sql = '';

	if($inforum != '' && $inforum != 'all') {
		$sql .= " AND fid='$inforum'";
	}
开发者ID:jonycookie,项目名称:projectm2,代码行数:30,代码来源:threads.inc.php

示例10: _viewRate

    private function _viewRate($res, $tid, $pid)
    {
        $res = $this->_checkRate($res, $tid, $pid);
        $status = WebUtils::checkError($res);
        $location = WebUtils::createUrl_oldVersion('index/returnmobileview');
        if ($status) {
            $str = <<<HTML
            <script>
                alert("{$res['head']['errInfo']}");
                location.href = "{$location}";
            </script>
HTML;
            echo $str;
            exit;
        }
        // [add]修复gbk编码导致的评分理由不显示。Author:HanPengyu Data:04.09.27
        if (!empty($_POST)) {
            // 把$_POST转成utf-8, 这是由于discuz源码会在mobile情况下把$_POST预先转码成对应的charset,
            $_POST = array_intersect_key($_REQUEST, $_POST);
            // 手动把转成utf-8的$_POST数据再次转成对应的charset
            foreach ($_POST as $key => $value) {
                if (is_string($value)) {
                    $_POST[$key] = WebUtils::t($value);
                }
            }
            $_GET = array_merge($_GET, $_POST);
        }
        global $_G;
        require_once libfile('function/misc');
        require_once libfile('function/forum');
        //今日剩余积分
        $maxratetoday = $this->_getratingleft($_G['group']['raterange']);
        $post = C::t('forum_post')->fetch('tid:' . $tid, $pid);
        $thread = C::t('forum_thread')->fetch($tid);
        if (!empty($_POST)) {
            $reason = checkreasonpm();
            $rate = $ratetimes = 0;
            $creditsarray = $sub_self_credit = array();
            getuserprofile('extcredits1');
            foreach ($_G['group']['raterange'] as $id => $rating) {
                $score = intval($_GET['score' . $id]);
                if (isset($_G['setting']['extcredits'][$id]) && !empty($score)) {
                    if ($rating['isself'] && intval($_G['member']['extcredits' . $id]) - $score < 0) {
                        //抱歉,您的{extcreditstitle}(评分栏目)不足,无法评分
                        $errorMsg = lang('message', 'thread_rate_range_self_invalid', array('extcreditstitle' => $_G['setting']['extcredits'][$id]['title']));
                        $this->_renderTemplates($tid, $pid, $errorMsg);
                        exit;
                    }
                    if (abs($score) <= $maxratetoday[$id]) {
                        if ($score > $rating['max'] || $score < $rating['min']) {
                            //请输入正确的分值
                            $errorMsg = lang('message', 'thread_rate_range_invalid');
                            $this->_renderTemplates($tid, $pid, $errorMsg);
                            exit;
                        } else {
                            $creditsarray[$id] = $score;
                            if ($rating['isself']) {
                                $sub_self_credit[$id] = -abs($score);
                            }
                            $rate += $score;
                            $ratetimes += ceil(max(abs($rating['min']), abs($rating['max'])) / 5);
                        }
                    } else {
                        //抱歉,24 小时评分数超过限制
                        $errorMsg = lang('message', 'thread_rate_ctrl');
                        $this->_renderTemplates($tid, $pid, $errorMsg);
                        exit;
                    }
                }
            }
            if (!$creditsarray) {
                //请输入正确的分值
                $errorMsg = lang('message', 'thread_rate_range_invalid');
                $this->_renderTemplates($tid, $pid, $errorMsg);
                exit;
            }
            updatemembercount($post['authorid'], $creditsarray, 1, 'PRC', $_GET['pid']);
            if (!empty($sub_self_credit)) {
                updatemembercount($_G['uid'], $sub_self_credit, 1, 'RSC', $_GET['pid']);
            }
            C::t('forum_post')->increase_rate_by_pid('tid:' . $_G['tid'], $_GET['pid'], $rate, $ratetimes);
            if ($post['first']) {
                $threadrate = intval(@($post['rate'] + $rate) / abs($post['rate'] + $rate));
                C::t('forum_thread')->update($_G['tid'], array('rate' => $threadrate));
            }
            require_once libfile('function/discuzcode');
            $sqlvalues = $comma = '';
            $sqlreason = censor(trim($_GET['reason']));
            $sqlreason = cutstr(dhtmlspecialchars($sqlreason), 40, '.');
            foreach ($creditsarray as $id => $addcredits) {
                $insertarr = array('pid' => $_GET['pid'], 'uid' => $_G['uid'], 'username' => $_G['username'], 'extcredits' => $id, 'dateline' => $_G['timestamp'], 'score' => $addcredits, 'reason' => $sqlreason);
                C::t('forum_ratelog')->insert($insertarr);
            }
            include_once libfile('function/post');
            $_G['forum']['threadcaches'] && @deletethreadcaches($_G['tid']);
            $reason = dhtmlspecialchars(censor(trim($reason)));
            //对是否通知作者做的一些初始工作
            if ($_G['group']['resasonpm'] == 2 || $_G['group']['reasonpm'] == 3 || !empty($_GET['sendreasonpm'])) {
                $forumname = strip_tags($_G['forum']['name']);
                $sendreasonpm = 1;
//.........这里部分代码省略.........
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:101,代码来源:TopicRateAction.php

示例11: cpmsg

                    cpmsg('threads_forumstick_targets_empty', "action=threads&operation=forumstick&do=add", 'error');
                }
                $stickthread = C::t('forum_thread')->fetch($forumstick_tid);
                $stickthread_tmp = array('subject' => $stickthread['subject'], 'tid' => $forumstick_tid, 'forums' => $_GET['forumsticktargets']);
                $forumstickthreads[$forumstick_tid] = $stickthread_tmp;
                C::t('forum_thread')->update($forumstick_tid, array('displayorder' => 4));
            } elseif ($do == 'edit') {
                if (empty($_GET['forumsticktargets'])) {
                    cpmsg('threads_forumstick_targets_empty', "action=threads&operation=forumstick&do=edit&id={$_GET['id']}", 'error');
                }
                $forumstickthreads[$_GET['id']]['forums'] = $_GET['forumsticktargets'];
                C::t('forum_thread')->update($forumstick_tid, array('displayorder' => 4));
            }
            C::t('common_setting')->update('forumstickthreads', $forumstickthreads);
            updatecache(array('forumstick', 'setting'));
            cpmsg('threads_forumstick_' . $do . '_succeed', "action=threads&operation=forumstick", 'succeed');
        }
    }
    $_GET['tids'] && deletethreadcaches($_GET['tids']);
    $cpmsg = $cpmsg ? "alert('{$cpmsg}');" : '';
    echo '<script type="text/JavaScript">' . $cpmsg . 'if(parent.$(\'threadforum\')) parent.$(\'threadforum\').searchsubmit.click();</script>';
}
function delete_position($select)
{
    if (empty($select) || !is_array($select)) {
        cpmsg('select_thread_empty', '', 'error');
    }
    $tids = dimplode($select);
    C::t('forum_postposition')->delete_by_tid($select);
    C::t('forum_thread')->update_status_by_tid($tids, '1111111111111110', '&');
}
开发者ID:softhui,项目名称:discuz,代码行数:31,代码来源:admincp_threads.php


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