[3.1][3.2][3.3][RC] Twig Converter

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 4316
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

[3.1][3.2][3.3][RC] Twig Converter

Post by kasimi »

Extension Name: Twig Converter

Author: kasimi

Extension Description: This extension converts template files using phpBB syntax to template files using Twig syntax. It adds a very simple ACP module with a dropdown list of all available extensions and styles. When submitting the form, it downloads a zip file with all .html template files found within the selected extension or style folder, converted to Twig syntax.

This extension is a development tool and should not be used in a production environment.

Extension Version: 1.3.0

Requirements: Since version 1.2.0 of this extension, you need phpBB 3.2.x or 3.3.x. For phpBB 3.1.x, please use version 1.1.1. The PHP zip extension needs to be installed in all cases.

Screenshots:

Image

Extension Download:

GitHub Releases: https://github.com/kasimi/phpbb-ext-twi ... r/releases
GitHub Repo: https://github.com/kasimi/phpbb-ext-twigconverter
User avatar
3Di
Former Team Member
Posts: 15692
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [3.1][3.2][RC] Twig Converter

Post by 3Di »

Cool, kasimi. What a great idea!

+ {{ put here a number }}
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
:studio_microphone: Looking for a specific feature or alternative option?
User avatar
Toxyy
Registered User
Posts: 758
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Re: [3.1][3.2][RC] Twig Converter

Post by Toxyy »

I just did this by hand about a day ago. You should have released this sooner!!

How do you handle loops?

Also, any bugs or kinks?
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

My extensions:
[3.2][BETA] Anonymous Posts || [3.2][BETA] Sticky Ad || [3.2][RC] Show User Activity ||
[3.2][DEV] User Delete Topics
User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 4316
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [3.1][3.2][RC] Twig Converter

Post by kasimi »

I wrote this only today. :P After having written a Python script yesterday with ugly regular expressions that didn't even cover all syntax features, I realized that phpBB does the conversion internally already, so this extension just reuses core code, which means that if your template files with phpBB syntax work as intended, this extension is able to convert them without problems. :)
User avatar
Toxyy
Registered User
Posts: 758
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Re: [3.1][3.2][RC] Twig Converter

Post by Toxyy »

That's great. How about support for selecting individual files/folders? Only reading html files of course.
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

My extensions:
[3.2][BETA] Anonymous Posts || [3.2][BETA] Sticky Ad || [3.2][RC] Show User Activity ||
[3.2][DEV] User Delete Topics
User avatar
david63
Registered User
Posts: 17965
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Contact:

Re: [3.1][3.2][RC] Twig Converter

Post by david63 »

Just a thought - could this be used to convert core templates?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored
User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 4316
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [3.1][3.2][RC] Twig Converter

Post by kasimi »

Toxyy wrote:
Fri Jun 30, 2017 11:35 pm
How about support for selecting individual files/folders?
Converting doesn't take long and is done only once, usually. You could just convert all .html files and extract only the ones you need from the zip archive. I don't think adding support for individual files is worth it.
david63 wrote:
Sat Jul 01, 2017 9:05 am
could this be used to convert core templates?
Yes indeed, good idea. I just tested this by copying the styles/prosilver folder to ext/kasimi/twigconverter/prosilver and doing the conversion, and it worked.
User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 4696
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James
Contact:

Re: [3.1][3.2][RC] Twig Converter

Post by HiFiKabin »

Very clever and very useful addition to the 'tool box'
User avatar
pierredu
Registered User
Posts: 1101
Joined: Thu Nov 01, 2012 8:04 am
Location: Paris (France)

Re: [3.1][3.2][RC] Twig Converter

Post by pierredu »

Fine idea. Thanks.
User avatar
</Solidjeuh>
Registered User
Posts: 1788
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [3.1][3.2][RC] Twig Converter

Post by </Solidjeuh> »

Great extension! So maybe the phpBb team can use this to convert the prosilver style?
Tested the ext on phpBB 3.2.1 RC1 and works great!
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: [3.1][3.2][RC] Twig Converter

Post by canonknipser »

Great extension!

Currently you are checking only the ext-folder for html-files? Is it possible to check also the styles-Folder to convert styles without copying them to the ext-folder?
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21152
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: [3.1][3.2][RC] Twig Converter

Post by RMcGirr83 »

Ditto on the great extension, makes it so easy for extension writers to convert.

:+1:
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions | My extensions are updated regularly on github
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored
User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 4316
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [3.1][3.2][RC] Twig Converter

Post by kasimi »

Glad to hear it's useful to others. :)
canonknipser wrote:
Sat Jul 01, 2017 6:55 pm
Is it possible to check also the styles-Folder to convert styles without copying them to the ext-folder?
There's a new version 1.1.0 that adds support for converting styles. It also fixes a critical directory traversal bug in 1.0.0 that could be used to extract .html files from outside of phpBB's root folder. Please update!

For the latest download see the link to the GitHub releases in the first post.
User avatar
Ibedejo
Registered User
Posts: 243
Joined: Tue Feb 21, 2012 12:12 am

Re: [3.1][3.2][RC] Twig Converter

Post by Ibedejo »

Great extension and a perfect help!

Chapeau! :D
User avatar
3Di
Former Team Member
Posts: 15692
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [3.1][3.2][RC] Twig Converter

Post by 3Di »

RMcGirr83 wrote:
Sat Jul 01, 2017 8:28 pm
Ditto on the great extension, makes it so easy for extension writers to convert.

:+1:
Yeah, that's not "greek" anymore uh? :)
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
:studio_microphone: Looking for a specific feature or alternative option?
Post Reply

Return to “Extensions in Development”