Ejemplo n.º 1
0
}
$postcredits = $forum['postcredits'] ? $forum['postcredits'] : $creditspolicy['post'];
$replycredits = $forum['replycredits'] ? $forum['replycredits'] : $creditspolicy['reply'];
$modnewthreads = (!$allowdirectpost || $allowdirectpost == 1) && ($forum['modnewposts'] || !empty($censormod)) ? 1 : 0;
$modnewreplies = (!$allowdirectpost || $allowdirectpost == 2) && ($forum['modnewposts'] == 2 || !empty($censormod)) ? 1 : 0;
$subject = wapconvert($subject);
$subject = $subject != '' ? dhtmlspecialchars(censor(trim($subject))) : '';
$message = wapconvert($message);
$message = $message != '' ? censor(trim($message)) : '';
if ($do == 'newthread') {
    $discuz_action = 195;
    if (empty($forum['allowpost']) && (!$forum['postperm'] && !$allowpost || $forum['postperm'] && !forumperm($forum['postperm']))) {
        wapmsg('post_newthread_nopermission');
    }
    if (empty($subject) || empty($message)) {
        $typeselect = isset($forum['threadtypes']['required']) ? typeselect() : '';
        echo "<p>" . ($typeselect ? "{$lang['type']}{$typeselect}<br />\n" : '') . "{$lang['subject']}<input type=\"text\" name=\"subject\" value=\"\" maxlength=\"80\" format=\"M*m\" /><br />\n" . "{$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=newthread&amp;fid={$fid}&amp;sid={$sid}\">\n" . "<postfield name=\"subject\" value=\"\$(subject)\" />\n" . "<postfield name=\"message\" value=\"\$(message)\" />\n" . "<postfield name=\"formhash\" value=\"" . formhash() . "\" />\n" . ($typeselect ? "<postfield name=\"typeid\" value=\"\$(typeid)\" />\n" : '') . "</go></anchor>\n<br /><br />" . "<a href=\"index.php?action=forum&amp;fid={$fid}\">{$lang['return_forum']}</a></p>\n";
    } else {
        if ($post_invalid = checkpost()) {
            wapmsg($post_invalid);
        }
        if ($formhash != formhash()) {
            wapmsg('wap_submit_invalid');
        }
        if (checkflood()) {
            wapmsg('post_flood_ctrl');
        }
        $typeid = isset($forum['threadtypes']['types'][$typeid]) ? $typeid : 0;
        if (empty($typeid) && !empty($forum['threadtypes']['required'])) {
            wapmsg('post_type_isnull');
        }
Ejemplo n.º 2
0
    $thread['lastpost'] = gmdate("{$dateformat} {$timeformat}", $thread['lastpost'] + $timeoffset * 3600);
    if (in_array($thread['displayorder'], array(1, 2, 3))) {
        $thread['id'] = 'stickthread_' . $thread['tid'];
        $separatepos++;
    } elseif (in_array($thread['displayorder'], array(4, 5))) {
        $thread['id'] = 'floatthread_' . $thread['tid'];
    } else {
        $thread['id'] = 'normalthread_' . $thread['tid'];
    }
    $iscircle && $thread['sgid'] && ($sgids[] = $thread['sgid']);
    $threadlist[] = $thread;
}
$separatepos = $separatepos ? $separatepos + 1 : ($announcement ? 1 : 0);
$visitedforums = $visitedforums ? visitedforums() : '';
$forumselect = $forummenu = '';
$typeselect = typeselect($typeid, '', 'onchange="if(this.options[this.selectedIndex].className) {this.form.action=this.form.action + \'&previewpost=yes&showpreview=no\';this.form.submit();}"');
$usesigcheck = $discuz_uid && $sigstatus ? 'checked="checked"' : '';
$allowpost = !$forum['postperm'] && $allowpost || $forum['postperm'] && forumperm($forum['postperm']) || !empty($forum['allowpost']);
$showpoll = $showtrade = $showreward = $showactivity = $showdebate = $showvideo = 0;
if ($forum['allowpostspecial']) {
    $showpoll = $forum['allowpostspecial'] & 1;
    $showtrade = $forum['allowpostspecial'] & 2;
    $showreward = isset($extcredits[$creditstrans]) && $forum['allowpostspecial'] & 4;
    $showactivity = $forum['allowpostspecial'] & 8;
    $showdebate = $forum['allowpostspecial'] & 16;
    $showvideo = $forum['allowpostspecial'] & 32 && $videoopen;
}
if ($allowpost) {
    $allowpostpoll = $allowpostpoll && $showpoll;
    $allowposttrade = $allowposttrade && $showtrade;
    $allowpostreward = $allowpostreward && $showreward;
Ejemplo n.º 3
0
 $stickcheck = $closecheck = $digestcheck = array('', '', '', '', '');
 $expirationdigest = $expirationhighlight = $expirationclose = '';
 if ($_G['gp_optgroup'] == 1 && $single) {
     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"');
     $string = sprintf('%02d', $threadlist[$_G['tid']]['highlight']);
     $stylestr = sprintf('%03b', $string[0]);
     for ($i = 1; $i <= 3; $i++) {
         $stylecheck[$i] = $stylestr[$i - 1] ? 1 : 0;
     }
     $colorcheck = $string[1];
     $_G['forum']['modrecommend'] = is_array($_G['forum']['modrecommend']) ? $_G['forum']['modrecommend'] : array();
 } elseif ($_G['gp_optgroup'] == 2 || $_G['gp_optgroup'] == 5) {
     require_once libfile('function/forumlist');
     $forumselect = forumselect(FALSE, 0, $threadlist[$_G['tid']]['fid']);
     $typeselect = typeselect($single ? $threadlist[$_G['tid']]['typeid'] : 0);
 } elseif ($_G['gp_optgroup'] == 4 && $single) {
     empty($threadlist[$_G['tid']]['closed']) ? $closecheck[0] = 'checked="checked"' : ($closecheck[1] = 'checked="checked"');
 }
 $imgattach = array();
 if (count($threadlist) == 1 && $operation == 'recommend') {
     $query = DB::query("SELECT * FROM " . DB::table(getattachtablebytid($_G['tid'])) . " WHERE tid='{$_G['tid']}' AND isimage IN ('1', '-1')");
     while ($row = DB::fetch($query)) {
         $imgattach[] = $row;
     }
     $query = DB::query("SELECT * FROM " . DB::table('forum_forumrecommend') . " WHERE tid='{$_G['tid']}'");
     if ($oldthread = DB::fetch($query)) {
         $threadlist[$_G['tid']]['subject'] = $oldthread['subject'];
         $selectposition[$oldthread['position']] = ' selected="selected"';
         $selectattach = $oldthread['aid'];
     } else {
Ejemplo n.º 4
0
    $from = in_array($from, array('direct', 'iframe')) ? $from : '';
    if ($data = @implode('', file("http://search.qihoo.com/sint/content.html?surl={$url}&md5={$md5}&ocs={$charset}&ics={$charset}&from={$from}"))) {
        preg_match_all("/(\\w+):([^\\>]+)/i", $data, $data);
        if (!$data[2][1]) {
            $subject = trim($data[2][3]);
            $message = !$editormode ? str_replace('[br]', "\n", trim($data[2][4])) : str_replace('[br]', '<br />', trim($data[2][4]));
        } else {
            showmessage('reprint_invalid');
        }
    }
}
checklowerlimit($postcredits);
if (!submitcheck('topicsubmit', 0, $seccodecheck, $secqaacheck)) {
    $special = !$allowspecialonly ? intval($special) : 'only';
    $modelid = $modelid ? intval($modelid) : '';
    $typeselect = typeselect($selecttypeid, $special, '', $modelid);
    $icons = '';
    if (!$special && is_array($_DCACHE['icons'])) {
        $key = 1;
        foreach ($_DCACHE['icons'] as $id => $icon) {
            $icons .= ' <input class="radio" type="radio" name="iconid" value="' . $id . '" /><img src="images/icons/' . $icon . '" alt="" />';
            $icons .= !(++$key % 10) ? '<br />' : '';
        }
    }
    if ($special == 2 && $allowposttrade) {
        $expiration_7days = date('Y-m-d', $timestamp + 86400 * 7);
        $expiration_14days = date('Y-m-d', $timestamp + 86400 * 14);
        $trade['expiration'] = $expiration_month = date('Y-m-d', mktime(0, 0, 0, date('m') + 1, date('d'), date('Y')));
        $expiration_3months = date('Y-m-d', mktime(0, 0, 0, date('m') + 3, date('d'), date('Y')));
        $expiration_halfyear = date('Y-m-d', mktime(0, 0, 0, date('m') + 6, date('d'), date('Y')));
        $expiration_year = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 1));
Ejemplo n.º 5
0
 if ($operation == 'move') {
     require_once DISCUZ_ROOT . './include/forum.func.php';
     $forumselect = forumselect();
 } elseif ($operation == 'highlight') {
     $stylecheck = array();
     $colorcheck = array(0 => 'checked="checked"');
     if ($single) {
         $string = sprintf('%02d', $threadlist[$tid]['highlight']);
         $stylestr = sprintf('%03b', $string[0]);
         for ($i = 1; $i <= 3; $i++) {
             $stylecheck[$i] = $stylestr[$i - 1] ? 'checked="checked"' : '';
         }
         $colorcheck = array($string[1] => 'checked="checked"');
     }
 } elseif ($operation == 'type') {
     $typeselect = typeselect('', 1);
 }
 if (in_array($operation, array('stick', 'digest', 'highlight', 'close', 'supe_push', 'recommend'))) {
     $expirationmin = gmdate($dateformat, $timestamp + 86400 + $timeoffset * 3600);
     $expirationmax = gmdate($dateformat, $timestamp + 86400 * 180 + $timeoffset * 3600);
     $expirationdefault = '';
     $stickcheck = $digestcheck = $closecheck = $supe_pushstatus = array();
     if ($single) {
         empty($threadlist[$tid]['displayorder']) ? $stickcheck[1] = 'checked="checked"' : ($stickcheck[$threadlist[$tid]['displayorder']] = 'checked="checked"');
         empty($threadlist[$tid]['digest']) ? $digestcheck[1] = 'checked="checked"' : ($digestcheck[$threadlist[$tid]['digest']] = 'checked="checked"');
         empty($threadlist[$tid]['supe_pushstatus']) ? $supe_pushstatus[2] = 'checked="checked"' : ($supe_pushstatus[$threadlist[$tid]['supe_pushstatus']] = 'checked="checked"');
         empty($threadlist[$tid]['closed']) ? $closecheck[0] = 'checked="checked"' : ($closecheck[1] = 'checked="checked"');
         if ($threadlist[$tid]['moderated']) {
             switch ($operation) {
                 case 'stick':
                     $actionarray = array('EST');
Ejemplo n.º 6
0
    $threadtags = dhtmlspecialchars(implode(' ', $threadtagary));
}
if ($special == 5) {
    $debate = array_merge($thread, daddslashes($db->fetch_first("SELECT * FROM {$tablepre}debates WHERE tid='{$tid}'"), 1));
    $firststand = $db->result_first("SELECT stand FROM {$tablepre}debateposts WHERE tid='{$tid}' AND uid='{$discuz_uid}' AND stand<>'0' ORDER BY dateline LIMIT 1");
    if (!$isfirstpost && $debate['endtime'] && $debate['endtime'] < $timestamp && !$forum['ismoderator']) {
        showmessage('debate_end');
    }
    if ($isfirstpost && $debate['umpirepoint'] && !$forum['ismoderator']) {
        showmessage('debate_umpire_comment_invalid');
    }
}
if (!submitcheck('editsubmit')) {
    include_once language('misc');
    $typespecial = $forum['threadtypes']['special'][$thread['typeid']] ? 'disabled' : 1;
    $typeselect = typeselect($thread['typeid'], $typespecial);
    if ($iscircle) {
        $mycircles = array();
        if ($discuz_uid) {
            supe_dbconnect();
            $query = $supe['db']->query("SELECT gid, groupname FROM {$supe[tablepre]}groupuid WHERE uid='{$discuz_uid}' AND flag>0", 'SILENT');
            while ($mycircle = $supe['db']->fetch_array($query)) {
                $mycircles[$mycircle['gid']] = $mycircle['groupname'];
            }
        }
        if ($sgid = $thread['sgid']) {
            supe_dbconnect();
            $query = $supe['db']->query("SELECT g.groupname, gf.headerimage, gf.css FROM {$supe[tablepre]}groups g, {$supe[tablepre]}groupfields gf WHERE g.gid='{$sgid}' AND g.flag=1 AND g.gid=gf.gid", 'SILENT');
            $circle = $supe['db']->fetch_array($query);
        }
    }