• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP updatemodworks函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: manage_addnotify

         if ($isfirstpost && $modnewthreads) {
             DB::query("UPDATE " . DB::table('forum_thread') . " SET displayorder='-2' WHERE tid='{$_G['tid']}'");
             manage_addnotify('verifythread');
         } elseif (!$isfirstpost && $modnewreplies) {
             DB::query("UPDATE " . DB::table('forum_thread') . " SET replies=replies-'1' WHERE tid='{$_G['tid']}'");
             manage_addnotify('verifypost');
         }
         if ($modnewreplies || $modnewthreads) {
             DB::update('forum_forum', array('modworks' => '1'), "fid='{$_G['fid']}'");
         }
     }
     if ($thread['lastpost'] == $orig['dateline'] && (!$orig['anonymous'] && $thread['lastposter'] == $orig['author'] || $orig['anonymous'] && $thread['lastposter'] == '') && $orig['anonymous'] != $isanonymous) {
         DB::query("UPDATE " . DB::table('forum_thread') . " SET lastposter='" . ($isanonymous ? '' : addslashes($orig['author'])) . "' WHERE tid='{$_G['tid']}'", 'UNBUFFERED');
     }
     if (!$isorigauthor) {
         updatemodworks('EDT', 1);
         require_once libfile('function/misc');
         modlog($thread, 'EDT');
     }
 } else {
     if (!$_G['setting']['editperdel']) {
         showmessage('post_edit_thread_ban_del', NULL);
     }
     if ($isfirstpost && $thread['replies'] > 0) {
         showmessage($thread['special'] == 3 ? 'post_edit_reward_already_reply' : 'post_edit_thread_already_reply', NULL);
     }
     if ($thread['special'] == 3) {
         if ($thread['price'] < 0 && $thread['dateline'] + 1 == $orig['dateline']) {
             showmessage('post_edit_reward_nopermission', NULL);
         }
     }
开发者ID:kleitz,项目名称:sports,代码行数:31,代码来源:post_editpost.php


示例2: undeletethreads

function undeletethreads($tids)
{
    global $db, $tablepre, $creditspolicy;
    $threadsundel = 0;
    if ($tids && is_array($tids)) {
        $tids = '\'' . implode('\',\'', $tids) . '\'';
        $tuidarray = $ruidarray = $fidarray = array();
        $query = $db->query("SELECT fid, first, authorid FROM {$tablepre}posts WHERE tid IN ({$tids})");
        while ($post = $db->fetch_array($query)) {
            if ($post['first']) {
                $tuidarray[] = $post['authorid'];
            } else {
                $ruidarray[] = $post['authorid'];
            }
            if (!in_array($post['fid'], $fidarray)) {
                $fidarray[] = $post['fid'];
            }
        }
        if ($tuidarray) {
            updatepostcredits('+', $tuidarray, $creditspolicy['post']);
        }
        if ($ruidarray) {
            updatepostcredits('+', $ruidarray, $creditspolicy['reply']);
        }
        $db->query("UPDATE {$tablepre}posts SET invisible='0' WHERE tid IN ({$tids})", 'UNBUFFERED');
        $db->query("UPDATE {$tablepre}threads SET displayorder='0', moderated='1' WHERE tid IN ({$tids})");
        $threadsundel = $db->affected_rows();
        updatemodlog($tids, 'UDL');
        updatemodworks('UDL', $threadsundel);
        foreach ($fidarray as $fid) {
            updateforumcount($fid);
        }
    }
    return $threadsundel;
}
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:35,代码来源:cpanel.share.php


示例3: array

         $validatedthreads[] = $thread;
         $pm = 'pm_' . $thread['tid'];
         if (isset($_G['gp_' . $pm]) && $_G['gp_' . $pm] != '' && $thread['authorid']) {
             $pmlist[] = array('action' => 'modthreads_validate', 'notevar' => array('tid' => $thread['tid'], 'threadsubject' => $thread['subject'], 'reason' => dhtmlspecialchars($_G['gp_' . $pm])), 'authorid' => $thread['authorid']);
         }
     }
     if ($tids) {
         $tidstr = dimplode($tids);
         $validates = DB::query("UPDATE " . DB::table(getposttable()) . " SET status='4' WHERE tid IN ({$tidstr}) AND status='0' AND invisible='-2'");
         updatepost(array('invisible' => '0'), "tid IN ({$tidstr}) AND first='1'");
         DB::query("UPDATE " . DB::table('forum_thread') . " SET displayorder='0', moderated='1' WHERE tid IN ({$tidstr})");
         $validates = DB::affected_rows();
         foreach (array_unique($forums) as $fid) {
             updateforumcount($fid);
         }
         updatemodworks('MOD', $validates);
         updatemodlog($tidstr, 'MOD');
         updatemoderate('tid', $tids, 2);
     }
 }
 if ($pmlist) {
     foreach ($pmlist as $pm) {
         notification_add($pm['authorid'], 'system', $pm['action'], $pm['notevar'], 1);
     }
 }
 if ($_G['gp_fast']) {
     echo callback_js($_G['gp_tid']);
     exit;
 } else {
     cpmsg('moderate_threads_succeed', "action=moderate&operation=threads&page={$page}&filter={$filter}&modfid={$modfid}", 'succeed', array('validates' => $validates, 'ignores' => $ignores, 'recycles' => $recycles, 'deletes' => $deletes));
 }
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:31,代码来源:moderate_thread.php


示例4: dimplode

             }
         }
         if ($tids) {
             $tidstr = dimplode($tids);
             C::t('forum_post')->update_by_tid(0, $tids, array('invisible' => 0), true, false, 1);
             C::t('forum_thread')->update($tids, array('displayorder' => 0, 'moderated' => 1));
             $threadsmod = DB::affected_rows();
             if ($_G['fid']) {
                 updateforumcount($_G['fid']);
             } else {
                 $fids = array_keys($modforums['list']);
                 foreach ($fids as $f) {
                     updateforumcount($f);
                 }
             }
             updatemodworks('MOD', $threadsmod);
             updatemodlog($tidstr, 'MOD');
             updatemoderate('tid', $tids, 2);
         }
     }
     if ($pmlist) {
         foreach ($pmlist as $pm) {
             $threadsubject = $pm['thread'];
             $_G['tid'] = intval($pm['tid']);
             notification_add($pm['authorid'], 'system', $pm['act'], $pm['notevar'], 1);
         }
     }
     showmessage('modcp_mod_succeed', "{$cpscript}?mod=modcp&action={$_GET['action']}&op={$op}&filter={$filter}&fid={$_G['fid']}");
 }
 $modcount = C::t('common_moderate')->count_by_seach_for_thread($moderatestatus, $modfids ? explode(',', $modfids) : null);
 $multipage = multi($modcount, $_G['tpp'], $page, "{$cpscript}?mod=modcp&action={$_GET['action']}&op={$op}&filter={$filter}&fid={$_G['fid']}");
开发者ID:tang86,项目名称:discuz-utf8,代码行数:31,代码来源:modcp_moderate.php


示例5: isset

    }
}
$typeid = isset($typeid) ? $typeid : 0;
$displayorder = $modnewthreads ? -2 : ($_G['forum']['ismoderator'] && !empty($_G['gp_sticktopic']) ? 1 : 0);
$digest = $_G['forum']['ismoderator'] && !empty($addtodigest) ? 1 : 0;
$readperm = $_G['group']['allowsetreadperm'] ? $readperm : 0;
$isanonymous = $_G['gp_isanonymous'] && $_G['group']['allowanonymous'] ? 1 : 0;
$author = !$isanonymous ? $_G['username'] : '';
$moderated = $digest || $displayorder > 0 ? 1 : 0;
$posttableid = getposttableid('p');
$isgroup = $_G['forum']['status'] == 3 ? 1 : 0;
DB::query("INSERT INTO " . DB::table('forum_thread') . " (fid, posttableid, readperm, price, typeid, author, authorid, subject, dateline, lastpost, lastposter, displayorder, digest, special, attachment, moderated, replies, status, isgroup)\n\tVALUES ('{$_G['fid']}', '{$posttableid}', '{$readperm}', '{$price}', '{$typeid}', '{$author}', '{$_G['uid']}', '{$subject}', '{$_G['timestamp']}', '{$_G['timestamp']}', '{$author}', '{$displayorder}', '{$digest}', '{$special}', '{$attachment}', '{$moderated}', '1', '{$thread['status']}', '{$isgroup}')");
$tid = DB::insert_id();
if ($moderated) {
    updatemodlog($tid, $displayorder > 0 ? 'STK' : 'DIG');
    updatemodworks($displayorder > 0 ? 'STK' : 'DIG', 1);
}
$bbcodeoff = checkbbcodes($message, !empty($_G['gp_bbcodeoff']));
$smileyoff = checksmilies($message, !empty($_G['gp_smileyoff']));
$parseurloff = !empty($_G['gp_parseurloff']);
$htmlon = bindec(($_G['setting']['tagstatus'] && !empty($tagoff) ? 1 : 0) . ($_G['group']['allowhtml'] && !empty($_G['gp_htmlon']) ? 1 : 0));
$attentionon = empty($_G['gp_attention_add']) ? 0 : 1;
$pinvisible = $modnewthreads ? -2 : 0;
insertpost(array('fid' => $_G['fid'], 'tid' => $tid, 'first' => '1', 'author' => $_G['username'], 'authorid' => $_G['uid'], 'subject' => $subject, 'dateline' => $_G['timestamp'], 'message' => '', 'useip' => $_G['clientip'], 'invisible' => $pinvisible, 'anonymous' => $isanonymous, 'usesig' => $_G['gp_usesig'], 'htmlon' => $htmlon, 'bbcodeoff' => $bbcodeoff, 'smileyoff' => $smileyoff, 'parseurloff' => $parseurloff, 'attachment' => '0'));
if ($_G['setting']['tagstatus'] && $_G['gp_tags'] != '') {
    $tags = str_replace(array(chr(0xa3) . chr(0xac), chr(0xa1) . chr(0x41), chr(0xef) . chr(0xbc) . chr(0x8c)), ',', censor($_G['gp_tags']));
    if (strexists($tags, ',')) {
        $tagarray = array_unique(explode(',', $tags));
    } else {
        $tags = str_replace(array(chr(0xa1) . chr(0xa1), chr(0xa1) . chr(0x40), chr(0xe3) . chr(0x80) . chr(0x80)), ' ', $tags);
        $tagarray = array_unique(explode(' ', $tags));
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:31,代码来源:post_newtrade.php


示例6: template

        include template('topicadmin_banpost');
    } else {
        $banned = intval($banned);
        $modaction = $banned ? 'BNP' : 'UBN';
        checkreasonpm();
        $db->query("UPDATE {$tablepre}posts SET status='{$banned}' WHERE pid IN ({$banpids}) AND tid='{$tid}'", 'UNBUFFERED');
        $resultarray = array('redirect' => "viewthread.php?tid={$tid}&amp;page={$page}", 'reasonpm' => $sendreasonpm ? array('data' => $posts, 'var' => 'post', 'item' => 'reason_ban_post') : array(), 'modtids' => 0, 'modlog' => $thread);
    }
} else {
    showmessage('undefined_action', NULL, 'HALTED');
}
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']) {
        include language('modactions');
        $modaction = $modactioncode[$modaction];
        foreach ($resultarray['reasonpm']['data'] as ${$resultarray['reasonpm']['var']}) {
            sendreasonpm($resultarray['reasonpm']['var'], $resultarray['reasonpm']['item']);
        }
开发者ID:jonycookie,项目名称:projectm2,代码行数:31,代码来源:topicadmin.php


示例7: _adminTopic


//.........这里部分代码省略.........
                         C::t('forum_thread')->update($tidsarr, $fieldarr, true);
                         C::t('forum_forumrecommend')->update($tidsarr, array('fid' => $moveto));
                         loadcache('posttableids');
                         $posttableids = $_G['cache']['posttableids'] ? $_G['cache']['posttableids'] : array('0');
                         foreach ($posttableids as $id) {
                             C::t('forum_post')->update_by_tid($id, $tidsarr, array('fid' => $moveto));
                         }
                         $typeoptionvars = C::t('forum_typeoptionvar')->fetch_all_by_tid_optionid($tidsarr);
                         foreach ($typeoptionvars as $typeoptionvar) {
                             C::t('forum_typeoptionvar')->update_by_tid($typeoptionvar['tid'], array('fid' => $moveto));
                             C::t('forum_optionvalue')->update($typeoptionvar['sortid'], $typeoptionvar['tid'], $_G['fid'], "fid='{$moveto}'");
                         }
                         if ($_G['setting']['globalstick'] && $stickmodify) {
                             require_once libfile('function/cache');
                             updatecache('globalstick');
                         }
                         $modaction = 'MOV';
                         $_G['toforum'] = $toforum;
                         updateforumcount($moveto);
                         updateforumcount($_G['fid']);
                         break;
                     default:
                         $errorMsg = '错误的动作参数';
                         break;
                 }
                 if ($errorMsg == '') {
                     if ($updatemodlog) {
                         if ($operation != 'delete') {
                             updatemodlog($moderatetids, $modaction, $expiration);
                         } else {
                             updatemodlog($moderatetids, $modaction, $expiration, 0, $reason);
                         }
                     }
                     updatemodworks($modaction, $modpostsnum);
                     foreach ($threadlist as $thread) {
                         modlog($thread, $modaction);
                     }
                     if ($sendreasonpm) {
                         $modactioncode = lang('forum/modaction');
                         $modtype = $modaction;
                         $modaction = $modactioncode[$modaction];
                         foreach ($threadlist as $thread) {
                             if ($operation == 'move') {
                                 sendreasonpm($thread, 'reason_move', array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason, 'tofid' => $toforum['fid'], 'toname' => $toforum['name'], 'from_id' => 0, 'from_idtype' => 'movethread'));
                             } else {
                                 sendreasonpm($thread, 'reason_moderate', array('tid' => $thread['tid'], 'subject' => $thread['subject'], 'modaction' => $modaction, 'reason' => $reason, 'from_id' => 0, 'from_idtype' => 'moderate_' . $modtype));
                             }
                         }
                     }
                     if ($stampstatus) {
                         set_stamp($stampstatus, $stampaction, $threadlist, $expiration);
                     }
                     $this->getController()->redirect(WebUtils::createUrl_oldVersion('index/returnmobileview'));
                 }
             } else {
                 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 {
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:67,代码来源:TopicAdminViewAction.php


示例8: updatepostcredits

            }
            if (!in_array($post['fid'], $fidarray)) {
                $fidarray[] = $post['fid'];
            }
        }
        if ($tuidarray) {
            updatepostcredits('+', $tuidarray, $creditspolicy['post']);
        }
        if ($ruidarray) {
            updatepostcredits('+', $ruidarray, $creditspolicy['reply']);
        }
        $db->query("UPDATE {$tablepre}posts SET invisible='0' WHERE tid IN ({$undeletetids})", 'UNBUFFERED');
        $db->query("UPDATE {$tablepre}threads SET displayorder='0', moderated='1' WHERE tid IN ({$undeletetids})");
        $threadsundel = $db->affected_rows();
        updatemodlog($undeletetids, 'UDL');
        updatemodworks('UDL', $threadsundel);
        foreach ($fidarray as $fid) {
            updateforumcount($fid);
        }
    }
    cpmsg('recyclebin_succeed');
}
if (submitcheck('searchsubmit')) {
    $sql = '';
    $sql .= $inforum ? " AND t.fid='{$inforum}'" : '';
    $sql .= $authors != '' ? " AND t.author IN ('" . str_replace(',', '\',\'', str_replace(' ', '', $authors)) . "')" : '';
    $sql .= $admins != '' ? " AND tm.username IN ('" . str_replace(',', '\',\'', str_replace(' ', '', $admins)) . "')" : '';
    $sql .= $pstarttime != '' ? " AND t.dateline>='" . (strtotime($pstarttime) - $timeoffset * 3600) . "'" : '';
    $sql .= $pendtime != '' ? " AND t.dateline<'" . (strtotime($pendtime) - $timeoffset * 3600) . "'" : '';
    $sql .= $mstarttime != '' ? " AND tm.dateline>='" . (strtotime($mstarttime) - $timeoffset * 3600) . "'" : '';
    $sql .= $mendtime != '' ? " AND tm.dateline<'" . (strtotime($mendtime) - $timeoffset * 3600) . "'" : '';
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:recyclebin.inc.php


示例9: array

                    $pmlist[] = array('action' => 'modreplies_validate', 'notevar' => array('tid' => $_G['tid'], 'post' => $post, 'reason' => stripslashes($reason)), 'authorid' => $post['authorid'], 'tid' => $post['tid'], 'post' => dhtmlspecialchars(cutstr($post['message'], 30)), 'reason' => dhtmlspecialchars(${$pm}));
                }
            }
            if ($authoridarray) {
                updatepostcredits('+', $authoridarray, 'reply');
            }
            foreach ($threads as $tid => $thread) {
                DB::query("UPDATE " . DB::table('forum_thread') . " SET replies=replies+{$thread['posts']} {$thread['lastpostadd']} {$thread['attachadd']} WHERE tid='{$tid}'", 'UNBUFFERED');
            }
            foreach (array_unique($forums) as $fid) {
                updateforumcount($fid);
            }
            if (!empty($pidarray)) {
                updatepost(array('invisible' => '0'), "pid IN (0," . implode(',', $pidarray) . ")");
                $validates = DB::affected_rows();
                updatemodworks('MOD', $validates);
            } else {
                updatemodworks('MOD', 1);
            }
        }
        if ($pmlist) {
            foreach ($pmlist as $pm) {
                $reason = $pm['reason'];
                $post = $pm['post'];
                $tid = intval($pm['tid']);
                notification_add($pm['authorid'], 'system', $pm['action'], $pm['notvar'], 1);
            }
        }
        cpmsg('moderate_replies_succeed', "action=moderate&operation=replies&page={$page}&filter={$filter}&modfid={$modfid}", 'succeed', array('validates' => $validates, 'ignores' => $ignores, 'recycles' => $recycles, 'deletes' => $deletes));
    }
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:31,代码来源:admincp_moderate.php


示例10: undeletethreads

function undeletethreads($tids)
{
    global $_G;
    $threadsundel = 0;
    if ($tids && is_array($tids)) {
        foreach ($tids as $t) {
            my_thread_log('restore', array('tid' => $t));
        }
        $tids = '\'' . implode('\',\'', $tids) . '\'';
        $tuidarray = $ruidarray = $fidarray = $posttabletids = array();
        $query = DB::query('SELECT tid, posttableid FROM ' . DB::table('forum_thread') . " WHERE tid IN ({$tids})");
        while ($thread = DB::fetch($query)) {
            $posttabletids[$thread['posttableid'] ? $thread['posttableid'] : 0][] = $thread['tid'];
        }
        foreach ($posttabletids as $posttableid => $ptids) {
            $query = DB::query('SELECT fid, first, authorid FROM ' . DB::table(getposttable($posttableid)) . " WHERE tid IN (" . dimplode($ptids) . ")");
            while ($post = DB::fetch($query)) {
                if ($post['first']) {
                    $tuidarray[] = $post['authorid'];
                } else {
                    $ruidarray[] = $post['authorid'];
                }
                if (!in_array($post['fid'], $fidarray)) {
                    $fidarray[] = $post['fid'];
                }
            }
            updatepost(array('invisible' => '0'), "tid IN (" . dimplode($ptids) . ")", true, $posttableid);
        }
        if ($tuidarray) {
            updatepostcredits('+', $tuidarray, 'post');
        }
        if ($ruidarray) {
            updatepostcredits('+', $ruidarray, 'reply');
        }
        DB::query("UPDATE " . DB::table('forum_thread') . " SET displayorder='0', moderated='1' WHERE tid IN ({$tids})");
        $threadsundel = DB::affected_rows();
        updatemodlog($tids, 'UDL');
        updatemodworks('UDL', $threadsundel);
        foreach ($fidarray as $fid) {
            updateforumcount($fid);
        }
    }
    return $threadsundel;
}
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:44,代码来源:function_misc.php


示例11: foreach

                $repliesarray[$decrease][] = $tid;
            }
            foreach ($repliesarray as $decrease => $tidarray) {
                DB::query("UPDATE " . DB::table('forum_thread') . " SET replies=replies-{$decrease} WHERE tid IN (" . implode(',', $tidarray) . ")");
            }
        }
        if ($_G['setting']['globalstick']) {
            updatecache('globalstick');
        }
        foreach (array_unique($prune['forums']) as $fid) {
            updateforumcount($fid);
        }
    }
    $deletedthreads = intval($deletedthreads);
    $deletedposts = intval($deletedposts);
    updatemodworks('DLP', $deletedposts);
    $cpmsg = cplang('prune_succeed', array('deletedthreads' => $deletedthreads, 'deletedposts' => $deletedposts));
    ?>
<script type="text/JavaScript">alert('<?php 
    echo $cpmsg;
    ?>
');parent.$('pruneforum').searchsubmit.click();</script>
<?php 
}
if (submitcheck('searchsubmit', 1)) {
    loadcache('posttableids');
    $posttable = in_array($_G['gp_posttableid'], $_G['cache']['posttableids']) ? $_G['gp_posttableid'] : 0;
    $_G['gp_detail'] = !empty($_GET['users']) ? true : $_G['gp_detail'];
    $pids = $postcount = '0';
    $sql = $error = '';
    $operation == 'group' && ($_G['gp_forums'] = 'isgroup');
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:31,代码来源:admincp_prune.php


示例12: sendPost


//.........这里部分代码省略.........
             $_GET['replycredit_random'] = $_GET['replycredit_random'] < 0 || $_GET['replycredit_random'] > 99 ? 0 : $_GET['replycredit_random'] ;
             $replycredit = $replycredit_real = 0;
             if($_GET['replycredit_extcredits'] > 0 && $_GET['replycredit_times'] > 0) {
             $replycredit_real = ceil(($_GET['replycredit_extcredits'] * $_GET['replycredit_times']) + ($_GET['replycredit_extcredits'] * $_GET['replycredit_times'] *  $_G['setting']['creditstax']));
             if($replycredit_real > getuserprofile('extcredits'.$_G['setting']['creditstransextra'][10])) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'forum_passwd');
             showmessage('replycredit_morethan_self');
             } else {
             $replycredit = ceil($_GET['replycredit_extcredits'] * $_GET['replycredit_times']);
             }
             }
             } */
     $newthread = array('fid' => $_G['fid'], 'posttableid' => 0, 'readperm' => $readperm, 'price' => $price, 'typeid' => $typeid, 'sortid' => $sortid, 'author' => $author, 'authorid' => $_G['uid'], 'subject' => $subject, 'dateline' => $publishdate, 'lastpost' => $publishdate, 'lastposter' => $author, 'displayorder' => $displayorder, 'digest' => $digest, 'special' => $special, 'attachment' => 0, 'moderated' => $moderated, 'status' => $thread['status'] | $topicStatus, 'isgroup' => $isgroup, 'replycredit' => $replycredit, 'closed' => $closed ? 1 : 0);
     $tid = C::t('forum_thread')->insert($newthread, true);
     useractionlog($_G['uid'], 'tid');
     if (!getuserprofile('threads') && $_G['setting']['newbie']) {
         C::t('forum_thread')->update($tid, array('icon' => $_G['setting']['newbie']));
     }
     if ($publishdate != $_G['timestamp']) {
         loadcache('cronpublish');
         $cron_publish_ids = dunserialize($_G['cache']['cronpublish']);
         $cron_publish_ids[$tid] = $tid;
         $cron_publish_ids = serialize($cron_publish_ids);
         savecache('cronpublish', $cron_publish_ids);
     }
     if (!$isanonymous) {
         C::t('common_member_field_home')->update($_G['uid'], array('recentnote' => $subject));
     }
     if ($special == 3 && $_G['group']['allowpostreward']) {
         updatemembercount($_G['uid'], array($_G['setting']['creditstransextra'][2] => -$realprice), 1, 'RTC', $tid);
     }
     if ($moderated) {
         updatemodlog($tid, $displayorder > 0 ? 'STK' : 'DIG');
         updatemodworks($displayorder > 0 ? 'STK' : 'DIG', 1);
     }
     /* if($special == 1) {
     
             foreach($pollarray['options'] as $polloptvalue) {
             $polloptvalue = dhtmlspecialchars(trim($polloptvalue));
             C::t('forum_polloption')->insert(array('tid' => $tid, 'polloption' => $polloptvalue));
             }
             $polloptionpreview = '';
             $query = C::t('forum_polloption')->fetch_all_by_tid($tid, 1, 2);
             foreach($query as $option) {
             $polloptvalue = preg_replace("/\[url=(https?){1}:\/\/([^\[\"']+?)\](.+?)\[\/url\]/i", "<a href=\"\\1://\\2\" target=\"_blank\">\\3</a>", $option['polloption']);
             $polloptionpreview .= $polloptvalue."\t";
             }
     
             $polloptionpreview = daddslashes($polloptionpreview);
     
             $data = array('tid' => $tid, 'multiple' => $pollarray['multiple'], 'visible' => $pollarray['visible'], 'maxchoices' => $pollarray['maxchoices'], 'expiration' => $pollarray['expiration'], 'overt' => $pollarray['overt'], 'pollpreview' => $polloptionpreview);
             C::t('forum_poll')->insert($data);
             } */
     if ($_G['forum']['threadsorts']['types'][$sortid] && !empty($_G['forum_optiondata']) && is_array($_G['forum_optiondata'])) {
         $filedname = $valuelist = $separator = '';
         foreach ($_G['forum_optiondata'] as $optionid => $value) {
             if ($value) {
                 $filedname .= $separator . $_G['forum_optionlist'][$optionid]['identifier'];
                 $valuelist .= $separator . "'" . daddslashes($value) . "'";
                 $separator = ' ,';
             }
             if ($_G['forum_optionlist'][$optionid]['type'] == 'image') {
                 $identifier = $_G['forum_optionlist'][$optionid]['identifier'];
                 $sortaids[] = intval($_GET['typeoption'][$identifier]['aid']);
             }
             C::t('forum_typeoptionvar')->insert(array('sortid' => $sortid, 'tid' => $tid, 'fid' => $_G['fid'], 'optionid' => $optionid, 'value' => censor($value), 'expiration' => $typeexpiration ? $publishdate + $typeexpiration : 0));
开发者ID:caidongyun,项目名称:CS,代码行数:67,代码来源:TopicAdminAction.php


示例13: editpost


//.........这里部分代码省略.........
             $this->param['threadupdatearr']['readperm'] = $this->param['readperm'];
         }
         $this->param['threadupdatearr']['price'] = $this->param['price'];
         $this->param['threadupdatearr']['status'] = $this->thread['status'];
         if (getglobal('forum_auditstatuson') && $this->param['audit'] == 1) {
             $this->param['threadupdatearr']['displayorder'] = 0;
             $this->param['threadupdatearr']['moderated'] = 1;
         } else {
             $this->param['threadupdatearr']['displayorder'] = $displayorder;
         }
         C::t('forum_thread')->update($this->thread['tid'], $this->param['threadupdatearr'], true);
         if ($this->thread['tid'] > 1) {
             if ($this->thread['closed'] > 1) {
                 C::t('forum_thread')->update($this->thread['closed'], array('subject' => $this->param['subject']), true);
             } elseif (empty($this->thread['isgroup'])) {
                 $threadclosed = C::t('forum_threadclosed')->fetch($thread['tid']);
                 if ($threadclosed['redirect']) {
                     C::t('forum_thread')->update($threadclosed['redirect'], array('subject' => $this->param['subject']), true);
                 }
             }
         }
         $class_tag = new tag();
         $tagstr = $class_tag->update_field($this->param['tags'], $this->thread['tid'], 'tid', $this->thread);
     } else {
         if ($this->param['subject'] == '' && $this->param['message'] == '' && $this->thread['special'] != 2) {
             showmessage('post_sm_isnull');
         }
     }
     $this->param['htmlon'] = $this->group['allowhtml'] && !empty($this->param['htmlon']) ? 1 : 0;
     if ($this->setting['editedby'] && TIMESTAMP - $this->post['dateline'] > 60 && $this->member['adminid'] != 1) {
         $editor = $this->param['isanonymous'] && $isorigauthor ? lang('forum/misc', 'anonymous') : $this->member['username'];
         $edittime = dgmdate(TIMESTAMP);
         $this->param['message'] = lang('forum/misc', $this->param['htmlon'] ? 'post_edithtml' : (!$this->forum['allowbbcode'] || $this->param['bbcodeoff'] ? 'post_editnobbcode' : 'post_edit'), array('editor' => $editor, 'edittime' => $edittime)) . $this->param['message'];
     }
     $this->param['bbcodeoff'] = checkbbcodes($this->param['message'], !empty($this->param['bbcodeoff']));
     $this->param['smileyoff'] = checksmilies($this->param['message'], !empty($this->param['smileyoff']));
     $tagoff = $isfirstpost ? !empty($tagoff) : 0;
     if (getglobal('forum_auditstatuson') && $this->param['audit'] == 1) {
         C::t('forum_post')->update($this->thread['posttableid'], $this->post['pid'], array('status' => 4), false, false, null, -2, null, 0);
         updatepostcredits('+', $this->post['authorid'], $isfirstpost ? 'post' : 'reply', $this->forum['fid']);
         updatemodworks('MOD', 1);
         updatemodlog($this->thread['tid'], 'MOD');
     }
     $displayorder = $pinvisible = 0;
     if ($isfirstpost) {
         $displayorder = $this->param['modnewthreads'] ? -2 : $this->thread['displayorder'];
         $pinvisible = $this->param['modnewthreads'] ? -2 : (empty($this->param['save']) ? 0 : -3);
     } else {
         $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']);
     $this->param['parseurloff'] = !empty($this->param['parseurloff']);
     $setarr = array('message' => $this->param['message'], 'usesig' => $this->param['usesig'], 'htmlon' => $this->param['htmlon'], 'bbcodeoff' => $this->param['bbcodeoff'], 'parseurloff' => $this->param['parseurloff'], 'smileyoff' => $this->param['smileyoff'], 'subject' => $this->param['subject'], 'tags' => $tagstr, 'port' => getglobal('remoteport'));
     $setarr['status'] = $this->post['status'];
     if ($this->param['modstatus']) {
         foreach ($this->param['modstatus'] as $modbit => $modvalue) {
             $setarr['status'] = setstatus($modbit, $modvalue, $setarr['status']);
         }
     }
     if ($anonymousadd !== '') {
         $setarr['anonymous'] = $anonymousadd;
     }
     if ($publishdate) {
         $setarr['dateline'] = $publishdate;
     }
     if (getglobal('forum_auditstatuson') && $this->param['audit'] == 1) {
         $setarr['invisible'] = 0;
     } else {
         $setarr['invisible'] = $pinvisible;
     }
     C::t('forum_post')->update('tid:' . $this->thread['tid'], $this->post['pid'], $setarr);
     $this->forum['lastpost'] = explode("\t", $this->forum['lastpost']);
     if ($this->post['dateline'] == $this->forum['lastpost'][2] && ($this->post['author'] == $this->forum['lastpost'][3] || $this->forum['lastpost'][3] == '' && $this->post['anonymous'])) {
         $lastpost = $this->thread['tid'] . "\t" . ($isfirstpost ? $this->param['subject'] : $this->thread['subject']) . "\t" . $this->post['dateline'] . "\t" . ($this->param['isanonymous'] ? '' : $this->post['author']);
         C::t('forum_forum')->update($this->forum['fid'], array('lastpost' => $lastpost));
     }
     if (!getglobal('forum_auditstatuson') || $this->param['audit'] != 1) {
         if ($isfirstpost && $this->param['modnewthreads']) {
             C::t('forum_thread')->update($this->thread['tid'], array('displayorder' => -2));
             manage_addnotify('verifythread');
         } elseif (!$isfirstpost && $this->param['modnewreplies']) {
             C::t('forum_thread')->increase($this->thread['tid'], array('replies' => -1));
             manage_addnotify('verifypost');
         }
         if ($this->param['modnewreplies'] || $this->param['modnewthreads']) {
             C::t('forum_forum')->update($this->forum['fid'], array('modworks' => '1'));
         }
     }
     if ($this->thread['lastpost'] == $this->post['dateline'] && (!$this->post['anonymous'] && $this->thread['lastposter'] == $this->post['author'] || $this->post['anonymous'] && $this->thread['lastposter'] == '') && $this->post['anonymous'] != $this->param['isanonymous']) {
         C::t('forum_thread')->update($this->thread['tid'], array('lastposter' => $this->param['isanonymous'] ? '' : $this->post['author']), true);
     }
     if (!$isorigauthor) {
         updatemodworks('EDT', 1);
         require_once libfile('function/misc');
         modlog($this->thread, 'EDT');
     }
     if ($isfirstpost && $this->thread['displayorder'] == -4 && empty($this->param['save'])) {
         threadpubsave($this->thread['tid']);
     }
 }
开发者ID:MCHacker,项目名称:docker-discuz,代码行数:101,代码来源:model_forum_post.php


示例14: undeletethreads

function undeletethreads($tids)
{
    global $_G;
    $threadsundel = 0;
    if ($tids && is_array($tids)) {
        foreach ($tids as $t) {
            my_thread_log('restore', array('tid' => $t));
        }
        $tids = '\'' . implode('\',\'', $tids) . '\'';
        $tuidarray = $ruidarray = $fidarray = array();
        $postarray = getfieldsofposts('fid, first, authorid', "tid IN ({$tids})");
        foreach ($postarray as $post) {
            if ($post['first']) {
                $tuidarray[] = $post['authorid'];
            } else {
                $ruidarray[] = $post['authorid'];
            }
            if (!in_array($post['fid'], $fidarray)) {
                $fidarray[] = $post['fid'];
            }
        }
        if ($tuidarray) {
            updatepostcredits('+', $tuidarray, 'post');
        }
        if ($ruidarray) {
            updatepostcredits('+', $ruidarray, 'reply');
        }
        updatepost(array('invisible' => '0'), "tid IN ({$tids})", true);
        DB::query("UPDATE " . DB::table('forum_thread') . " SET displayorder='0', moderated='1' WHERE tid IN ({$tids})");
        $threadsundel = DB::affected_rows();
        updatemodlog($tids, 'UDL');
        updatemodworks('UDL', $threadsundel);
        foreach ($fidarray as $fid) {
            updateforumcount($fid);
        }
    }
    return $threadsundel;
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:38,代码来源:function_misc.php


示例15: undeletethreads

function undeletethreads($tids)
{
    global $_G;
    if ($_G['setting']['plugins']['func'][HOOKTYPE]['undeletethreads']) {
        $param = func_get_args();
        hookscript('undeletethreads', 'global', 'funcs', array('param' => $param), 'undeletethreads');
    }
    $threadsundel = 0;
    if ($tids && is_array($tids)) {
        $arrtids = $tids;
        $tids = '\'' . implode('\',\'', $tids) . '\'';
        $tuidarray = $ruidarray = $fidarray = $posttabletids = array();
        foreach (C::t('forum_thread')->fetch_all_by_tid($arrtids) as $thread) {
            $posttabletids[$thread['posttableid'] ? $thread['posttableid'] : 0][] = $thread['tid'];
        }
        foreach ($posttabletids as $posttableid => $ptids) {
            foreach (C::t('forum_post')->fetch_all_by_tid($posttableid, $ptids, false) as $post) {
                if ($post['first']) {
                    $tuidarray[$post['fid']][] = $post['authorid'];
                } else {
                    $ruidarray[$post['fid']][] = $post['authorid'];
                }
                if (!in_array($post['fid'], $fidarray)) {
                    $fidarray[] = $post['fid'];
                }
            }
            C::t('forum_post')->update_by_tid($posttableid, $ptids, array('invisible' => '0'), true);
        }
        if ($tuidarray) {
            foreach ($tuidarray as $fid => $tuids) {
                updatepostcredits('+', $tuids, 'post', $fid);
            }
        }
        if ($ruidarray) {
            foreach ($ruidarray as $fid => $ruids) {
                updatepostcredits('+', $ruids, 'reply', $fid);
            }
        }
        $threadsundel = C::t('forum_thread')->update($arrtids, array('displayorder' => 0, 'moderated' => 1));
        updatemodlog($tids, 'UDL');
        updatemodworks('UDL', $threadsundel);
        foreach ($fidarray as $fid) {
            updateforumcount($fid);
        }
    }
    return $threadsundel;
}
开发者ID:jaideejung007,项目名称:DiscuzxTH,代码行数:47,代码来源:function_misc.php


示例16: newthread

 public function newthread($parameters)
 {
     require_once libfile('function/post');
     $this->tid = $this->pid = 0;
     $this->_init_parameters($parameters);
     if (trim($this->param['subject']) == '') {
         return $this->showmessage('post_sm_isnull');
     }
     if (!$this->param['sortid'] && !$this->param['special'] && trim($this->param['message']) == '') {
         return $this->showmessage('post_sm_isnull');
     }
     list($this->param['modnewthreads'], $this->param['modnewreplies']) = threadmodstatus($this->param['subject'] . "\t" . $this->param['message'] . $this->param['extramessage']);
     if ($post_invalid = checkpost($this->param['subject'], $this->param['message'], $this->param['special'] || $this->param['sortid'])) {
         return $this->showmessage($post_invalid, '', array('minpostsize' => $this->setting['minpostsize'], 'maxpostsize' => $this->setting['maxpostsize']));
     }
     if (checkflood()) {
         return $this->showmessage('post_flood_ctrl', '', array('floodctrl' => $this->setting['floodctrl']));
     } elseif (checkmaxperhour('tid')) {
         return $this->showmessage('thread_flood_ctrl_threads_per_hour', '', array('threads_per_hour' => $this->group['maxthreadsperhour']));
     }
     $this->param['save'] = $this->member['uid'] ? $this->param['save'] : 0;
     $this->param['typeid'] = isset($this->param['typeid']) && isset($this->forum['threadtypes']['types'][$this->param['typeid']]) && (!$this->forum['threadtypes']['moderators'][$this->param['typeid']] || $this->forum['ismoderator']) ? $this->param['typeid'] : 0;
     $this->param['displayorder'] = $this->param['modnewthreads'] ? -2 : ($this->forum['ismoderator'] && $this->group['allowstickthread'] && !empty($this->param['sticktopic']) ? 1 : (empty($this->param['save']) ? 0 : -4));
     if ($this->param['displayorder'] == -2) {
         C::t('forum_forum')->update($this->forum['fid'], array('modworks' => '1'));
     }
     $this->param['digest'] = $this->forum['ismoderator'] && $this->group['allowdigestthread'] && !empty($this->param['digest']) ? 1 : 0;
     $this->param['readperm'] = $this->group['allowsetreadperm'] ? $this->param['readperm'] : 0;
     $this->param['isanonymous'] = $this->group['allowanonymous'] && $this->param['isanonymous'] ? 1 : 0;
     $this->param['price'] = intval($this->param['price']);
     if (!$this->param['special']) {
         $this->param['price'] = $this->group['maxprice'] ? $this->param['price'] <= $this->group['maxprice'] ? $this->param['price'] : $this->group['maxprice'] : 0;
     }
     if (!$this->param['typeid'] && $this->forum['threadtypes']['required'] && !$this->param['special']) {
         return $this->showmessage('post_type_isnull');
     }
     if (!$this->param['sortid'] && $this->forum['threadsorts']['required'] && !$this->param['special']) {
         return $this->showmessage('post_sort_isnull');
     }
     if (!$this->param['special'] && $this->param['price'] > 0 && floor($this->param['price'] * (1 - $this->setting['creditstax'])) == 0) {
         return $this->showmessage('post_net_price_iszero');
     }
     $this->param['sortid'] = $this->param['special'] && $this->forum['threadsorts']['types'][$this->param['sortid']] ? 0 : $this->param['sortid'];
     $this->param['typeexpiration'] = intval($this->param['typeexpiration']);
     if ($this->forum['threadsorts']['expiration'][$this->param['typeid']] && !$this->param['typeexpiration']) {
         return $this->showmessage('threadtype_expiration_invalid');
     }
     $author = !$this->param['isanonymous'] ? $this->member['username'] : '';
     $this->param['moderated'] = $this->param['digest'] || $this->param['displayorder'] > 0 ? 1 : 0;
     $this->param['ordertype'] && ($this->param['tstatus'] = setstatus(4, 1, $this->param['tstatus']));
     $this->param['imgcontent'] && ($this->param['tstatus'] = setstatus(15, $this->param['imgcontent'], $this->param['tstatus']));
     $this->param['hiddenreplies'] && ($this->param['tstatus'] = setstatus(2, 1, $this->param['tstatus']));
     $this->param['allownoticeauthor'] && ($this->param['tstatus'] = setstatus(6, 1, $this->param['tstatus']));
     $this->param['isgroup'] = $this->forum['status'] == 3 ? 1 : 0;
     $this->param['publishdate'] = !$this->param['modnewthreads'] ? $this->par 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP updatenotify_delete函数代码示例发布时间:2022-05-23
下一篇:
PHP updatemodlog函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap