post.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <?php echo '思维定制 QQ277718133';exit;?>
  2. <!--{template common/header-ft}-->
  3. <!--{if $special != 2 && $special != 4 && !($isfirstpost && $sortid)}-->
  4. <!--{eval $adveditor = $isfirstpost && $special && ($_GET['action'] == 'newthread' || $_GET['action'] == 'reply' && !empty($_GET['addtrade']) || $_GET['action'] == 'edit' );}-->
  5. <form method="post" id="postform"
  6. {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"
  7. {elseif $_GET[action] == 'reply'}action="forum.php?mod=post&action=reply&fid=$_G[fid]&tid=$_G[tid]&extra=$extra&replysubmit=yes&mobile=2"
  8. {elseif $_GET[action] == 'edit'}action="forum.php?mod=post&action=edit&extra=$extra&editsubmit=yes&mobile=2" $enctype
  9. {/if}>
  10. <input type="hidden" name="formhash" id="formhash" value="{FORMHASH}" />
  11. <input type="hidden" name="posttime" id="posttime" value="{TIMESTAMP}" />
  12. <!--{if !empty($_GET['modthreadkey'])}--><input type="hidden" name="modthreadkey" id="modthreadkey" value="$_GET['modthreadkey']" /><!--{/if}-->
  13. <!--{if $_GET[action] == 'reply'}-->
  14. <input type="hidden" name="noticeauthor" value="$noticeauthor" />
  15. <input type="hidden" name="noticetrimstr" value="$noticetrimstr" />
  16. <input type="hidden" name="noticeauthormsg" value="$noticeauthormsg" />
  17. <!--{if $reppid}-->
  18. <input type="hidden" name="reppid" value="$reppid" />
  19. <!--{/if}-->
  20. <!--{if $_GET[reppost]}-->
  21. <input type="hidden" name="reppost" value="$_GET[reppost]" />
  22. <!--{elseif $_GET[repquote]}-->
  23. <input type="hidden" name="reppost" value="$_GET[repquote]" />
  24. <!--{/if}-->
  25. <!--{/if}-->
  26. <!--{if $_GET[action] == 'edit'}-->
  27. <input type="hidden" name="fid" id="fid" value="$_G[fid]" />
  28. <input type="hidden" name="tid" value="$_G[tid]" />
  29. <input type="hidden" name="pid" value="$pid" />
  30. <input type="hidden" name="page" value="$_GET[page]" />
  31. <!--{/if}-->
  32. <!--{if $special}-->
  33. <input type="hidden" name="special" value="$special" />
  34. <!--{/if}-->
  35. <!--{if $specialextra}-->
  36. <input type="hidden" name="specialextra" value="$specialextra" />
  37. <!--{/if}-->
  38. <!-- header start -->
  39. <header class="header">
  40. <div class="nav">
  41. <span class="y"><button id="postsubmit" class="btn_pn <!--{if $_GET[action] == 'edit'}-->btn_pn_blue" disable="false"<!--{else}-->btn_pn_grey" disable="true"<!--{/if}-->><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>
  42. <input type="hidden" name="{if $_GET[action] == 'newthread'}topicsubmit{elseif $_GET[action] == 'reply'}replysubmit{elseif $_GET[action] == 'edit'}editsubmit{/if}" value="yes">
  43. <a href="<!--{if $_GET[action] == 'newthread'}-->forum.php?mod=forumdisplay&fid=$_G[fid]&page=$_GET[page]<!--{else}-->forum.php?mod=redirect&goto=findpost&ptid=$_G[tid]&pid=$pid<!--{/if}-->" class="z"><img src="{STATICURL}image/mobile/images/icon_back.png" /></a>
  44. <span><!--{if $_GET[action] == 'edit'}-->{lang edit}<!--{else}-->{lang send_threads}<!--{/if}--></span>
  45. </div>
  46. </header>
  47. <!-- header end -->
  48. <!-- main postbox start -->
  49. <div class="wp">
  50. <div class="post_from">
  51. <ul class="cl">
  52. <li class="bl_line">
  53. <!--{if $_GET['action'] != 'reply'}-->
  54. <input type="text" tabindex="1" class="px" id="needsubject" size="30" autocomplete="off" value="$postinfo[subject]" name="subject" placeholder="{lang thread_subject}" fwin="login">
  55. <!--{else}-->
  56. RE: $thread['subject']
  57. <!--{if $quotemessage}-->$quotemessage<!--{/if}-->
  58. <!--{/if}-->
  59. </li>
  60. <!--{if $isfirstpost && !empty($_G['forum'][threadtypes][types])}-->
  61. <li class="bl_line">
  62. <select id="typeid" name="typeid" class="sort_sel">
  63. <option value="0" selected="selected">{lang select_thread_catgory}</option>
  64. <!--{loop $_G['forum'][threadtypes][types] $typeid $name}-->
  65. <!--{if empty($_G['forum']['threadtypes']['moderators'][$typeid]) || $_G['forum']['ismoderator']}-->
  66. <option value="$typeid"{if $thread['typeid'] == $typeid || $_GET['typeid'] == $typeid} selected="selected"{/if}><!--{echo strip_tags($name);}--></option>
  67. <!--{/if}-->
  68. <!--{/loop}-->
  69. </select>
  70. </li>
  71. <!--{/if}-->
  72. <!--{if $_GET[action] == 'edit' && $isorigauthor && ($isfirstpost && $thread['replies'] < 1 || !$isfirstpost) && !$rushreply && $_G['setting']['editperdel']}-->
  73. <li class="bl_line">
  74. <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 delete_check}
  75. </li>
  76. <!--{/if}-->
  77. <li class="bl_none area">
  78. <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>
  79. </li>
  80. <li style="padding:0px;">
  81. <a href="javascript:;" class="y" style="background:url({STATICURL}image/mobile/images/icon_photo.png) no-repeat;overflow:hidden;">
  82. <input type="file" name="Filedata" id="filedata" style="width:30px;height:30px;font-size:30px;opacity:0;"/>
  83. </a>
  84. </li>
  85. </ul>
  86. <ul id="imglist" class="post_imglist cl bl_line">
  87. </ul>
  88. <!--{if $_GET[action] != 'edit' && ($secqaacheck || $seccodecheck)}-->
  89. <!--{subtemplate common/seccheck}-->
  90. <!--{/if}-->
  91. <!--{hook/post_bottom_mobile}-->
  92. </div>
  93. </div>
  94. <!-- main postbox start -->
  95. </form>
  96. <!--{else}-->
  97. <div class="box xg1 n5-dnbts">
  98. <!--{if $special == '2'}-->
  99. {lang send_special_trade_error}
  100. <!--{elseif $special == '4'}-->
  101. {lang send_special_activity_error}
  102. <!--{elseif $isfirstpost && $sortid}-->
  103. {lang threadsort_error} <p><span id="n5-show"></span> <a href="{$_G['setting']['mobile']['nomobileurl']}">跳转至 {lang nomobiletype}</a></p>
  104. <!--{/if}-->
  105. </div>
  106. <!--{/if}-->
  107. <script>
  108. var t=10;
  109. setInterval("refer()",1000);
  110. function refer(){
  111. if(t==0){
  112. location="{$_G['setting']['mobile']['nomobileurl']}";
  113. }
  114. document.getElementById('n5-show').innerHTML=""+t+"秒后";
  115. t--;
  116. }
  117. </script>
  118. <script type="text/javascript">
  119. (function() {
  120. var needsubject = needmessage = false;
  121. <!--{if $_GET[action] == 'reply'}-->
  122. needsubject = true;
  123. <!--{elseif $_GET[action] == 'edit'}-->
  124. needsubject = needmessage = true;
  125. <!--{/if}-->
  126. <!--{if $_GET[action] == 'newthread' || ($_GET[action] == 'edit' && $isfirstpost)}-->
  127. $('#needsubject').on('keyup input', function() {
  128. var obj = $(this);
  129. if(obj.val()) {
  130. needsubject = true;
  131. if(needmessage == true) {
  132. $('.btn_pn').removeClass('btn_pn_grey').addClass('btn_pn_blue');
  133. $('.btn_pn').attr('disable', 'false');
  134. }
  135. } else {
  136. needsubject = false;
  137. $('.btn_pn').removeClass('btn_pn_blue').addClass('btn_pn_grey');
  138. $('.btn_pn').attr('disable', 'true');
  139. }
  140. });
  141. <!--{/if}-->
  142. $('#needmessage').on('keyup input', function() {
  143. var obj = $(this);
  144. if(obj.val()) {
  145. needmessage = true;
  146. if(needsubject == true) {
  147. $('.btn_pn').removeClass('btn_pn_grey').addClass('btn_pn_blue');
  148. $('.btn_pn').attr('disable', 'false');
  149. }
  150. } else {
  151. needmessage = false;
  152. $('.btn_pn').removeClass('btn_pn_blue').addClass('btn_pn_grey');
  153. $('.btn_pn').attr('disable', 'true');
  154. }
  155. });
  156. $('#needmessage').on('scroll', function() {
  157. var obj = $(this);
  158. if(obj.scrollTop() > 0) {
  159. obj.attr('rows', parseInt(obj.attr('rows'))+2);
  160. }
  161. }).scrollTop($(document).height());
  162. })();
  163. </script>
  164. <script type="text/javascript" src="{STATICURL}js/mobile/ajaxfileupload.js?{VERHASH}"></script>
  165. <script type="text/javascript" src="{STATICURL}js/mobile/buildfileupload.js?{VERHASH}"></script>
  166. <script type="text/javascript">
  167. var imgexts = typeof imgexts == 'undefined' ? 'jpg, jpeg, gif, png' : imgexts;
  168. var STATUSMSG = {
  169. '-1' : '{lang uploadstatusmsgnag1}',
  170. '0' : '{lang uploadstatusmsg0}',
  171. '1' : '{lang uploadstatusmsg1}',
  172. '2' : '{lang uploadstatusmsg2}',
  173. '3' : '{lang uploadstatusmsg3}',
  174. '4' : '{lang uploadstatusmsg4}',
  175. '5' : '{lang uploadstatusmsg5}',
  176. '6' : '{lang uploadstatusmsg6}',
  177. '7' : '{lang uploadstatusmsg7}(' + imgexts + ')',
  178. '8' : '{lang uploadstatusmsg8}',
  179. '9' : '{lang uploadstatusmsg9}',
  180. '10' : '{lang uploadstatusmsg10}',
  181. '11' : '{lang uploadstatusmsg11}'
  182. };
  183. var form = $('#postform');
  184. $(document).on('change', '#filedata', function() {
  185. popup.open('<img src="' + IMGDIR + '/imageloading.gif">');
  186. uploadsuccess = function(data) {
  187. if(data == '') {
  188. popup.open('{lang uploadpicfailed}', 'alert');
  189. }
  190. var dataarr = data.split('|');
  191. if(dataarr[0] == 'DISCUZUPLOAD' && dataarr[2] == 0) {
  192. popup.close();
  193. $('#imglist').append('<li><span aid="'+dataarr[3]+'" class="del"><a href="javascript:;"><img src="{STATICURL}image/mobile/images/icon_del.png"></a></span><span class="p_img"><a href="javascript:;"><img style="height:54px;width:54px;" id="aimg_'+dataarr[3]+'" title="'+dataarr[6]+'" src="{$_G[setting][attachurl]}forum/'+dataarr[5]+'" /></a></span><input type="hidden" name="attachnew['+dataarr[3]+'][description]" /></li>');
  194. } else {
  195. var sizelimit = '';
  196. if(dataarr[7] == 'ban') {
  197. sizelimit = '{lang uploadpicatttypeban}';
  198. } else if(dataarr[7] == 'perday') {
  199. sizelimit = '{lang donotcross}'+Math.ceil(dataarr[8]/1024)+'K)';
  200. } else if(dataarr[7] > 0) {
  201. sizelimit = '{lang donotcross}'+Math.ceil(dataarr[7]/1024)+'K)';
  202. }
  203. popup.open(STATUSMSG[dataarr[2]] + sizelimit, 'alert');
  204. }
  205. };
  206. if(typeof FileReader != 'undefined' && this.files[0]) {//note 支持html5上传新特性
  207. $.buildfileupload({
  208. uploadurl:'misc.php?mod=swfupload&operation=upload&type=image&inajax=yes&infloat=yes&simple=2',
  209. files:this.files,
  210. uploadformdata:{uid:"$_G[uid]", hash:"<!--{eval echo md5(substr(md5($_G[config][security][authkey]), 8).$_G[uid])}-->"},
  211. uploadinputname:'Filedata',
  212. maxfilesize:"$swfconfig[max]",
  213. success:uploadsuccess,
  214. error:function() {
  215. popup.open('{lang uploadpicfailed}', 'alert');
  216. }
  217. });
  218. } else {
  219. $.ajaxfileupload({
  220. url:'misc.php?mod=swfupload&operation=upload&type=image&inajax=yes&infloat=yes&simple=2',
  221. data:{uid:"$_G[uid]", hash:"<!--{eval echo md5(substr(md5($_G[config][security][authkey]), 8).$_G[uid])}-->"},
  222. dataType:'text',
  223. fileElementId:'filedata',
  224. success:uploadsuccess,
  225. error: function() {
  226. popup.open('{lang uploadpicfailed}', 'alert');
  227. }
  228. });
  229. }
  230. });
  231. <!--{if 0 && $_G['setting']['mobile']['geoposition']}-->
  232. geo.getcurrentposition();
  233. <!--{/if}-->
  234. $('#postsubmit').on('click', function() {
  235. var obj = $(this);
  236. if(obj.attr('disable') == 'true') {
  237. return false;
  238. }
  239. obj.attr('disable', 'true').removeClass('btn_pn_blue').addClass('btn_pn_grey');
  240. popup.open('<img src="' + IMGDIR + '/imageloading.gif">');
  241. var postlocation = '';
  242. if(geo.errmsg === '' && geo.loc) {
  243. postlocation = geo.longitude + '|' + geo.latitude + '|' + geo.loc;
  244. }
  245. $.ajax({
  246. type:'POST',
  247. url:form.attr('action') + '&geoloc=' + postlocation + '&handlekey='+form.attr('id')+'&inajax=1',
  248. data:form.serialize(),
  249. dataType:'xml'
  250. })
  251. .success(function(s) {
  252. popup.open(s.lastChild.firstChild.nodeValue);
  253. })
  254. .error(function() {
  255. popup.open('{lang networkerror}', 'alert');
  256. });
  257. return false;
  258. });
  259. $(document).on('click', '.del', function() {
  260. var obj = $(this);
  261. $.ajax({
  262. type:'GET',
  263. url:'forum.php?mod=ajax&action=deleteattach&inajax=yes&aids[]=' + obj.attr('aid'),
  264. })
  265. .success(function(s) {
  266. obj.parent().remove();
  267. })
  268. .error(function() {
  269. popup.open('{lang networkerror}', 'alert');
  270. });
  271. return false;
  272. });
  273. </script>
  274. <!--{eval $nofooter = true;}-->
  275. <!--底部菜单-->
  276. <div id="contactbar">
  277. <a href="forum.php?mod=guide&view=hot" class="bottom_index"></a>
  278. <a href="forum.php?forumlist=1" class="bottom_history_on"></a>
  279. <a href="forum.php?mod=misc&action=nav" class="bottom_post"></a>
  280. <a href="<!--{if $_G[uid]}-->home.php?mod=space&uid=$_G[uid]&do=profile&mycenter=1<!--{else}-->member.php?mod=logging&action=login<!--{/if}-->" class="bottom_member"></a>
  281. </div>
  282. <!--{template common/footer}-->