Turn PM Preview Off?

Discussion forum for MOD Writers regarding MOD Development.
Locked
wizer
Registered User
Posts: 85
Joined: Sat Mar 27, 2010 11:34 pm
Location: London, UK
Name: Tom
Contact:

Turn PM Preview Off?

Post by wizer »

Probably simple this. But I can't find the setting for it.

Where can I turn off PM previews for my board?

phpbb3 3.0.7PL

TIA
Want to say thanks for receiving great advice or support from the phpBB Community? Make a donation to OSUOSL (the group that hosts phpBB.com) OR buy some merchandise from the phpBB Shop
User avatar
Rahber
Former Team Member
Posts: 2720
Joined: Tue Feb 12, 2008 3:39 pm
Location: Pakistan
Name: Rahber
Contact:

Re: Turn PM Preview Off?

Post by Rahber »

open posting_editor.html
find

Code: Select all

<input type="submit" tabindex="5" name="preview" value="{L_PREVIEW}" class="button1"<!-- IF not S_PRIVMSGS --> onclick="document.getElementById('postform').action += '#preview';"<!-- ENDIF --> />&nbsp;
repalce it with

Code: Select all

<!-- IF not S_PRIVMSGS --><input type="submit" tabindex="5" name="preview" value="{L_PREVIEW}" class="button1"<!-- IF not S_PRIVMSGS --> onclick="document.getElementById('postform').action += '#preview';"<!-- ENDIF --> />&nbsp;<!-- ENDIF --> 
refresh your templates

this edit will remove the preview button when you are in composing private message window :D
wizer
Registered User
Posts: 85
Joined: Sat Mar 27, 2010 11:34 pm
Location: London, UK
Name: Tom
Contact:

Re: Turn PM Preview Off?

Post by wizer »

Thanks Rahber, but this is not what I want. I still want members to have the ability to preview their message, but I don't want it to forced when you click submit. At the moment if I type a message but don't want to preview it, when I click submit it forces me to preview. I find this confusing and a lot of members are not realising they have to click submit again.
Want to say thanks for receiving great advice or support from the phpBB Community? Make a donation to OSUOSL (the group that hosts phpBB.com) OR buy some merchandise from the phpBB Shop
User avatar
RMcGirr83
Former Team Member
Posts: 21680
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Turn PM Preview Off?

Post by RMcGirr83 »

That only happens when you input a users name and don't click "Add" prior to hitting the submit button. The software checks to make sure that the user name you inputted actually exists prior to submission which is why you see a preview of the PM.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beerImage
wizer
Registered User
Posts: 85
Joined: Sat Mar 27, 2010 11:34 pm
Location: London, UK
Name: Tom
Contact:

Re: Turn PM Preview Off?

Post by wizer »

No way to turn that off? I'd rather it just returned a 'Unknown User' message if the username(s) don't exist.
Want to say thanks for receiving great advice or support from the phpBB Community? Make a donation to OSUOSL (the group that hosts phpBB.com) OR buy some merchandise from the phpBB Shop
User avatar
RMcGirr83
Former Team Member
Posts: 21680
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Turn PM Preview Off?

Post by RMcGirr83 »

You can try this

OPEN

includes/ucp/ucp_pm_compose.php

FIND (on or about line 1154)

Code: Select all

		// Preview is only true if there was also a message entered
		if (request_var('message', ''))
		{
			$preview = true;
		}
REPLACE WITH

Code: Select all

/*
		// Preview is only true if there was also a message entered
		if (request_var('message', ''))
		{
			$preview = true;
		}
*/
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beerImage
wizer
Registered User
Posts: 85
Joined: Sat Mar 27, 2010 11:34 pm
Location: London, UK
Name: Tom
Contact:

Re: Turn PM Preview Off?

Post by wizer »

Thanks for that. What that does is turn off the preview, but if you haven't added the name, clicking submit will add the name and stop. Instead of adding the name and then sending.

If there isn't an easy way around that, I'd be happy with going back to the preview, but with a message saying something like "You did not add the senders name to the message" or maybe a message on the first Compose PM screen which states "You need to click 'Add' once you have typed the username. Just so it's not confusing for people.
Want to say thanks for receiving great advice or support from the phpBB Community? Make a donation to OSUOSL (the group that hosts phpBB.com) OR buy some merchandise from the phpBB Shop
User avatar
RMcGirr83
Former Team Member
Posts: 21680
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Turn PM Preview Off?

Post by RMcGirr83 »

Code: Select all

		// Preview is only true if there was also a message entered
		if (request_var('message', ''))
		{
			$preview = true;
			$error[] = 'You did not add the senders name to the message.';
		}
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beerImage
wizer
Registered User
Posts: 85
Joined: Sat Mar 27, 2010 11:34 pm
Location: London, UK
Name: Tom
Contact:

Re: Turn PM Preview Off?

Post by wizer »

That works perfectly. Thanks very much.
Want to say thanks for receiving great advice or support from the phpBB Community? Make a donation to OSUOSL (the group that hosts phpBB.com) OR buy some merchandise from the phpBB Shop
User avatar
RMcGirr83
Former Team Member
Posts: 21680
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Turn PM Preview Off?

Post by RMcGirr83 »

Well it isn't exactly perfect...if a user inputs a wrong user name they will get two messages. The one I gave you and another stating the user doesn't exist.

But "Good enough for government work"? :?

...and you're welcome. :)
Last edited by RMcGirr83 on Fri Jul 09, 2010 6:57 pm, edited 1 time in total.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beerImage
wizer
Registered User
Posts: 85
Joined: Sat Mar 27, 2010 11:34 pm
Location: London, UK
Name: Tom
Contact:

Re: Turn PM Preview Off?

Post by wizer »

I didn't think to test a non-existent username. IT's fine, I can live with that double message.

Cheers
Want to say thanks for receiving great advice or support from the phpBB Community? Make a donation to OSUOSL (the group that hosts phpBB.com) OR buy some merchandise from the phpBB Shop
Locked

Return to “[3.0.x] MOD Writers Discussion”