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.
Get Involved
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 » Fri Sep 02, 2011 4:44 pm

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: 51873
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

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

Post by Brf » Fri Sep 02, 2011 4:49 pm

Code: Select all

update phpbb_users set user_options = user_options | 256;

User avatar
Lumpy Burgertushie
Registered User
Posts: 66829
Joined: Mon May 02, 2005 3:11 am
Contact:

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

Post by Lumpy Burgertushie » Fri Sep 02, 2011 5:20 pm

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.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51873
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

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

Post by Brf » Fri Sep 02, 2011 5:32 pm

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: 66829
Joined: Mon May 02, 2005 3:11 am
Contact:

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

Post by Lumpy Burgertushie » Fri Sep 02, 2011 6:03 pm

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.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51873
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

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

Post by Brf » Fri Sep 02, 2011 6:04 pm

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 » Fri Sep 02, 2011 6:21 pm

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 » Fri Sep 02, 2011 8:11 pm

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: 51873
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

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

Post by Brf » Fri Sep 02, 2011 8:22 pm

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 » Fri Sep 02, 2011 9:22 pm

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: 51873
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

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

Post by Brf » Fri Sep 02, 2011 9:24 pm

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 » Fri Sep 02, 2011 9:53 pm

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: 51873
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

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

Post by Brf » Sun Sep 04, 2011 11:38 am

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 » Sun Sep 04, 2011 3:21 pm

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: 51873
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

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

Post by Brf » Sun Sep 04, 2011 3:49 pm

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”