post.htm
11.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<!--{template common/header}-->
<!--{if $special != 2 && $special != 4 && !($isfirstpost && $sortid)}-->
<!--{eval $adveditor = $isfirstpost && $special && ($_GET['action'] == 'newthread' || $_GET['action'] == 'reply' && !empty($_GET['addtrade']) || $_GET['action'] == 'edit' );}-->
<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 $special}-->
<input type="hidden" name="special" value="$special" />
<!--{/if}-->
<!--{if $specialextra}-->
<input type="hidden" name="specialextra" value="$specialextra" />
<!--{/if}-->
<!-- header start -->
<header class="header">
<div class="nav">
<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>
<input type="hidden" name="{if $_GET[action] == 'newthread'}topicsubmit{elseif $_GET[action] == 'reply'}replysubmit{elseif $_GET[action] == 'edit'}editsubmit{/if}" value="yes">
<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>
<span><!--{if $_GET[action] == 'edit'}-->{lang edit}<!--{else}-->{lang send_threads}<!--{/if}--></span>
</div>
</header>
<!-- header end -->
<!-- main postbox start -->
<div class="wp">
<div class="post_from">
<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 && ($isfirstpost && $thread['replies'] < 1 || !$isfirstpost) && !$rushreply && $_G['setting']['editperdel']}-->
<li class="bl_line">
<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}
</li>
<!--{/if}-->
<li class="bl_none area">
<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>
<li style="padding:0px;">
<a href="javascript:;" class="y" style="background:url({STATICURL}image/mobile/images/icon_photo.png) no-repeat;overflow:hidden;">
<input type="file" name="Filedata" id="filedata" style="width:30px;height:30px;font-size:30px;opacity:0;"/>
</a>
</li>
</ul>
<ul id="imglist" class="post_imglist cl bl_line">
</ul>
<!--{if $_GET[action] != 'edit' && ($secqaacheck || $seccodecheck)}-->
<!--{subtemplate common/seccheck}-->
<!--{/if}-->
<!--{hook/post_bottom_mobile}-->
</div>
</div>
<!-- main postbox start -->
</form>
<!--{else}-->
<div class="box xg1">
<!--{if $special == '2'}-->
{lang send_special_trade_error}
<!--{elseif $special == '4'}-->
{lang send_special_activity_error}
<!--{elseif $isfirstpost && $sortid}-->
{lang threadsort_error}
<!--{/if}-->
</div>
<!--{/if}-->
<script type="text/javascript">
(function() {
var needsubject = needmessage = false;
<!--{if $_GET[action] == 'reply'}-->
needsubject = true;
<!--{elseif $_GET[action] == 'edit'}-->
needsubject = needmessage = true;
<!--{/if}-->
<!--{if $_GET[action] == 'newthread' || ($_GET[action] == 'edit' && $isfirstpost)}-->
$('#needsubject').on('keyup input', function() {
var obj = $(this);
if(obj.val()) {
needsubject = true;
if(needmessage == true) {
$('.btn_pn').removeClass('btn_pn_grey').addClass('btn_pn_blue');
$('.btn_pn').attr('disable', 'false');
}
} else {
needsubject = false;
$('.btn_pn').removeClass('btn_pn_blue').addClass('btn_pn_grey');
$('.btn_pn').attr('disable', 'true');
}
});
<!--{/if}-->
$('#needmessage').on('keyup input', function() {
var obj = $(this);
if(obj.val()) {
needmessage = true;
if(needsubject == true) {
$('.btn_pn').removeClass('btn_pn_grey').addClass('btn_pn_blue');
$('.btn_pn').attr('disable', 'false');
}
} else {
needmessage = false;
$('.btn_pn').removeClass('btn_pn_blue').addClass('btn_pn_grey');
$('.btn_pn').attr('disable', 'true');
}
});
$('#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}'
};
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]+'" 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>');
} 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ϴ
$.buildfileupload({
uploadurl:'misc.php?mod=swfupload&operation=upload&type=image&inajax=yes&infloat=yes&simple=2',
files:this.files,
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');
}
});
}
});
<!--{if 0 && $_G['setting']['mobile']['geoposition']}-->
geo.getcurrentposition();
<!--{/if}-->
$('#postsubmit').on('click', function() {
var obj = $(this);
if(obj.attr('disable') == 'true') {
return false;
}
obj.attr('disable', 'true').removeClass('btn_pn_blue').addClass('btn_pn_grey');
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'),
})
.success(function(s) {
obj.parent().remove();
})
.error(function() {
popup.open('{lang networkerror}', 'alert');
});
return false;
});
</script>
<!--{eval $nofooter = true;}-->
<!--{template common/footer}-->