Search found 650 matches

by kasimi
Fri May 26, 2017 1:50 pm
Forum: phpBB Custom Coding
Topic: Help with the user class
Replies: 10
Views: 179

Re: Help with the user class

All columns in the users table are put into the data array for the current $user : $user_vip = $this->user->data['user_vip']; $user_special = $this->user->data['user_special']; $user_immunity = $this->user->data['user_immunity']; I want to access that information in the functions_content.php file in...
by kasimi
Mon May 22, 2017 8:38 pm
Forum: Extension Writers Discussion
Topic: Posting event not working in extension
Replies: 7
Views: 136

Re: Posting event not working in extension

Would this be sufficient for CDB approval? Yes. Yeah, interestingly, this works. I've had a look, here's why: in viewforum and viewtopic, the template file is assigned before the event is triggered: $template->set_filenames(array( 'body' => 'viewforum_body.html') ); Inside your event, you call $thi...
by kasimi
Mon May 22, 2017 8:13 pm
Forum: Extension Writers Discussion
Topic: Posting event not working in extension
Replies: 7
Views: 136

Re: Posting event not working in extension

I wonder, don't you have the same problem in viewtopic and viewforum? According to your code on GitHub, you're also using $this->helper->message() which shouldn't be working there either.

Be that as it may, maybe trigger_error($message) is what you're looking for?
by kasimi
Mon May 22, 2017 8:28 am
Forum: Extension Writers Discussion
Topic: Posting event not working in extension
Replies: 7
Views: 136

Re: Posting event not working in extension

You're calling $this->helper->message() which creates and returns a new Response object. As you're in an event listener, you can't use this response object. Instead, add your error message to the event's error array: $error = $event['error']; $error[] = $this->user->lang('POSTCOUNT_NO_POST', $forum_...
by kasimi
Fri May 19, 2017 8:38 am
Forum: Extension Writers Discussion
Topic: [3.1] Display fetched results in a HTML5 table
Replies: 7
Views: 209

Re: [3.1] Display fetched results in a HTML5 table

I think what you want is a CSS flex layout.

Code: Select all

.container {
	display: flex;
	flex-wrap: wrap;
}

.container .item {
	flex-grow: 1;
	width: 25%;
}
Also see the answer and the link to a JSFiddle example here: http://stackoverflow.com/questions/2419 ... ns-per-row
by kasimi
Sat Apr 29, 2017 9:50 pm
Forum: Extension Writers Discussion
Topic: Class loader class
Replies: 19
Views: 581

Re: Class loader class

I know close to nothing about autoloading in PHP, but maybe you could use spl_autoload_functions() to get all registered loaders, spl_autoload_unregister() to remove the loader you want to extend, and then register your decorated service.
by kasimi
Sat Apr 29, 2017 8:36 pm
Forum: Extension Writers Discussion
Topic: tables.yml table in ACP...
Replies: 2
Views: 105

Re: tables.yml table in ACP...

Code: Select all

global $ajax_chat_chat_table;
The parameters in your tables.yml aren't added as global variables.

You need to fetch them from the container:

Code: Select all

$this->ajax_chat_chat_table = $phpbb_container->getParameter('spaceace.ajaxchat.tables.ajax_chat_chat_table');
by kasimi
Fri Apr 28, 2017 2:48 pm
Forum: Extension Writers Discussion
Topic: Get user_lastpost_time with $event in submit_post_end event?
Replies: 5
Views: 145

Re: Get user_lastpost_time with $event in submit_post_end event?

$event['data'] contains information about the post itself. user_lastpost_time is a field in the $user object:

Code: Select all

$user_lastpost_time = $this->user->data['user_lastpost_time'];
by kasimi
Thu Apr 27, 2017 3:00 pm
Forum: Extensions in Development
Topic: [3.1][3.2][RC] Mark Post Unread
Replies: 55
Views: 4550

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

Version 1.1.1 is now available. In earlier versions there was a bug that allowed users without m_approve permission to find out if a certain post was soft- or hard-deleted. Furthermore users were able to find out if a post was moved to a forum where they don't have read permission. Please update to ...
by kasimi
Fri Apr 21, 2017 9:54 am
Forum: Extension Writers Discussion
Topic: Routing to php page
Replies: 6
Views: 222

Re: Routing to php page

With rewriting enabled, no app.php/ is added to the generated routes.

Do you get 404s when you change the route to /compat (without .php)?
by kasimi
Thu Apr 20, 2017 1:21 pm
Forum: Extension Writers Discussion
Topic: Routing to php page
Replies: 6
Views: 222

Re: Routing to php page

A quick and dirty solution would be to enable URL rewriting in the ACP and then change the route to this:

Code: Select all

promods_main_controller:
    path: /compat.php
by kasimi
Thu Apr 20, 2017 12:45 pm
Forum: Extension Writers Discussion
Topic: Routing to php page
Replies: 6
Views: 222

Re: Routing to php page

Move your code from root/compat.php to a controller inside your extension: https://area51.phpbb.com/docs/dev/32x/extensions/tutorial_controllers.html Define your route like this: promods_main_controller: path: /compat Now you can use the controller.helper service to generate the link to your page: '...
by kasimi
Tue Apr 18, 2017 9:10 pm
Forum: Extension Writers Discussion
Topic: Transfer args to language class via helper
Replies: 12
Views: 325

Re: Transfer args to language class via helper

The EPV uses the "nikic/php-parser": "0.9.*@dev" library for checking your PHP syntax: https://github.com/phpbb/epv/blob/0.0.8/composer.json#L18 However, variadic functions are supported only since 1.0.0 Beta 1 (4th item): https://github.com/nikic/PHP-Parser/releases/tag/v1.0.0beta1 As Paul said, $t...
by kasimi
Tue Apr 18, 2017 6:42 pm
Forum: Extension Writers Discussion
Topic: help with an error...
Replies: 11
Views: 357

Re: help with an error...

The config.php you posted in the validation discussion does NOT have DEBUG enabled. Let's repeat: You need to make sure to enable DEBUG in your config.php The above in combination with an unmodified includes/functions.php file will print the notice. If DEBUG is enabled, the default error reporting l...

Go to advanced search