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.
Scam Warning
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:

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

Post by alecrust » Sun Sep 04, 2011 4:01 pm

Many thanks for that information.

Is there an SQL query I can run to set the default to "true"?

User avatar
Brf
Support Team Member
Support Team Member
Posts: 51889
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 4:07 pm

The "default" is whatever is set by the user_add function in includes/functions_user:

Code: Select all

		'user_options'		=> 230271,
If you want to set all of your users to the default, run

Code: Select all

update phpbb_users set user_options = 230271;

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 » Mon Sep 05, 2011 1:15 pm

Ah OK, that makes sense.

So I need to ensure that the default is set to 230271 for new user registrations within /includes/functions_user.php, and then run that SQL command to update all user's setting to that value.

Many thanks!

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

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

Post by Brf » Mon Sep 05, 2011 2:06 pm

Exactly.

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 » Mon Sep 05, 2011 7:00 pm

Many thanks for all your help Brf, seems to be sorted now.

My default setting in that file was "1919", no idea how it got set to that!

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 50924
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

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

Post by stevemaury » Mon Sep 05, 2011 7:26 pm

To me, that implies an out-of-date version of that file. What version of phpBB are you running?
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)

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 » Mon Sep 05, 2011 7:43 pm

3.0.9, recently updated. It's a bit of a hack job however, been updating and modifying the same core code for years.

I'm building a new version of my site in an isolated development environment using a fresh copy of 3.0.9, so this is just an interim solution until that goes live. I'm happy to say in the fresh copy of 3.0.9, that value is set correctly.

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 » Tue Sep 06, 2011 9:41 am

Hmm, it seems that SQL query in fact just set "Display signatures" to "true" for all my board users.

Is it a different query for just enabling BBCode in their signatures?

User avatar
Oyabun1
Former Team Member
Posts: 23162
Joined: Sun May 17, 2009 1:05 pm
Location: Australia
Name: Bill

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

Post by Oyabun1 » Tue Sep 06, 2011 10:03 am

You can't enable BBCode only for signatures with an SQL query, you would also need to add PHP code to create a new permission.

Board wide BBCodes can be enabled or disabled with ACP > General > Board features > Allow BBCode
                      Support Request Template
3.0.x: Knowledge Base Styles Support MOD Requests
3.1.x: Knowledge BaseStyles SupportExtension Requests

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 » Tue Sep 06, 2011 10:26 am

Yes, but there also seems to be a separate option when setting your Signature, "Disable BBCode":
Untitled-4.png
Untitled-4.png (17.35 KiB) Viewed 189 times
Many of my users seem to have this option checked, despite the default "Enable BBCode" for the board being set to "true".

What I'm looking for, as I've been discussing with Brf, is to set the default of this "Disable BBCode" value to "false" so that BBCodes work in Signatures for all users, and also an SQL query to set all current users to this also.

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

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

Post by Brf » Tue Sep 06, 2011 11:09 am

You already stated you had old code in includes/functions_users.php. You likely also have old code in includes/session.php where it is reading that setting.

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 » Tue Sep 06, 2011 11:18 am

But making BBCode enabled by default for all members is the only setting I've wanted to change since the beginning of this topic!

Can you let me know what the value should be for this setting in includes/session.php and what SQL I should run to update all users to this setting?

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

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

Post by Brf » Tue Sep 06, 2011 11:27 am

I already gave you the code to set bbcode in signatures to true:

Code: Select all

update phpbb_users set user_options = user_options | 32768;
But if you have old code in includes/sessions.php, where it is reading that setting, it will always read that setting as false.

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 » Tue Sep 06, 2011 11:37 am

Hi Brf,

You gave me this SQL to do that job:

Code: Select all

update phpbb_users set user_options = 230271;
After running that, it set all user's "View Signatures in Posts" to "true".

Now this number "32768" is cropping up (which I notice from the beginning of the topic). Does this, in fact, set user's "Enable BBCode" in the signatures to true?

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

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

Post by Brf » Tue Sep 06, 2011 12:15 pm

alecrust wrote: Now this number "32768" is cropping up (which I notice from the beginning of the topic). Does this, in fact, set user's "Enable BBCode" in the signatures to true?
There is no such setting.

Setting that bit to True sets the "Disable bbcode" in the signature editor to False, assuming your code-base is up-to-date to handle that setting.

Locked

Return to “[3.0.x] Support Forum”