[3.1][3.2][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!
Suggested Hosts
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
3Di
Registered User
Posts: 13128
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 » Sat Jul 01, 2017 11:23 pm

Finally I got 10 minutes of spare time to d/l the latest and test it.

On a side note: the PHP extension php_fileinfo is a requirement here, lesson taken and server re-started. ;) Maybe add a prior check in ext.php, kasimi?

Going to test this with a mix-salad (half and half template syntaxes). I will report.

Edit: success, the only ACP page left to be translated, mixed-salad, has been succesfully rewritten, also some commented code has been translated. Page tested as well. At a first glance, you got a winner. Thanks. :)
:game_die: The new Dice Roller extension for phpBB 3.2 is out! :game_die:

Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3384
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

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

Post by kasimi » Sun Jul 02, 2017 8:20 am

Thanks for testing. With these changes the php_fileinfo extension shouldn't be needed anymore.

User avatar
</Solidjeuh>
Registered User
Posts: 1154
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> » Mon Jul 03, 2017 2:42 pm

I have these errors when I convert my templates:

Code: Select all

[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 550: Undefined index: ulist_open_default
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 550: Undefined index: ulist_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 553: Undefined index: olist_open
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 553: Undefined index: olist_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 556: Undefined index: ulist_open
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 556: Undefined index: ulist_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 560: Undefined index: listitem
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 560: Undefined index: listitem_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 570: Undefined index: inline_attachment_open
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 570: Undefined index: inline_attachment_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 550: Undefined index: ulist_open_default
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 550: Undefined index: ulist_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 553: Undefined index: olist_open
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 553: Undefined index: olist_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 556: Undefined index: ulist_open
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 556: Undefined index: ulist_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 560: Undefined index: listitem
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 560: Undefined index: listitem_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 570: Undefined index: inline_attachment_open
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 570: Undefined index: inline_attachment_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 550: Undefined index: ulist_open_default
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 550: Undefined index: ulist_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 553: Undefined index: olist_open
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 553: Undefined index: olist_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 556: Undefined index: ulist_open
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 556: Undefined index: ulist_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 560: Undefined index: listitem
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 560: Undefined index: listitem_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 570: Undefined index: inline_attachment_open
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 570: Undefined index: inline_attachment_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 550: Undefined index: ulist_open_default
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 550: Undefined index: ulist_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 553: Undefined index: olist_open
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 553: Undefined index: olist_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 556: Undefined index: ulist_open
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 556: Undefined index: ulist_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 560: Undefined index: listitem
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 560: Undefined index: listitem_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 570: Undefined index: inline_attachment_open
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 570: Undefined index: inline_attachment_close
[phpBB Debug] PHP Notice: in file [ROOT]/phpbb/textformatter/s9e/factory.php on line 505: Undefined index: code
phpBB: 3.2.1-RC1
PHP: 7.0.12
We offer fun HTML5 games for young and old.
Register a free account & enjoy all functions!
Save your score, challenge other members or play along with our tournaments.


~~~ https://www.solidjeuh.be ~~~

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3384
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

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

Post by kasimi » Mon Jul 03, 2017 4:30 pm

Your style's bbcode.html is missing or incomplete.

User avatar
</Solidjeuh>
Registered User
Posts: 1154
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> » Mon Jul 03, 2017 4:38 pm

kasimi wrote:
Mon Jul 03, 2017 4:30 pm
Your style's bbcode.html is missing or incomplete.
This is what I got from the conversion

Code: Select all

{% for ulist_open in loops.ulist_open %}<ul style="list-style-type: {{ LIST_TYPE }}">{% endfor %}
{% for ulist_open_default in loops.ulist_open_default %}<ul>{% endfor %}
{% for ulist_close in loops.ulist_close %}</ul>{% endfor %}

{% for olist_open in loops.olist_open %}<ol style="list-style-type: {{ LIST_TYPE }}">{% endfor %}
{% for olist_close in loops.olist_close %}</ol>{% endfor %}

{% for listitem in loops.listitem %}<li>{% endfor %}
{% for listitem_close in loops.listitem_close %}</li>{% endfor %}

{% for quote_username_open in loops.quote_username_open %}<blockquote><div><cite>{{ USERNAME }} {{ lang('WROTE') }}{{ lang('COLON') }}</cite>{% endfor %}
{% for quote_open in loops.quote_open %}<blockquote class="uncited"><div>{% endfor %}
{% for quote_close in loops.quote_close %}</div></blockquote>{% endfor %}
{% for quote_extended in loops.quote_extended %}
<blockquote>
	<xsl:if test="not(@author)">
		<xsl:attribute name="class">uncited</xsl:attribute>
	</xsl:if>
	<div>
		<xsl:if test="@author">
			<cite>
				<xsl:choose>
					<xsl:when test="@url">
						<a href="{@url}" class="postlink"><xsl:value-of select="@author"/></a>
					</xsl:when>
					<xsl:when test="@profile_url">
						<a href="{@profile_url}"><xsl:value-of select="@author"/></a>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="@author"/>
					</xsl:otherwise>
				</xsl:choose>
				<xsl:text> </xsl:text>
				<xsl:value-of select="$L_WROTE"/>
				<xsl:value-of select="$L_COLON"/>
				<xsl:if test="@post_url">
					<xsl:text> </xsl:text>
					<a href="{@post_url}" data-post-id="{@post_id}" onclick="if(document.getElementById(hash.substr(1)))href=hash">&#8593;</a>
				</xsl:if>
				<xsl:if test="@date">
					<div class="responsive-hide"><xsl:value-of select="@date"/></div>
				</xsl:if>
			</cite>
		</xsl:if>
		<xsl:apply-templates/>
	</div>
</blockquote>
{% endfor %}

{% for code_open in loops.code_open %}<div class="codebox"><p>{{ lang('CODE') }}{{ lang('COLON') }} <a href="#" onclick="selectCode(this); return false;">{{ lang('SELECT_ALL_CODE') }}</a></p><pre><code>{% endfor %}
{% for code_close in loops.code_close %}</code></pre></div>{% endfor %}

{% for inline_attachment_open in loops.inline_attachment_open %}<div class="inline-attachment">{% endfor %}
{% for inline_attachment_close in loops.inline_attachment_close %}</div>{% endfor %}

{% for b_open in loops.b_open %}<strong class="text-strong">{% endfor %}
{% for b_close in loops.b_close %}</strong>{% endfor %}

{% for u_open in loops.u_open %}<span style="text-decoration: underline">{% endfor %}
{% for u_close in loops.u_close %}</span>{% endfor %}

{% for i_open in loops.i_open %}<em class="text-italics">{% endfor %}
{% for i_close in loops.i_close %}</em>{% endfor %}

{% for color in loops.color %}<span style="color: {{ COLOR }}">{{ TEXT }}</span>{% endfor %}

{% for size in loops.size %}<span style="font-size: {{ SIZE }}%; line-height: 116%;">{{ TEXT }}</span>{% endfor %}

{% for img in loops.img %}<img src="{{ URL }}" class="postimage" alt="{{ lang('IMAGE') }}" />{% endfor %}

{% for url in loops.url %}<a href="{{ URL }}" class="postlink">{{ DESCRIPTION }}</a>{% endfor %}

{% for email in loops.email %}<a href="mailto:{{ EMAIL }}">{{ DESCRIPTION }}</a>{% endfor %}

{% for flash in loops.flash %}<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{{ WIDTH }}" height="{{ HEIGHT }}"><param name="movie" value="{{ URL }}" /><param name="play" value="false" /><param name="loop" value="false" /><param name="quality" value="high" /><param name="allowScriptAccess" value="never" /><param name="allowNetworking" value="internal" /><embed src="{{ URL }}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{{ WIDTH }}" height="{{ HEIGHT }}" play="false" loop="false" quality="high" allowscriptaccess="never" allownetworking="internal"></embed></object>{% endfor %}
We offer fun HTML5 games for young and old.
Register a free account & enjoy all functions!
Save your score, challenge other members or play along with our tournaments.


~~~ https://www.solidjeuh.be ~~~

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3384
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

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

Post by kasimi » Mon Jul 03, 2017 4:56 pm

It looks like the textformatter expects bbcode.html to use phpBB template syntax: https://github.com/phpbb/phpbb/blob/rel ... y.php#L508

Here's an idea: before this line, add this code:

Code: Select all

if ($template_file['filename'] == 'bbcode.html')
{
    continue;
}
Maybe JoshyPHP has details on this.
JoshyPHP wrote: poke

User avatar
JoshyPHP
Code Contributor
Posts: 972
Joined: Mon Jul 11, 2011 12:28 am

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

Post by JoshyPHP » Mon Jul 03, 2017 4:58 pm

Yes, everything in phpBB expects bbcode.html to use the <!-- BEGIN ... --> syntax.
I wrote the thing that does BBCodes in 3.2.

User avatar
</Solidjeuh>
Registered User
Posts: 1154
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> » Mon Jul 03, 2017 5:27 pm

kasimi wrote:
Mon Jul 03, 2017 4:56 pm
It looks like the textformatter expects bbcode.html to use phpBB template syntax: https://github.com/phpbb/phpbb/blob/rel ... y.php#L508

Here's an idea: before this line, add this code:

Code: Select all

if ($template_file['filename'] == 'bbcode.html')
{
    continue;
}
Maybe JoshyPHP has details on this.
JoshyPHP wrote: poke
Yes that worked, no more errors :D
We offer fun HTML5 games for young and old.
Register a free account & enjoy all functions!
Save your score, challenge other members or play along with our tournaments.


~~~ https://www.solidjeuh.be ~~~

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3384
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

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

Post by kasimi » Mon Jul 03, 2017 8:02 pm

Thank you both for confirming.

Changes in version 1.1.1:
  • When downloading zip file, set content type explicitly to not rely on php_fileinfo extension
  • When converting a style, don't convert bbcode.html
For the latest download see the link to the GitHub releases in the first post.

User avatar
Toxyy
Registered User
Posts: 594
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

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

Post by Toxyy » Mon Jul 03, 2017 8:13 pm

Does twig syntax work on the ACP? Did it by hand the other day and it broke, wasn't sure if it was something on my end or not.
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][RC] Show User Activity

User avatar
david63
Jr. Extension Validator
Posts: 15066
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

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

Post by david63 » Mon Jul 03, 2017 8:17 pm

Toxyy wrote:
Mon Jul 03, 2017 8:13 pm
Does twig syntax work on the ACP?
Yes
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
</Solidjeuh>
Registered User
Posts: 1154
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> » Mon Jul 03, 2017 9:02 pm

Toxyy wrote:
Mon Jul 03, 2017 8:13 pm
Does twig syntax work on the ACP? Did it by hand the other day and it broke, wasn't sure if it was something on my end or not.
Yes just tried it. Everything works.
We offer fun HTML5 games for young and old.
Register a free account & enjoy all functions!
Save your score, challenge other members or play along with our tournaments.


~~~ https://www.solidjeuh.be ~~~

User avatar
3Di
Registered User
Posts: 13128
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 » Mon Jul 03, 2017 9:29 pm

What about trying first and in case provide feedback..
that's still a developmental topic, therefore is provided for testing.

The ACP side has been tested already, with mixed-salad as well
viewtopic.php?p=14772336#p14772336
:game_die: The new Dice Roller extension for phpBB 3.2 is out! :game_die:

Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
Toxyy
Registered User
Posts: 594
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

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

Post by Toxyy » Mon Jul 03, 2017 9:44 pm

Can there be an option to converted to 3.2 twig? The only change there would be removing "loops." from for statements.
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][RC] Show User Activity

User avatar
3Di
Registered User
Posts: 13128
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 » Mon Jul 03, 2017 9:52 pm

loops. are compatible.
:game_die: The new Dice Roller extension for phpBB 3.2 is out! :game_die:

Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: battye, ivailo95, PGreca and 25 guests