Advanced BBCode Box

ABBC3 editor not in some extenstions - Advanced BBCode Box

ABBC3 editor not in some extenstions

by nhseacoast » Fri Oct 30, 2020 5:56 pm

I'm sure the answer here is to contact the extensions' authors....but I have noticed that some extensions that inherit the default editor do not always display the ABBC3 editor properly. ie - Toolbars with drop downs are there, but no visible icons. Is this an easy fix or does it require serious coding from the extension developers?
Thanks!
http://nhgunforum.com phpBB v3.2.1
http://wtprise.org phpBB v3.3.2
User avatar
nhseacoast
Registered User
Posts: 625
Joined: Sun Sep 22, 2002 10:31 pm
Location: NH, USA
Contact:

Re: ABBC3 editor not in some extenstions

by oxpus » Thu Jan 07, 2021 9:46 pm

There is a bug in the abbc3 extension on using the default path settings for the existing bbcode icons.

I've tested this extention in combination with my download extension and can see all icons after modify the bbcode-display-controller with the following small but quick and dirty fix.
Please do not use "global" in live boards! Better modify the service.yml to add the phpbb_container object here!

To fix thie error for testing find in /ext/vse/abbc3/core/bbcodes_display.php

Code: Select all

		if (empty($icons))
		{
			$finder = $this->extension_manager->get_finder();
			$icons = $finder
				->set_extensions(['vse/abbc3'])
				->suffix(".{$this->config['abbc3_icons_type']}")
				->extension_directory('/images/icons')
				->core_path('images/abbc3/icons/')
				->get_files();

			// Rewrite the image array with img names as keys and paths as values
			foreach ($icons as $key => $path)
			{
				$icons[basename($path, ".{$this->config['abbc3_icons_type']}")] = $path;
				unset($icons[$key]);
			}
		}

		return $icons;
	}
and replace this code block with

Code: Select all

		if (empty($icons))
		{
			global $phpbb_container; // <<- DO NOT USE THIS IN LIVE BOARDS! THIS IS JUST FOR TESTING AT THIS POINT!!
			$ext_path = $this->extension_manager->get_extension_path('vse/abbc3', true);
			$ext_path_web = $phpbb_container->get('path_helper')->update_web_root_path($ext_path);

			$finder = $this->extension_manager->get_finder();
			$icons = $finder
				->set_extensions(['vse/abbc3'])
				->suffix(".{$this->config['abbc3_icons_type']}")
				->extension_directory('/images/icons')
				->core_path('images/abbc3/icons/')
				->get_files();

			// Rewrite the image array with img names as keys and paths as values
			foreach ($icons as $key => $path)
			{
				$path = $ext_path_web . 'images/icons/' . basename($path);
				$icons[basename($path, ".{$this->config['abbc3_icons_type']}")] = $path;
After this I can see all bbcode icons in my extension like in the default phpBB posting formular.
User avatar
oxpus
Registered User
Posts: 25
Joined: Mon Feb 03, 2003 11:43 am
Location: D - Bad Wildungen
Name: Karsten Ude
Contact: