Fast addressing user in quick reply Request by: FeyFreRequest topic: http://www.phpbb.com/community/viewtopi ... &t=2156740Description: "In viewtopic, each post author name becomes a link, which on click inserts this name to quick reply textarea surrounded by bold bb-code"
(FeyFre)With smooth jq scroll-to-bottom..
Demo:subsilver2:
http://4seven.bplaced.net/forum/media/viewto ... f=10&t=365prosilver:
http://4seven.bplaced.net/forum/media/viewto ... f=10&t=365Guest-Names have no
cursor:hand
, but works
onclick
anyway.
phpBB-Version: phpBB 3.0.x
phpBB-Languages: en
phpBB-Styles: subsilver2 / prosilver
InstructionDownload: Attachment:
open
styles/subsilver2/template/viewtopic_body.html
find
Code:
<!-- BEGIN postrow -->
before add
Code:
<!-- Fast addressing user in quick reply / 4_seven / 2012 -->
<!-- IF S_QUICK_REPLY -->
<script type="text/javascript">
!window.jQuery && document.write('<script type="text\/javascript" src="http:\/\/code.jquery.com\/jquery.min.js"><\/script>');
</script>
<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/scroll-startstop.events.jquery.js"></script>
<script>
// <![CDATA[
function go_qr(message)
{
var $elem = $('.ltr');
var box = $("textarea[name=message]").val();
if (box !== ''){
var srg = '\r\n';
}
else{
var srg = '';
}
$('html, body').animate({scrollTop: $elem.height()}, 800);
$("textarea[name=message]").append(srg + message);
}
// ]]>
</script>
<!-- ENDIF -->
<!-- Fast addressing user in quick reply / 4_seven / 2012 -->
find
Code:
<b class="postauthor"
replace with
Code:
<b<!-- IF S_QUICK_REPLY --> onclick="go_qr('[b]{postrow.POST_AUTHOR}[/b]'); return false;"<!-- ENDIF --> class="postauthor"
open
styles/prosilver/template/viewtopic_body.html
find
Code:
<!-- BEGIN postrow -->
before add
Code:
<!-- Fast addressing user in quick reply / 4_seven / 2012 -->
<!-- IF S_QUICK_REPLY -->
<script type="text/javascript">
!window.jQuery && document.write('<script type="text\/javascript" src="http:\/\/code.jquery.com\/jquery.min.js"><\/script>');
</script>
<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/scroll-startstop.events.jquery.js"></script>
<script>
// <![CDATA[
function go_qr(message)
{
var $elem = $('#phpbb');
var box = $("textarea[name=message]").val();
if (box !== ''){
var srg = '\r\n';
}
else{
var srg = '';
}
$('html, body').animate({scrollTop: $elem.height()}, 800);
if (document.getElementById('qr_editor_div').style.display == 'none'){
hide_qr(true);
}
$("textarea[name=message]").append(srg + message);
}
// ]]>
</script>
<!-- ENDIF -->
<!-- Fast addressing user in quick reply / 4_seven / 2012 -->
find
Code:
<strong>{postrow.POST_AUTHOR_FULL}</strong>
replace with
Code:
<strong<!-- IF S_QUICK_REPLY --> onclick="go_qr('[b]{postrow.POST_AUTHOR}[/b]'); return false;"<!-- ENDIF -->>{postrow.POST_AUTHOR_FULL}</strong>
Note:You can add multiple usernames by click. They will be inserted with a linebreak after each.
But, if you want do do so, click all usernames first, then write your answer or change the
content of the qr postbox. Otherwise the script stops and must be reactivated via strg + f5.