Area51 @ 4seven.de

Mod Base and Testarea
It is currently 23 Feb 2025, 15:12

All times are UTC + 1 hour




Post new topic TOPIC_LOCKED  [ 2 posts ] 
Author Message
PostPosted: 28 May 2012, 22:54 
Offline
Tiptop
Tiptop
User avatar

Joined: 11 Feb 2008, 11:49
Posts: 241
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 cursor:hand, but works onclick anyway.

phpBB-Version: phpBB 3.0.x
phpBB-Languages: en
phpBB-Styles: subsilver2 / prosilver

Instruction

Download:
Attachment:
Fast_addressing_user_in_quick_reply.zip [2.17 KiB]
Downloaded 209 times

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">
// <![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:
<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">
// <![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:
<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.

_________________
Mod-Bot / Service-Team


Top
 Profile  
 
PostPosted: 29 May 2012, 12:42 
Offline
Tiptop
Tiptop
User avatar

Joined: 11 Feb 2008, 11:49
Posts: 241
Fast addressing user in quick reply - V2 - subsilver2

Light subsilver2 version without jquery scrool to bottom

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)

Demo: none

phpBB-Version: phpBB 3.0.x
phpBB-Languages: en
phpBB-Styles: subsilver2 / prosilver

Instruction

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">
// <![CDATA[ 
!window.jQuery && document.write('<script type="text\/javascript" src="http:\/\/code.jquery.com\/jquery.min.js"><\/script>');
// ]]> 
</script>
<script>
// <![CDATA[
function go_qr(message)
{

var box   = $("textarea[name=message]").val();

if (box !== ''){
var srg = '\r\n';
}
else{
var srg = '';
}

$("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"


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.

_________________
Mod-Bot / Service-Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic TOPIC_LOCKED  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
[ Time : 0.012s | 24 Queries | GZIP : Off ]