[RC1] Prime Notify Topic - Add Msg to Notification Email

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!
Scam Warning
Locked
lfaragon
Registered User
Posts: 7
Joined: Sun Mar 30, 2008 9:08 pm

Re: [RC1] Prime Notify Topic - Add Msg to Notification Email

Post by lfaragon » Mon Mar 31, 2008 12:59 am

I installed it and is working fine when subscribed to the direct forum in question, a couple of question though:

a) If I have a forum within a forum, and I subscribe to the top level forum, I am not getting new posts to the sub-forums, any way around this?

b) Has anybody tried the optional feature, where a user can determine if he wants the post to be on the notification email? Any problems and/or bugs?

Thanks for any reply.

User avatar
primehalo
Former Team Member
Posts: 2849
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC1] Prime Notify Topic - Add Msg to Notification Email

Post by primehalo » Mon Mar 31, 2008 6:26 pm

lfaragon wrote:a) If I have a forum within a forum, and I subscribe to the top level forum, I am not getting new posts to the sub-forums, any way around this?
I don't know. Sounds like an issue with the board, though, not my MOD.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

lfaragon
Registered User
Posts: 7
Joined: Sun Mar 30, 2008 9:08 pm

Re: [RC1] Prime Notify Topic - Add Msg to Notification Email

Post by lfaragon » Mon Mar 31, 2008 7:58 pm

I just wanted to know if the MOD was supposed to do this or if this was a known issue, if it is supposed to send notifications when subscribed from a top level forums when a post is done on a topic from an unsubscribed subforum, then I am going have to reinstall and go over the modifications line by line.


This is what I have:

I have a category with a client's name
Then I have a forum with a the year
Subforums with the months
Topics are individual accounts.

I subscribed to the year only and did not receive the notifications from posts from the account, but when I subscribed to the month I did receive them.

I just didn't want to subscribe to over 300 months.

Thanks for your prompt response.

User avatar
primehalo
Former Team Member
Posts: 2849
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC1] Prime Notify Topic - Add Msg to Notification Email

Post by primehalo » Mon Mar 31, 2008 8:14 pm

lfaragon wrote:I just wanted to know if the MOD was supposed to do this or if this was a known issue, if it is supposed to send notifications when subscribed from a top level forums when a post is done on a topic from an unsubscribed subforum, then I am going have to reinstall and go over the modifications line by line.


This is what I have:

I have a category with a client's name
Then I have a forum with a the year
Subforums with the months
Topics are individual accounts.

I subscribed to the year only and did not receive the notifications from posts from the account, but when I subscribed to the month I did receive them.

I just didn't want to subscribe to over 300 months.

Thanks for your prompt response.
My MOD doesn't actually send anything or modify the way notifications are sent. It just injects additional information into the message before it is sent.

My MOD does have an optional feature that allows you to have notifications sent for each new message posted, but this is accomplished solely by stopping the board from keeping track of who has received notifications already.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

gunemalli
Registered User
Posts: 7
Joined: Sat Feb 23, 2008 9:08 am

Re: [RC1] Prime Notify Topic - Add Msg to Notification Email

Post by gunemalli » Tue Apr 01, 2008 1:12 am

Hi,
There's one feature that i'd like to ask from you to put into this MOD, and it has been asked in this thread but hasn't been replied yet.

I'd like to limit the amount of characters that the user sees from his e-mail. Say to about 500 chars, so that he must visit the forum to read the post fully. An added bonus would be if this is happens to all users except for Admins and Moderators. But my primary is to limit the chars.
Is this possible?

Thanks Primehalo for a great MOD.

User avatar
primehalo
Former Team Member
Posts: 2849
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC1] Prime Notify Topic - Add Msg to Notification Email

Post by primehalo » Tue Apr 01, 2008 1:22 am

gunemalli wrote:Hi,
There's one feature that i'd like to ask from you to put into this MOD, and it has been asked in this thread but hasn't been replied yet.

I'd like to limit the amount of characters that the user sees from his e-mail. Say to about 500 chars, so that he must visit the forum to read the post fully. An added bonus would be if this is happens to all users except for Admins and Moderators. But my primary is to limit the chars.
Is this possible?

Thanks Primehalo for a great MOD.
Find:

Code: Select all

            $message = stripslashes(trim($message));   
After, add:

Code: Select all

            $message = substr($message, 0, 500);   
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
Trinity
Registered User
Posts: 474
Joined: Wed Dec 11, 2002 10:06 pm
Location: Hollywood, CA

Re: [RC1] Prime Notify Topic - Add Msg to Notification Email

Post by Trinity » Fri Apr 04, 2008 6:15 pm

I installed this but get this error when replying:

WRONG_NOTIFICATION_MODE

It has something to do with these lines of code:

Code: Select all

//-- mod: Prime Notify Topic ------------------------------------------------//
	// MOD options/settings
	$prime_notify_topic = true;		// Enable or disable this MOD.
	$prime_keep_bbcodes = true;		// Having BBCodes in the email will help show how the message is supposed to be formatted.
	$prime_notify_always = false;	// Notify user even if they've already received a previous notification and have not yet visited the forum to read it.

	// Prepare the message for inclusion in an e-mail
	if ($prime_notify_topic)
	{
		$msg_data = array();
		if ($user->page['page_name'] == "posting.$phpEx")
		{
			global $data;
			$msg_data = &$data;
		}
		if (isset($msg_data['message']))
		{
			$author  = $user->data['username']; // This is the name, not the ID
			$message = !isset($msg_data['message'])		? '' : $msg_data['message'];
			$uid     = !isset($msg_data['bbcode_uid'])	? '' : $msg_data['bbcode_uid'];	// bbcode uid if bbcodes are enabled for this message
			$prime_keep_bbcodes = empty($data['enable_bbcode']) ? true : $prime_keep_bbcodes; // If BBCodes are not enabled for this post, then we keep them because they do not represent formatting

			if ($uid)
			{
				// If there is a spoiler, remove the spoiler content.
				$search = '@\[spoiler:' . $uid . '\](?!.*\[spoiler:' . $uid . '\].*)(.*?)\[/spoiler:' . $uid . '\]@s';
				$replace = !$prime_keep_bbcodes ? '----- (spoiler removed) -----' : '[spoiler](spoiler removed)[/spoiler]';
				$message = preg_replace($search, $replace, $message);
	
				// Remove BBCodes (so convert some to a text-format).
				if (!$prime_keep_bbcodes)
				{
					// Change quotes
					$message = preg_replace('@(?:[\r\n]*)\[quote=(?:"|")([^"]*)(?:"|"):' . $uid . '\](?:[\r\n]*)@', "\r\n\r\n----- Quote by $1 -----\r\n\r\n", $message);
					$message = preg_replace('@(?:[\r\n]*)\[quote:' . $uid . '\](?:[\r\n]*)@', "\r\n\r\n----- Quote -----\r\n\r\n", $message);
					$message = preg_replace('@(?:[\r\n]*)\[/quote:' . $uid . '\](?:[\r\n]*)@', "\r\n\r\n----- End Quote -----\r\n\r\n", $message);
	
					// Change lists (quick & dirty, no checking if we're actually in a list, much less if it's ordered or unordered)
					$message = str_replace('[*]', '* ', $message);
					$message = str_replace('[*:' . $uid . ']', '* ', $message);
	
					// Change [url=http://www.example.com]Example[/url] to Example (http://www.example.com)
					$message = preg_replace('@\[url=([^]]*):' . $uid . '\]([^[]*)\[/url:' . $uid . '\]@', '$2 ($1)', $message);
	
					// Remove all remaining BBCodes
					strip_bbcode($message);
				}
	
				// Transform special BBCode characters into human-readable characters
				$transform = array('<' => '<', '>' => '>', '&#91;' => '[', '&#93;' => ']', '&#46;' => '.', '&#58;' => ':');
				$message = str_replace(array_keys($transform), array_values($transform), $message);
	
				// If there is a URL between BBCode URL tags, then add spacing so
				// the email program won't think the BBCode is part of the URL.
				$message = preg_replace('@](http://.*?)\[@', '] $1 [', $message);
	
				// Strip unique ids out of BBCodes
				$uid = $uid ? $uid : '[0-9a-z]{5,}';
				$message = preg_replace("#\[(\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?)(\:?$uid)\]#", '[\1]', $message);
			}
	
			// Remove HTML tags and remove backslashes that appear directly before single quotes
			$message = strip_tags($message); 	
			$message = stripslashes(trim($message));
		}
	}
//-- end: Prime Notify Topic ------------------------------------------------//
Shop smart, shop S-mart.

User avatar
primehalo
Former Team Member
Posts: 2849
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC1] Prime Notify Topic - Add Msg to Notification Email

Post by primehalo » Fri Apr 04, 2008 6:39 pm

Trinity wrote:I installed this but get this error when replying:

WRONG_NOTIFICATION_MODE

It has something to do with these lines of code:

Code: Select all

//-- mod: Prime Notify Topic ------------------------------------------------//
	// MOD options/settings
	$prime_notify_topic = true;		// Enable or disable this MOD.
	$prime_keep_bbcodes = true;		// Having BBCodes in the email will help show how the message is supposed to be formatted.
	$prime_notify_always = false;	// Notify user even if they've already received a previous notification and have not yet visited the forum to read it.

	// Prepare the message for inclusion in an e-mail
	if ($prime_notify_topic)
	{
		$msg_data = array();
		if ($user->page['page_name'] == "posting.$phpEx")
		{
			global $data;
			$msg_data = &$data;
		}
		if (isset($msg_data['message']))
		{
			$author  = $user->data['username']; // This is the name, not the ID
			$message = !isset($msg_data['message'])		? '' : $msg_data['message'];
			$uid     = !isset($msg_data['bbcode_uid'])	? '' : $msg_data['bbcode_uid'];	// bbcode uid if bbcodes are enabled for this message
			$prime_keep_bbcodes = empty($data['enable_bbcode']) ? true : $prime_keep_bbcodes; // If BBCodes are not enabled for this post, then we keep them because they do not represent formatting

			if ($uid)
			{
				// If there is a spoiler, remove the spoiler content.
				$search = '@\[spoiler:' . $uid . '\](?!.*\[spoiler:' . $uid . '\].*)(.*?)\[/spoiler:' . $uid . '\]@s';
				$replace = !$prime_keep_bbcodes ? '----- (spoiler removed) -----' : '[spoiler](spoiler removed)[/spoiler]';
				$message = preg_replace($search, $replace, $message);
	
				// Remove BBCodes (so convert some to a text-format).
				if (!$prime_keep_bbcodes)
				{
					// Change quotes
					$message = preg_replace('@(?:[\r\n]*)\[quote=(?:"|")([^"]*)(?:"|"):' . $uid . '\](?:[\r\n]*)@', "\r\n\r\n----- Quote by $1 -----\r\n\r\n", $message);
					$message = preg_replace('@(?:[\r\n]*)\[quote:' . $uid . '\](?:[\r\n]*)@', "\r\n\r\n----- Quote -----\r\n\r\n", $message);
					$message = preg_replace('@(?:[\r\n]*)\[/quote:' . $uid . '\](?:[\r\n]*)@', "\r\n\r\n----- End Quote -----\r\n\r\n", $message);
	
					// Change lists (quick & dirty, no checking if we're actually in a list, much less if it's ordered or unordered)
					$message = str_replace('[*]', '* ', $message);
					$message = str_replace('[*:' . $uid . ']', '* ', $message);
	
					// Change [url=http://www.example.com]Example[/url] to Example (http://www.example.com)
					$message = preg_replace('@\[url=([^]]*):' . $uid . '\]([^[]*)\[/url:' . $uid . '\]@', '$2 ($1)', $message);
	
					// Remove all remaining BBCodes
					strip_bbcode($message);
				}
	
				// Transform special BBCode characters into human-readable characters
				$transform = array('<' => '<', '>' => '>', '&#91;' => '[', '&#93;' => ']', '&#46;' => '.', '&#58;' => ':');
				$message = str_replace(array_keys($transform), array_values($transform), $message);
	
				// If there is a URL between BBCode URL tags, then add spacing so
				// the email program won't think the BBCode is part of the URL.
				$message = preg_replace('@](http://.*?)\[@', '] $1 [', $message);
	
				// Strip unique ids out of BBCodes
				$uid = $uid ? $uid : '[0-9a-z]{5,}';
				$message = preg_replace("#\[(\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?)(\:?$uid)\]#", '[\1]', $message);
			}
	
			// Remove HTML tags and remove backslashes that appear directly before single quotes
			$message = strip_tags($message); 	
			$message = stripslashes(trim($message));
		}
	}
//-- end: Prime Notify Topic ------------------------------------------------//
I don't think that code is causing your problem. That error occurs when both $topic_notification and $forum_notification are set to false. The values of these two variables are set based on the value of $mode, but $mode never shows up in that Prime Notify Topic code you posted.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

Madhumal
Registered User
Posts: 3
Joined: Thu Jun 26, 2008 6:34 am

Re: [RC1] Prime Notify Topic - Add Msg to Notification Email

Post by Madhumal » Sat Jul 26, 2008 10:41 am

I get the same error as well...

WRONG_NOTIFICATION_MODE

I'm pretty much running the standard setup and have followed your instructions well... If as Trinity suggested, the error is not in that piece of code, could u be able to tell us what may be causing this?

Thanks in advance!

User avatar
primehalo
Former Team Member
Posts: 2849
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC1] Prime Notify Topic - Add Msg to Notification Email

Post by primehalo » Sun Jul 27, 2008 5:19 am

Madhumal wrote:I get the same error as well...

WRONG_NOTIFICATION_MODE

I'm pretty much running the standard setup and have followed your instructions well... If as Trinity suggested, the error is not in that piece of code, could u be able to tell us what may be causing this?

Thanks in advance!
Look in that same file, near this pieice of code:

Code: Select all

user_notification($mode, $subject, $data['topic_title'] 
See if anything looks awkward around there. You're getting that message because $mode is not what it's supposed to be, and that's where it's passed into the function.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
primehalo
Former Team Member
Posts: 2849
Joined: Fri May 06, 2005 5:58 pm
Location: Redding, CA
Contact:

Re: [RC1] Prime Notify Topic - Add Msg to Notification Email

Post by primehalo » Mon Jul 28, 2008 5:04 pm

This MOD is being retired in favor of a new one with the same functionality: Prime Notify
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
Highway of Life
Former Team Member
Posts: 6048
Joined: Wed Feb 02, 2005 5:41 pm
Location: Seattle, WA
Name: David Lewis
Contact:

Re: [RC1] Prime Notify Topic - Add Msg to Notification Email

Post by Highway of Life » Mon Jul 28, 2008 6:45 pm

Locked as per MOD Author request.
The phpBB Weekly Podcast - Discussing the developments of phpBB4 and beyond.

New to phpBB3? Want to learn about programing?
Visit phpBB Academy at StarTrekGuide to learn how.

Locked

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