Example #1
0
            if ($_G['setting']['bannedmessages']) {
                $post['groupid'] = $users[$post['authorid']]['groupid'];
            }
            $postlist[$k] = $post;
        }
    }
    unset($uids, $users);
    if ($_G['group']['allowpostattach'] || $_G['group']['allowpostimage']) {
        $attachlist = getattach(0);
        $attachs = $attachlist['attachs'];
        $imgattachs = $attachlist['imgattachs'];
        unset($attachlist);
    }
    getgpc('infloat') ? include template('forum/post_infloat') : (include template('forum/post'));
} else {
    $modpost = C::m('forum_post', $_G['tid']);
    $bfmethods = $afmethods = array();
    $params = array('subject' => $subject, 'message' => $message, 'special' => $special, 'extramessage' => $extramessage, 'bbcodeoff' => $_GET['bbcodeoff'], 'smileyoff' => $_GET['smileyoff'], 'htmlon' => $_GET['htmlon'], 'parseurloff' => $_GET['parseurloff'], 'usesig' => $_GET['usesig'], 'isanonymous' => $_GET['isanonymous'], 'noticetrimstr' => $_GET['noticetrimstr'], 'noticeauthor' => $_GET['noticeauthor'], 'from' => $_GET['from'], 'sechash' => $_GET['sechash'], 'geoloc' => diconv($_GET['geoloc'], 'UTF-8'));
    if (!empty($_GET['trade']) && $thread['special'] == 2 && $_G['group']['allowposttrade']) {
        $bfmethods[] = array('class' => 'extend_thread_trade', 'method' => 'before_newreply');
    }
    $attentionon = empty($_GET['attention_add']) ? 0 : 1;
    $attentionoff = empty($attention_remove) ? 0 : 1;
    $bfmethods[] = array('class' => 'extend_thread_rushreply', 'method' => 'before_newreply');
    if ($_G['group']['allowat']) {
        $bfmethods[] = array('class' => 'extend_thread_allowat', 'method' => 'before_newreply');
    }
    $bfmethods[] = array('class' => 'extend_thread_comment', 'method' => 'before_newreply');
    $modpost->attach_before_method('newreply', array('class' => 'extend_thread_filter', 'method' => 'before_newreply'));
    if ($_G['group']['allowat']) {
        $afmethods[] = array('class' => 'extend_thread_allowat', 'method' => 'after_newreply');
Example #2
0
     if (!$article['allowcomment']) {
         showmessage('no_privilege_commentadd', '', array(), array('return' => true));
     }
     if ($article['idtype'] == 'blogid') {
         $currentid = $article['id'];
         $currenttype = 'blogid';
     } elseif ($article['idtype'] == 'tid') {
         $currentid = $article['id'];
         $currenttype = 'thread';
     }
 }
 if ($currenttype == 'thread') {
     if ($commentcable[$type] == 'article') {
         $_POST['portal_referer'] = $article_url ? $article_url : 'portal.php?mod=view&aid=' . $id;
     }
     $modpost = C::m('forum_post', $currentid);
     $params = array('subject' => '', 'message' => $_POST['general']);
     $modpost->newreply($params);
     if ($_POST['portal_referer']) {
         $redirecturl = $_POST['portal_referer'];
     } else {
         if ($modnewreplies) {
             $redirecturl = "forum.php?mod=viewthread&tid=" . $currentid;
         } else {
             $redirecturl = "forum.php?mod=viewthread&tid=" . $currentid . "&pid=" . $modpost->pid . "&page=" . $modpost->param('page') . "&extra=" . $extra . "#pid" . $modpost->pid;
         }
     }
     $showmessagecontent = $modnewreplies && $commentcable[$type] != 'article' ? 'do_success_thread_share_mod' : '';
 } elseif ($currenttype == 'article') {
     if (!checkperm('allowcommentarticle')) {
         showmessage('group_nopermission', NULL, array('grouptitle' => $_G['group']['grouptitle']), array('login' => 1));
Example #3
0
    getgpc('infloat') ? include template('forum/post_infloat') : (include template('forum/post'));
} else {
    if ($_GET['mygroupid']) {
        $mygroupid = explode('__', $_GET['mygroupid']);
        $mygid = intval($mygroupid[0]);
        if ($mygid) {
            $mygname = $mygroupid[1];
            if (count($mygroupid) > 2) {
                unset($mygroupid[0]);
                $mygname = implode('__', $mygroupid);
            }
            $message .= '[groupid=' . intval($mygid) . ']' . $mygname . '[/groupid]';
            C::t('forum_forum')->update_commoncredits(intval($mygroupid[0]));
        }
    }
    $modthread = C::m('forum_thread');
    $bfmethods = $afmethods = array();
    $params = array('subject' => $subject, 'message' => $message, 'typeid' => $typeid, 'sortid' => $sortid, 'special' => $special);
    $_GET['save'] = $_G['uid'] ? $_GET['save'] : 0;
    if ($_G['group']['allowsetpublishdate'] && $_GET['cronpublish'] && $_GET['cronpublishdate']) {
        $publishdate = strtotime($_GET['cronpublishdate']);
        if ($publishdate > $_G['timestamp']) {
            $_GET['save'] = 1;
        } else {
            $publishdate = $_G['timestamp'];
        }
    } else {
        $publishdate = $_G['timestamp'];
    }
    $params['publishdate'] = $publishdate;
    $params['save'] = $_GET['save'];
    $imgattachs['unused'] = !$sortid ? $imgattachs['unused'] : '';
    include template('forum/post');
} else {
    if ($_GET['mygroupid']) {
        $mygroupid = explode('__', $_GET['mygroupid']);
        $mygid = intval($mygroupid[0]);
        if ($mygid) {
            $mygname = $mygroupid[1];
            if (count($mygroupid) > 2) {
                unset($mygroupid[0]);
                $mygname = implode('__', $mygroupid);
            }
            $message .= '[groupid=' . intval($mygid) . ']' . $mygname . '[/groupid]';
        }
    }
    $modpost = C::m('forum_post', $_G['tid'], $pid);
    $modpost->param('redirecturl', "forum.php?mod=viewthread&tid={$_G['tid']}&page={$_GET['page']}&extra={$extra}" . ($vid && $isfirstpost ? "&vid={$vid}" : '') . "#pid{$pid}");
    if (empty($_GET['delete'])) {
        if ($isfirstpost) {
            if ($thread['special'] == 1 && ($_G['group']['alloweditpoll'] || $isorigauthor) && !empty($_GET['polls'])) {
            } elseif ($thread['special'] == 3 && $isorigauthor) {
            } elseif ($thread['special'] == 4 && $_G['group']['allowpostactivity']) {
            } elseif ($thread['special'] == 5 && $_G['group']['allowpostdebate']) {
            } elseif ($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')) {
                    $threadpluginclass->editpost_submit($_G['fid'], $_G['tid']);
                }
            }
        } else {