[RC] Prime Notify - Put the message in notification emails

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!
Anti-Spam Guide
Locked
Bituser
Registered User
Posts: 167
Joined: Sat Oct 31, 2009 9:56 am

Re: [RC] Prime Notify - Put the message in notification emai

Post by Bituser »

Please help me Primehalo, my website isn't sending out topic reply notifications and I have no idea why.

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

Re: [RC] Prime Notify - Put the message in notification emai

Post by primehalo »

That doesn't sound like an issue relating to my modification, as my MOD basically just changes which email template to use, it doesn't change the code for sending out the emails.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

Bituser
Registered User
Posts: 167
Joined: Sat Oct 31, 2009 9:56 am

Re: [RC] Prime Notify - Put the message in notification emai

Post by Bituser »

Ok, thanks for replying :D . I'll have to find some other way to find the source of the problem...

User avatar
Martin Day
Registered User
Posts: 59
Joined: Fri Nov 28, 2008 8:39 pm
Location: Woking, UK
Contact:

Re: [RC] Prime Notify - Put the message in notification emai

Post by Martin Day »

Ken,

I know it's a while since I posted this question ( http://www.phpbb.com/community/viewtopi ... #p12239095 ) but it is still an issue for my board. In fact I may have to consider removing the Prime Notify mod as a result (which would be a great shame). The issue is that getting all the post details in an email is actually discouraging many of my members from logging in, and if they don't log in - they don't post. Result: more spectators and less participants.

It's a long time since I did any serious coding myself (I was originally trained in COBOL - have pity on my soul!) but I would be happy to try thrashing around if you could just give me some thoughts as how and where I could go about limiting the number of characters that are included in an email resulting from a post and therefore tempt some of my lethargic members into logging on...

Thanks.
Martin

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

Re: [RC] Prime Notify - Put the message in notification emai

Post by primehalo »

In includes/prime_notify.php, find this line:

Code: Select all

            $text = stripslashes(trim($text)); 
After this line would be the place to truncate the $text variable. Off the top of my head, something like:

Code: Select all

$text = substr($text, 0, 255); 
Although I think phpbb3 might have some special functions for truncating strings to handle double byte strings. Don't remember for sure off hand.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

User avatar
Martin Day
Registered User
Posts: 59
Joined: Fri Nov 28, 2008 8:39 pm
Location: Woking, UK
Contact:

Re: [RC] Prime Notify - Put the message in notification emai

Post by Martin Day »

Thanks Ken - This was just the kind of help I was hoping for :D . I am having trouble getting my test board to push out emails at present, but when I can get to do some tests, I'll let you know how it went.
Martin

usagi_chan
Registered User
Posts: 11
Joined: Wed Mar 29, 2006 11:46 pm

Re: [RC] Prime Notify - Put the message in notification emai

Post by usagi_chan »

I have installed boardwatch_1-0-2 which notifies if any posts are made on the board but it doesn't send out the text of the new posts. Can I piggyback this onto that mod to get text? Or should I remove boardwatch then install this? Can users set it to be notified if any posts are made on any part of the board?

Thanks
Usagi_Chan

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

Re: [RC] Prime Notify - Put the message in notification emai

Post by primehalo »

I have no idea how boardwatch is coded to work, so I couldn't tell you if it would work with my MOD or not. Probably easiest thing to do is just try it, and if it doesn't work then uninstall it.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

usagi_chan
Registered User
Posts: 11
Joined: Wed Mar 29, 2006 11:46 pm

Re: [RC] Prime Notify - Put the message in notification emai

Post by usagi_chan »

It doesn't work with boardwatch because boardwatch has it's own templates for notices. No harm was done, it just didn't give any text so I uninstalled it. There is a mod on page 3 of the boardwatch mod which adds the ability to send text. I'm trying that out now.

Thanks for your efforts.

User avatar
Martin Day
Registered User
Posts: 59
Joined: Fri Nov 28, 2008 8:39 pm
Location: Woking, UK
Contact:

Re: [RC] Prime Notify - Put the message in notification emai

Post by Martin Day »

Martin Day wrote:Thanks Ken - This was just the kind of help I was hoping for :D . I am having trouble getting my test board to push out emails at present, but when I can get to do some tests, I'll let you know how it went.
I just thought I 'd add in this variation on Ken's suggested solution...

This little patch truncates the amount of text included in the subscription notification email. The objective is to continue to allow board members to still read those cheery one-liners in the notification emails. However, for more substantial posts they are given a taster of what has been said but then have to login to the board to read the whole post (from where they are more likely to reply). This then tips the balance on a board back from convenience more towards participation.

In includes/prime_notify.php, find this line:

Code: Select all

            $text = stripslashes(trim($text));  
and insert the following after it

Code: Select all

			// Truncate message text in email
            if (strlen($text) > 200)
			{
			   $tobecont = '... [click on the link above to read more]';
			   $text = substr($text, 0, 200).$tobecont; 
			}
			// end of Truncate message text in email
The Topic, Reply or Private Message text is included in the email notification, in full, as long as it is no longer than 200 characters. Otherwise the text is chopped after 200 characters and the the phase '... [click on the link above to read more]' is appended to the text (you can obviously change the two "200" values above for any number of text characters that works for you).

With this in mind I have found it more helpful to have the Topic and Reply links drop the member into the text that they have already started to read in the email (Base 'Prime Notify' will link to the forum for some posts and requires an extra click to get down to the post itself).

In language/en/email/prime_notify_forum.txt find the following

Code: Select all

Hello {USERNAME}, the forum "{FORUM_NAME}" at "{SITENAME}" has received a new reply since your last visit. You can view the forum by clicking on the following link: {U_FORUM}
and replace with

Code: Select all

Hello {USERNAME}, the forum "{FORUM_NAME}" at "{SITENAME}" has received a new reply since your last visit. You can view the topic by clicking on the following link: {U_NEWEST_POST}
in language/en/email/prime_notify_newtopic.txt find the following

Code: Select all

Hello {USERNAME}, the forum "{FORUM_NAME}" at "{SITENAME}" has received a new topic since your last visit. You can view the forum by clicking on the following link: {U_FORUM}
and replace with

Code: Select all

Hello {USERNAME}, the forum "{FORUM_NAME}" at "{SITENAME}" has received a new topic since your last visit. You can view the Topic by clicking on the following link: {U_NEWEST_POST}
Martin

sophos09
Registered User
Posts: 53
Joined: Wed Sep 02, 2009 9:12 pm

Re: [RC] Prime Notify - Put the message in notification emai

Post by sophos09 »

No support needed here, just wanted to say Ken, this is exactly what I was after and it worked first time. Thanks a bunch!

Quick question, how come this has not been authorised yet?

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

Re: [RC] Prime Notify - Put the message in notification emai

Post by primehalo »

Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

sophos09
Registered User
Posts: 53
Joined: Wed Sep 02, 2009 9:12 pm

Re: [RC] Prime Notify - Put the message in notification emai

Post by sophos09 »

primehalo wrote:It has been approved: http://www.phpbb.com/customise/db/mod/prime_notify/
Great work and many thanks :)

User avatar
britrider
Registered User
Posts: 23
Joined: Tue Dec 26, 2006 11:27 pm

Re: [RC] Prime Notify - Put the message in notification emai

Post by britrider »

I have gone over my install a few times now, thinking I missed something... but I can't find it. I can't get the author and message to come through. Please help!! I really really like this feature. I am using Glacier style, if that make any diffeerence. Here is a copy of an email that I got while testing. The author should have been "Tester" and the message should have been, "Testing it out"

Hello BritRider, the forum "General Discussion" at "BritRider.com" has
received a new topic since your last visit. You can view the forum by
clicking on the following link:
http://www.britrider.com/message/viewforum.php?f=3
_____________________________________________________________________
Topic: testing notification feature
Author:
Message:

_____________________________________________________________________

If you no longer wish to watch this forum, either click the "Unsubscribe
forum" link found in the forum above, or click the following link:
http://www.britrider.com/message/viewfo ... atch=forum
--
Thanks, The Management

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

Re: [RC] Prime Notify - Put the message in notification emai

Post by primehalo »

This issue is extremely difficult to diagnose, since I have never been able to replicate it, and only some people have the issue while it works just fine for other people.

In that copy of the e-mail you posted, I notice this line was not part of it:
No more notifications will be sent until you visit the forum.

Did you have PRIME_NOTIFY_ALWAYS set to TRUE at the time the e-mail was sent? If so, that would be the reason the line does not show up, but if not then that would be a symptom of the issue and would give me somewhere to start looking. So, if you did have PRIME_NOTIFY_ALWAYS set to TRUE, could you please change it back to FALSE and see what the notification e-mail looks like?

The reason I ask is that the e-mail template has three new variables not in the original template, {AUTHOR}, {MESSAGE}, and {VISIT_MSG}, and I want to see if all three are empty or if just the author and message are empty.
Ken F. Innes IV
My Extensions | My MODs | My Topics | My Site: Absolute Anime
Experience the wonder of Japanese Animation!

Locked

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