Page 1 of 1

[BETA] Mass Email and PMs

Posted: Sun Mar 07, 2004 10:52 pm
by Dr DLP
#################################################
## MOD Title: Mass Email and PMs
## MOD Author: Dr DLP < > ( Malicious Rabbit ) http://lapin-malin.com/
##
## MOD Description : Allows to send Mass PMs and E-mails to users using the ACP
##
## MOD Version : 1.0.0
##
## Installation Level: (Easy)
## Installation Time: 5 Minutes
##
## Files To Edit: - language/lang_english/lang_admin.php
##
## Included Files: - admin_email_users.php
## - config_email_users_body.tpl
##
##############################################


DOWNLOAD

Many mods like this one already exists , but maybe you'll find it interesting . It allows to send mass PM or emails using the ACP .
You select users from the userlist , then enter the message and subject , then send .
It's easy :)

Seems to work with 2.0.4-2.0.5-2.0.6 , let me know if you have issues with previous versions , thanks .

Posted: Mon Mar 08, 2004 12:36 am
by BADBOY2004UK1234
Heres the SQL

4 those who dont know how to :(


Don't mind Dr DLP??


http://www.frozentoast.co.uk/v2/db_update.zip

Posted: Sat Jun 05, 2004 10:26 am
by transwarp™
We got a problem with it !! - It sends out the MAILS and PM all from the MAIN ADMIN only !! -

If a forum got more ADMINS or JR.ADMINS it should include the right sender name inside the PM or mail but it always include the one from the main ADMIN !! -

We already try to fix this with this kind of change, but it did not working ?? -

Old code:

Code: Select all

		$sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig)
			VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("\'", "''", $privmsg_subject) . "', 2 , " . $to_userdata['user_id'] . ", $msg_time, '$user_ip', 0 , 1 , 1 , 1)";
	    if ( !($result = $db->sql_query($sql_info, BEGIN_TRANSACTION)) )
New code, but it still won't work ?? -

Code: Select all

		$sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig)
			VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("\'", "''", $privmsg_subject) . "', ". $from_userdata['user_id'] ." , " . $to_userdata['user_id'] . ", $msg_time, '$user_ip', 0 , 1 , 1 , 1)";
	    if ( !($result = $db->sql_query($sql_info, BEGIN_TRANSACTION)) )
Any help about this ?? - :roll:

Posted: Sat Jun 05, 2004 10:42 am
by Dr DLP
Why is it a problem ?

Posted: Sat Jun 05, 2004 11:01 am
by Paddic
transwarp™ wrote: New code, but it still won't work ?? -

Code: Select all

		$sql_info = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig)
			VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("\'", "''", $privmsg_subject) . "', ". $from_userdata['user_id'] ." , " . $to_userdata['user_id'] . ", $msg_time, '$user_ip', 0 , 1 , 1 , 1)";
	    if ( !($result = $db->sql_query($sql_info, BEGIN_TRANSACTION)) )
Any help about this ?? - :roll:


Change $from_userdata['user_id'] to $userdata['user_id']

Posted: Sat Jun 05, 2004 12:56 pm
by rambo88521
It's a problem, yes.

You see, the MOD only sends the mass PM from the Admin who created the board, and who installed phpBB. You see, most people have more than one admin on their board, or as I do, five. My other admins have sent out mass PMs, but the sender is recorded as me, not the admin who was actually logged in and sent the thing!

If you can't get something that automatically recognises which admin is signed in, there should be a field like 'Sender', where the Admin can put their name in.

Hope this helps you understand the problem that the guy above is having. And I haven't tried that code above yet, will get on it.

Rambo.

Posted: Sat Jun 05, 2004 7:41 pm
by transwarp™
Ok THANKS this makes the job working fine now !! - Changing the $userdata['user_id'] did the job !! -

Did anyone know if this also works with e-mails and how to get the right sender there ?? -

It uses the standart mail from inside the board config ?? -

Code: Select all

		if  ( $board_config['version'] == '.0.5' || $board_config['version'] == '.0.6' )
		{
			$emailer->from($board_config['board_email']);
			$emailer->replyto($board_config['board_email']);

			for ($i = 0; $i < count($bcc_list); $i++)
			{
				$emailer->bcc($bcc_list[$i]);
			}

			$email_headers = 'X-AntiAbuse: Board servername - ' . $board_config['server_name'] . "\n";
			$email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n";
			$email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n";
			$email_headers .= 'X-AntiAbuse: User IP - ' . decode_ip($user_ip) . "\n";
		}
		else
		{    
			$email_headers = 'Return-Path: ' . $userdata['board_email'] . "\nFrom: " . $board_config['board_email'] . "\n"; 
			$email_headers .= 'X-AntiAbuse: Board servername - ' . $board_config['server_name'] . "\n"; 
			$email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n"; 
			$email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n"; 
			$email_headers .= 'X-AntiAbuse: User IP - ' . decode_ip($user_ip) . "\n"; 
			$email_headers .= "Bcc: $bcc_list\n"; 			
		}

Posted: Sat Jun 05, 2004 8:22 pm
by Paddic
transwarp™ wrote: Did anyone know if this also works with e-mails and how to get the right sender there ?? -


In the code you provided, try changing all occurrences of $board_config['board_email'] to $userdata['user_email']...

Posted: Sun Jun 06, 2004 2:34 pm
by transwarp™
Sometimes things are just to simple - :wink: :oops:

Posted: Fri Aug 06, 2004 3:52 am
by Jaffery
I found another probs with this.. When i send small mesages then it works.. like sending 1 line message but when i send paragraph or big messages it is giving error..

Code: Select all

ould not insert/update private message sent text.

DEBUG MODE

SQL Error : 1196 Warning: Some non-transactional changed tables couldn't be rolled back

INSERT INTO phpbb_privmsgs_text (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text) VALUES (1406, '', 'TEX TEXT TEXT TEXT BIG TEXT')

Line : 251
File : /home/jeff/public_html/forums/admin/admin_email_users.php
Is it due to some mistake in running sql ?

Posted: Fri Aug 06, 2004 1:26 pm
by burnthome
the download link not work...

thanks,
burnthome

Posted: Fri Aug 06, 2004 2:36 pm
by MaddoxX
Uhm, the default forum/board already has Mass E-mail function; Is there anything so I can also have a Mass PM version?

Posted: Sat Aug 07, 2004 1:49 am
by cheesypeanut
Here you go, you guys might be interested as the download link to this MOD is broken.

I made this MOD specifically for MaddoxX but anyone can use it if they want.

http://www.phpbb.com/phpBB/viewtopic.php?p=1191077

Posted: Tue Aug 10, 2004 4:30 am
by wGEric
Locked by Authors request.