Search found 1042 matches

by javiexin
Fri Aug 18, 2017 1:39 pm
Forum: Extension Writers Discussion
Topic: Using phpbb javascript modal dialogs
Replies: 0
Views: 693

Using phpbb javascript modal dialogs

Hello, I have a question. In an extension I am working on, I want to use some modal dialogs from within javascript code. The usual: I want to get user confirmation, and when the user clicks "Confirm" then execute the code and show a "Done" message (that would autoclose in some ti...
by javiexin
Thu Aug 10, 2017 4:09 pm
Forum: Extension Writers Discussion
Topic: How to use { in a template file
Replies: 13
Views: 2733

Re: How to use { in a template file

It's really quite simple: {{ '{' }} I know: Sorry to bother, I found an alternative, ugly, but it works (using Twig escaping): pattern="#[a-fA-F0-9]{{ '{' }}6{{ '}' }}" Any other options? Thanks! But honestly, it is not quite simple, and anyhow I like the other option better ( pattern=&qu...
by javiexin
Tue Aug 08, 2017 11:24 pm
Forum: Extension Writers Discussion
Topic: How to use { in a template file
Replies: 13
Views: 2733

Re: How to use { in a template file

Looking at it further, I think it is this line that is causing the issue: https://github.com/phpbb/phpbb/blob/3.2.x/phpBB/phpbb/template/twig/lexer.php#L134 $code = preg_replace('#{([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ $1$2 }}', $code); Looking at this, and given the situation, I will propose a chan...
by javiexin
Tue Aug 08, 2017 11:18 pm
Forum: Extension Writers Discussion
Topic: How to use { in a template file
Replies: 13
Views: 2733

Re: How to use { in a template file

The best solution I have found is the following: pattern="#[a-fA-F0-9]{6,6}" It works perfectly, and is translated as it should, basically because the phpbb lexer is NOT understanding 6,6 as a variable name, while 6 is interpreted as such, and hence, replaced for Twig to process it. Thanks...
by javiexin
Tue Aug 08, 2017 6:29 pm
Forum: Extension Writers Discussion
Topic: How to use { in a template file
Replies: 13
Views: 2733

Re: How to use { in a template file

If you use pure twig syntax in your template, then the lexer functions should be skipped, as they are not needed. But afiak there is currently no switch to tell phpBB that a template file is written in pure twig syntax Yes, you are right. They run always, as there is no way to tell if a template is...
by javiexin
Tue Aug 08, 2017 5:09 pm
Forum: Extension Writers Discussion
Topic: How to use { in a template file
Replies: 13
Views: 2733

Re: How to use { in a template file

Looking at it further, I think it is this line that is causing the issue:
https://github.com/phpbb/phpbb/blob/3.2 ... r.php#L134
$code = preg_replace('#{([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ $1$2 }}', $code);

Now, should this be fixed at the core?
-javiexin
by javiexin
Tue Aug 08, 2017 3:58 pm
Forum: Extension Writers Discussion
Topic: How to use { in a template file
Replies: 13
Views: 2733

Re: How to use { in a template file

Thanks again, Kasimi, but no: it gets translated as {{{ 6 }}}
kasimi wrote: Tue Aug 08, 2017 1:12 pm I didn't expect Twig to pick up single curly braces like this. :shock:
In fact, I am suspecting that this is not produced by Twig, but by the phpbb preprocessor...
by javiexin
Tue Aug 08, 2017 1:02 pm
Forum: Extension Writers Discussion
Topic: How to use { in a template file
Replies: 13
Views: 2733

Re: How to use { in a template file

Thanks a lot Kasimi, but: Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'A hash key must be followed by a colon (:). Unexpected token "punctuation" of value "}" ("punctuation" expected with value ":") in "file.html" at line 36.' in...
by javiexin
Tue Aug 08, 2017 11:52 am
Forum: Extension Writers Discussion
Topic: How to use { in a template file
Replies: 13
Views: 2733

Re: How to use { in a template file

Sorry to bother, I found an alternative, ugly, but it works (using Twig escaping):
pattern="#[a-fA-F0-9]{{ '{' }}6{{ '}' }}"

Any other options?
Thanks!
by javiexin
Tue Aug 08, 2017 11:38 am
Forum: Extension Writers Discussion
Topic: How to use { in a template file
Replies: 13
Views: 2733

How to use { in a template file

Hi, I would like to use the following HTML code in a template file (example): <input type="text" pattern="#[a-fA-F0-9]{6}" name="mycolor" value="#000000" size="7"/> Now all works fine, EXCEPT the {6} is processed by the phpbb template engine, and rep...
by javiexin
Tue Jul 18, 2017 12:01 pm
Forum: phpBB Custom Coding
Topic: How to replace $_POST with $request?
Replies: 10
Views: 2660

Re: How to get POST results without page reloading?

…Turned out that you cannot actually use „$template->assign_block_vars” when there’s only a single variable. I’ve used „$template->assign_var” instead. Now everything works fine, but I need to find a way to get a result without having the page to reload. Yes, you can use assign_block_vars with what...
by javiexin
Fri Jul 14, 2017 6:54 pm
Forum: Extension Requests
Topic: Auto-update Extension
Replies: 2
Views: 500

Re: Auto-update Extension

Included in 3.3
by javiexin
Tue Jul 11, 2017 5:06 pm
Forum: Extension Writers Discussion
Topic: Looking for advice: best way to add a new "visibility"
Replies: 9
Views: 1248

Re: Looking for advice: best way to add a new "visibility"

the visibility class was new in 3.1, and not all of the old usages were simply converted. I know Paul, and what I am saying is that the change was, as you indicate, partial, making it extremely difficult for an extension to modify the core behaviour. In fact, very few cases were converted... Do you...
by javiexin
Tue Jul 11, 2017 4:38 pm
Forum: Extension Writers Discussion
Topic: Looking for advice: best way to add a new "visibility"
Replies: 9
Views: 1248

Re: Looking for advice: best way to add a new "visibility"

For information, there are MORE than 225 uses of the visibility constants throught the phpbb software WITHOUT the uses within content_visibility (around 50). This is really unmanageable. All (most) of those uses should be somehow function calls to content_visibility, otherwise, it is almost impossib...

Go to advanced search