Files
2025-06-27 21:04:18 +08:00

397 lines
19 KiB
PHP

<?php echo 'Discuz!应用中心开发者-简约设计';exit;?>
<!--{template common/header}-->
<!--{eval $adveditor = $isfirstpost && $special || $special == 2 && ($_GET['action'] == 'newthread' || $_GET['action'] == 'reply' && !empty($_GET['addtrade']) || $_GET['action'] == 'edit' && $thread['special'] == 2);}-->
<form method="post" id="postform"
{if $_GET[action] == 'newthread'}action="forum.php?mod=post&action={if $special != 2}newthread{else}newtrade{/if}&fid=$_G[fid]&extra=$extra&topicsubmit=yes&mobile=2"
{elseif $_GET[action] == 'reply'}action="forum.php?mod=post&action=reply&fid=$_G[fid]&tid=$_G[tid]&extra=$extra&replysubmit=yes&mobile=2"
{elseif $_GET[action] == 'edit'}action="forum.php?mod=post&action=edit&extra=$extra&editsubmit=yes&mobile=2" $enctype
{/if}>
<input type="hidden" name="formhash" id="formhash" value="{FORMHASH}" />
<input type="hidden" name="posttime" id="posttime" value="{TIMESTAMP}" />
<!--{if !empty($_GET['modthreadkey'])}-->
<input type="hidden" name="modthreadkey" id="modthreadkey" value="$_GET['modthreadkey']" />
<!--{/if}-->
<!--{if $_GET[action] == 'reply'}-->
<input type="hidden" name="noticeauthor" value="$noticeauthor" />
<input type="hidden" name="noticetrimstr" value="$noticetrimstr" />
<input type="hidden" name="noticeauthormsg" value="$noticeauthormsg" />
<!--{if $reppid}-->
<input type="hidden" name="reppid" value="$reppid" />
<!--{/if}-->
<!--{if $_GET[reppost]}-->
<input type="hidden" name="reppost" value="$_GET[reppost]" />
<!--{elseif $_GET[repquote]}-->
<input type="hidden" name="reppost" value="$_GET[repquote]" />
<!--{/if}-->
<!--{/if}-->
<!--{if $_GET[action] == 'edit'}-->
<input type="hidden" name="fid" id="fid" value="$_G[fid]" />
<input type="hidden" name="tid" value="$_G[tid]" />
<input type="hidden" name="pid" value="$pid" />
<input type="hidden" name="page" value="$_GET[page]" />
<!--{/if}-->
<!--{if $sortid}-->
<input type="hidden" name="sortid" value="$sortid" />
<!--{/if}-->
<!--{if $special}-->
<input type="hidden" name="special" value="$special" />
<!--{/if}-->
<!--{if $specialextra}-->
<input type="hidden" name="specialextra" value="$specialextra" />
<!--{/if}-->
<!-- header start -->
<header class="header_xin">
<div class="hdc_xin cl" id="byg_header">
<h2 class="header_z cl">
<a href="javascript:;" class="shouye">
<img src="<!--{avatar($_G['uid'], 'middle', true)}-->" alt="头像"/>
<!--{if $_G[member][newpm] || $post_notice_new}-->
<img src="{$_G['style']['styleimgdir']}/new_pm.png" alt="提醒" class="new_pm"/>
<!--{/if}-->
</a>
<i class="header_z_nav"><div class="swiper-wrapper">$navigation<em>&rsaquo;</em><span><!--{if $_GET[action] == 'edit'}-->{lang edit}<!--{else}-->{lang send_threads}<!--{/if}--></span></div></i>
<style type="text/css">
.header_z .header_z_nav{ width: 2.87rem;}
.header_z_nav a, .header_z_nav em, .header_z_nav span{ width: auto;}
</style>
<link rel="stylesheet" href="{$_G['style']['styleimgdir']}/swiper.min.css" type="text/css">
<script type="text/javascript" src="{$_G['style']['styleimgdir']}/swiper.jquery.min.js"></script>
<script type="text/javascript">
jQuery(".header_z_nav a, .header_z_nav em, .header_z_nav span").addClass("swiper-slide");
var header_z_nav = new Swiper('.header_z_nav', {
slidesPerView : 'auto',
freeMode : true,
});
</script>
</h2>
<a href="javascript:history.back();" title="返回上一页" class="header_y">
<img src="{$_G['style']['styleimgdir']}/houtui.png" alt="返回"/></a>
</div>
</header>
<!--{hook/global_header_mobile}-->
<!-- header end -->
<!-- main postbox start -->
<div class="wp">
<!--{if $_GET[action] == 'newthread'}-->
<div class="newthread_type_tab">
<div class="swiper-wrapper">
<!--{if !$_G['forum']['threadsorts']['required'] && !$_G['forum']['allowspecialonly']}-->
<a href="forum.php?mod=post&action=newthread&fid={$_GET[fid]}" {$postspecialcheck[0]}>默认</a>
<!--{/if}-->
<!--{loop $_G['forum']['threadsorts'][types] $tsortid $name}-->
<a href="forum.php?mod=post&action=newthread&sortid={$tsortid}&fid={$_GET[fid]}" class="{if $sortid == $tsortid}a{/if}"><!--{echo strip_tags($name);}--></a>
<!--{/loop}-->
<!--{if $_G['group']['allowpostpoll']}-->
<a href="forum.php?mod=post&action=newthread&fid={$_GET[fid]}&special=1" {$postspecialcheck[1]}>{lang post_newthreadpoll}</a>
<!--{/if}-->
<!--{if $_G['group']['allowpostreward']}-->
<a href="forum.php?mod=post&action=newthread&fid={$_GET[fid]}&special=3" {$postspecialcheck[3]}>{lang post_newthreadreward}</a>
<!--{/if}-->
<!--{if $_G['group']['allowpostdebate']}-->
<a href="forum.php?mod=post&action=newthread&fid={$_GET[fid]}&special=5" {$postspecialcheck[5]}>{lang post_newthreaddebate}</a>
<!--{/if}-->
<!--{if $_G['group']['allowpostactivity']}-->
<a href="forum.php?mod=post&action=newthread&fid={$_GET[fid]}&special=4" {$postspecialcheck[4]}>{lang post_newthreadactivity}</a>
<!--{/if}-->
<!--{if $_G['group']['allowposttrade']}-->
<a href="forum.php?mod=post&action=newthread&fid={$_GET[fid]}&special=2" {$postspecialcheck[2]}>{lang post_newthreadtrade}</a>
<!--{/if}-->
</div>
</div>
<link rel="stylesheet" href="{$_G['style']['styleimgdir']}/swiper.min.css" type="text/css">
<script type="text/javascript" src="{$_G['style']['styleimgdir']}/swiper.jquery.min.js"></script>
<script type="text/javascript">
jQuery(".newthread_type_tab a").addClass("swiper-slide");
var tab_initial = jQuery(".newthread_type_tab .a").length > 0 ? jQuery(".newthread_type_tab .a").index() : 0;
var newthread_type_tab = new Swiper('.newthread_type_tab', {
initialSlide : tab_initial,
slidesPerView : 'auto',
freeMode : true,
});
</script>
<!--{/if}-->
<div class="post_from">
<!--{hook/post_top_mobile}-->
<ul class="cl">
<li class="bl_line">
<!--{if $_GET['action'] != 'reply'}-->
<input type="text" tabindex="1" class="px" id="needsubject" size="30" autocomplete="off" value="$postinfo[subject]" name="subject" placeholder="{lang thread_subject}(必填)" fwin="login">
<!--{else}-->
RE: $thread['subject']
<!--{if $quotemessage}-->$quotemessage<!--{/if}-->
<!--{/if}-->
</li>
<!--{if $isfirstpost && !empty($_G['forum'][threadtypes][types])}-->
<li class="bl_line">
<select id="typeid" name="typeid" class="sort_sel">
<option value="0" selected="selected">{lang select_thread_catgory}</option>
<!--{loop $_G['forum'][threadtypes][types] $typeid $name}-->
<!--{if empty($_G['forum']['threadtypes']['moderators'][$typeid]) || $_G['forum']['ismoderator']}-->
<option value="$typeid"{if $thread['typeid'] == $typeid || $_GET['typeid'] == $typeid} selected="selected"{/if}><!--{echo strip_tags($name);}--></option>
<!--{/if}-->
<!--{/loop}-->
</select>
</li>
<!--{/if}-->
<!--{if $_GET[action] == 'edit' && $isorigauthor && !$rushreply && $_G['setting']['editperdel']}-->
<li class="bl_line xg1" style="background: #f5f5f5; font-size: .14rem;">
<input type="checkbox" name="delete" id="delete" class="pc" value="1" title="{lang post_delpost}{if $thread[special] == 3}{lang reward_price_back}{/if}">{lang post_delpost}{if $thread[special] == 3}{lang reward_price_back}{/if}
</li>
<!--{/if}-->
<!--{if $showthreadsorts}-->
<li class="byg_post_sort">
<!--{template forum/post_sortoption}-->
</li>
<!--{elseif $adveditor}-->
<!--{if $special == 1}--><!--{template forum/post_poll}-->
<!--{elseif $special == 2 && ($_GET[action] != 'edit' || ($_GET[action] == 'edit' && ($thread['authorid'] == $_G['uid'] && $_G['group']['allowposttrade'] || $_G['group']['allowedittrade'])))}--><!--{template forum/post_trade}-->
<!--{elseif $special == 3}--><!--{template forum/post_reward}-->
<!--{elseif $special == 4}--><!--{template forum/post_activity}-->
<!--{elseif $special == 5}--><!--{template forum/post_debate}-->
<!--{/if}-->
<!--{/if}-->
<li class="bl_none area" style="margin-top: .05rem; padding-bottom: 0;">
<textarea class="pt" id="needmessage" tabindex="3" autocomplete="off" id="{$editorid}_textarea" name="$editor[textarea]" cols="80" rows="2" placeholder="{lang thread_content}(必填)" fwin="reply">$postinfo[message]</textarea>
</li>
<!--{subtemplate forum/post_editor_attribute}-->
</ul>
<!--{hook/post_middle_mobile}-->
<!--{if $_GET[action] != 'edit' && ($secqaacheck || $seccodecheck)}-->
<!--{subtemplate common/seccheck}-->
<!--{/if}-->
<!--{hook/post_bottom_mobile}-->
<!--{if helper_access::check_module('follow') && $_GET[action] != 'edit'}-->
<div id="adddynamicspan" style="padding: .08rem .14rem 0; font-size: .14rem;">
<label><input type="checkbox" name="adddynamic" id="adddynamic" value="true" class="pc" {if $_G['forum']['allowfeed'] && !$_G[tid] && empty($_G['forum']['viewperm'])}checked="checked"{/if} />{lang post_relay}</label>
</div>
<!--{/if}-->
<div class="publish">
<span><button id="postsubmit" class="btn_pn btn_pn_blue" disable="false"><span><!--{if $_GET[action] == 'newthread'}-->{lang send_thread}<!--{elseif $_GET[action] == 'reply'}-->{lang join_thread}<!--{elseif $_GET[action] == 'edit'}-->{lang edit_save}<!--{/if}--></span></button></span>
<input type="hidden" name="{if $_GET[action] == 'newthread'}topicsubmit{elseif $_GET[action] == 'reply'}replysubmit{elseif $_GET[action] == 'edit'}editsubmit{/if}" value="yes">
</div>
</div>
</div>
<!--{hook/post_btn_extra_mobile}-->
<!-- main postbox end -->
</form>
<script type="text/javascript">
(function() {
var needsubject = needmessage = false;
<!--{if $_GET[action] == 'reply'}-->
needsubject = true;
<!--{elseif $_GET[action] == 'edit'}-->
needsubject = needmessage = true;
<!--{/if}-->
$('#needmessage').on('scroll', function() {
var obj = $(this);
if(obj.scrollTop() > 0) {
obj.attr('rows', parseInt(obj.attr('rows'))+2);
}
}).scrollTop($(document).height());
})();
</script>
<script type="text/javascript" src="{STATICURL}js/mobile/ajaxfileupload.js?{VERHASH}"></script>
<script type="text/javascript" src="{STATICURL}js/mobile/buildfileupload.js?{VERHASH}"></script>
<script type="text/javascript">
var imgexts = typeof imgexts == 'undefined' ? 'jpg, jpeg, gif, png' : imgexts;
var STATUSMSG = {
'-1' : '{lang uploadstatusmsgnag1}',
'0' : '{lang uploadstatusmsg0}',
'1' : '{lang uploadstatusmsg1}',
'2' : '{lang uploadstatusmsg2}',
'3' : '{lang uploadstatusmsg3}',
'4' : '{lang uploadstatusmsg4}',
'5' : '{lang uploadstatusmsg5}',
'6' : '{lang uploadstatusmsg6}',
'7' : '{lang uploadstatusmsg7}(' + imgexts + ')',
'8' : '{lang uploadstatusmsg8}',
'9' : '{lang uploadstatusmsg9}',
'10' : '{lang uploadstatusmsg10}',
'11' : '{lang uploadstatusmsg11}',
'12' : '{lang uploadstatusmsg12}',
'13' : '{lang uploadstatusmsg13}'
};
var form = $('#postform');
$(document).on('change', '#filedata', function() {
popup.open('<img src="' + IMGDIR + '/imageloading.gif">');
uploadsuccess = function(data) {
if(data == '') {
popup.open('{lang uploadpicfailed}', 'alert');
}
var dataarr = data.split('|');
if(dataarr[0] == 'DISCUZUPLOAD' && dataarr[2] == 0) {
popup.close();
$('#imglist').append('<li><span aid="'+dataarr[3]+'" tu="1" class="del"><a href="javascript:;"><img src="{STATICURL}image/mobile/images/icon_del.png"></a></span><span class="p_img"><a href="javascript:;" onClick="addface(\'needmessage\',\'[attachimg]'+dataarr[3]+'[/attachimg]\')"><img id="aimg_'+dataarr[3]+'" title="'+dataarr[6]+'" src="{$_G[setting][attachurl]}forum/'+dataarr[5]+'" /><span class="charu">插入'+dataarr[3]+'</span></a></span><input type="hidden" name="attachnew['+dataarr[3]+'][description]" /></li>');
} else {
var sizelimit = '';
if(dataarr[7] == 'ban') {
sizelimit = '{lang uploadpicatttypeban}';
} else if(dataarr[7] == 'perday') {
sizelimit = '{lang donotcross}'+Math.ceil(dataarr[8]/1024)+'K)';
} else if(dataarr[7] > 0) {
sizelimit = '{lang donotcross}'+Math.ceil(dataarr[7]/1024)+'K)';
}
popup.open(STATUSMSG[dataarr[2]] + sizelimit, 'alert');
}
};
if(typeof FileReader != 'undefined' && this.files[0]) {//note 支持html5上传新特性
for (var i=0;i<this.files.length;i++ ) {
var file_data = [];
file_data.push(this.files[i]);
$.buildfileupload({
uploadurl:'misc.php?mod=swfupload&operation=upload&type=image&inajax=yes&infloat=yes&simple=2',
files:file_data,
uploadformdata:{uid:"$_G[uid]", hash:"<!--{eval echo md5(substr(md5($_G['config']['security']['authkey']), 8).$_G['uid'])}-->"},
uploadinputname:'Filedata',
maxfilesize:"$swfconfig[max]",
success:uploadsuccess,
error:function() {
popup.open('{lang uploadpicfailed}', 'alert');
}
});
}
} else {
$.ajaxfileupload({
url:'misc.php?mod=swfupload&operation=upload&type=image&inajax=yes&infloat=yes&simple=2',
data:{uid:"$_G[uid]", hash:"<!--{eval echo md5(substr(md5($_G['config']['security']['authkey']), 8).$_G['uid'])}-->"},
dataType:'text',
fileElementId:'filedata',
success:uploadsuccess,
error: function() {
popup.open('{lang uploadpicfailed}', 'alert');
}
});
}
});
$(document).on('change', '#attfiledata', function() {
popup.open('<img src="' + IMGDIR + '/imageloading.gif">');
uploadsuccess = function(data) {
if(data == '') {
popup.open('{lang uploadpicfailed}', 'alert');
}
var dataarr = data.split('|');
if(dataarr[0] == 'DISCUZUPLOAD' && dataarr[2] == 0) {
popup.close();
var video_file = '';
var file_ex = 'unknown.gif';
if (/bittorrent$|torrent$/.test(dataarr[6].toLowerCase())) {
file_ex = 'torrent.gif';
} else if (/pdf$|pdf$/.test(dataarr[6].toLowerCase())) {
file_ex = 'pdf.gif';
} else if (/(jpg|gif|png|bmp)$/.test(dataarr[6].toLowerCase())) {
file_ex = 'image.gif';
} else if (/(swf|fla|flv|swi)$/.test(dataarr[6].toLowerCase())) {
file_ex = 'flash.gif';
} else if (/(wav|mid|mp3|m3u|wma|asf|asx|vqf|mpg|mpeg|avi|wmv|mp4|ogv|webm|ogg)$/.test(dataarr[6].toLowerCase())) {
file_ex = 'av.gif';
} else if (/(ra|rm|rv)$/.test(dataarr[6].toLowerCase())) {
file_ex = 'real.gif';
} else if (/(php|js|pl|cgi|asp|htm|html|xml)$/.test(dataarr[6].toLowerCase())) {
file_ex = 'html.gif';
} else if (/(txt|rtf|wri|chm)$/.test(dataarr[6].toLowerCase())) {
file_ex = 'text.gif';
} else if (/(doc|ppt)$/.test(dataarr[6].toLowerCase())) {
file_ex = 'msoffice.gif';
} else if (/rar$/.test(dataarr[6].toLowerCase())) {
file_ex = 'rar.gif';
} else if (/(zip|arj|arc|cab|lzh|lha|tar|gz)$/.test(dataarr[6].toLowerCase())) {
file_ex = 'zip.gif';
} else if (/(exe|com|bat|dll)$/.test(dataarr[6].toLowerCase())) {
file_ex = 'binary.gif';
} else {
file_ex = 'unknown.gif';
}
if (/mp3$/.test(dataarr[6].toLowerCase())) {
video_file = '<span class="kmbtn bg_a f_f" onclick="addsmilies(\'[audio]attach://' + dataarr[3] + '.mp3[/audio]\')">{lang forum_post_insert}音乐</span>';
} else if (/(mp4)$/.test(dataarr[6].toLowerCase())) {
video_file = '<span class="kmbtn bg_a f_f" onclick="addsmilies(\'[media=x,500,375]attach://' + dataarr[3] + '.mp4[/media]\')">{lang forum_post_insert}视频</span>';
}
$('#attlist').prepend('<li class="cl"><span class="z byg_attswf_name"><img src="static/image/filetype/'+file_ex+'">'+dataarr[6]+'</span><a href="javascript:;" aid="'+dataarr[3]+'" tu="1" class="del y byg_attswf_del"><img src="{STATICURL}image/mobile/images/icon_del.png"></a><a href="javascript:;" class="y byg_attswf_add" id="attachname'+dataarr[3]+'" onClick="addface(\'needmessage\', \'[attach]'+dataarr[3]+'[/attach]\')">插入'+dataarr[3]+'</a><p class="cl"></p><!--{if $_GET[result] != 'simple'}--><p class="byg_atds cl">描述 : <input type="text" name="attachnew['+dataarr[3]+'][description]" value="" class="px" /></p><p class="byg_attv cl"><!--{if $_G['group']['allowsetattachperm']}--><!--{if $_G['cache']['groupreadaccess']}-->阅读权限 : <select class="ps" name="attachnew['+dataarr[3]+'][readperm]" id="readperm" tabindex="1"><option value="" selected="selected">{lang unlimited}</option><!--{loop $_G['cache']['groupreadaccess'] $val}--><option value="$val[readaccess]" title="{lang readperm}: $val[readaccess]">$val[grouptitle]</option><!--{/loop}--><option value="255"{if $attach[readperm] == 255} selected{/if}>{lang highest_right}</option></select><!--{/if}--><!--{/if}--><!--{if $_G['group']['maxprice']}-->{$_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]][title]} : <input type="text" name="attachnew['+dataarr[3]+'][price]" value="0" class="px" /><!--{/if}--></p><!--{/if}--></li>');
} else {
var sizelimit = '';
if(dataarr[7] == 'ban') {
sizelimit = '{lang uploadpicatttypeban}';
} else if(dataarr[7] == 'perday') {
sizelimit = '{lang donotcross}'+Math.ceil(dataarr[8]/1024)+'K)';
} else if(dataarr[7] > 0) {
sizelimit = '{lang donotcross}'+Math.ceil(dataarr[7]/1024)+'K)';
}
popup.open(STATUSMSG[dataarr[2]] + sizelimit, 'alert');
}
};
$.ajaxfileupload({
url:'misc.php?mod=swfupload&operation=upload&fid={$_G['fid']}&inajax=yes&infloat=yes&simple=2',
data:{uid:"$_G['uid']", hash:"<!--{eval echo md5(substr(md5($_G['config']['security']['authkey']), 8).$_G['uid'])}-->"},
dataType:'text',
fileElementId:'attfiledata',
success:uploadsuccess,
error: function() {
popup.open('{lang uploadpicfailed}', 'alert');
}
});
});
<!--{if 0 && $_G['setting']['mobile']['geoposition']}-->
geo.getcurrentposition();
<!--{/if}-->
$('#postsubmit').on('click', function() {
<!--{if $showthreadsorts}-->
if(validateextra() == false) {
return false;
}
<!--{/if}-->
var obj = $(this);
popup.open('<img src="' + IMGDIR + '/imageloading.gif">');
var postlocation = '';
if(geo.errmsg === '' && geo.loc) {
postlocation = geo.longitude + '|' + geo.latitude + '|' + geo.loc;
}
$.ajax({
type:'POST',
url:form.attr('action') + '&geoloc=' + postlocation + '&handlekey='+form.attr('id')+'&inajax=1',
data:form.serialize(),
dataType:'xml'
})
.success(function(s) {
popup.open(s.lastChild.firstChild.nodeValue);
})
.error(function() {
popup.open('{lang networkerror}', 'alert');
});
return false;
});
$(document).on('click', '.del', function() {
var obj = $(this);
$.ajax({
type:'GET',
url:'forum.php?mod=ajax&action=deleteattach&inajax=yes&aids[]=' + obj.attr('aid') + (obj.attr('tu') == 1 ? '&tid={$postinfo['tid']}&pid={$postinfo['pid']}&formhash={FORMHASH}' : ''),
})
.success(function(s) {
obj.parent().remove();
})
.error(function() {
popup.open('{lang networkerror}', 'alert');
});
return false;
});
</script>
<!--{eval $nofooter = true;}-->
<!--{template common/footer}-->