News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

change default notifySendBody option to ON

Started by kennethmgreen, September 16, 2007, 11:00:23 PM

Previous topic - Next topic

kennethmgreen

I tried searching for this, but couldn't find anything useful.

What is the best/easiest way to change the default options for new members? I want all members of a forum to initially have the 'When sending notification of a reply to a topic, send the post in the email...' checkbox checked (but allow them to UNcheck if they want).

Many users on this forum (most of whom are not very technical) have been asking for this feature. I was excited that the new version included this option - just successfully upgraded from 1.0.8 to 1.1.3.

Unfortunately, I noticed that although the option was there, it was turned off by default. I understand why - sending the text of the post can create heavy loads on a big forum. The forum in question isn't that big, and sending the text would be of great help to many users.

I realize that I could post an announcement and explain to users how to turn this option on. But there is a small percentage of members that almost never log onto the forum, but would still need to be sent announcements. The text of the announcements need to be included in the notification message.

I went in with phpmyadmin and updated all members to notifySendBody = 1 where notifySendBody = 0. That works, but as soon as new members join, they won't have that setting.

How do I change this? A better question is how do I select what options are set by default when a new member joins the forum?

Thanks.

pablorindt

#1
I have exactly the same question. How to put this option on for all users? Thx in advance!

Kirby

On lines 691-726 of Subs-Members.php you can edit this information :)
Add this to the array

'notifySendBody' => 1,

pablorindt

Wow thank you a lot :) Do all users that already registered to my forum have this option on now, or only new registered?

kennethmgreen

Thanks for the response!

Quote from: pablorindt on October 17, 2007, 04:30:41 AM
Wow thank you a lot :) Do all users that already registered to my forum have this option on now, or only new registered?

I'm not 100% sure (not at a computer with SMF source files), but I'm assuming this is for the options that get set when a new member is created.

In order for you to change existing members' preferences, you are going to have to go into the database, unless you want to change them individually (easiest option if you only have a few members). If you have phpmyadmin access, I can tell you exactly what I did, as I described in my first post in this thread.

Kirby


pablorindt

Quote from: kennethmgreen on October 17, 2007, 03:16:06 PM
Thanks for the response!

Quote from: pablorindt on October 17, 2007, 04:30:41 AM
Wow thank you a lot :) Do all users that already registered to my forum have this option on now, or only new registered?

I'm not 100% sure (not at a computer with SMF source files), but I'm assuming this is for the options that get set when a new member is created.

In order for you to change existing members' preferences, you are going to have to go into the database, unless you want to change them individually (easiest option if you only have a few members). If you have phpmyadmin access, I can tell you exactly what I did, as I described in my first post in this thread.
Can you tell me plz? I can go into the database and can set it per user there. But you say there is an option to put all on?

kennethmgreen

#7
This is a pretty simple task in something like phpMyadmin.. Nevertheless, I TAKE NO RESPONSBILITY FOR ANYTHING THAT MESSES UP YOUR FORUM AND/OR YOUR DATABASE.

OK... assuming you have access to the database (not just admin access to the forum), you can run an update command.

See: http://dev.mysql.com/doc/refman/5.0/en/update.html for reference.

First, let's see what rows you are about to update.

run this SQL query:

SELECT `memberName` , `realName` , `emailAddress` , `notifySendBody`
FROM `smf_members`
WHERE `notifySendBody` <> 1
AND `is_activated` <> 0


That should show you a result list of all active members of your forum that have the notifySendBody off. If you cannot get this to work, stop here - DO NOT PROCEED.

If the result list looks good, and you want to update your *existing* members to have the notifySendBody option ON, run the following SQL query.

Note that you are about to update the preferences for ALL active members (everyone in the list generated by the query above). This could include members that have explicitly turned this option off. Understand that you are doing a system-wide update for all your members.

SQL query:

UPDATE smf_members
SET notifySendBody=1
WHERE notifySendBody <> 1
AND `is_activated` <> 0


The is_activated part is optional - assuming you just want to work with active members. You can leave the AND statement out if you wish.

Hope this helps.

[edit]: it's a good idea to put forum into Maintenance Mode before doing this - or anytime you are making database changes.

pablorindt

#8
Got an error by the first SQL query:

SQL-query: Documentatie

SELECT `memberName` , `realName` , `emailAddress` , `notifySendBody`
FROM `smf_members`
WHERE `notifySendBody` <>1
AND `is_activated` <>0
LIMIT 0 , 30

MySQL retourneerde: Documentatie
#1046 - No Database Selected


So seems i have no database selected  ::)

EDIT: oh got it working, just deleted the: AND `is_activated` <> 0  :) Now trying to update...

EDIT2: YEAH got it working, thank you for this, now I understand the sql a bit  ;) Thank you!  :D

EDIT3: just another little question:
All notifications for users are set on by default now, except one: When users place a reply. Is there an option to put that on by default too? I think there is, but can't find it ;) And can I update my members list? Thx man!

kennethmgreen

Glad I could help.

Quote from: pablorindt on October 18, 2007, 06:09:23 AM
EDIT3: just another little question:
All notifications for users are set on by default now, except one: When users place a reply. Is there an option to put that on by default too? I think there is, but can't find it ;) And can I update my members list? Thx man!

I'm again away from smf source files, but I'm guessing you could take a look at the array that was talked about in Kirby's post. That is, to modify what new member settings are.

These references may help:
http://www.w3schools.com/php/func_array.asp
http://www.phpf1.com/tutorial/php-array.html?page=5

To modify existing members, take a look at the smf_members table and find the field that corresponds to the option you want to change, then do another update. USE SELECT STATEMENTS FIRST TO CONFIRM WHAT RECORDS YOU ARE GOING TO MODIFY <--- always, always, always - no matter how trivial you think the SQL is --- run a SELECT first.

pablorindt

K man, thx! I now set email at pm defauld at 1. And also other options. Thank you for u'r help! :)

Kirby

Everything looks good, I will mark this as solved :)

Advertisement: