vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   How to Add Line Breaks in PM quickreply (https://vborg.vbsupport.ru/showthread.php?t=316151)

joeychgo 12-22-2014 03:34 AM

How to Add Line Breaks in PM quickreply
 
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

Quote:

Originally Posted by joeychgo (Post 2528407)
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....1&postcount=59

--------------- Added [DATE]1419330028[/DATE] at [TIME]1419330028[/TIME] ---------------

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 [DATE]1419332387[/DATE] at [TIME]1419332387[/TIME] ---------------

Im also not sure how that would add line breaks

kh99 12-23-2014 10:13 AM

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

Quote:

<if condition="THIS_SCRIPT == 'private'">
</if>
Quote:

Originally Posted by $originalposter
{$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:
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 !!!!

kh99 12-24-2014 09:39 AM

Quote:

Originally Posted by joeychgo (Post 2528542)
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:
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

Quote:

Originally Posted by ozzy47 (Post 2528610)
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:
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 [DATE]1419429140[/DATE] at [TIME]1419429140[/TIME] ---------------

Quote:

Originally Posted by ozzy47 (Post 2528632)
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

Quote:

Originally Posted by ozzy47 (Post 2528635)
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 .... :)

kh99 12-24-2014 12:30 PM

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:
Code:

<vb:if condition="THIS_SCRIPT != 'private'">[QUOTE={vb:raw originalposter}]{vb:raw pagetext}[/QUOTE]</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....1&postcount=59

Thanks for the condition though !!!!

kh99 12-24-2014 03:32 PM

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

Quote:

Originally Posted by CAG CheechDogg (Post 2528636)
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:
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

Quote:

Originally Posted by ozzy47 (Post 2528676)
Ok lets do this.

Product: vBulletin
Hook Location : editor_toobar_start
Title: Remove Quote In Pm
Execution Order : 5
Plugin PHP Code:
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. :)


All times are GMT. The time now is 11:21 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02074 seconds
  • Memory Usage 1,782KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (30)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete