BBCode enable/disable

General discussion of development ideas and the approaches taken in the 3.x branch of phpBB. The current feature release of phpBB 3 is 3.3/Proteus.
Forum rules
Please do not post support questions regarding installing, updating, or upgrading phpBB 3.3.x. If you need support for phpBB 3.3.x please visit the 3.3.x Support Forum on phpbb.com.

If you have questions regarding writing extensions please post in Extension Writers Discussion to receive proper guidance from our staff and community.
Post Reply
amalnaeem
Registered User
Posts: 4
Joined: Thu Mar 08, 2018 5:29 pm

BBCode enable/disable

Post by amalnaeem »

Sorry if I'm posting in a wrong forum. I was looking into the functionality of enabling/disabling BBCodes.
..\phpBB3\phpbb\textformatter\s9e\parser.php contains functions of enable_bbcode which further uses parser's disablePlugin(). Can you help me in finding out where the functionality of disablePlugin is implemented?

User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 1904
Joined: Thu Mar 02, 2006 4:29 pm
Location: Earth
Contact:

Re: BBCode enable/disable

Post by DavidIQ »

It isn't.
Image

User avatar
3Di
Registered User
Posts: 951
Joined: Tue Nov 01, 2005 9:50 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Contact:

Re: BBCode enable/disable

Post by 3Di »

May I ask if you need it for an extension?

Forget: I did read this https://area51.phpbb.com/phpBB/viewtopi ... 99&t=55396 right now.

I will post a link for you later once I'll find it somewhere in my bookmarks. How to use it, I mean.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades

User avatar
3Di
Registered User
Posts: 951
Joined: Tue Nov 01, 2005 9:50 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Contact:

Re: BBCode enable/disable

Post by 3Di »

amalnaeem wrote: Fri Mar 23, 2018 7:41 am ... snip...

... which further uses parser's disablePlugin(). Can you help me in finding out where the functionality of disablePlugin is implemented?
Right in the related s9e's vendor folder, see ./vendor/s9e/text-formatter/src/Parser.php

Code: Select all

	public function disablePlugin($pluginName)
	{
		if (isset($this->pluginsConfig[$pluginName]))
		{
			$pluginConfig = $this->pluginsConfig[$pluginName];
			unset($this->pluginsConfig[$pluginName]);
			$pluginConfig['isDisabled'] = \true;
			$this->pluginsConfig[$pluginName] = $pluginConfig;
		}
	}
But if you are after disabling BBcodes on a per BBcode/permission basis, there is another approach, easier.

I am not sure of what you would like to achieve with the above information I gave you.

Edit: since the function isn't (as David said) actually implemented.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades

amalnaeem
Registered User
Posts: 4
Joined: Thu Mar 08, 2018 5:29 pm

Re: BBCode enable/disable

Post by amalnaeem »

I just wanted to understand the variable game here as I was trying to fix https://tracker.phpbb.com/browse/PHPBB3-15592

I fixed that by using the 'bbcode_status' variable i.e. if that's 1 then show the place inline button otherwise hide it in the

\phpbb\cache\production\twig\75\7557e0bea29f833ba4635c3631970112a6a80cf39656aa51225c8aae447a0b6d.php along with bb_code buttons bar.

But the file (obviously) exists in installed directory. How can I merge it with the GitHub phpBB repository as the file isn't already there ?

User avatar
3Di
Registered User
Posts: 951
Joined: Tue Nov 01, 2005 9:50 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Contact:

Re: BBCode enable/disable

Post by 3Di »

amalnaeem wrote: Sat Mar 24, 2018 6:37 am I just wanted to understand the variable game here as I was trying to fix https://tracker.phpbb.com/browse/PHPBB3-15592

I fixed that by using the 'bbcode_status' variable i.e. if that's 1 then show the place inline button otherwise hide it in the

\phpbb\cache\production\twig\75\7557e0bea29f833ba4635c3631970112a6a80cf39656aa51225c8aae447a0b6d.php along with bb_code buttons bar.

But the file (obviously) exists in installed directory. How can I merge it with the GitHub phpBB repository as the file isn't already there ?
Are you trying to fix that PR modding the cache file? The cache is automatically generated on a per installed Board on each server, the cache folder shipped with phpBB in almost empty as you can see https://github.com/phpbb/phpbb/tree/master/phpBB/cache and should remain this way.

The line where that button, as per the Tracker/ticket, is located seems to be this one https://github.com/phpbb/phpbb/blob/17c ... y.html#L64

Assuming the bug there decribed is valid (I didn't try to replicate it), I'd go for adding a template switch based on the DB/config table/related config (bool) .. like an IF/ENDIF which surrounds that button.

If the bug is valid, as I said.
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades

amalnaeem
Registered User
Posts: 4
Joined: Thu Mar 08, 2018 5:29 pm

Re: BBCode enable/disable

Post by amalnaeem »

sorry but can you briefly explain this part DB/config table/related config (bool) ?

User avatar
3Di
Registered User
Posts: 951
Joined: Tue Nov 01, 2005 9:50 pm
Location: Milano 🇮🇹 Frankfurt 🇩🇪
Contact:

Re: BBCode enable/disable

Post by 3Di »

Database/config table/allow_bbcode

-
allow_bbcode_config_table.png
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades

Post Reply