SQL for setting "Enable BBCode" to true?

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
User avatar
alecrust
Registered User
Posts: 348
Joined: Thu Mar 27, 2008 11:24 am
Location: London, UK
Contact:

SQL for setting "Enable BBCode" to true?

Post by alecrust »

Hi,

I was wondering what SQL command I'd need to run to set all user's accounts to "Enable BBCode" by default?

Obviously there is the settings in my ACP which is set correctly, and this works for all new users. Many old members have this disabled though, and I'd like to enable it for all users in one go.

Many thanks,
Alec
Last edited by Mick on Wed Sep 07, 2011 5:42 am, edited 1 time in total.
Reason: Topic icon changed
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52236
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by Brf »

Code: Select all

update phpbb_users set user_options = user_options | 256;
User avatar
Lumpy Burgertushie
Registered User
Posts: 68495
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by Lumpy Burgertushie »

Brf wrote:

Code: Select all

update phpbb_users set user_options = user_options | 256;
how do you know what number to use to set those types of things?

robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52236
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by Brf »

The labels are in session.php:

Code: Select all

	var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17);
2^8 = 256
User avatar
Lumpy Burgertushie
Registered User
Posts: 68495
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by Lumpy Burgertushie »

would the number for smilies therefore be
2^9=512
and if so, why?
and if not, why?

thanks,
robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.3 Styles by PlanetStyles.net

If nobody is in the forest, does a tree really fall?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52236
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by Brf »

yes.
User avatar
alecrust
Registered User
Posts: 348
Joined: Thu Mar 27, 2008 11:24 am
Location: London, UK
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by alecrust »

Many thanks! That worked perfectly.
User avatar
alecrust
Registered User
Posts: 348
Joined: Thu Mar 27, 2008 11:24 am
Location: London, UK
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by alecrust »

Can I just confirm that user's signature box "Enable BBCode" option shares this setting?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52236
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by Brf »

I think that setting would be:
Brf wrote:'sig_bbcode' => 15

That would be 32768.
User avatar
alecrust
Registered User
Posts: 348
Joined: Thu Mar 27, 2008 11:24 am
Location: London, UK
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by alecrust »

So would the SQL query look like this? Don't want to get it wrong!

Code: Select all

update phpbb_users set user_options = user_options | 15;
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52236
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by Brf »

Brf wrote: 32768
User avatar
alecrust
Registered User
Posts: 348
Joined: Thu Mar 27, 2008 11:24 am
Location: London, UK
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by alecrust »

Many thanks for your help. I just have one more question!

Upon running that query, an abnormal amount of rows were affected (11890 to be precise). I'm starting to wonder if the default setting for "Allow BBCode in Signatures" is set to "false". I can't seem to find it in the ACP though, is this a setting that is in there?
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52236
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by Brf »

By default it is false. You would set it to true if you added bbcode to your signature.
User avatar
alecrust
Registered User
Posts: 348
Joined: Thu Mar 27, 2008 11:24 am
Location: London, UK
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by alecrust »

Is there an option in the ACP to change this? It's causing confusion with members attempting to write BBCode in their signature box and it not working because they haven't enabled it.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 52236
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: SQL for setting "Enable BBCode" to true?

Post by Brf »

The setting would be on each user's record, so it would be found on their signature page in either their UCP, or in Manage Users. By default it is supposed to be true, as enable BBcode setting is. Since yours were both false, I assume you used a bad convertor from some other software.
Locked

Return to “[3.0.x] Support Forum”