📄 postnew.php
字号:
<?php
!function_exists('readover') && exit('Forbidden');
##主题分类
$t_typedb=array();
$t_per=0;$t_exits=0;
$t_db=$foruminfo['t_type'];
if($t_db){
$t_typedb=explode("\t",$t_db);
$t_typedb = array_unique ($t_typedb);
$t_per=$t_typedb[0];unset($t_typedb[0]);
}
/**
* 版块权限判断
*/
if($foruminfo['allowpost'] && strpos($foruminfo['allowpost'],','.$groupid.',')===false && !$admincheck){
Showmsg('postnew_forum_right');
}
/**
* 用户组权限判断
*/
if(!$foruminfo['allowpost'] && !$admincheck && $gp_allownewvote==0 && $action=='vote'){
Showmsg('postnew_group_vote');
}
if(!$foruminfo['allowpost'] && !$admincheck && $gp_allowpost==0){
Showmsg('postnew_group_right');
}
if (!$_POST['step']){
foreach($t_typedb as $value){
if($value) $t_exits=1;
}
require_once('./header.php');
$cateid=$foruminfo['fup'];
while($forum[$cateid]['type']!='category'){
$cateid=$forum[$cateid]['fup'];
}
$guidename=forumindex($foruminfo['fup']);
/*if($action=="vote"){
$guidename["发表新投票"]='';
} elseif($action=="new"){
$guidename["发表新文章"]='';
}*/
$msg_guide=headguide($guidename);
require_once PrintEot('post');footer();
}elseif($_POST['step']==2){
##主题分类
if(!$p_type || empty($t_typedb[$p_type]) || ($t_per==0 && !$admincheck)){
$w_type=0;
}else{
$w_type=$p_type;
}
list($atc_title,$atc_content)=check_data($action);
$attachs=array();
require_once(R_P.'require/postupload.php');
if($action=="vote"){
$vt_select=Char_cv($vt_select);
$vt_selarray=explode("\n",$vt_select);
foreach($vt_selarray as $voteoption){
$voteoption = trim($voteoption);
if($voteoption){
$votearray['options'][] = array($voteoption, 0,array());
}
}
if(count($vt_selarray) > $db_selcount){
Showmsg('vote_num_limit');
}
if($mostvotes && is_numeric($mostvotes)){
$mostvotes>count($vt_selarray)?$mostvotes=count($vt_selarray):'';
} else{
$mostvotes=count($vt_selarray);
}
$votearray['multiple'] = array($multiplevote,$mostvotes);
$voteopts = addslashes(serialize($votearray));
$db->update("INSERT INTO pw_polls(voteopts) VALUES ('$voteopts')");
$pollid=$db->insert_id();
} else{
$pollid=0;
}
if ($_POST['atc_convert']=="1"){
$_POST['atc_autourl'] && $atc_content=autourl($atc_content);
$atc_content = html_check($atc_content);
/*
* [post]、[hide、[sell=位置不能换
*/
if(!$foruminfo['allowhide'] || !$gp_allowhidden){
$atc_content=str_replace("[post]","[\tpost]",$atc_content);
} elseif($atc_hide=='1'){
$atc_content="[post]".$atc_content."[/post]";
}
if(!$foruminfo['allowencode'] || !$gp_allowencode){
$atc_content=str_replace("[hide=","[\thide=",$atc_content);
} elseif($atc_requirervrc=='1' ){
$atc_content="[hide=".$atc_rvrc."]".$atc_content."[/hide]";
}
if(!$foruminfo['allowsell'] || !$gp_allowsell){
$atc_content=str_replace("[sell=","[\tsell=",$atc_content);
} elseif($atc_requiresell=='1'){
$atc_content="[sell=".$atc_money."]".$atc_content."[/sell]";
}
if(!$SYSTEM['typeadmin']){
$topped=$digest=0;
}
/**
* 主要因为convert函数需要$tpc_author变量
*/
$tpc_author=$windid;
$lxcontent=convert($atc_content,$db_windpost);
$ifconvert=$lxcontent==$atc_content ? 1:2;
}else{
$ifconvert=1;
}
$ifcheck=($foruminfo['f_check']==1||$foruminfo['f_check']==3) && !$SYSTEM['atccheck'] && !$admincheck ? 0 : 1;
$db->update("INSERT INTO pw_threads (fid,icon,author,authorid,subject,ifcheck,type,postdate,lastpost,lastposter,hits,replies,topped,digest,pollid,ifupload) VALUES ('$fid','$atc_iconid','".addslashes($windid)."','$winddb[uid]','$atc_title','$ifcheck','$w_type','$timestamp','$timestamp','".addslashes($windid)."','1','0','$topped','$digest','$pollid','$ifupload')");
$tid = $db->insert_id();
$db->update("INSERT INTO pw_tmsgs (tid,aid,userip,ifsign,buy,ipfrom,ifconvert,content) VALUES('$tid','$attachs','$onlineip','$atc_usesign', '', '$ipfrom', '$ifconvert','$atc_content')");
if($foruminfo['cms']){
include_once(R_P.'require/c_search.php');
insert_key($tid,$keyword);
}
$top_post=1;
$t_date=$timestamp;//主题发表时间 bbspostguide 中用到
bbspostguide();
if($ifcheck==1){
unset($j_p);
if($foruminfo['allowhtm']){
include_once R_P.'require/template.php';
}
lastinfo($fid,$foruminfo['allowhtm'],'new',$foruminfo['cms'].'B');
empty($j_p) && $j_p="read.php?tid=$tid";
$foruminfo['cms'] && $j_p="read.php?tid=$tid&toread=1";
refreshto($j_p,'enter_thread');
} else{
refreshto("thread.php?fid=$fid",'post_check');
}
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -