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


PHP modlog函数代码示例

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


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

示例1: manage_addnotify

             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);
         }
     }
     if ($rushreply) {
         showmessage('post_edit_delete_rushreply_nopermission', NULL);
开发者ID:kleitz,项目名称:sports,代码行数:31,代码来源:post_editpost.php

示例2: checkreasonpm

        $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']);
        }
    }
    showmessage(isset($resultarray['message']) ? $resultarray['message'] : 'admin_succeed', $resultarray['redirect']);
}
开发者ID:jonycookie,项目名称:projectm2,代码行数:31,代码来源:topicadmin.php

示例3: elseif

} elseif ($action == 'blog') {
    if (!$discuz_uid || !$thread['blog'] && (!$allowuseblog || !$forum['allowshare'])) {
        showmessage('group_nopermission', NULL, 'NOPERM');
    }
    if ($thread['authorid'] != $discuz_uid) {
        $thread['adminid'] = $db->result_first("SELECT adminid FROM {$tablepre}members WHERE uid='{$thread['authorid']}'");
        if (!$forum['ismoderator'] || in_array($thread['adminid'], array(1, 2, 3)) && $adminid > $thread['adminid']) {
            showmessage('blog_add_illegal');
        }
    }
    $blog = $thread['blog'] ? 0 : 1;
    $db->query("UPDATE {$tablepre}threads SET blog='{$blog}' WHERE tid='{$tid}'", 'UNBUFFERED');
    if ($forum['ismoderator'] && $thread['authorid'] != $discuz_uid && $blog != $thread['blog']) {
        $reason = '';
        require_once DISCUZ_ROOT . './include/misc.func.php';
        modlog($thread, $thread['blog'] ? 'RBL' : 'ABL');
    }
    showmessage('blog_add_succeed', "viewthread.php?tid={$tid}");
} elseif ($action == 'viewthreadmod' && $tid) {
    $loglist = array();
    $query = $db->query("SELECT * FROM {$tablepre}threadsmod WHERE tid='{$tid}' ORDER BY dateline DESC");
    while ($log = $db->fetch_array($query)) {
        $log['dateline'] = gmdate("{$dateformat} {$timeformat}", $log['dateline'] + $timeoffset * 3600);
        $log['expiration'] = !empty($log['expiration']) ? gmdate("{$dateformat}", $log['expiration'] + $timeoffset * 3600) : '';
        $log['status'] = empty($log['status']) ? 'style="text-decoration: line-through" disabled' : '';
        if ($log['magicid']) {
            require_once DISCUZ_ROOT . './forumdata/cache/cache_magics.php';
            $log['magicname'] = $_DCACHE['magics'][$log['magicid']]['name'];
        }
        $loglist[] = $log;
    }
开发者ID:jonycookie,项目名称:projectm2,代码行数:31,代码来源:misc.php

示例4: _adminTopic

 private function _adminTopic($fid, $tid, $pid, $act, $type)
 {
     global $_G;
     $errorMsg = '';
     $_GET['topiclist'] = array($_GET['pid']);
     // 在DISCUZ_ROOT/source/module/forum/forum_topicadmin.php基础上进行二次开发
     $_GET['topiclist'] = !empty($_GET['topiclist']) ? is_array($_GET['topiclist']) ? array_unique($_GET['topiclist']) : $_GET['topiclist'] : array();
     loadcache(array('modreasons', 'stamptypeid', 'threadtableids'));
     require_once libfile('function/post');
     require_once libfile('function/misc');
     $modpostsnum = 0;
     $resultarray = $thread = array();
     if ($_G['group']['reasonpm'] == 2 || $_G['group']['reasonpm'] == 3 || !empty($_GET['sendreasonpm'])) {
         $forumname = strip_tags($_G['forum']['name']);
         $sendreasonpm = 1;
     } else {
         $sendreasonpm = 0;
     }
     if ($type == 'topic') {
         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_moderate.php基础上进行二次开发
             $thread = $_G['forum_thread'];
             $thread['dblastpost'] = $thread['lastpost'];
             $threadlist[$thread['tid']] = $thread;
             $modpostsnum = count($threadlist);
             $stickcheck = $closecheck = $digestcheck = array('', '', '', '', '');
             empty($threadlist[$_G['tid']]['displayorder']) ? $stickcheck[0] = 'selected="selected"' : ($stickcheck[$threadlist[$_G['tid']]['displayorder']] = 'selected="selected"');
             empty($threadlist[$_G['tid']]['digest']) ? $digestcheck[0] = 'selected="selected"' : ($digestcheck[$threadlist[$_G['tid']]['digest']] = 'selected="selected"');
             empty($threadlist[$_G['tid']]['closed']) ? $closecheck[0] = 'checked="checked"' : ($closecheck[1] = 'checked="checked"');
             if (!empty($_POST)) {
                 $tidsarr = array_keys($threadlist);
                 $moderatetids = dimplode($tidsarr);
                 $reason = checkreasonpm();
                 $stampstatus = 0;
                 $stampaction = 'SPA';
                 $operationMap = array('top' => 'stick', 'marrow' => 'digest', 'delete' => 'delete');
                 $operation = $operationMap[$act];
                 $updatemodlog = TRUE;
                 switch ($act) {
                     case 'top':
                         $sticklevel = intval($_GET['sticklevel']);
                         if ($sticklevel < 0 || $sticklevel > 3 || $sticklevel > $_G['group']['allowstickthread']) {
                             // showmessage('no_privilege_stickthread');
                             $this->_exitWithHtmlAlert('no_privilege_stickthread');
                         }
                         $expiration = checkexpiration($_GET['expirationstick'], $operation);
                         $expirationstick = $sticklevel ? $_GET['expirationstick'] : 0;
                         $forumstickthreads = $_G['setting']['forumstickthreads'];
                         $forumstickthreads = isset($forumstickthreads) ? dunserialize($forumstickthreads) : array();
                         C::t('forum_thread')->update($tidsarr, array('displayorder' => $sticklevel, 'moderated' => 1), true);
                         $delkeys = array_keys($threadlist);
                         foreach ($delkeys as $k) {
                             unset($forumstickthreads[$k]);
                         }
                         C::t('common_setting')->update('forumstickthreads', $forumstickthreads);
                         $stickmodify = 0;
                         foreach ($threadlist as $thread) {
                             $stickmodify = (in_array($thread['displayorder'], array(2, 3)) || in_array($sticklevel, array(2, 3))) && $sticklevel != $thread['displayorder'] ? 1 : $stickmodify;
                         }
                         if ($_G['setting']['globalstick'] && $stickmodify) {
                             require_once libfile('function/cache');
                             updatecache('globalstick');
                         }
                         $modaction = $sticklevel ? $expiration ? 'EST' : 'STK' : 'UST';
                         C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('STK', 'UST', 'EST', 'UES'), array('status' => 0));
                         if (!$sticklevel) {
                             $stampaction = 'SPD';
                         }
                         $stampstatus = 1;
                         break;
                     case 'marrow':
                         $digestlevel = intval($_GET['digestlevel']);
                         if ($digestlevel < 0 || $digestlevel > 3 || $digestlevel > $_G['group']['allowdigestthread']) {
                             // showmessage('no_privilege_digestthread');
                             $this->_exitWithHtmlAlert('no_privilege_digestthread');
                         }
                         $expiration = checkexpiration($_GET['expirationdigest'], $operation);
                         $expirationdigest = $digestlevel ? $expirationdigest : 0;
                         C::t('forum_thread')->update($tidsarr, array('digest' => $digestlevel, 'moderated' => 1), true);
                         foreach ($threadlist as $thread) {
                             if ($thread['digest'] != $digestlevel) {
                                 if ($digestlevel == $thread['digest']) {
                                     continue;
                                 }
                                 $extsql = array();
                                 if ($digestlevel > 0 && $thread['digest'] == 0) {
                                     $extsql = array('digestposts' => 1);
                                 }
                                 if ($digestlevel == 0 && $thread['digest'] > 0) {
                                     $extsql = array('digestposts' => -1);
                                 }
                                 if ($digestlevel == 0) {
                                     $stampaction = 'SPD';
                                 }
                                 updatecreditbyaction('digest', $thread['authorid'], $extsql, '', $digestlevel - $thread['digest']);
                             }
                         }
                         $modaction = $digestlevel ? $expiration ? 'EDI' : 'DIG' : 'UDG';
//.........这里部分代码省略.........
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:101,代码来源:TopicAdminViewAction.php

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


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