Codebox Plus and Knowledge Base - talk to each other?

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
User avatar
nou nou
Registered User
Posts: 507
Joined: Sat Oct 29, 2016 8:08 pm

Codebox Plus and Knowledge Base - talk to each other?

Post by nou nou »

Hello all,


I hope this is the right forum to post this in, since I am not an extension writer...

I manage a forum (phpBB 3.3.5) for which code sharing in a variety of languages is very important. For syntax highlighting, Codebox Plus is used. The extension was abandoned a long time ago, but with some help of david63 and kasimi it is still going strong on the most recent phpBB.

Now the wish is to add a Knowledge Base to the forum, not unlike the Knowledge Base present here. For this we'll be using https://github.com/Crizz0/knowledgebase

Both extensions work nicely, but I can't get my head around how to make sure that Codeboxes are rendered inside the Knowledge Base. It's not just a matter of adding Codebox Plus to the editor (which can be done with events in HTML), but once the posts are rendered, the Codebox BBCode results in a "normal" codebox only. Even though other BBCodes work.

Codebox Plus in a "normal" post:
CBPlus01.png
Codebox Plus in a Knowledge Base post:
CBPlus02.png
I am not an extension writer and don't really know php so this goes a little over my head. I also don't know whether this is involves an addition to Knowledge Base, Codebox Plus or both. What I have done, though, is this:

I posted Codebox Plus on GitHub, working nicely for 3.3.5:

https://github.com/nou-nou/phpBB-Extension-Codebox-Plus

Also a fork of Knowledge Base, but no adjustments have been made there:

https://github.com/nou-nou/knowledgebase

Lastly I set up a test board with the above two extensions (as posted on GitHub) here: https://www.wesuckless.dev/phpBB3.3.5/index.php

Hope someone can please take a look and help me on my way :)

Thanks!
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Codebox Plus and Knowledge Base - talk to each other?

Post by 3Di »

Oh, you are requesting something not that easy, did you even though about changing the way that code is being interpreted? Like https://phpbbstudio.com/extensions/pris ... ighlighter ?
🆓 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. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
nou nou
Registered User
Posts: 507
Joined: Sat Oct 29, 2016 8:08 pm

Re: Codebox Plus and Knowledge Base - talk to each other?

Post by nou nou »

I did, in fact, and your extension is very nice! One issue that I have is that I have a couple of languages that aren't supported by it. So I'd have to add those. Also there are a couple of external scripts that support the Codebox syntax of my forum to share code among users (nothing to do with the forum itself). I am not the author of those, so there is that. All that just means work essentially (and figuring out how to add languages to Prism, but I can probably find out) so that's not such a disaster.

The deal-breaker however, is the lack of a download button that Codebox Plus has, which allows you to set the filename. Users have come to depend on that for consistency and support... The download button also works with phpBB permissions.

I was hoping it was something less than "not that easy", since other BBCodes seem to work out of the box in the Knowledge Base extension, and so does Media Embed for example. Would you be able to tell me what the procedure is that would have to be added or adjusted? And whether it's in Codebox or in Knowledge Base?

I'm not afraid of trying or learning something new :)

Thanks!
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Codebox Plus and Knowledge Base - talk to each other?

Post by 3Di »

nou nou wrote: Sat Nov 27, 2021 3:18 am One issue that I have is that I have a couple of languages that aren't supported by it. So I'd have to add those.
Example?
🆓 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. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Codebox Plus and Knowledge Base - talk to each other?

Post by 3Di »

nou nou wrote: Sat Nov 27, 2021 3:18 am and figuring out how to add languages to Prism
https://prismjs.com/extending.html
nou nou wrote: Sat Nov 27, 2021 3:18 am The deal-breaker however, is the lack of a download button that Codebox Plus has
https://prismjs.com/plugins/download-button/
🆓 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. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
nou nou
Registered User
Posts: 507
Joined: Sat Oct 29, 2016 8:08 pm

Re: Codebox Plus and Knowledge Base - talk to each other?

Post by nou nou »

Oooh OK, this is getting very interesting!

Got some testing to do next, then. Thanks for the pointers!

EDIT: just out of interest alone, even if it turns out prism.js is a viable alternative, I'd still love to learn what it would take to integrate Codebox Plus, should anyone (you?) feel like enlightening me? :)
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco
Contact:

Re: Codebox Plus and Knowledge Base - talk to each other?

Post by 3Di »

nou nou wrote: Sun Nov 28, 2021 3:09 am EDIT: just out of interest alone, even if it turns out prism.js is a viable alternative, I'd still love to learn what it would take to integrate Codebox Plus, should anyone (you?) feel like enlightening me?
Contrary to what this world used to be where a lot of us actively participated in these kinds of challenges, now there is not much participation and desire to prove ourselves, many have moved on to other things, life changes and evolves, I personally participate by helping out as much as I can if it's not big participations, for which I decided long ago to follow the commercial approach. I wish you all the best with your project.
🆓 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. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
nou nou
Registered User
Posts: 507
Joined: Sat Oct 29, 2016 8:08 pm

Re: Codebox Plus and Knowledge Base - talk to each other?

Post by nou nou »

Noted and understood, but I wasn't asking you to do it, just to explain to me, even in high level terms, how it may work. Like "Codebox needs to do X, while KB needs to do Y..."
Post Reply

Return to “phpBB Custom Coding”