[Snippet] Fast addressing user in quick reply

Fast addressing user in quick reply
Request by: FeyFre
Request topic: http://www.phpbb.com/community/viewtopi ... &t=2156740
Description:
"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=365
prosilver: http://4seven.bplaced.net/forum/media/viewto ... f=10&t=365
Guest-Names have no
phpBB-Version: phpBB 3.0.x
phpBB-Languages: en
phpBB-Styles: subsilver2 / prosilver
Instruction
Download:
open
styles/subsilver2/template/viewtopic_body.html
find
before add
find
replace with
open
styles/prosilver/template/viewtopic_body.html
find
before add
find
replace with
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.
Request by: FeyFre
Request topic: http://www.phpbb.com/community/viewtopi ... &t=2156740
Description:
"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=365
prosilver: http://4seven.bplaced.net/forum/media/viewto ... f=10&t=365
Guest-Names have no
cursor:hand
, but works onclick
anyway.phpBB-Version: phpBB 3.0.x
phpBB-Languages: en
phpBB-Styles: subsilver2 / prosilver
Instruction
Download:
open
styles/subsilver2/template/viewtopic_body.html
find
- Code: Select all
<!-- BEGIN postrow -->
before add
- Code: Select all
<!-- Fast addressing user in quick reply / 4_seven / 2012 -->
<!-- IF S_QUICK_REPLY -->
<script type="text/javascript">
// <![CDATA[
!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: Select all
<b class="postauthor"
replace with
- Code: Select all
<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: Select all
<!-- BEGIN postrow -->
before add
- Code: Select all
<!-- Fast addressing user in quick reply / 4_seven / 2012 -->
<!-- IF S_QUICK_REPLY -->
<script type="text/javascript">
// <![CDATA[
!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: Select all
<strong>{postrow.POST_AUTHOR_FULL}</strong>
replace with
- Code: Select all
<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.