Page 1 of 3

'Notify me upon replies by default' set to YES by default?

Posted: Fri Jan 28, 2011 10:40 pm
by DaveH
What version of phpBB are you using? phpBB 3.0.8
What is your board's URL? http://gbbmembers.org
Who do you host your board with? hostgator
How did you install your board? I used the download package from phpBB.com
Is your board a fresh install or a conversion? Fresh Install
Do you have any MODs installed? No
Is registration required to reproduce this issue? No
What styles do you currently have installed? prosilver
What language(s) is your board currently using? english
Which database type/version are you using? MySQL 5
What is your level of experience? Comfortable with PHP and phpBB
When did your problem begin? n/a
Please describe your problem.

I've been searching the forum but I haven't manage to find an answer to this simple question:

I would like newly registered users to have the 'Notify me upon replies by default' option set to YES by default. I understand that this could be spammy or annoying for some users, but I am familiar with this user group (just 20-30 people) and we'd like to try this out. The users would be able to turn off that feature if they wanted.

Is there an easy way to do this??

thanks :)

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Fri Jan 28, 2011 10:56 pm
by stevemaury
OPEN styles/prosilver/template/posting_editor.html

FIND:

Code: Select all

<!-- IF S_NOTIFY_ALLOWED -->
            <div><label for="notify"><input type="checkbox" name="notify" id="notify"{S_NOTIFY_CHECKED} /> {L_NOTIFY_REPLY}</label></div>
REPLACE WITH:

Code: Select all

<!-- IF S_NOTIFY_ALLOWED -->
            <div><label for="notify"><input type="checkbox" checked="checked" name="notify" id="notify"{S_NOTIFY_CHECKED} /> {L_NOTIFY_REPLY}</label></div>
Purge the cache in the ACP.

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Fri Jan 28, 2011 11:30 pm
by DaveH
That will work, but wouldn't it ignore the user's setting in their profile?
I would like them to be able to turn off the feature if they want.

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Sat Jan 29, 2011 10:55 am
by Pony99CA
dhecker wrote:That will work, but wouldn't it ignore the user's setting in their profile?
I would like them to be able to turn off the feature if they want.
You're referring to the UCP option, not the posting page option, right?

If so, try this in \includes\functions_user.php:

Find:

Code: Select all

'user_notify'			=> 0,
Replace with:

Code: Select all

'user_notify'			=> 1,
That will make reply notification the default for new users.

If you want to make reply notification the default for existing users, run the following SQL query:

Code: Select all

UPDATE phpbb_users 
SET user_notify = 1
WHERE user_type <> 2;
Of course, you should back up your database before running an UPDATE query.

Steve

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Sat Jan 29, 2011 8:32 pm
by DaveH
That is perfect, thank you!

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Tue Jun 28, 2011 5:20 pm
by jelo77
Thanks, I made those two changes. How do I apply the notification change backwards for all existing posts. Almost all of my users missed this configuration and I have hundreds of posts where the notification is not enabled. Can I run an update in the database to have all posts set to "notify the poster"?

The table posts does not seem to include a field that stores a value for notification of the user. Which table do I need to update. I only found "topics_watch" which seems to deal with topic subscriptions, not with post subscriptions.

Thanks, Jelo

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Tue Jun 28, 2011 9:25 pm
by Pony99CA
You can't subscribe to a post (which doesn't really even make sense unless the post is edited); you subscribe to a topic and get notified when a post is made.

You can insert rows for each user and topic into the topics_watch table, but that might be a bad idea. Unless your users really want that, it would almost be like spamming them if they didn't want to subscribe.

I think that your best bet is to tell your users to subscribe to the forums that they're interested in. That will notify them of new topics and new posts to existing topics in those forums.

Steve

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Wed Jun 29, 2011 12:23 am
by Oyabun1
There is a MOD, Board watch, that gives your users the option of subscribing to all topics, and being notified of every post not just the first unread one.

However, bear in mind that notifying all members of all posts can substantially increase the volume of email being sent by your board, which may cause other issues.

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Wed Jun 29, 2011 5:55 am
by jelo77
You can insert rows for each user and topic into the topics_watch table, but that might be a bad idea. Unless your users really want that, it would almost be like spamming them if they didn't want to subscribe.
I do not intend to subscribe everyone to every topic. I just want all the people (initial creator plus any replies) in a topic to be notified if another reply gets posted. Essentially, I would like to create the situation as if "notify me when a reply is posted" had been ticked for every post that has been made so far.

Now that I have changed the configuration for every user to get notified by default (unless box is unticked) this must be stored somewhere in the database. Shouldn't I be able to change the notify indicator to 1, similarly to the notification configuration SQL update?

Thanks

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Wed Jun 29, 2011 1:00 pm
by stevemaury
To make notify on reply the default:

For new registrations:
OPEN includes/functions_user.php
FIND

Code: Select all

		'user_notify'			=> 0,
REPLACE WITH

Code: Select all

		'user_notify'			=> 1,
To change all your present members, run this query in phpMyAdmin

Code: Select all

UPDATE phpbb_users SET user_notify = 1 WHERE user_type <> 2
If your table prefix is not phpbb_ change to your table prefix.[/quote]

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Wed Jun 29, 2011 1:38 pm
by Khoala
Pony99CA wrote:
dhecker wrote:That will work, but wouldn't it ignore the user's setting in their profile?
I would like them to be able to turn off the feature if they want.
You're referring to the UCP option, not the posting page option, right?

If so, try this in \includes\functions_user.php:

Find:

Code: Select all

'user_notify'			=> 0,
Replace with:

Code: Select all

'user_notify'			=> 1,
That will make reply notification the default for new users.

If you want to make reply notification the default for existing users, run the following SQL query:

Code: Select all

UPDATE phpbb_users 
SET user_notify = 1
WHERE user_type <> 2;
Of course, you should back up your database before running an UPDATE query.

Steve
Thanks! Exactly what I wanted and worked great!

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Wed Jun 29, 2011 2:04 pm
by Pony99CA
jelo77 wrote:
You can insert rows for each user and topic into the topics_watch table, but that might be a bad idea. Unless your users really want that, it would almost be like spamming them if they didn't want to subscribe.
I do not intend to subscribe everyone to every topic. I just want all the people (initial creator plus any replies) in a topic to be notified if another reply gets posted. Essentially, I would like to create the situation as if "notify me when a reply is posted" had been ticked for every post that has been made so far.
You'll still need to insert rows for those people into topics_watch. That's what happens when people subscribe to a topic.
jelo77 wrote:Now that I have changed the configuration for every user to get notified by default (unless box is unticked) this must be stored somewhere in the database.
Yes, that's the user_notify column in the users table (as the SQL query posted above shows).
jelo77 wrote:Shouldn't I be able to change the notify indicator to 1, similarly to the notification configuration SQL update?
No. Once again, the topics_watch table stores topic subscription information. Why is this hard to believe? You need to track each topic that a user has subscribed to, which requires storing both a user ID and a topic ID. Look at the definition of topics_watch.

You might be able to create an INSERT query from the results of a SELECT query, but that's beyond my middling SQL skills right now.

Steve

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Wed Jun 29, 2011 2:56 pm
by stevemaury
Also note that the settings in the *_watch tables will only give one notice until a topic or forum has been viewed.

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Wed Jun 29, 2011 3:57 pm
by jelo77
No. Once again, the topics_watch table stores topic subscription information. Why is this hard to believe? You need to track each topic that a user has subscribed to, which requires storing both a user ID and a topic ID. Look at the definition of topics_watch.
I did look at the table. My board has 2884 posts in 447 topics. In the table topic_watch I have 395 entries, most of them have a notify_status=0. I was under the impression that each user that posts will get an entry with the correct notification status of 0 or 1 for that user id and topic id, but apparently that is not the case. I will check if I can run an SQL command to select all users in one topic to then set the notification for those users only for each of my topics.

Re: 'Notify me upon replies by default' set to YES by defaul

Posted: Wed Jun 29, 2011 4:55 pm
by wcanetworks2
stevemaury wrote:To make notify on reply the default:

For new registrations:
OPEN includes/functions_user.php
FIND

Code: Select all

		'user_notify'			=> 0,
REPLACE WITH

Code: Select all

		'user_notify'			=> 1,
To change all your present members, run this query in phpMyAdmin

Code: Select all

UPDATE phpbb_users SET user_notify = 1 WHERE user_type <> 2
If your table prefix is not phpbb_ change to your table prefix.
[/quote]

Thank you.