Addition #1 for genuine phpBB3 QR for v.0.0.2openviewtopic.php
findCode:
($topic_data['topic_status'] == ITEM_LOCKED) ? $qr_hidden_fields['lock_topic'] = 1 : true;
after addCode:
$sql_last_sel = 'SELECT last_post_text
FROM ' . USERS_TABLE . "
WHERE user_id = " . (int) $user->data['user_id'];
$result_last_sel = $db->sql_query_limit($sql_last_sel, 1);
$last_sel = $db->sql_fetchrowset($result_last_sel);
$db->sql_freeresult($result_last_sel);
findCode:
'S_QUICK_REPLY' => true,
after addCode:
'POST_SAVE_INSERT' => (!empty($last_sel[0]['last_post_text'])) ? $last_sel[0]['last_post_text'] : '',
openstyles/prosilver/tenplate/quickreply_editor.html
find (the second find)
Code:
<form method="post" action="{U_QR_ACTION}">
replace withCode:
<form method="post" id="qr_protection" action="{U_QR_ACTION}">
find (the second find)
Code:
<dd><input type="text" name="subject" id="subject" size="45" maxlength="64" tabindex="2" value="{SUBJECT}" class="inputbox autowidth" />
after addCode:
<!-- Post Crash Protection / Addition <!-- IF S_USER_LOGGED_IN && (SCRIPT_NAME eq 'viewtopic') -->
<script type="text/javascript">
!window.jQuery && document.write('<script type="text\/javascript" src="http:\/\/code.jquery.com\/jquery-latest.min.js"><\/script>');
</script>
<input type="hidden" id="content" value="{POST_SAVE_INSERT}" />
<script type="text/javascript">
// <![CDATA[
function imgcopy(){
var copy = $('#content').val();
document.forms['qr_protection'].message.value += copy;
document.forms['qr_protection'].message.focus();
return false;
}
$(document).ready(function(){
var refreshId = setInterval(function() {
$('#post_save').load('post_crash_protection.php?text=' +encodeURIComponent($('#message').val()));
}, 12000);
});
// ]]>
</script>
<input type="button" class="button2" value="{L_INSR_SAVED_POST_TEXT}" onclick="imgcopy();" />
<div id="post_save" style="display: none;"></div>
<!-- ENDIF -->
<!-- Post Crash Protection / Addition #1 / 4seven / 2011 -->
If you dont find an
id="message"
before/after
name="message"
in the second find of
Code:
<div id="message-box">
<textarea style="height: 9em;" name="message" rows="7" cols="76" tabindex="3" class="inputbox"></textarea>
</div>
than change it to
Code:
<div id="message-box">
<textarea style="height: 9em;" name="message" id="message" rows="7" cols="76" tabindex="3" class="inputbox"></textarea>
</div>
- Clear all Board- and Browser-Caches
- Adjust this Code-Part
Code:
12000
in styles/prosilver/template/quickreply_editor.html
to set the Intervall of Saving in Milliseconds.