Search found 713 matches

by kasimi
Sat Dec 09, 2017 5:39 pm
Forum: Extension Requests
Topic: Highlight and "Marked as Read" Posts
Replies: 18
Views: 498

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: 26
Views: 1699

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: 67

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: 173

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: 125

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: 114

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: 240

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: 603

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: 319

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: 803

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/...
by kasimi
Tue Oct 24, 2017 1:44 pm
Forum: Extension Writers Discussion
Topic: [3.2.1 ] Migration refuses to populate a custom table
Replies: 11
Views: 555

Re: [3.2.1 ] Migration refuses to populate a custom table

I don't know why it isn't working, but some notes: In your second post, the update_schema() method doesn't return the custom method. If your backup column is in the same table, you can just do this: UPDATE phpbb_users SET pia_user_avatar = user_avatar Just I am using new indexes created in the users...
by kasimi
Fri Oct 20, 2017 1:45 pm
Forum: [3.2.x] Support Forum
Topic: Ajax error clearing notifications/cookies
Replies: 27
Views: 565

Re: Ajax error clearing notifications/cookies

Yes, that's most likely a BOM. Did you make manual changes to any files?

Go to advanced search

cron