SyTry
Well-known member
Hello !
I want to do an add-on to add a member statistic to the notable members page. I know very little about PHP so I use XenForo files to help me. In my Listener.php I have this :
Then I did the code_event_listener here : /admin.php?code-events/listeners/
Listen to event : user_searcher_orders
Event hint :
Execute callback : SyTryC\MostFollowersMember\Listener :: userSearcherOrders
Now in member statistics : /admin.php?member-stats/ I have this :
I think it's ok because with my other codes (files) it works at the installation :
My problem is that the number of followers doesn't update, I made a rebuild tool :
It works too but only in the database, so I don't know where is my problem.. If someone can help me or give me some directions, thank you !
Regards, SyTry
I want to do an add-on to add a member statistic to the notable members page. I know very little about PHP so I use XenForo files to help me. In my Listener.php I have this :
PHP:
<?php
namespace SyTryC\MostFollowersMember;
class Listener
{
public static function userSearcherOrders(\XF\Searcher\User $userSearcher, array &$sortOrders)
{
$sortOrders['sc_user_follow'] = \XF::phrase('sc_most_followers_member');
}
}
Then I did the code_event_listener here : /admin.php?code-events/listeners/
Listen to event : user_searcher_orders
Event hint :
Execute callback : SyTryC\MostFollowersMember\Listener :: userSearcherOrders
Now in member statistics : /admin.php?member-stats/ I have this :
I think it's ok because with my other codes (files) it works at the installation :
My problem is that the number of followers doesn't update, I made a rebuild tool :
It works too but only in the database, so I don't know where is my problem.. If someone can help me or give me some directions, thank you !
Regards, SyTry