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


PHP checkautoclose函数代码示例

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


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

示例1: libfile

if (!empty($_GET['action']) && $_GET['action'] == 'printable' && $_G['tid']) {
    require_once libfile('thread/printable', 'include');
    dexit();
}
if ($_G['forum_thread']['stamp'] >= 0) {
    $_G['forum_threadstamp'] = $_G['cache']['stamps'][$_G['forum_thread']['stamp']];
}
$lastmod = viewthread_lastmod($_G['forum_thread']);
$showsettings = str_pad(decbin($_G['setting']['showsettings']), 3, '0', STR_PAD_LEFT);
$showsignatures = $showsettings[0];
$showavatars = $showsettings[1];
$_G['setting']['showimages'] = $showsettings[2];
$highlightstatus = isset($_GET['highlight']) && str_replace('+', '', $_GET['highlight']) ? 1 : 0;
$_G['forum']['allowreply'] = isset($_G['forum']['allowreply']) ? $_G['forum']['allowreply'] : '';
$_G['forum']['allowpost'] = isset($_G['forum']['allowpost']) ? $_G['forum']['allowpost'] : '';
$allowpostreply = $_G['forum']['allowreply'] != -1 && ($_G['forum_thread']['isgroup'] || !$_G['forum_thread']['closed'] && !checkautoclose($_G['forum_thread']) || $_G['forum']['ismoderator']) && (!$_G['forum']['replyperm'] && $_G['group']['allowreply'] || $_G['forum']['replyperm'] && forumperm($_G['forum']['replyperm']) || $_G['forum']['allowreply']);
$fastpost = $_G['setting']['fastpost'] && !$_G['forum_thread']['archiveid'] && ($_G['forum']['status'] != 3 || $_G['isgroupuser']);
$allowfastpost = $_G['setting']['fastpost'] && $allowpostreply;
if (!$_G['uid'] && ($_G['setting']['need_avatar'] || $_G['setting']['need_email'] || $_G['setting']['need_friendnum']) || !$_G['adminid'] && (!cknewuser(1) || $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 60) && TIMESTAMP - $_G['member']['regdate'] < $_G['setting']['newbiespan'] * 60)) {
    $allowfastpost = false;
}
$_G['group']['allowpost'] = $_G['forum']['allowpost'] != -1 && (!$_G['forum']['postperm'] && $_G['group']['allowpost'] || $_G['forum']['postperm'] && forumperm($_G['forum']['postperm']) || $_G['forum']['allowpost']);
$_G['forum']['allowpostattach'] = isset($_G['forum']['allowpostattach']) ? $_G['forum']['allowpostattach'] : '';
$allowpostattach = $allowpostreply && ($_G['forum']['allowpostattach'] != -1 && ($_G['forum']['allowpostattach'] == 1 || !$_G['forum']['postattachperm'] && $_G['group']['allowpostattach'] || $_G['forum']['postattachperm'] && forumperm($_G['forum']['postattachperm'])));
if ($_G['group']['allowpost']) {
    $_G['group']['allowpostpoll'] = $_G['group']['allowpostpoll'] && $_G['forum']['allowpostspecial'] & 1;
    $_G['group']['allowposttrade'] = $_G['group']['allowposttrade'] && $_G['forum']['allowpostspecial'] & 2;
    $_G['group']['allowpostreward'] = $_G['group']['allowpostreward'] && $_G['forum']['allowpostspecial'] & 4 && isset($_G['setting']['extcredits'][$_G['setting']['creditstrans']]);
    $_G['group']['allowpostactivity'] = $_G['group']['allowpostactivity'] && $_G['forum']['allowpostspecial'] & 8;
    $_G['group']['allowpostdebate'] = $_G['group']['allowpostdebate'] && $_G['forum']['allowpostspecial'] & 16;
} else {
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:31,代码来源:forum_viewthread.php

示例2: wapmsg

            wapmsg('post_newthread_succeed', array('title' => 'post_newthread_forward', 'link' => "index.php?action=thread&amp;tid={$tid}"));
        }
    }
} elseif ($do == 'reply') {
    $discuz_action = 196;
    $thread = $db->fetch_first("SELECT * FROM {$tablepre}threads WHERE tid='{$tid}'");
    if (!$thread) {
        wapmsg('thread_nonexistence');
    }
    if (empty($forum['allowreply']) && (!$forum['replyperm'] && !$allowreply || $forum['replyperm'] && !forumperm($forum['replyperm']))) {
        wapmsg('post_newreply_nopermission');
    }
    if ($thread['closed'] && !$forum['ismoderator']) {
        wapmsg('post_thread_closed');
    }
    if ($post_autoclose = checkautoclose()) {
        wapmsg($post_autoclose);
    }
    if (empty($message)) {
        echo "<p>{$lang['message']}<input type=\"text\" name=\"message\" value=\"\" format=\"M*m\" /><br />\n" . "<anchor title=\"{$lang['submit']}\">{$lang['submit']}" . "<go method=\"post\" href=\"index.php?action=post&amp;do=reply&amp;fid={$fid}&amp;tid={$tid}&amp;sid={$sid}\">\n" . "<postfield name=\"subject\" value=\"\$(subject)\" />\n" . "<postfield name=\"message\" value=\"\$(message)\" />\n" . "<postfield name=\"formhash\" value=\"" . formhash() . "\" />\n" . "</go></anchor><br /><br />\n" . "<a href=\"index.php?action=thread&amp;tid={$tid}\">{$lang['return_thread']}</a><br />\n" . "<a href=\"index.php?action=forum&amp;fid={$fid}\">{$lang['return_forum']}</a></p>\n";
    } else {
        if ($message == '') {
            wapmsg('post_sm_isnull');
        }
        if ($post_invalid = checkpost()) {
            wapmsg($post_invalid);
        }
        if ($formhash != formhash()) {
            wapmsg('wap_submit_invalid');
        }
        if (checkflood()) {
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:post.inc.php

示例3: foreach

    foreach ($query as $options) {
        $viewvoteruid[] = $options['voterids'];
        $voterids .= "\t" . $options['voterids'];
        $option = preg_replace("/\\[url=(https?){1}:\\/\\/([^\\[\"']+?)\\](.+?)\\[\\/url\\]/i", "<a href=\"\\1://\\2\" target=\"_blank\">\\3</a>", $options['polloption']);
        $polloptions[$opts++] = array('polloptionid' => $options['polloptionid'], 'polloption' => $option, 'votes' => $options['votes'], 'width' => $options['votes'] > 0 ? @round($options['votes'] * 100 / $count['total']) . '%' : '8px', 'percent' => @sprintf("%01.2f", $options['votes'] * 100 / $count['total']), 'color' => $colors[$ci]);
        if ($ci < 2) {
            $polloptionpreview .= $option . "\t";
        }
        $ci++;
        if ($ci == count($colors)) {
            $ci = 0;
        }
    }
    $voterids = explode("\t", $voterids);
    $voters = array_unique($voterids);
    array_shift($voters);
    if (!$expiration) {
        $expirations = TIMESTAMP + 86400;
    } else {
        $expirations = $expiration;
        if ($expirations > TIMESTAMP) {
            $_G['forum_thread']['remaintime'] = remaintime($expirations - TIMESTAMP);
        }
    }
    $allwvoteusergroup = $_G['group']['allowvote'];
    $allowvotepolled = !in_array($_G['uid'] ? $_G['uid'] : $_G['clientip'], $voters);
    $allowvotethread = ($_G['forum_thread']['isgroup'] || !$_G['forum_thread']['closed'] && !checkautoclose($_G['forum_thread']) || $_G['group']['alloweditpoll']) && TIMESTAMP < $expirations && $expirations > 0;
    $_G['group']['allowvote'] = $allwvoteusergroup && $allowvotepolled && $allowvotethread;
    $optiontype = $multiple ? 'checkbox' : 'radio';
    $visiblepoll = $visible || $_G['forum']['ismoderator'] || $_G['uid'] && $_G['uid'] == $_G['forum_thread']['authorid'] || $expirations >= TIMESTAMP && in_array($_G['uid'] ? $_G['uid'] : $_G['clientip'], $voters) || $expirations < TIMESTAMP ? 0 : 1;
}
开发者ID:softhui,项目名称:discuz,代码行数:31,代码来源:thread_poll.php

示例4: showmessage

    showmessage('thread_nonexistence');
} elseif ($thread['price'] > 0 && $thread['special'] == 0 && !$_G['uid']) {
    showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
}
checklowerlimit('reply', 0, 1, $_G['forum']['fid']);
if ($_G['setting']['commentnumber'] && !empty($_GET['comment'])) {
    if (!submitcheck('commentsubmit', 0, $seccodecheck, $secqaacheck)) {
        showmessage('submitcheck_error', NULL);
    }
    $post = C::t('forum_post')->fetch('tid:' . $_G['tid'], $_GET['pid']);
    if (!$post) {
        showmessage('post_nonexistence', NULL);
    }
    if ($thread['closed'] && !$_G['forum']['ismoderator'] && !$thread['isgroup']) {
        showmessage('post_thread_closed');
    } elseif (!$thread['isgroup'] && ($post_autoclose = checkautoclose($thread))) {
        showmessage($post_autoclose, '', array('autoclose' => $_G['forum']['autoclose']));
    } elseif (checkflood()) {
        showmessage('post_flood_ctrl', '', array('floodctrl' => $_G['setting']['floodctrl']));
    } elseif (checkmaxperhour('pid')) {
        showmessage('post_flood_ctrl_posts_per_hour', '', array('posts_per_hour' => $_G['group']['maxpostsperhour']));
    }
    $commentscore = '';
    if (!empty($_GET['commentitem']) && !empty($_G['uid']) && $post['authorid'] != $_G['uid']) {
        foreach ($_GET['commentitem'] as $itemk => $itemv) {
            if ($itemv !== '') {
                $commentscore .= strip_tags(trim($itemk)) . ': <i>' . intval($itemv) . '</i> ';
            }
        }
    }
    $comment = cutstr(($commentscore ? $commentscore . '<br />' : '') . censor(trim(dhtmlspecialchars($_GET['message'])), '***'), 200, ' ');
开发者ID:lemonstory,项目名称:bbs,代码行数:31,代码来源:post_newreply.php

示例5: getattach

            $postlist[] = $post;
        }
    }
    if ($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) {
        $attachlist = getattach($pid);
        $attachs = $attachlist['attachs'];
        $imgattachs = $attachlist['imgattachs'];
        unset($attachlist);
    }
    getgpc('infloat') ? include template('forum/post_infloat') : (include template('forum/post'));
} else {
    if ($subject == '' && $message == '' && $thread['special'] != 2) {
        showmessage('post_sm_isnull');
    } elseif ($thread['closed'] && !$_G['forum']['ismoderator']) {
        showmessage('post_thread_closed');
    } elseif ($post_autoclose = checkautoclose($thread)) {
        showmessage($post_autoclose, '', array('autoclose' => $_G['forum']['autoclose']));
    } elseif ($post_invalid = checkpost($subject, $message, $special == 2 && $_G['group']['allowposttrade'])) {
        showmessage($post_invalid, '', array('minpostsize' => $_G['setting']['minpostsize'], 'maxpostsize' => $_G['setting']['maxpostsize']));
    } elseif (checkflood()) {
        showmessage('post_flood_ctrl', '', array('floodctrl' => $_G['setting']['floodctrl']));
    }
    if (!empty($_G['gp_trade']) && $thread['special'] == 2 && $_G['group']['allowposttrade']) {
        $item_price = floatval($_G['gp_item_price']);
        $item_credit = intval($_G['gp_item_credit']);
        if (!trim($_G['gp_item_name'])) {
            showmessage('trade_please_name');
        } elseif ($_G['group']['maxtradeprice'] && $item_price > 0 && ($_G['group']['mintradeprice'] > $item_price || $_G['group']['maxtradeprice'] < $item_price)) {
            showmessage('trade_price_between', '', array('mintradeprice' => $_G['group']['mintradeprice'], 'maxtradeprice' => $_G['group']['maxtradeprice']));
        } elseif ($_G['group']['maxtradeprice'] && $item_credit > 0 && ($_G['group']['mintradeprice'] > $item_credit || $_G['group']['maxtradeprice'] < $item_credit)) {
            showmessage('trade_credit_between', '', array('mintradeprice' => $_G['group']['mintradeprice'], 'maxtradeprice' => $_G['group']['maxtradeprice']));
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:31,代码来源:post_newreply.php

示例6: replyPost

 private function replyPost($extract)
 {
     global $_G;
     extract($extract);
     // 获取主题和帖子要插入的状态信息
     $topicStatus = ForumUtils::getPostSendStatus('topic', $_GET['platType']);
     $postStatus = ForumUtils::getPostSendStatus('post', $_GET['platType']);
     //$navtitle .= ' - '.$thread['subject'].' - '.$_G['forum']['name'];
     //copy from dz source/include/post/post_newreply.php
     require_once libfile('function/forumlist');
     $isfirstpost = 0;
     $showthreadsorts = 0;
     $quotemessage = '';
     if (!$_G['uid'] && !(!$_G['forum']['replyperm'] && $_G['group']['allowreply'] || $_G['forum']['replyperm'] && forumperm($_G['forum']['replyperm']))) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'replyperm_login_nopermission', array('{login}' => 1));
     } elseif (empty($_G['forum']['allowreply'])) {
         if (!$_G['forum']['replyperm'] && !$_G['group']['allowreply']) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'replyperm_none_nopermission', array('{login}' => 1));
         } elseif ($_G['forum']['replyperm'] && !forumperm($_G['forum']['replyperm'])) {
             $msg = mobcent_showmessagenoperm('replyperm', $_G['forum']['fid']);
             return WebUtils::makeErrorInfo_oldVersion($res, $msg['message'], $msg['params']);
         }
     } elseif ($_G['forum']['allowreply'] == -1) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_forum_newreply_nopermission');
     }
     if (!$_G['uid'] && ($_G['setting']['need_avatar'] || $_G['setting']['need_email'] || $_G['setting']['need_friendnum'])) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'replyperm_login_nopermission', array('{login}' => 1));
     }
     if (empty($thread)) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'thread_nonexistence');
     } elseif ($thread['price'] > 0 && $thread['special'] == 0 && !$_G['uid']) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'group_nopermission', array('{grouptitle}' => $_G['group']['grouptitle']));
     }
     checklowerlimit('reply', 0, 1, $_G['forum']['fid']);
     if ($_G['setting']['commentnumber'] && !empty($_GET['comment'])) {
         if (!submitcheck('commentsubmit', 0, $seccodecheck, $secqaacheck)) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'forum_passwd');
             showmessage('submitcheck_error', NULL);
         }
         $post = C::t('forum_post')->fetch('tid:' . $_G['tid'], $_GET['pid']);
         if (!$post) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'post_nonexistence');
         }
         if ($thread['closed'] && !$_G['forum']['ismoderator'] && !$thread['isgroup']) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'post_thread_closed');
         } elseif (!$thread['isgroup'] && ($post_autoclose = checkautoclose($thread))) {
             return WebUtils::makeErrorInfo_oldVersion($res, $post_autoclose, array('{autoclose}' => $_G['forum']['autoclose']));
         } elseif (checkflood()) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'post_flood_ctrl', array('{floodctrl}' => $_G['setting']['floodctrl']));
         } elseif (checkmaxperhour('pid')) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'post_flood_ctrl_posts_per_hour', array('posts_per_hour' => $_G['group']['maxpostsperhour']));
         }
         $commentscore = '';
         if (!empty($_GET['commentitem']) && !empty($_G['uid']) && $post['authorid'] != $_G['uid']) {
             foreach ($_GET['commentitem'] as $itemk => $itemv) {
                 if ($itemv !== '') {
                     $commentscore .= strip_tags(trim($itemk)) . ': <i>' . intval($itemv) . '</i> ';
                 }
             }
         }
         $comment = cutstr(($commentscore ? $commentscore . '<br />' : '') . censor(trim(dhtmlspecialchars($_GET['message'])), '***'), 200, ' ');
         if (!$comment) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'post_sm_isnull');
         }
         C::t('forum_postcomment')->insert(array('tid' => $post['tid'], 'pid' => $post['pid'], 'author' => $_G['username'], 'authorid' => $_G['uid'], 'dateline' => TIMESTAMP, 'comment' => $comment, 'score' => $commentscore ? 1 : 0, 'useip' => $_G['clientip']));
         C::t('forum_post')->update('tid:' . $_G['tid'], $_GET['pid'], array('comment' => 1));
         if (!empty($_G['uid'])) {
             Mobcent::import(MOBCENT_APP_ROOT . '/components/discuz/source/function/function_post.php');
             mobcent_updatepostcredits('+', $_G['uid'], 'reply', $_G['fid']);
         }
         if (!empty($_G['uid']) && $_G['uid'] != $post['authorid']) {
             notification_add($post['authorid'], 'pcomment', 'comment_add', array('tid' => $_G['tid'], 'pid' => $_GET['pid'], 'subject' => $thread['subject'], 'from_id' => $_G['tid'], 'from_idtype' => 'pcomment', 'commentmsg' => cutstr(str_replace(array('[b]', '[/b]', '[/color]'), '', preg_replace("/\\[color=([#\\w]+?)\\]/i", "", $comment)), 200)));
         }
         update_threadpartake($post['tid']);
         $pcid = C::t('forum_postcomment')->fetch_standpoint_by_pid($_GET['pid']);
         $pcid = $pcid['id'];
         if (!empty($_G['uid']) && $_GET['commentitem']) {
             $totalcomment = array();
             foreach (C::t('forum_postcomment')->fetch_all_by_pid_score($_GET['pid'], 1) as $comment) {
                 $comment['comment'] = addslashes($comment['comment']);
                 if (strexists($comment['comment'], '<br />')) {
                     if (preg_match_all("/([^:]+?):\\s<i>(\\d+)<\\/i>/", $comment['comment'], $a)) {
                         foreach ($a[1] as $k => $itemk) {
                             $totalcomment[trim($itemk)][] = $a[2][$k];
                         }
                     }
                 }
             }
             $totalv = '';
             foreach ($totalcomment as $itemk => $itemv) {
                 $totalv .= strip_tags(trim($itemk)) . ': <i>' . floatval(sprintf('%1.1f', array_sum($itemv) / count($itemv))) . '</i> ';
             }
             if ($pcid) {
                 C::t('forum_postcomment')->update($pcid, array('comment' => $totalv, 'dateline' => TIMESTAMP + 1));
             } else {
                 C::t('forum_postcomment')->insert(array('tid' => $post['tid'], 'pid' => $post['pid'], 'author' => '', 'authorid' => '-1', 'dateline' => TIMESTAMP + 1, 'comment' => $totalv));
             }
         }
         C::t('forum_postcache')->delete($post['pid']);
         return WebUtils::makeErrorInfo_oldVersion($res, 'comment_add_succeed');
//.........这里部分代码省略.........
开发者ID:caidongyun,项目名称:CS,代码行数:101,代码来源:TopicAdminAction.php

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

示例8: array

$secqaacheck = $secqaa['status'][2] && (!$secqaa['minposts'] || $posts < $secqaa['minposts']);
$postlist = $attachtags = $attachlist = array();
$aimgcount = 0;
$attachpids = -1;
if (empty($action) && $tid) {
    $thisgid = $forum['type'] == 'forum' ? $forum['fup'] : $_DCACHE['forums'][$forum['fup']]['fup'];
    $lastmod = $thread['moderated'] ? viewthread_lastmod() : array();
    $showsettings = str_pad(decbin($showsettings), 3, '0', STR_PAD_LEFT);
    $customshow = $discuz_uid ? str_pad(base_convert($customshow, 10, 3), 4, '0', STR_PAD_LEFT) : '2222';
    $disableddateconvert = $customshow[0];
    $showsignatures = $customshow[1] == 2 ? $showsettings[0] : $customshow[1];
    $showavatars = $customshow[2] == 2 ? $showsettings[1] : $customshow[2];
    $showimages = $customshow[3] == 2 ? $showsettings[2] : $customshow[3];
    $highlightstatus = isset($highlight) && str_replace('+', '', $highlight) ? 1 : 0;
    $usesigcheck = $discuz_uid && $sigstatus ? 1 : 0;
    $allowpostreply = $forum['allowreply'] != -1 && (!$thread['closed'] && !checkautoclose() || $forum['ismoderator']) && (!$forum['replyperm'] && $allowreply || $forum['replyperm'] && forumperm($forum['replyperm']) || $forum['allowreply']);
    $allowpost = $forum['allowpost'] != -1 && (!$forum['postperm'] && $allowpost || $forum['postperm'] && forumperm($forum['postperm']) || $forum['allowpost']);
    $addfeedcheck = $customaddfeed & 4 ? 1 : 0;
    if ($allowpost) {
        $allowpostpoll = $allowpostpoll && $forum['allowpostspecial'] & 1;
        $allowposttrade = $allowposttrade && $forum['allowpostspecial'] & 2;
        $allowpostreward = $allowpostreward && $forum['allowpostspecial'] & 4 && isset($extcredits[$creditstrans]);
        $allowpostactivity = $allowpostactivity && $forum['allowpostspecial'] & 8;
        $allowpostdebate = $allowpostdebate && $forum['allowpostspecial'] & 16;
        $allowpostvideo = $allowpostvideo && $forum['allowpostspecial'] & 32 && $videoopen;
    } else {
        $allowpostpoll = $allowposttrade = $allowpostreward = $allowpostactivity = $allowpostdebate = $allowpostvideo = FALSE;
    }
    $visitedforums = $visitedforums ? visitedforums() : '';
    $forummenu = '';
    if ($forumjump) {
开发者ID:BGCX067,项目名称:f2cont-svn-to-git,代码行数:31,代码来源:viewthread.php

示例9: rand

    $query = $sdb->query("SELECT polloptionid, votes, polloption, voterids FROM {$tablepre}polloptions WHERE tid='{$tid}' ORDER BY displayorder");
    $voterids = '';
    $bgcolor = rand(0, 9);
    while ($options = $sdb->fetch_array($query)) {
        if ($bgcolor > 9) {
            $bgcolor = 0;
        }
        $viewvoteruid[] = $options['voterids'];
        $voterids .= "\t" . $options['voterids'];
        $polloptions[] = array('polloptionid' => $options['polloptionid'], 'polloption' => preg_replace("/\\[url=(https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|ed2k|thunder|synacast){1}:\\/\\/([^\\[\"']+?)\\](.+?)\\[\\/url\\]/i", "<a href=\"\\1://\\2\" target=\"_blank\">\\3</a>", $options['polloption']), 'votes' => $options['votes'], 'width' => @round($options['votes'] * 300 / $count['max']) + 2, 'percent' => @sprintf("%01.2f", $options['votes'] * 100 / $count['total']), 'color' => $bgcolor);
        $bgcolor++;
    }
    $voterids = explode("\t", $voterids);
    $voters = array_unique($voterids);
    $voterscount = count($voters) - 1;
    array_shift($voters);
    if (!$expiration) {
        $expirations = $timestamp + 86400;
    } else {
        $expirations = $expiration;
        if ($expirations > $timestamp) {
            $thread['remaintime'] = remaintime($expirations - $timestamp);
        }
    }
    $allwvoteusergroup = $allowvote;
    $allowvotepolled = !in_array($discuz_uid ? $discuz_uid : $onlineip, $voters);
    $allowvotethread = (!$thread['closed'] && !checkautoclose() || $alloweditpoll) && $timestamp < $expirations && $expirations > 0;
    $allowvote = $allwvoteusergroup && $allowvotepolled && $allowvotethread;
    $optiontype = $multiple ? 'checkbox' : 'radio';
    $visiblepoll = $visible || $forum['ismoderator'] || $discuz_uid && $discuz_uid == $thread['authorid'] || $expirations >= $timestamp && in_array($discuz_uid ? $discuz_uid : $onlineip, $voters) || $expirations < $timestamp ? 0 : 1;
}
开发者ID:lilhorse,项目名称:cocoa,代码行数:31,代码来源:viewthread_poll.inc.php


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