Ejemplo n.º 1
0
}
define('NOROBOT', TRUE);
cknewuser();
require_once libfile('class/credit');
require_once libfile('function/post');
$pid = intval(getgpc('pid'));
$sortid = intval(getgpc('sortid'));
$typeid = intval(getgpc('typeid'));
$special = intval(getgpc('special'));
$_G['gp_from'] = !empty($_G['gp_from']) && in_array($_G['gp_from'], array('home', 'portal')) ? $_G['gp_from'] : '';
$postinfo = array('subject' => '');
$thread = array('readperm' => '', 'pricedisplay' => '', 'hiddenreplies' => '');
$_G['forum_dtype'] = $_G['forum_checkoption'] = $_G['forum_optionlist'] = $tagarray = $_G['forum_typetemplate'] = array();
if ($sortid) {
    require_once libfile('function/threadsort');
    threadsort_checkoption($sortid);
}
if ($_G['forum']['status'] == 3) {
    require_once libfile('function/group');
    $status = groupperm($_G['forum'], $_G['uid'], 'post');
    if ($status == -1) {
        showmessage('forum_not_group', 'index.php');
    } elseif ($status == 1) {
        showmessage('forum_group_status_off');
    } elseif ($status == 2) {
        showmessage('forum_group_noallowed', "forum.php?mod=group&fid={$_G['fid']}");
    } elseif ($status == 3) {
        showmessage('forum_group_moderated', "forum.php?mod=group&fid={$_G['fid']}");
    } elseif ($status == 4) {
        showmessage('forum_group_not_groupmember', "forum.php?mod=forumdisplay&fid={$_G['fid']}");
    }
Ejemplo n.º 2
0
         if ($attachfileadd) {
             $db->query("UPDATE {$tablepre}attachments SET {$attachfileadd} WHERE aid='{$attach['aid']}'");
         }
     }
 }
 $allowpostattach && ($attachnew || $attachdel || $special == 2 && $tradeaid || $isfirstpost && $sortid) && updateattach();
 if ($uattachment || $attachdel) {
     $tattachment = $db->result_first("SELECT count(*) FROM {$tablepre}posts p, {$tablepre}attachments a WHERE a.tid='{$tid}' AND a.isimage IN ('1', '-1') AND a.pid=p.pid AND p.invisible='0' LIMIT 1") ? 2 : ($db->result_first("SELECT count(*) FROM {$tablepre}posts p, {$tablepre}attachments a WHERE a.tid='{$tid}' AND a.pid=p.pid AND p.invisible='0' LIMIT 1") ? 1 : 0);
     $db->query("UPDATE {$tablepre}threads SET attachment='{$tattachment}' WHERE tid='{$tid}'");
 }
 if ($special == 2 && $allowposttrade) {
     $oldtypeid = $db->result_first("SELECT typeid FROM {$tablepre}trades WHERE pid='{$pid}'");
     $oldtypeid = isset($tradetypes[$oldtypeid]) ? $oldtypeid : 0;
     $tradetypeid = !$tradetypeid ? $oldtypeid : $tradetypeid;
     $optiondata = array();
     threadsort_checkoption($oldtypeid, 1);
     $optiondata = array();
     if ($tradetypes && $typeoption && is_array($typeoption) && $checkoption) {
         $optiondata = threadsort_validator($typeoption);
     }
     if ($tradetypes && $optiondata && is_array($optiondata)) {
         foreach ($optiondata as $optionid => $value) {
             if ($oldtypeid) {
                 $db->query("UPDATE {$tablepre}tradeoptionvars SET value='{$value}' WHERE pid='{$pid}' AND optionid='{$optionid}'");
             } else {
                 $db->query("INSERT INTO {$tablepre}tradeoptionvars (sortid, pid, optionid, value)\r\n\t\t\t\t\t\t\tVALUES ('{$tradetypeid}', '{$pid}', '{$optionid}', '{$value}')");
             }
         }
     }
     if (!$oldtypeid) {
         $db->query("UPDATE {$tablepre}trades SET typeid='{$tradetypeid}' WHERE pid='{$pid}'");
Ejemplo n.º 3
0
<?php

/*
	[Discuz!] (C)2001-2009 Comsenz Inc.
	This is NOT a freeware, use is subject to license terms

	$Id: post.php 17458 2008-12-23 12:06:32Z monkey $
*/
define('CURSCRIPT', 'post');
define('NOROBOT', TRUE);
require_once './include/common.inc.php';
require_once DISCUZ_ROOT . './include/post.func.php';
$_DTYPE = $checkoption = $optionlist = array();
if ($sortid) {
    threadsort_checkoption();
}
if (empty($action)) {
    showmessage('undefined_action', NULL, 'HALTED');
} elseif ($action == 'threadsorts') {
    threadsort_optiondata();
    $template = intval($operate) ? 'search_sortoption' : 'post_sortoption';
    include template($template);
    exit;
} elseif ($forum['simple'] & 1 || $forum['redirect']) {
    showmessage('forum_disablepost');
}
require_once DISCUZ_ROOT . './include/discuzcode.func.php';
$customaddfeed = $customaddfeed ? $customaddfeed : $uchome['addfeed'];
if ($action == 'reply') {
    $addfeedcheck = $customaddfeed & 4 ? 'checked="checked"' : '';
} elseif (!empty($special) && $action != 'reply') {
Ejemplo n.º 4
0
     if (!trim($item_name)) {
         showmessage('trade_please_name');
     } elseif ($maxtradeprice && $item_price > 0 && ($mintradeprice > $item_price || $maxtradeprice < $item_price)) {
         showmessage('trade_price_between');
     } elseif ($maxtradeprice && $item_credit > 0 && ($mintradeprice > $item_credit || $maxtradeprice < $item_credit)) {
         showmessage('trade_credit_between');
     } elseif (!$maxtradeprice && $item_price > 0 && $mintradeprice > $item_price) {
         showmessage('trade_price_more_than');
     } elseif (!$maxtradeprice && $item_credit > 0 && $mintradeprice > $item_credit) {
         showmessage('trade_credit_more_than');
     } elseif ($item_price <= 0 && $item_credit <= 0) {
         showmessage('trade_pricecredit_need');
     } elseif ($item_number < 1) {
         showmessage('tread_please_number');
     }
     threadsort_checkoption(1, 1);
     $optiondata = array();
     if ($tradetypes && $typeoption && $checkoption) {
         $optiondata = threadsort_validator($typeoption);
     }
 }
 $attentionon = empty($attention_add) ? 0 : 1;
 $attentionoff = empty($attention_remove) ? 0 : 1;
 if ($thread['lastposter'] != $discuz_userss) {
     $userreplies = $db->result_first("SELECT COUNT(*) FROM {$tablepre}posts WHERE tid='{$tid}' AND first='0' AND authorid='{$discuz_uid}'");
     $thread['heats'] += round($heatthread['reply'] * pow(0.8, $userreplies));
     $heatbefore = $thread['heats'];
     $db->query("UPDATE {$tablepre}threads SET heats='{$thread['heats']}' WHERE tid='{$tid}'", 'UNBUFFERED');
 }
 $bbcodeoff = checkbbcodes($message, !empty($bbcodeoff));
 $smileyoff = checksmilies($message, !empty($smileyoff));