Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jan 2009
Posts: 92
whk
Offline
Journeyman
Journeyman
Joined: Jan 2009
Posts: 92
I'm not a SQL guru but know how to run a script from the admin panel for the database. Since there is no admin screen to set default preferences, can someone please post SQL scripts I can run as admin that will do the following?

1. Set the answer to "Yes" for all users "Do you want to be notified via email when you receive a private message?"

2. Set the answer to "Yes" for all users "Accept private messages from other users?"

Is there a mod I can do so all new users default to these answers? I'm running version 7.5.4.1

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Update current users:

SQL Query
update ubbt_USER_PROFILE
set USER_NOTIFY_ON_PM = 'yes',
USER_ACCEPT_PM = 'yes'

The default for accepting private messages should already be yes, but just in case:

SQL Query
alter table ubbt_USER_PROFILE
change USER_NOTIFY_ON_PM varchar(3) not null default 'yes',
change USER_ACCEPT_PM varchar(3) not null default 'yes'

Joined: Jan 2009
Posts: 92
whk
Offline
Journeyman
Journeyman
Joined: Jan 2009
Posts: 92
Thanks Rick. The 1st script worked just fine. The 2nd script gave me a SQL error. Here is the response:

Quote
Script: /...../dodbcommand.php
Line#: 101
SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(3) not null default 'yes', change USER_ACCEPT_PM varchar(3) not null de' at line 2
SQL Error #: 1064
Query: alter table ubbt_USER_PROFILE change USER_NOTIFY_ON_PM varchar(3) not null default 'yes', change USER_ACCEPT_PM varchar(3) not null default 'yes'

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
Whoops, need to pay a bit more attention, sorry about that:

SQL Query
alter table ubbt_USER_PROFILE
change USER_NOTIFY_ON_PM USER_NOTIFY_ON_PM varchar(3) not null default 'yes',
change USER_ACCEPT_PM USER_ACCEPT_PM varchar(3) not null default 'yes'

Joined: Jan 2009
Posts: 92
whk
Offline
Journeyman
Journeyman
Joined: Jan 2009
Posts: 92
That did it. Thanks!

Joined: Jan 2009
Posts: 92
whk
Offline
Journeyman
Journeyman
Joined: Jan 2009
Posts: 92
Ok - final email notification I forgot in the previous request. I'd like to set to "yes" for default and set all existing to "yes" on the following question on the "Edit Profile" screen:

From time to time we send out emails regarding this community.
Do you wish to receive these emails?
No Yes

What is the SQL query to do that?

Joined: Jun 2006
Posts: 9,242
Likes: 1
R
Former Developer
Former Developer
R Offline
Joined: Jun 2006
Posts: 9,242
Likes: 1
2 queries:

SQL Query
alter table ubbt_USER_PROFILE
change USER_ACCEPT_ADMIN_EMAILS USER_ACCEPT_ADMIN_EMAILS varchar(3) not null default 'yes'

SQL Query
update ubbt_USER_PROFILE
set USER_ACCEPT_ADMIN_EMAILS='yes'

Just a note on the last one. Unless you have something in your board rules, users that have elected to not receive admin emails might accuse you of spamming when they are forced to accept them.

Joined: Jan 2009
Posts: 92
whk
Offline
Journeyman
Journeyman
Joined: Jan 2009
Posts: 92
Thanks Rick. I just updated the board rules to let people know that as a condition of signing up on the forum, they have to accept messages from the administrator.


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
1 members (Napalm), 806 guests, and 165 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)