Page 5 of 9

Re: [3.2][BETA] Board Notices Manager

Posted: Wed Jan 23, 2019 11:06 am
by mrgoldy
About sending it to the CDB.
Here is something you will not like:
Functions (and variables, etc) in php should not be camelCase but snake_case.

Re: [3.2][BETA] Board Notices Manager

Posted: Wed Jan 23, 2019 1:06 pm
by FredQ
Seriously? it's going against the common rules. As a matter of fact, I've spent so much time converting everything to camelCase in a previous project :?

Anyway, thanks for the tip ;)

Re: [3.2][BETA] Board Notices Manager

Posted: Wed Jan 23, 2019 2:48 pm
by david63
FredQ wrote:
Wed Jan 23, 2019 1:06 pm
Seriously? it's going against the common rules.
Yes, seriously - it may be going against "common" rules but these are phpBB rules.

There are also quite a few other things that will not pass validation:
  • No files should be in the extension's root other that composer.json, ext.php and licence.txt
  • The items in services.yml that start with @ or % should be surrounded by single quotes
  • js code should be in its own file and not in-line
  • Language variables should not be passed to the template by a .php file unless they are using placeholders
  • You should be using the $language object and not $user->lang
  • You should consider using Twig syntax for your templates - there is a conversion tool available

Re: [3.2][BETA] Board Notices Manager

Posted: Wed Jan 23, 2019 3:30 pm
by mrgoldy
Well, files in the root directory are allowed, but generally considered crowding a place and more often than not can have a more fitting place, but it is allowed. And the use of $language instead of $user is not applicable to this extension, as he also supports phpBB 3.1 by the looks of the composer, so that would require the $user class.

And in case you did not know/have the link yet, Fred, have a look here: https://area51.phpbb.com/docs/dev/3.2.x ... lines.html

Re: [3.2][BETA] Board Notices Manager

Posted: Wed Jan 23, 2019 3:34 pm
by david63
mrgoldy wrote:
Wed Jan 23, 2019 3:30 pm
And the use of $language instead of $user is not applicable to this extension, as he also supports phpBB 3.1
Not wishing to start an argument but the tag is for 3.2 and even if it does support 3.1 it will not be validated against 3.1

Re: [3.2][BETA] Board Notices Manager

Posted: Wed Jan 23, 2019 4:48 pm
by FredQ
Thank you for taking the time to look at my extension ;) I've taken note of all these points and already fixed most of them. I'm not sure I understand this one though:
david63 wrote:
Wed Jan 23, 2019 2:48 pm

There are also quite a few other things that will not pass validation:
  • Language variables should not be passed to the template by a .php file unless they are using placeholders
Now I just hope I can find a tool to convert variable/method names and everything else to snake_case...

Re: [3.2][BETA] Board Notices Manager

Posted: Wed Jan 23, 2019 6:25 pm
by Paul
mrgoldy wrote:
Wed Jan 23, 2019 11:06 am
About sending it to the CDB.
Here is something you will not like:
Functions (and variables, etc) in php should not be camelCase but snake_case.
An extension won't be denied for things like that at all.

Re: [3.2][BETA] Board Notices Manager

Posted: Wed Jan 23, 2019 6:48 pm
by david63
FredQ wrote:
Wed Jan 23, 2019 4:48 pm
I'm not sure I understand this one though:
Currently you have in your template assignments 'ACP_BOARD_NOTICES_MANAGER' => $this->user->lang('ACP_BOARD_NOTICES_MANAGER'), and then in your template you have {ACP_BOARD_NOTICES_MANAGER}.

Using Twig syntax all you need to do is put {{ lang('ACP_BOARD_NOTICES_MANAGER') }} in the template.

The assigning of language variables in the way that you are doing it went out with phpBB 2

Re: [3.2][BETA] Board Notices Manager

Posted: Wed Jan 23, 2019 6:51 pm
by FredQ
david63 wrote:
Wed Jan 23, 2019 6:48 pm

The assigning of language variables in the way that you are doing it went out with phpBB 2
You can tell I started this extension a long time ago :lol:

Anyway, I see what you mean now, and it is much easier indeed! thanks

Re: [3.2][BETA] Board Notices Manager

Posted: Wed Jan 23, 2019 6:57 pm
by FredQ
Paul wrote:
Wed Jan 23, 2019 6:25 pm
mrgoldy wrote:
Wed Jan 23, 2019 11:06 am
About sending it to the CDB.
Here is something you will not like:
Functions (and variables, etc) in php should not be camelCase but snake_case.
An extension won't be denied for things like that at all.
Oh that's a relief! :) Thanks for that

Anyway, new version on the way:

version 0.4.3:
  • Added a global default background (instead of the hardcoded light red) and the ability to remove it entirely if you prefer the background colour to inherit the colour of the CSS parent
  • Added Estonian translation from exabot
  • [Internal] A lot of cleanup and bug fixes

Re: [3.2][BETA] Board Notices Manager

Posted: Thu Jan 24, 2019 12:47 pm
by twm49
Great work, congratulations!
Thanks for this extension, it is really very useful for me. If it were not too difficult it would be important, for me, to have the option " Display on board index only:"

Thanks in advance

Re: [3.2][BETA] Board Notices Manager

Posted: Thu Jan 24, 2019 6:16 pm
by FredQ
twm49 wrote:
Thu Jan 24, 2019 12:47 pm
If it were not too difficult it would be important, for me, to have the option " Display on board index only:"
I guess I just need to find out a reliable way of checking that the current page is the board index. I'm not sure how yet.

BTW the code in master is broken for PHP 5 right now (it works for PHP 7). I'll fix it asap.

I've been using using PHP 7 for too long and I forgot what was not possible back in these days... :roll:

Re: [3.2][BETA] Board Notices Manager

Posted: Thu Jan 24, 2019 6:20 pm
by mrgoldy

Re: [3.2][BETA] Board Notices Manager

Posted: Thu Jan 24, 2019 9:43 pm
by donsenilo
And copy all the files to the folder [root of your phpBB]/ext/fq/boardnotices/
Done, but doesn't show up to activeting it.
There are some files missing.

Re: [3.2][BETA] Board Notices Manager

Posted: Thu Jan 24, 2019 9:51 pm
by FredQ
mrgoldy wrote:
Thu Jan 24, 2019 6:20 pm
For your index check: https://github.com/phpbb/phpbb/blob/mas ... x.php#L221
Excellent! Exactly what I needed, thank you very much 8-)