[BETA..] Mass PM Mod (Selection Groups Based on User Levels)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
ChristianWeb
Registered User
Posts: 42
Joined: Wed Nov 13, 2002 6:24 pm
Contact:

Post by ChristianWeb » Fri Jul 11, 2003 4:06 pm

2.0.4 and I'm not updating for one mod to work cuz then i'd need to do the changed files then i would lose all my mods.

ChristianWeb
Registered User
Posts: 42
Joined: Wed Nov 13, 2002 6:24 pm
Contact:

Post by ChristianWeb » Fri Jul 11, 2003 4:07 pm

you think you could re-do this mod for 2.0.4?

CrazyPhil
Registered User
Posts: 153
Joined: Sat Mar 16, 2002 4:03 am
Location: Ottawa, Canada

Re: [BETA..] Mass PM Mod (Selection Groups Based on User Lev

Post by CrazyPhil » Sun Jul 13, 2003 12:52 am

CrazyPhil wrote: NO upgrades will be made to this mod, I will only change it if it doesn't work for someone.


As I said, only if it doesn't work for someone, which in other words means on the current version its made for (since I'd have to install 2.0.4 just to test it for you). Sorry. I suggest you look at the emailing code in privmsg.php, and copy it over the code i'm using to send out the private message e-mail notification.

hkiforum
Registered User
Posts: 48
Joined: Mon May 12, 2003 9:52 am
Location: Hong Kong
Contact:

Post by hkiforum » Sun Jul 13, 2003 10:31 am

CrazyPhil wrote:
ChristianWeb wrote:i got this:

Fatal error: Call to undefined function: from() in /home/urlf/public_html/christianweb/admin/admin_mass_pm.php on line 294


2.0.5, thats all its been tested on and it works successfully. From that error it looks as if your emailer.php is out of date.

This is the function its looking for: located in includes/emailer.php:

Code: Select all

function from($address)
	{
		$this->from = trim($address);
	}


I got the same problem too. Where this code should I put in emailer.php? (I'm using 2.0.4)

CrazyPhil
Registered User
Posts: 153
Joined: Sat Mar 16, 2002 4:03 am
Location: Ottawa, Canada

Post by CrazyPhil » Wed Jul 16, 2003 4:58 am

Ok well I figured it'll only take a sec (if i don't install 2.0.4 again and test it) so here it is: a 2.0.4 version (UNTESTED).

Download the current 2.0.5 version and open admin/admin_mass_pm.php

UNTESTED FIX for 2.0.4
2.0.5 users please IGNORE.

FIND:

Code: Select all

$script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path']));
				$script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx;
				$server_name = trim($board_config['server_name']);
				$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
				$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';

				require_once($phpbb_root_path . 'includes/emailer.'.$phpEx);
			
				$emailer = new emailer($board_config['smtp_delivery']);
					
				$emailer->from($board_config['board_email']);
				$emailer->replyto($board_config['board_email']);

				$emailer->use_template('privmsg_notify', $to_userdata['user_lang']);
				$emailer->email_address($to_userdata['user_email']);
				$emailer->set_subject($lang['Notification_subject']);
					
				$emailer->assign_vars(array(
					'USERNAME' => $to_username, 
					'SITENAME' => $board_config['sitename'],
					'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 

					'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox')
				);

				$emailer->send();
				$emailer->reset();
REPLACE WITH:

Code: Select all

	$email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\n";

				$script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($board_config['script_path']));
				$script_name = ( $script_name != '' ) ? $script_name . '/privmsg.'.$phpEx : 'privmsg.'.$phpEx;
				$server_name = trim($board_config['server_name']);
				$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
				$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';

				require_once($phpbb_root_path . 'includes/emailer.'.$phpEx);
				$emailer = new emailer($board_config['smtp_delivery']);
					
				$emailer->use_template('privmsg_notify', $to_userdata['user_lang']);
				$emailer->extra_headers($email_headers);
				$emailer->email_address($to_userdata['user_email']);
				$emailer->set_subject($lang['Notification_subject']);
					
				$emailer->assign_vars(array(
					'USERNAME' => $to_username, 
					'SITENAME' => $board_config['sitename'],
					'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '', 

					'U_INBOX' => $server_protocol . $server_name . $server_port . $script_name . '?folder=inbox')
				);

				$emailer->send();
				$emailer->reset();
Test it out and if it works, yahoo.

nadav144
Registered User
Posts: 8
Joined: Fri Jul 11, 2003 9:31 pm

no...

Post by nadav144 » Wed Jul 16, 2003 3:26 pm

not working...

CrazyPhil
Registered User
Posts: 153
Joined: Sat Mar 16, 2002 4:03 am
Location: Ottawa, Canada

Post by CrazyPhil » Wed Jul 16, 2003 10:31 pm

I assume your speaking of the 2.0.4 version fix, if please post DEBUG info.

nadav144
Registered User
Posts: 8
Joined: Fri Jul 11, 2003 9:31 pm

here it is...

Post by nadav144 » Thu Jul 17, 2003 12:05 am

this is what i'm getting when i'm sending a msg

Code: Select all

Fatal error: Call to undefined function: from() in /ftp/virt/astronomy/phpBB2/admin/admin_mass_pm.php on line 294
i know that one man get it, the first in the memberlist, but the rest.. nothing...

Thank you

CrazyPhil
Registered User
Posts: 153
Joined: Sat Mar 16, 2002 4:03 am
Location: Ottawa, Canada

Post by CrazyPhil » Thu Jul 17, 2003 2:58 am

TO ALL WHO READ THIS:

THE ERROR ABOVE IS DUE TO THE FACT THAT YOU ARE USING PHPBB 2.0.4 WHEN THIS MOD IS FOR 2.0.5

PLEASE READ THIS (UNTESTED) FIX AND APPLY IT TO THE MOD TO ALLOW IT TO WORK IN 2.0.4. I will NOT address this again, instead I'll just forward you to this post.

http://www.phpbb.com/phpBB/viewtopic.ph ... 066#675066

ChristianWeb
Registered User
Posts: 42
Joined: Wed Nov 13, 2002 6:24 pm
Contact:

Post by ChristianWeb » Thu Jul 17, 2003 10:33 pm

CrazyPhil wrote: TO ALL WHO READ THIS:

THE ERROR ABOVE IS DUE TO THE FACT THAT YOU ARE USING PHPBB 2.0.4 WHEN THIS MOD IS FOR 2.0.5

PLEASE READ THIS (UNTESTED) FIX AND APPLY IT TO THE MOD TO ALLOW IT TO WORK IN 2.0.4. I will NOT address this again, instead I'll just forward you to this post.

http://www.phpbb.com/phpBB/viewtopic.ph ... 066#675066


thanks a lot for the fix. It works for me. :D :wink:

hkiforum
Registered User
Posts: 48
Joined: Mon May 12, 2003 9:52 am
Location: Hong Kong
Contact:

Post by hkiforum » Fri Jul 18, 2003 2:31 am

I'm using 2.0.4, but not work for me.

Code: Select all

Failed sending email :: 

DEBUG MODE

Line : 225
File : /home/hkiforum/public_html/phpBB-HK/includes/emailer.php

CrazyPhil
Registered User
Posts: 153
Joined: Sat Mar 16, 2002 4:03 am
Location: Ottawa, Canada

Post by CrazyPhil » Fri Jul 18, 2003 3:50 am

Has your emailer or related files been changed in any way? That debug information is not very helpful, it just seems the result is blank. Which means there is an error happening between line 209 to 221 of emailer.php.

Also since another user does not have a problem with my 2.0.4 fix then the error must be in your files, or your server! So I assume....

hkiforum
Registered User
Posts: 48
Joined: Mon May 12, 2003 9:52 am
Location: Hong Kong
Contact:

Post by hkiforum » Fri Jul 18, 2003 5:32 am

CrazyPhil wrote: Has your emailer or related files been changed in any way? That debug information is not very helpful, it just seems the result is blank. Which means there is an error happening between line 209 to 221 of emailer.php.


Here is the code in emailer.php between line 209 to 221, and I haven't changed anything since download.

Code: Select all

		if ( $this->use_smtp )
		{
			if ( !defined('SMTP_INCLUDED') ) 
			{
				include($phpbb_root_path . 'includes/smtp.' . $phpEx);
			}

			$result = smtpmail($this->address, $this->subject, $this->msg, $this->extra_headers);
		}
		else
		{
			$result = @mail($this->address, $this->subject, $this->msg, $this->extra_headers);
		}
CrazyPhil wrote: Also since another user does not have a problem with my 2.0.4 fix then the error must be in your files, or your server! So I assume....


What other files may cause this error?

CrazyPhil
Registered User
Posts: 153
Joined: Sat Mar 16, 2002 4:03 am
Location: Ottawa, Canada

Post by CrazyPhil » Fri Jul 18, 2003 8:33 pm

Are you using the smtp email option?
Otherwise, the problem is here:

Code: Select all

$result = @mail($this->address, $this->subject, $this->msg, $this->extra_headers); 
Meaning the data submitted: address, subject, msg, or extra_headers is blank or bad, invalidating the mail function.

If you have no mods installed, download the emailer for 2.0.4 again to insure their is no problems with it.

hkiforum
Registered User
Posts: 48
Joined: Mon May 12, 2003 9:52 am
Location: Hong Kong
Contact:

Post by hkiforum » Sat Jul 19, 2003 4:22 am

CrazyPhil wrote: Are you using the smtp email option?
Otherwise, the problem is here:

Code: Select all

$result = @mail($this->address, $this->subject, $this->msg, $this->extra_headers); 
Meaning the data submitted: address, subject, msg, or extra_headers is blank or bad, invalidating the mail function.

If you have no mods installed, download the emailer for 2.0.4 again to insure their is no problems with it.


I have downloaded the emailer.php for 2.0.4 again and tried again, still failed and still got the same error message... :( :cry:

Is there any other way to solve it? :?

Post Reply

Return to “[2.0.x] MODs in Development”