View Full Version : How to Add Line Breaks in PM quickreply
joeychgo
12-22-2014, 03:34 AM
this applies to both vb3 and 4
The quick reply box on PMs quotes the prior message. I get many pms where the user just started typing anywhere, making it a hunt and find mission to find what they said.
What I would like to see is a few line breaks and a line that says **** do not type below this line*** to precede the quoted text.
HM666
12-22-2014, 07:41 AM
I'm not sure but possibly that is something you could code into the template that handles PM replies.
joeychgo
12-23-2014, 02:20 AM
Yeah, I kinda thought that but - where?
HM666
12-23-2014, 02:59 AM
Yeah, I kinda thought that but - where?
Good question. I looked around a little bit but did not find where it could be put. I'm assuming that you would want it to show above the quoted PM so that members know not to go below that line, correct? Its kinda tricky with the editor being in place there. The code would have to placed some where within either a template that deals with the editor or for the editor or hard coded into the php in the editor. I'm not quite sure where that would go.
joeychgo
12-23-2014, 07:24 AM
Yes, that's my thinking....
Something has to be feeding the editor
CAG CheechDogg
12-23-2014, 08:10 AM
Go to your "newpost_quote" template ...
and follow this post here by kh99:
https://vborg.vbsupport.ru/showpost.php?p=2408041&postcount=59
--------------- Added 1419330028 at 1419330028 ---------------
Hey wait !!! lol ...that's you in that quote !!!! lol
joeychgo
12-23-2014, 08:58 AM
Not quite. It doesn't add the text
********* DON'T WRITE BELOW THIS LINE **********
--------------- Added 1419332387 at 1419332387 ---------------
Im also not sure how that would add line breaks
You want to add line breaks before that message? You should be able to do it by adding as many <br/> as you want.
joeychgo
12-23-2014, 10:17 PM
But where? all I have is this
<if condition="THIS_SCRIPT == 'private'">
</if>{$pagetext}
I don't know where to put it in the newpm_quote template and I don't see any indication of where any <br /> would go in there
ozzy47
12-23-2014, 11:09 PM
How about ********* DON'T WRITE ABOVE THIS LINE **********
Then users could type in below it?
--------------- Added 23 Dec 2014 at 19:13 ---------------
Actually hold on, I might have it the way you want.
ozzy47
12-23-2014, 11:49 PM
Ok lets do this. We will create a new plugin.
Product: vBulletin
Hook Location : private_newpm_reply
Title: Add Text To Pm
Execution Order : 5
Plugin PHP Code:
$pm['message'] = "
********* DO NOT WRITE BELOW THIS LINE **********
".$pm['message']."
";
joeychgo
12-24-2014, 08:31 AM
PERFECT!!!!!!!!!!!!!!!!!!!
Thank you!
CAG CheechDogg
12-24-2014, 08:37 AM
Ozzy... how would you do this so that when you start typing the predefined text disappears automatically .... that would be even GOODER !!!
ozzy47
12-24-2014, 09:16 AM
Yeah I tried a couple of ways to make the line disappear, but to no avail. If I get some time I'll look into it more.
CAG CheechDogg
12-24-2014, 09:18 AM
Ok good stuff ozzy once again thanks !!!!
But where? all I have is this
I don't know where to put it in the newpm_quote template and I don't see any indication of where any <br /> would go in there
I meant just put <br/><br/> at the beginning. But it sounds like you got it working a different way.
Edit: ...which is good because now that I get around to trying it, it doesn't seem to work. Sorry about that.
ozzy47
12-24-2014, 09:50 AM
Ok lets do this, this will hide the line in the display of the PM's
Product: vBulletin
Hook Location : postbit_display_complete
Title: Hide Text In Pm
Execution Order : 5
Plugin PHP Code:
if (THIS_SCRIPT == 'private')
{
$find = '********* DO NOT WRITE BELOW THIS LINE **********';
$replace = '';
$this->post['message'] = str_replace($find, $replace, $this->post['message']);
}
CAG CheechDogg
12-24-2014, 11:43 AM
Ok lets do this, this will hide the line in the display of the PM's
Product: vBulletin
Hook Location : postbit_display_complete
Title: Hide Text In Pm
Execution Order : 5
Plugin PHP Code:
if (THIS_SCRIPT == 'private')
{
$find = '********* DO NOT WRITE BELOW THIS LINE **********';
$replace = '';
$this->post['message'] = str_replace($find, $replace, $this->post['message']);
}
Yeeerp !!! that did the job ...good stuff Ozzy !!! thanks once again ..
ozzy47
12-24-2014, 11:46 AM
Not a problem, glad to help. :)
CAG CheechDogg
12-24-2014, 11:49 AM
Only thing is that when you have a few pm's in the conversation you will see the message "********* DO NOT WRITE BELOW THIS LINE **********" over and over again lol ..
ozzy47
12-24-2014, 11:50 AM
Yeah I know, but there is no easy way around that.
CAG CheechDogg
12-24-2014, 11:51 AM
How would you prevent the pm from being quoted automatically..is there a setting for that?
--------------- Added 1419429140 at 1419429140 ---------------
Yeah I know, but there is no easy way around that.
Yeah ...no worries about that ...pretty cool how this works though..im learning more and more ....:)
ozzy47
12-24-2014, 11:55 AM
There was a mod somewhere to do that, I'll look when I get home later.
CAG CheechDogg
12-24-2014, 11:56 AM
There was a mod somewhere to do that, I'll look when I get home later.
Ok good stuff...I been searching the last couple of nights and haven't found it ..lol .. and I remember running into it a while ago .... :)
If you just want the quote to not appear when you reply to a pm, you can edit the template newpost_quote and remove the quote. But since the same template is used when replying to posts (and maybe other places like the blog), you'd probably want to put in a condition that checks for pms, like:
<vb:if condition="THIS_SCRIPT != 'private'">{vb:raw pagetext}</vb:if>
and just for the record, adding line breaks to that template (so that there's space between the top and the quote) does work, but I was wrong about using <br/> because the template is not html, it's bbcode. You can just use blank lines and it should work.
CAG CheechDogg
12-24-2014, 03:22 PM
The blank line's wont work kh99 ... I tried that from your thread to joey in this post:
https://vborg.vbsupport.ru/showpost.php?p=2408041&postcount=59
Thanks for the condition though !!!!
Hmm, that's strange, I just tried it before posting that. But I just looked at the reply box and I didn't actually send a message. Or maybe it depends on some other options or something, I don't know. But I was wrong about using <br/>.
ozzy47
12-24-2014, 04:25 PM
Ok good stuff...I been searching the last couple of nights and haven't found it ..lol .. and I remember running into it a while ago .... :)
Ok lets do this.
Product: vBulletin
Hook Location : editor_toobar_start
Title: Remove Quote In Pm
Execution Order : 5
Plugin PHP Code:
if (THIS_SCRIPT == 'private' AND $editor_type == 'qr')
{
$text = '';
}Now that will also override the previous plugin that set the Do Not Reply Below bla,bla,bla
CAG CheechDogg
12-24-2014, 08:01 PM
Ok lets do this.
Product: vBulletin
Hook Location : editor_toobar_start
Title: Remove Quote In Pm
Execution Order : 5
Plugin PHP Code:
if (THIS_SCRIPT == 'private' AND $editor_type == 'qr')
{
$text = '';
}Now that will also override the previous plugin that set the Do Not Reply Below bla,bla,bla
OOOOOH YEAH !!! Good stuff ozzy !!! That did it ...MUAHAHAH !!!!! Thank you once again ...
ozzy47
12-24-2014, 08:14 PM
Not a problem. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.