mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 02:27:34 -07:00
r201
Исправление двойного поста при отправке сообщения git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@201 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
fa18c340bc
commit
2d2b31b635
7 changed files with 197 additions and 34 deletions
|
@ -57,8 +57,8 @@ $bb_cfg['css_ver'] = 1;
|
||||||
|
|
||||||
// Increase number of revision after update
|
// Increase number of revision after update
|
||||||
$bb_cfg['tp_version'] = '2.0 Stable';
|
$bb_cfg['tp_version'] = '2.0 Stable';
|
||||||
$bb_cfg['tp_release_state'] = 'R200';
|
$bb_cfg['tp_release_state'] = 'R201';
|
||||||
$bb_cfg['tp_release_date'] = '8-08-2011';
|
$bb_cfg['tp_release_date'] = '9-08-2011';
|
||||||
|
|
||||||
$bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger
|
$bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger
|
||||||
$bb_cfg['srv_overloaded_msg'] = "Извините, в данный момент сервер перегружен\nПопробуйте повторить запрос через несколько минут";
|
$bb_cfg['srv_overloaded_msg'] = "Извините, в данный момент сервер перегружен\nПопробуйте повторить запрос через несколько минут";
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -556,7 +556,7 @@ switch ($mode)
|
||||||
//mpd end
|
//mpd end
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$sql = "SELECT u.username, p.*, pt.post_text, pt.post_subject, p.post_username
|
$sql = "SELECT u.username, p.*, pt.post_text, p.post_username
|
||||||
FROM " . BB_POSTS . " p, " . BB_USERS . " u, " . BB_POSTS_TEXT . " pt
|
FROM " . BB_POSTS . " p, " . BB_USERS . " u, " . BB_POSTS_TEXT . " pt
|
||||||
WHERE p.topic_id = $topic_id
|
WHERE p.topic_id = $topic_id
|
||||||
AND p.poster_id = u.user_id
|
AND p.poster_id = u.user_id
|
||||||
|
@ -590,7 +590,6 @@ switch ($mode)
|
||||||
$post_date = bb_date($postrow[$i]['post_time']);
|
$post_date = bb_date($postrow[$i]['post_time']);
|
||||||
|
|
||||||
$message = $postrow[$i]['post_text'];
|
$message = $postrow[$i]['post_text'];
|
||||||
$post_subject = ( isset($postrow[$i]['post_subject']) ) ? $postrow[$i]['post_subject'] : $topic_title;
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// If the board has HTML off but the post has HTML
|
// If the board has HTML off but the post has HTML
|
||||||
|
@ -604,7 +603,6 @@ switch ($mode)
|
||||||
'ROW_CLASS' => $row_class,
|
'ROW_CLASS' => $row_class,
|
||||||
'POSTER_NAME' => wbr($poster),
|
'POSTER_NAME' => wbr($poster),
|
||||||
'POST_DATE' => $post_date,
|
'POST_DATE' => $post_date,
|
||||||
'POST_SUBJECT' => $post_subject,
|
|
||||||
'MESSAGE' => $message,
|
'MESSAGE' => $message,
|
||||||
|
|
||||||
'CHECKBOX' => (defined('BEGIN_CHECKBOX')) ? TRUE : FALSE,
|
'CHECKBOX' => (defined('BEGIN_CHECKBOX')) ? TRUE : FALSE,
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
<!-- IF POSTING_TOPIC_ID --><em>»</em> <a class="normal" href="{TOPIC_URL}{POSTING_TOPIC_ID}">{POSTING_TOPIC_TITLE}</a><!-- ENDIF -->
|
<!-- IF POSTING_TOPIC_ID --><em>»</em> <a class="normal" href="{TOPIC_URL}{POSTING_TOPIC_ID}">{POSTING_TOPIC_TITLE}</a><!-- ENDIF -->
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this);" {S_FORM_ENCTYPE}>
|
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="if(checkForm(this)){ dis_submit_btn(); }else{ return false; }" {S_FORM_ENCTYPE}>
|
||||||
{S_HIDDEN_FORM_FIELDS}
|
{S_HIDDEN_FORM_FIELDS}
|
||||||
{ADD_ATTACH_HIDDEN_FIELDS}
|
{ADD_ATTACH_HIDDEN_FIELDS}
|
||||||
{POSTED_ATTACHMENTS_HIDDEN_FIELDS}
|
{POSTED_ATTACHMENTS_HIDDEN_FIELDS}
|
||||||
|
|
|
@ -87,7 +87,7 @@ ajax.callback.posts = function(data){
|
||||||
<input type="button" value="{L_LIST}" name="codeList" title="{L_LIST_TITLE}" style="width: 58px;"/>
|
<input type="button" value="{L_LIST}" name="codeList" title="{L_LIST_TITLE}" style="width: 58px;"/>
|
||||||
<input type="button" value="1." name="codeOpt" title="{L_LIST_ITEM}" style="width: 30px;" />
|
<input type="button" value="1." name="codeOpt" title="{L_LIST_ITEM}" style="width: 30px;" />
|
||||||
<input type="button" value="{L_QUOTE_SEL}" name="quoteselected" title="{L_QUOTE_SELECTED}" onmouseout="bbcode.refreshSelection(false);" onmouseover="bbcode.refreshSelection(true);" onclick="bbcode.onclickQuoteSel();" />
|
<input type="button" value="{L_QUOTE_SEL}" name="quoteselected" title="{L_QUOTE_SELECTED}" onmouseout="bbcode.refreshSelection(false);" onmouseover="bbcode.refreshSelection(true);" onclick="bbcode.onclickQuoteSel();" />
|
||||||
|
|
||||||
<input type="button" value="{L_TRANSLIT}" name="Translit" title="{L_TRANSLIT_TITLE}" style="width: 68px;" onclick="transliterate(document.post.message, this);" /> <a href="#" onclick="toggle_block('translit_opt'); return false"><span style="color: darkred"><b>?</b></span></a>
|
<input type="button" value="{L_TRANSLIT}" name="Translit" title="{L_TRANSLIT_TITLE}" style="width: 68px;" onclick="transliterate(document.post.message, this);" /> <a href="#" onclick="toggle_block('translit_opt'); return false"><span style="color: darkred"><b>?</b></span></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -141,16 +141,44 @@ ajax.callback.posts = function(data){
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mrg_4 tCenter">
|
<div class="mrg_8 tCenter">
|
||||||
<div class="pad_4">{CAPTCHA_HTML}</div>
|
<div id="post-buttons-block" style="display: none;">
|
||||||
<input title="Alt+Enter" type="submit" name="preview" value="{L_PREVIEW}" />
|
<div class="pad_4">{CAPTCHA_HTML}</div>
|
||||||
<input onclick="submitted = true;" title="Ctrl+Enter" type="submit" name="post" class="bold" value="{L_SUBMIT}" />
|
<input type="submit" name="preview" value="{L_PREVIEW}" id="post-preview-btn" onclick="$('#post-submit').remove();">
|
||||||
<input type="button" value="{L_AJAX_PREVIEW}" onclick="ajax.exec({ action: 'posts', type: 'view_message', message: $('textarea#message').val()});">
|
<input onclick="submitted = true;" title="Ctrl+Enter" type="submit" name="post" class="bold" value="{L_SUBMIT}" id="post-submit-btn">
|
||||||
|
<input type="button" value="{L_AJAX_PREVIEW}" onclick="ajax.exec({ action: 'posts', type: 'view_message', message: $('textarea#message').val()});">
|
||||||
|
</div>
|
||||||
|
<div id="post-js-warn">Для отправки сообщений необходимo включить JavaScript</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var submitted = false;
|
function dis_submit_btn ()
|
||||||
|
{
|
||||||
|
$('#post-submit-btn').attr('disabled', 1);
|
||||||
|
//debounce('post-submit-btn', 3000);
|
||||||
|
}
|
||||||
|
|
||||||
|
function debounce (el_id, time_ms)
|
||||||
|
{
|
||||||
|
var $el = $('#'+el_id);
|
||||||
|
if ( $el.attr('disabled') == false ) {
|
||||||
|
$el.attr('disabled', 1);
|
||||||
|
setTimeout(function(){ $el.attr('disabled', 0); }, time_ms);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('#post-submit-btn').click(function(event){
|
||||||
|
$('#post-submit-btn').after('<input id="post-submit" type="hidden" name="post" value="1" />');
|
||||||
|
});
|
||||||
|
$('#post-js-warn').hide();
|
||||||
|
$('#post-buttons-block').show();
|
||||||
|
$('#post-submit-btn').attr('disabled', 0);
|
||||||
|
});
|
||||||
|
|
||||||
// Called before form submitting.
|
// Called before form submitting.
|
||||||
|
var submitted = false;
|
||||||
|
|
||||||
function checkForm(form) {
|
function checkForm(form) {
|
||||||
var formErrors = false;
|
var formErrors = false;
|
||||||
if (form.message.value.length < 2) {
|
if (form.message.value.length < 2) {
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
<!-- IF QUICK_REPLY -->
|
<!-- IF QUICK_REPLY -->
|
||||||
<div class="spacer_6"></div>
|
<div class="spacer_6"></div>
|
||||||
|
|
||||||
<form action="{S_PRIVMSGS_ACTION}" method="post" name="post" onsubmit="return checkForm(this);">
|
<form action="{S_PRIVMSGS_ACTION}" method="post" name="post" onsubmit="if(checkForm(this)){ dis_submit_btn(); }else{ return false; }">
|
||||||
{S_HIDDEN_FIELDS}
|
{S_HIDDEN_FIELDS}
|
||||||
|
|
||||||
<table class="topic" cellpadding="0" cellspacing="0">
|
<table class="topic" cellpadding="0" cellspacing="0">
|
||||||
|
|
|
@ -359,7 +359,7 @@ function set_hid_chbox (id)
|
||||||
</table><!--/pagination-->
|
</table><!--/pagination-->
|
||||||
|
|
||||||
<!-- IF QUICK_REPLY -->
|
<!-- IF QUICK_REPLY -->
|
||||||
<form action="{QR_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this);">
|
<form action="{QR_POST_ACTION}" method="post" name="post" onsubmit="if(checkForm(this)){ dis_submit_btn(); }else{ return false; }">
|
||||||
<input type="hidden" name="mode" value="reply" />
|
<input type="hidden" name="mode" value="reply" />
|
||||||
<input type="hidden" name="t" value="{QR_TOPIC_ID}" />
|
<input type="hidden" name="t" value="{QR_TOPIC_ID}" />
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue