Search found 715 matches

by kasimi
Fri Dec 15, 2017 9:15 am
Forum: Extension Writers Discussion
Topic: [Tutorial] Convert to Twig Syntax
Replies: 38
Views: 4232

Re: [Tutorial] Convert to Twig Syntax

MarkDHamill wrote:
Fri Dec 15, 2017 12:52 am
I have some language files with the old syntax still embedded in it.
There's template syntax embedded in language files? Do you have an example?
by kasimi
Tue Dec 12, 2017 6:00 pm
Forum: Extension Writers Discussion
Topic: [Tutorial] Convert to Twig Syntax
Replies: 38
Views: 4232

Re: [Tutorial] Convert to Twig Syntax

See first post, Includes section, first example. Also have a look at the Twig Converter extension.
by kasimi
Sat Dec 09, 2017 5:39 pm
Forum: Extension Requests
Topic: Highlight and "Marked as Read" Posts
Replies: 19
Views: 568

Re: Highlight and "Marked as Read" Posts

Your second request sounds like a thanks/like/thumbs-up extension with "thanks" changed to "has read" in the the language files.
by kasimi
Fri Dec 08, 2017 10:31 pm
Forum: Extension Writers Discussion
Topic: Updates in EPV
Replies: 29
Views: 1828

Re: Updates in EPV

This seems to be a bug in composer: https://github.com/composer/composer/issues/6859

A temporary solution is to downgrade to 1.5.2: https://github.com/kasimi/mChat/commit/ ... 139a46e592
by kasimi
Fri Dec 08, 2017 9:42 pm
Forum: phpBB Custom Coding
Topic: assign_block_vars and assign_block_vars_array
Replies: 3
Views: 81

Re: assign_block_vars and assign_block_vars_array

In your second code block, the 'block2' keys are ignored. Instead, try this: $template->assign_block_vars_array('block1.block2', [ ['a1', 'b1', 'c1'], ['a2', 'b2', 'c2'], ]); The above is the same as this: $template->assign_block_vars('block1.block2', ['a1', 'b1', 'c1']); $template->assign_block_var...
by kasimi
Thu Dec 07, 2017 6:04 pm
Forum: phpBB Custom Coding
Topic: Ways to include breadcrumb in own page
Replies: 7
Views: 188

Re: Ways to include breadcrumb in own page

Probably like this:

Code: Select all

$this->template->assign_block_vars_array('navlinks', [
    [
        'FORUM_NAME'   => 'CategoryB',
        'U_VIEW_FORUM' => 'URL to CategoryB',
    ],
    [
        'FORUM_NAME'   => 'SubcategoryB',
        'U_VIEW_FORUM' => 'URL to SubcategoryB',
    ],
]);
by kasimi
Sun Dec 03, 2017 9:49 pm
Forum: phpBB Custom Coding
Topic: assign_block_vars with multiple arrays
Replies: 2
Views: 139

Re: assign_block_vars with multiple arrays

Are you looking for assign_block_vars_array()?
by kasimi
Thu Nov 30, 2017 7:14 pm
Forum: Extension Writers Discussion
Topic: Get Template Variables
Replies: 1
Views: 134

Re: Get Template Variables

For phpBB 3.1.x and 3.2.0 you need to use the @template_context service:

Code: Select all

$username = $this->template_context->get_root_ref()['USERNAME'];
Since phpBB 3.2.1 you can use the @template:

Code: Select all

$username = $this->template->retrieve_var('USERNAME')
by kasimi
Wed Nov 29, 2017 12:33 pm
Forum: Extension Writers Discussion
Topic: Fill template in code
Replies: 6
Views: 261

Re: Fill template in code

Twig can do this easily for you: $template = 'This is my {{ TEMPLATE }}. I want to fill in all {{ DATA }}.'; $twig = new \Twig_Environment(new \Twig_Loader_Array(['template' => $template])); echo $twig->render('template', [ 'TEMPLATE' => 'awesome template', 'DATA' => 'my data', ]); // This is my awe...
by kasimi
Wed Nov 29, 2017 12:08 pm
Forum: Extension Writers Discussion
Topic: 3.2 Text Parser/Renderer tutorial
Replies: 20
Views: 630

Re: 3.2 Text Parser/Renderer tutorial

The $request->variable() method applies htmlspecialchars to the data. Before rendering, do the reverse:

Code: Select all

$post_text1 = htmlspecialchars_decode($post_text1, ENT_COMPAT);
by kasimi
Thu Nov 16, 2017 10:33 am
Forum: Extension Writers Discussion
Topic: Queries amount, sessions, empty response
Replies: 7
Views: 323

Re: Queries amount, sessions, empty response

Adding this empty JsonResponse solves everything. Is this allowed? Yes, it is indeed required. it still baffels me that when you forget a single "," at the end of a line in a language file the entire page turns white This is not limited to language files. You need to set up your development environ...
by kasimi
Tue Oct 24, 2017 7:51 pm
Forum: phpBB Custom Coding
Topic: Adding a users IP address to registration notification email
Replies: 17
Views: 830

Re: Adding a users IP address to registration notification email

The array you have added your variables to isn't used when assigning data to the admin_activate.txt email template. Since phpBB 3.1 the respective notification class is sending these emails, and it defines its own variables: https://github.com/phpbb/phpbb/blob/release-3.2.1/phpBB/phpbb/notification/...

Go to advanced search

cron