Greeting from Canada

Welcome -- introduce yourself!
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
tutu11
New member
New member
Posts: 1
Joined: 07 Jun 2019, 08:27
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Greeting from Canada

Postby tutu11 » 07 Jun 2019, 08:36

Have a nice day, I'm Mikiko, I'm a new member. Now I need support.
I'm using a dual ranklist (users can choose their rank alignement in their profile) and while it's a trivial change editing the core files, the event system does not seem to allow for an efficient way of achieving the same thing:

forum/includes/functions_display.php, line 1546, replace:
CODE: SELECT ALL

if ($user_posts >= $rank['rank_min'])
with:
CODE: SELECT ALL

if ($user_posts >= $rank['rank_min'] && $user_data['user_rank_alignment'] == $rank['rank_alignment'])
It would be ideal if the native behaviour could be changed inside phpbb_get_user_rank rather than having to loop through all ranks a second time.

A simple idea would be to provide core.modify_user_rank with an additional argument such as a closure that could be overridden to change the way of determining if a rank 'suits' a user:

New line 1546
CODE: SELECT ALL

if ($rank_suits_user($user_data, $rank))
However I haven't seen a closure used in any of the phpBB events so that might be something the development team wants to avoid, in which case a rewriting of the phpbb_get_user_rank method would be the only solution.

User avatar
Random American
New member
New member
Posts: 17
Joined: 02 Nov 2019, 01:00
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Greeting from Canada

Postby Random American » 20 Mar 2020, 20:02

If you're still having problems, take it to phpbb.com. They have a custom coding section.


[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Return to “Introductions”

Who is online

Users browsing this forum: No registered users and 4 guests