Search found 623 matches

by kasimi
Wed Mar 22, 2017 11:26 am
Forum: Extensions in Development
Topic: [3.1][3.2][RC] Mark Post Unread
Replies: 54
Views: 4160

Re: [3.1][3.2][RC] Mark Post Unread

For phpBB 3.2.x, change the fa-file in this line to any FA icon you want.

For phpBB 3.1.x it's more complicated. You would have to add your icon file to the theme/images folder, include a CSS file and add some rules to it, similar to the core icons.
by kasimi
Fri Mar 17, 2017 2:29 pm
Forum: Extension Requests
Topic: Facebook like chat for phpbb
Replies: 17
Views: 351

Re: Facebook like chat for phpbb

Shameless self-advertisement: have a look at my addon extensions for mChat linked below. Maybe the Sticky Footer extension is what you're looking for.
by kasimi
Fri Mar 17, 2017 12:45 pm
Forum: Extension Writers Discussion
Topic: get_profile_fields process and principle
Replies: 1
Views: 97

Re: get_profile_fields process and principle

The $profile_fields property is dynamic and thus public. After it's set, you can access it from everywhere: print_r($this->user->profile_fields); If you're asking for a way to access the profile fields data in an event, did you look at core.generate_profile_fields_template_data ? If that doesn't wor...
by kasimi
Wed Mar 01, 2017 11:57 am
Forum: Extension Writers Discussion
Topic: EPV failing on unserialize()
Replies: 13
Views: 285

Re: EPV failing on unserialize()

The core code you linked to was added 11 years ago. phpBB 3.0 supported PHP 4.3. json_en|decode is around only since PHP 5.2.0. This is worth a read, note the red warning box: http://php.net/manual/en/function.unserialize.php So unless you really need the additional features un|serialize gives you, ...
by kasimi
Tue Feb 28, 2017 5:29 pm
Forum: Extension Writers Discussion
Topic: simple example ajax database request in acp
Replies: 8
Views: 381

Re: simple example ajax database request in acp

Instead of hardcoding the URL into your JS code, inject the controller.helper service into your controller and use its route() method to generate the URL. Here are some detailed examples: https://area51.phpbb.com/docs/dev/31x/extensions/tutorial_controllers.html Also you use JsonResponce twice in yo...
by kasimi
Sat Feb 25, 2017 11:39 am
Forum: Extension Writers Discussion
Topic: Arithmetic/PHP Manipulation with Template Variables
Replies: 3
Views: 109

Re: Arithmetic/PHP Manipulation with Template Variables

You need to add +0 to make it work. Don't ask me why. :)

Code: Select all

<!-- DEFINE $SUM = NUMBER_ONE + NUMBER_TWO + 0 -->
As David suggested, Twig is much nicer:

Code: Select all

{{ NUMBER_ONE + NUMBER_TWO }}
by kasimi
Tue Feb 21, 2017 4:24 pm
Forum: Extension Writers Discussion
Topic: Modifying postrow.U_QUOTE
Replies: 2
Views: 72

Re: Modifying postrow.U_QUOTE

You can use the core.viewtopic_modify_post_row event for that: $post_row = $event['post_row']; $post_row['U_QUOTE'] = $event['topic_data']['topic_poster'] == $user->data['user_id']; $event['post_row'] = $post_row; By the way, you should use dependency injection instead of using global to access the ...
by kasimi
Tue Feb 21, 2017 12:29 pm
Forum: Extension Writers Discussion
Topic: 2 extensions, same event
Replies: 18
Views: 196

Re: 2 extensions, same event

Assuming that the content from each event is wrapped in a container, you can use CSS flexbox and order to re-order the containers. This is also helpful for mobile view where you might want to switch the order if the containers are displayed side-by-side in desktop view.
by kasimi
Mon Feb 20, 2017 9:20 pm
Forum: Extension Writers Discussion
Topic: Get Extension Name Function
Replies: 15
Views: 235

Re: Get Extension Name Function

To add, the extension(s) (If I am not mistaken, those installed) are cached (serialized maybe?).. Perhaps it is possible to use $this->cache->get() . You can do this to get a list of all extensions that are either enabled or disabled. Extensions that are uninstalled won't be in this list. $extensio...
by kasimi
Mon Feb 20, 2017 8:59 pm
Forum: Extension Writers Discussion
Topic: Get Extension Name Function
Replies: 15
Views: 235

Re: Get Extension Name Function

I know this isn't what david63 asked for but here's another way to get the display name from the metadata. You can define your own manager service for your metadata by passing your vendor/ext as first argument: (note that this is for 3.2.x, in 3.1.x the metadata_manager has more dependencies) vendor...
by kasimi
Wed Feb 15, 2017 2:07 pm
Forum: Extension Requests
Topic: ACP User Administration request
Replies: 11
Views: 245

Re: ACP User Administration request

As for an extension, this is presently not possible because there's no event in place. Here's an easy code edit that you might want to use this one time: Open includes/acp/acp_users.php Find WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; Replace with WHERE username_...
by kasimi
Wed Feb 15, 2017 12:07 pm
Forum: Extensions in Development
Topic: [3.1][3.2][RC] Mark Post Unread
Replies: 54
Views: 4160

Re: [3.1][3.2][RC] Mark Post Unread

wojtek64 wrote:
Mon Feb 06, 2017 8:53 am
Line 245 need modification to:

Code: Select all

                                    'topic_id'  => $row['topic_id'];
Thanks for finding the fix wojtek. :)

The package for version 1.1.0 has been updated.
by kasimi
Thu Feb 02, 2017 9:10 pm
Forum: Extension Writers Discussion
Topic: How to create a services.yml file dynamically
Replies: 7
Views: 290

Re: How to create a services.yml file dynamically

How about not using a services.yml at all? :P

http://symfony.com/blog/new-in-symfony- ... uto-wiring

No idea if it works as I haven't used it, and it's only available in phpBB 3.2.x.

Oh I just saw you're injecting not only services but also parameters. It won't work in that case.
by kasimi
Wed Feb 01, 2017 1:17 pm
Forum: Extension Writers Discussion
Topic: Add javascript to download file page
Replies: 3
Views: 322

Re: Add javascript to download file page

Inject the user service and the core.php_ext parameter, subscribe to the core.page_footer_after event and do this: $on_download_page = strpos($this->user->page['page'], 'download/file.' . $this->php_ext)) === 0; if ($on_download_page && defined('IN_ERROR_HANDLER')) { // error on download page }
by kasimi
Wed Feb 01, 2017 12:09 pm
Forum: Extension Writers Discussion
Topic: Using pagination with another variable in the URL
Replies: 1
Views: 214

Re: Using pagination with another variable in the URL

If you have have a route for your URL you can use the controller.helper service:

Code: Select all

$url = $this->controller_helper->route('your_route', array(
	'name' => $this->request->variable('name', ''),
));

$this->pagination->generate_template_pagination($url, ...);

Go to advanced search