Minimum post count before PM allowed

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Suggested Hosts
Locked
amochohan
Registered User
Posts: 92
Joined: Tue Dec 11, 2007 2:59 pm

Minimum post count before PM allowed

Post by amochohan »

Is this possible? I've just had my board attacked by spammers overnight, and had to clean out over 20,000 PM's.

Can I have it so that there's a minimum post count before members can send Private messages? Say 10 posts

Paul
Infrastructure Team Leader
Infrastructure Team Leader
Posts: 25658
Joined: Sat Dec 04, 2004 3:44 pm
Location: The netherlands.
Name: Paul Sohier
Contact:

Re: Minimum post count before PM allowed

Post by Paul »

Moved to MOD requests.
Knock knock
Race condition
Who's there?

My BlogMy Photosmy phpBB Extensionscustom phpBB work & Development

amochohan
Registered User
Posts: 92
Joined: Tue Dec 11, 2007 2:59 pm

Re: Minimum post count before PM allowed

Post by amochohan »

This isn't a mod request...

I've actually written some code to do this myself.

Open includes/ucp/ucp_pm.php

Find:

Code: Select all

case 'compose'
change

Code: Select all

$action = request_var('action', 'post');

					get_folder($user->data['user_id']);

					if (!$auth->acl_get('u_sendpm'))
					{
						trigger_error('NO_AUTH_SEND_MESSAGE');
					}

					include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx);
					compose_pm($id, $mode, $action);

					$tpl_file = 'posting_body';

to:

Code: Select all

if ($user->data['user_posts'] <10){
					trigger_error ("You must have made a minimum of 10 posts within the forum to use the Private Messaging function.");
				}
				else
				{
					$action = request_var('action', 'post');

					get_folder($user->data['user_id']);

					if (!$auth->acl_get('u_sendpm'))
					{
						trigger_error('NO_AUTH_SEND_MESSAGE');
					}

					include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx);
					compose_pm($id, $mode, $action);

					$tpl_file = 'posting_body';
				}
This seems to have worked perfectly :)

CarolC1
Registered User
Posts: 571
Joined: Sat Dec 02, 2006 4:26 pm

Re: Minimum post count before PM allowed

Post by CarolC1 »

This is just what we need. :) Is there a way to do this so they must post before being allowed to PM other users, however they are not prevented from PMing moderators/admin right away?

Thanks

Mudjosh
Registered User
Posts: 234
Joined: Sat Jun 14, 2008 11:04 pm

Re: Minimum post count before PM allowed

Post by Mudjosh »

I also wish this could be controlled in the ACP.. I hate using my ftp just because I have to connect and etc etc.. It would be much easier to just log into your acp to control it.. Maybe under group permissions..

It seems like it would be an easy mod to code.. Though I do not know nearly enough to code it myself.. :oops:

User avatar
*Capmaster*
Registered User
Posts: 159
Joined: Tue Mar 20, 2007 5:00 pm
Location: Albuquerque, NM
Contact:

Re: Minimum post count before PM allowed

Post by *Capmaster* »

amochohan wrote:This isn't a mod request...

I've actually written some code to do this myself.

This seems to have worked perfectly :)
It does. Thank you!!! 8-) 8-) 8-)

I have a social forum with a few techie threads that are linked. One in particular is a NAS Firmware thread. We have been getting a bunch of new members who read the topic, then PM the firmware author. They don't post in the topic for some reason. That kind of defeats the purpose, IMO. They use forum resources, but nobody benefits from the exchanges if they can't read them, not to mention the search engines can't find PMs.

I run a forum, not an email service or a tech blog, so I needed something to restrict new members with 0 posts from being able to send PMs. This works .....PERFECTLY. Thank you so much for posting your code. I seriously think you should submit this as a MOD - it seems the forum code writers overlooked the PM issue when they released phpBB3. This fits the bill perfectly!!

Anyasha
Registered User
Posts: 704
Joined: Mon Aug 07, 2006 4:02 am
Name: Anyasha

Re: Minimum post count before PM allowed

Post by Anyasha »

CarolC1 wrote:Is there a way to do this so they must post before being allowed to PM other users, however they are not prevented from PMing moderators/admin right away?
I'm wondering the same thing!
Kiss me, I'm Polish!

Calman
Registered User
Posts: 339
Joined: Sat Jul 12, 2008 1:01 am
Location: Okanagan Valley, Canada
Contact:

Re: Minimum post count before PM allowed

Post by Calman »

Just found this thread and SO GLAD I DID!!!!!!!!!!!!! *thumbs up to original coder*

Quick question, do you have to refresh any templates/cache on the admin side?

All the best,
Cal :)
Visiting, Researching or Relocating to the Okanagan Valley in BC?
http://www.okanaganforum.com

User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Airdrie, UK (127.0.0.1)
Name: Kenny Cameron
Contact:

Re: Minimum post count before PM allowed

Post by stickerboy »

FWIW - this is a feature that was introduced into 3.0.6 :)
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red

SinDramas
Registered User
Posts: 34
Joined: Fri Sep 07, 2007 3:35 pm

Re: Minimum post count before PM allowed

Post by SinDramas »

n/m

JAMEEL225
Registered User
Posts: 70
Joined: Sun Mar 25, 2007 7:01 pm

Re: Minimum post count before PM allowed

Post by JAMEEL225 »

thanks bro working fine

-=KING=-
Registered User
Posts: 24
Joined: Thu Jan 26, 2012 2:35 am

Re: Minimum post count before PM allowed

Post by -=KING=- »

yes working prefect

LPRI
Registered User
Posts: 148
Joined: Thu Feb 21, 2013 1:06 am

Re: Minimum post count before PM allowed

Post by LPRI »

I need code for 3.012 board.

This is my includes/ucp/ucp_pm.php

Code: Select all

case 'compose':
				$action = request_var('action', 'post');

				$user_folders = get_folder($user->data['user_id']);

				if (!$auth->acl_get('u_sendpm'))
				{
					// trigger_error('NO_AUTH_SEND_MESSAGE');
					$template->assign_vars(array(
						'S_NO_AUTH_SEND_MESSAGE'	=> true,
						'S_COMPOSE_PM_VIEW'			=> true,
					));

					$tpl_file = 'ucp_pm_viewfolder';
					break;
				}
                            include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx);
				compose_pm($id, $mode, $action, $user_folders);

				$tpl_file = 'posting_body';

User avatar
KevC
Support Team Member
Support Team Member
Posts: 69555
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: Minimum post count before PM allowed

Post by KevC »

You can already do this with the newly registered users group.
New members in there cannot send PMs by default.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

Locked

Return to “[3.0.x] MOD Requests”