Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-17-2014, 02:47 AM
yukirina yukirina is offline
 
Join Date: Apr 2014
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Clicking on reply adding text

I've been trying to do this for a while, but is it possible to add a username of the person you're replying to in the quick reply box when you click on "reply"? No, this isn't quoting. I just want raw text of the username of the post you're replying to. This is what I'm hoping for:

User Bob posts a message on a thread.
User Charlie replies to Bob using "reply". The quick reply box shows right beneath. Normally it's empty, but in my case it should say:

[Bob ]
Without the brackets, but with the space.

I've been looking for what the template would give me and I believe this is the snippet that's relevant:

Code:
<vb:if condition="$show['quickreply'] AND !$show['threadedmode']">
<a id="qr_{vb:raw post.postid}" class='quickreply' href="{vb:raw post.replylink}&amp;noquote=1" rel="nofollow" title="{vb:rawphrase quick_reply_to_this_message}"><img id="replyimg_{vb:raw post.postid}" src="{vb:raw vboptions.cleargifurl}" alt="{vb:rawphrase quick_reply_to_this_message}" /> {vb:rawphrase reply}</a> 
<span class="seperator">&nbsp;</span>
</vb:if>
The question is vb:raw post.replylink. I can't seem to find where this is. I don't think I should edit that though, and instead work on a different variable instead (since I want "reply with quote" to still function as needed and it also seems to use the same raw variable).

Any suggestions and help?
Reply With Quote
  #2  
Old 06-17-2014, 09:28 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think you're going to be able to do that by editing a template. I think how it works is that when you click the quick reply button, some javascript creates an instance of the editor and displays it under the post. Of course it's possible to put some initial text in the editor, but I think you'd probably have to add or modify javascript to do it.
Reply With Quote
  #3  
Old 06-21-2014, 05:26 PM
yukirina yukirina is offline
 
Join Date: Apr 2014
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What javascript would I have to edit?
Reply With Quote
  #4  
Old 06-22-2014, 07:57 AM
CAG CheechDogg's Avatar
CAG CheechDogg CAG CheechDogg is offline
 
Join Date: Feb 2012
Location: Riverside, California USA
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wouldn't this do what you are asking for ....

https://vborg.vbsupport.ru/showthread.php?t=287620
Reply With Quote
  #5  
Old 06-22-2014, 09:16 AM
tbworld tbworld is offline
 
Join Date: Oct 2008
Posts: 2,126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Temporarily Reserved
Reply With Quote
  #6  
Old 06-22-2014, 12:16 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CAG CheechDogg View Post
Wouldn't this do what you are asking for ....

https://vborg.vbsupport.ru/showthread.php?t=287620
That doesn't seem to put the name in the editor text area, it seems like that puts it in the title when the post is displayed. But yeah, maybe that will solve yukirina's problem.

BTW, to answer the above question I don't know what javascript to change, I'm only assuming it could be done somehow.
Reply With Quote
Благодарность от:
CAG CheechDogg
  #7  
Old 06-22-2014, 11:01 PM
yukirina yukirina is offline
 
Join Date: Apr 2014
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CAG CheechDogg View Post
Wouldn't this do what you are asking for ....

https://vborg.vbsupport.ru/showthread.php?t=287620
No, this isn't exactly what I want. This just replaces the display of the postbit with replacement text, when I actually want that text to be part of the database, as in, that text should be editable as well. But it's close!

Edit: I looked around and found a mod that has a skeleton of what I want, but I don't know how to make use of it. This is from vBulletin 3 so I can't use it (I use 4.2.2), nor do I really want to, as this is not what I'm looking for. But this mod allows you to select one of the "canned replies" you wrote which will instantly write it out. I think that's what it does. This seems to be the relevant portion of the XML that I opened up:

HTML Code:
	<plugins>
		<plugin active="1" executionorder="5">
			<title>Canned Replies</title>
			<hookname>global_start</hookname>
			<phpcode><![CDATA[if ($permissions['cannedreplies'] & $vbulletin->bf_ugp['cannedreplies']['canusecr']) {
if (THIS_SCRIPT == 'newreply' OR THIS_SCRIPT == 'newthread' OR THIS_SCRIPT == 'infraction' OR THIS_SCRIPT == 'private' OR THIS_SCRIPT == 'showthread') {
$userid = $vbulletin->userinfo['userid'];
$crtest .= "$vbphrase[cannedreplies]: <br />";
$crtest .= "<select onchange=\"insertAtCaret(this.options[this.selectedIndex].value)\">";
$crtest .= "<option value=\"\"></option>";
$crs = $db->query_read("SELECT id, title, reply FROM " . TABLE_PREFIX . "cannedreplies WHERE userid=$userid || reply LIKE '{share}%' || reply LIKE '{share}%' ORDER BY title ASC");
    while($row = $db->fetch_array($crs)) {
                $row[reply] = preg_replace("#(\r\n|\n|\r)#s", "\r\n <br>", addslashes($row[reply]));
		$row[reply] = str_replace('\"', '"', $row[reply]);
		$row[reply] = str_replace("\'", ''', $row[reply]);
                $crtest .= "<option value=\"$row[reply]\">$row[title]</option>";
    }
$crtest .= "</select>";
} }]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Canned Replies Javascript AutoInsert</title>
			<hookname>parse_templates</hookname>
			<phpcode><![CDATA[if ($permissions['cannedreplies'] & $vbulletin->bf_ugp['cannedreplies']['canusecr']) {
if (THIS_SCRIPT == 'newreply' OR THIS_SCRIPT == 'newthread' OR THIS_SCRIPT == 'infraction' OR THIS_SCRIPT == 'private' OR THIS_SCRIPT == 'showthread') {
if (THIS_SCRIPT == 'showthread') {
$editorid = "vB_Editor_QR";
} else {
$editorid = "vB_Editor_001";
}
eval('$crjs = "' . fetch_template('cr_js') . '";');
$vbulletin->templatecache['pm_newpm'] = str_replace('<form', '$crjs <form', $vbulletin->templatecache['pm_newpm']);
$vbulletin->templatecache['newthread'] = str_replace('</head>', '$crjs </head>', $vbulletin->templatecache['newthread']);
$vbulletin->templatecache['newreply'] = str_replace('</head>', '$crjs </head>', $vbulletin->templatecache['newreply']);
$vbulletin->templatecache['userinfraction'] = str_replace('</head>', '$crjs </head>', $vbulletin->templatecache['userinfraction']);
$vbulletin->templatecache['SHOWTHREAD'] = str_replace('</head>', '$crjs </head>', $vbulletin->templatecache['SHOWTHREAD']);
} }]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Parser</title>
			<hookname>parse_templates</hookname>
			<phpcode><![CDATA[if ($permissions['cannedreplies'] & $vbulletin->bf_ugp['cannedreplies']['canusecr']) {
if (THIS_SCRIPT == 'profile' OR THIS_SCRIPT == 'private' OR THIS_SCRIPT == 'usercp') {
$cannedreplieslink = "<tr><td class=\"alt2\" nowrap=\"nowrap\"><a class=\"smallfont\" href=\"cannedreplies.php?$session[sessionurl]\">Edit Your $vbphrase[cannedreplies]</a></td></tr>";
$vbulletin->templatecache['USERCP_SHELL'] = str_replace('$vbphrase[edit_ignore_list]</a></td></tr>','$vbphrase[edit_ignore_list]</a></td></tr>$cannedreplieslink',$vbulletin->templatecache['USERCP_SHELL']); }
}]]></phpcode>
		</plugin>
		<plugin active="1" executionorder="5">
			<title>Parser 2</title>
			<hookname>parse_templates</hookname>
			<phpcode><![CDATA[if ($permissions['cannedreplies'] & $vbulletin->bf_ugp['cannedreplies']['canusecr']) {
if (THIS_SCRIPT == 'newreply' OR THIS_SCRIPT == 'newthread' OR THIS_SCRIPT == 'infraction' OR THIS_SCRIPT == 'private' OR THIS_SCRIPT == 'showthread') {
$crdd = "<div class=\"smallfont\"> $crtest </div><br />";
$vbulletin->templatecache['pm_newpm'] = str_replace('<!-- / subject field -->', '<!-- / subject field -->$crdd', $vbulletin->templatecache['pm_newpm']);
$vbulletin->templatecache['newthread'] = str_replace('<!-- / subject field -->', '<!-- / subject field -->$crdd', $vbulletin->templatecache['newthread']);
$vbulletin->templatecache['newreply'] = str_replace('<!-- / subject field -->', '<!-- / subject field -->$crdd', $vbulletin->templatecache['newreply']);
$vbulletin->templatecache['userinfraction'] = str_replace('<!-- / note field -->', '<!-- / note field --> $crdd', $vbulletin->templatecache['userinfraction']);
$vbulletin->templatecache['SHOWTHREAD'] = str_replace('$vbphrase[message]', '$crdd $vbphrase[message]', $vbulletin->templatecache['SHOWTHREAD']);
} }]]></phpcode>
		</plugin>
	</plugins>
Not sure if this will help but I think answer lies in here somewhere!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:57 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03921 seconds
  • Memory Usage 2,244KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)bbcode_html
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (1)post_thanks_box_bit
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete