[XTR] Most Followers

[XTR] Most Followers 1.0.6

No permission to download

XDinc

Well-known member
XDinc submitted a new resource:

[XTR] Most Followers - Adds a most followers tab on notable members page and create Most Followers widget.

View attachment 215761

[XTR] Most Followers Members
This add-on allows you to add most followers tab on notable members page of your community and Most followers widget with follower counts.

Options

View attachment 215762

Style Properties

View attachment 215763

Permissions

View attachment 215769


Sort by Most followers

View attachment 215764

User criteria for the Most Followers

[ATTACH...

Read more about this resource...
 
Your page is in turkish language and there are also issues with the license-check; i dont know if this is a paid addon. If not it would be nice to have it here, please.
For a forum in turkish language it makes really no sense to force the rest of the (not speaking turkish world) to register at your page, you dont think so?
 
I have to share mine too.. :LOL:

Your page is in turkish language and there are also issues with the license-check; i dont know if this is a paid addon. If not it would be nice to have it here, please.
For a forum in turkish language it makes really no sense to force the rest of the (not speaking turkish world) to register at your page, you dont think so?
You can select English if you want :)
 
Code:
XF\Db\Exception: MySQL query error [1690]: BIGINT UNSIGNED value is out of range in '(`db123`.`xf_user`.`xentr_user_follow` - 1)' in src/XF/Db/AbstractStatement.php at line 228

    XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
    XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 77
    XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 94
    XF\Db\AbstractAdapter->query() in src/addons/XENTR/MostFollowers/Listener.php at line 25
    XENTR\MostFollowers\Listener::decreaseFollowersCount()
    call_user_func_array() in src/XF/Extension.php at line 50
    XF\Extension->fire() in src/XF.php at line 718
    XF::fire() in src/XF/Mvc/Entity/Entity.php at line 1602
    XF\Mvc\Entity\Entity->delete() in src/XF/Service/User/Follow.php at line 95
    XF\Service\User\Follow->unfollow() in src/XF/Pub/Controller/Member.php at line 435
    XF\Pub\Controller\Member->actionFollow() in src/XF/Mvc/Dispatcher.php at line 350
    XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 261
    XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
    XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
    XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2190
    XF\App->run() in src/XF.php at line 391
    XF::runApp() in index.php at line 20
 
Code:
class Listener
{
    public static function decreaseFollowersCount($entity)
    {
        $finder = \XF::finder('XF:User')
            ->where('user_id', $entity->follow_user_id);

        $user = $finder->fetchOne();

        if ($user)
        {
            \XF::db()->query('UPDATE xf_user SET xentr_user_follow = xentr_user_follow - 1
                             WHERE user_id = ? AND xentr_user_follow > 0', $user->user_id);
        }
    }
 
A small int is enough for 32.000 + something. Anyway the problem is the query above, solved by
AND xentr_user_follow > 0
 
I have to work on 1.0.1; i guess you have found this?

UPDATE xf_user SET xentr_user_follow = xentr_user_follow - 1 WHERE user_id = ?

and changed it to:

UPDATE xf_user SET xentr_user_follow = xentr_user_follow - 1 WHERE user_id = ? AND xentr_user_follow > 0

else it is possible to have an bigint error.


BTW: Why all the people use int? A small_int with 32,767 is not enough to count followers?
 
Code:
       public static function criteriaUser($rule, array $data, \XF\Entity\User $user, &$returnValue)
    {
        switch ($rule)
        {
            case 'min_followers':
                if (isset($user->xentr_user_follow) && $user->xentr_user_follow >= $data['followers'])
                {
                    $returnValue = true;
                }
                break;

            case 'max_followers':
                if (isset($user->xentr_user_follow) && $user->xentr_user_follow >= $data['followers'])
                {
                    $returnValue = true;
                }
                break;
        }
    }


Maybe this should be for max_followers

if (isset($user->xentr_user_follow) && $user->xentr_user_follow <= $data['followers'])
 
Maybe this is not needed, but i have included it, because in my forum it is happen.

\MostFollowers\Listener.php
Line 25, check if value is > 0, if not, we dont need to update anyway.
\XF::db()->query('UPDATE xf_user SET xentr_user_follow = xentr_user_follow - 1 WHERE user_id = ? AND xentr_user_follow > 0', $user->user_id);

New options and rendering i will tryout now ...
 
Maybe this is not needed, but i have included it, because in my forum it is happen.

\MostFollowers\Listener.php
Line 25, check if value is > 0, if not, we dont need to update anyway.
\XF::db()->query('UPDATE xf_user SET xentr_user_follow = xentr_user_follow - 1 WHERE user_id = ? AND xentr_user_follow > 0', $user->user_id);

New options and rendering i will tryout now ...

Hi @Robert9
Thanks for your feedback. (y)

I will release a new version, I planning to add new options.
 
After I upgraded to PHP 8.0, it started showing these errors.
  • ErrorException: Template error: [E_WARNING] Attempt to read property "followersLimit" on null
  • src/addons/XENTR/MostFollowers/XF/Widget/MostFollowers.php:33

Code:
#0 src/addons/XENTR/MostFollowers/XF/Widget/MostFollowers.php(33): XF\Template\Templater->handleTemplateError(2, '[E_WARNING] Att...', '/var/www/html/f...', 33)
#1 internal_data/code_cache/widgets/_30_xentr_mostFollowers_widget.php(5): XENTR\MostFollowers\XF\Widget\MostFollowers->render()
#2 src/XF/Template/Templater.php(7472): XF\SubContainer\Widget->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, Array)
#3 src/XF/SubContainer/Widget.php(168): XF\Template\Templater->renderWidgetClosure(Object(Closure), Array)
#4 src/XF/Template/Templater.php(1903): XF\SubContainer\Widget->getCompiledWidget(Array, Array)
#5 internal_data/code_cache/templates/l3/s36/public/forum_list.php(216): XF\Template\Templater->widgetPosition('forum_list_side...', Array)
#6 src/XF/Template/Templater.php(1628): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#7 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('forum_list', Array)
#8 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#9 src/XF/Mvc/Dispatcher.php(458): XF\Mvc\Renderer\Html->renderView('XF:Forum\\Listin...', 'public:forum_li...', Array)
#10 src/XF/Mvc/Dispatcher.php(440): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#11 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#12 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#13 src/XF/App.php(2337): XF\Mvc\Dispatcher->run()
#14 src/XF.php(488): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}


  • ErrorException: Template error: [E_WARNING] Undefined variable $options
  • src/addons/XENTR/MostFollowers/XF/Widget/MostFollowers.php:33
Code:
#0 src/addons/XENTR/MostFollowers/XF/Widget/MostFollowers.php(33): XF\Template\Templater->handleTemplateError(2, '[E_WARNING] Und...', '/var/www/html/f...', 33)
#1 internal_data/code_cache/widgets/_30_xentr_mostFollowers_widget.php(5): XENTR\MostFollowers\XF\Widget\MostFollowers->render()
#2 src/XF/Template/Templater.php(7472): XF\SubContainer\Widget->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, Array)
#3 src/XF/SubContainer/Widget.php(168): XF\Template\Templater->renderWidgetClosure(Object(Closure), Array)
#4 src/XF/Template/Templater.php(1903): XF\SubContainer\Widget->getCompiledWidget(Array, Array)
#5 internal_data/code_cache/templates/l3/s36/public/forum_list.php(216): XF\Template\Templater->widgetPosition('forum_list_side...', Array)
#6 src/XF/Template/Templater.php(1628): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#7 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('forum_list', Array)
#8 src/XF/Mvc/Renderer/Html.php(48): XF\Template\Template->render()
#9 src/XF/Mvc/Dispatcher.php(458): XF\Mvc\Renderer\Html->renderView('XF:Forum\\Listin...', 'public:forum_li...', Array)
#10 src/XF/Mvc/Dispatcher.php(440): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#11 src/XF/Mvc/Dispatcher.php(400): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#12 src/XF/Mvc/Dispatcher.php(58): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#13 src/XF/App.php(2337): XF\Mvc\Dispatcher->run()
#14 src/XF.php(488): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}
 
I have same error:

Code:
ErrorException: Template error: [E_WARNING] Attempt to read property "followersLimit" on null src/addons/XENTR/MostFollowers/XF/Widget/MostFollowers.php:33
Generated by: Ascalon 3 Únor 2022 v 16:19

Stack trace
#0 src/addons/XENTR/MostFollowers/XF/Widget/MostFollowers.php(33): XF\Template\Templater->handleTemplateError(2, '[E_WARNING] Att...', '/data/web/virtu...', 33)
#1 internal_data/code_cache/widgets/_38_xentr_mostFollowers_widget.php(5): XENTR\MostFollowers\XF\Widget\MostFollowers->render()
#2 src/XF/Template/Templater.php(7518): XF\SubContainer\Widget->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, Array)
#3 src/XF/SubContainer/Widget.php(168): XF\Template\Templater->renderWidgetClosure(Object(Closure), Array)
#4 src/XF/Template/Templater.php(1928): XF\SubContainer\Widget->getCompiledWidget(Array, Array)
#5 internal_data/code_cache/templates/l2/s4/public/forum_list.php(216): XF\Template\Templater->widgetPosition('forum_list_side...', Array)
#6 src/XF/Template/Templater.php(1651): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#7 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('forum_list', Array)
#8 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#9 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XF:Forum\\Listin...', 'public:forum_li...', Array)
#10 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#11 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#12 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#13 src/XF/App.php(2351): XF\Mvc\Dispatcher->run()
#14 src/XF.php(517): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}

Request state
array(4) {
  ["url"] => string(7) "/forum/"
  ["referrer"] => string(52) "https://prekladyher.eu/uzivatele/?key=most_followers"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

Code:
ErrorException: Template error: [E_WARNING] Undefined variable $options src/addons/XENTR/MostFollowers/XF/Widget/MostFollowers.php:33
Generated by: Ascalon 3 Únor 2022 v 16:24

Stack trace
#0 src/addons/XENTR/MostFollowers/XF/Widget/MostFollowers.php(33): XF\Template\Templater->handleTemplateError(2, '[E_WARNING] Und...', '/data/web/virtu...', 33)
#1 internal_data/code_cache/widgets/_38_xentr_mostFollowers_widget.php(5): XENTR\MostFollowers\XF\Widget\MostFollowers->render()
#2 src/XF/Template/Templater.php(7518): XF\SubContainer\Widget->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, Array)
#3 src/XF/SubContainer/Widget.php(168): XF\Template\Templater->renderWidgetClosure(Object(Closure), Array)
#4 src/XF/Template/Templater.php(1928): XF\SubContainer\Widget->getCompiledWidget(Array, Array)
#5 internal_data/code_cache/templates/l2/s4/public/forum_list.php(216): XF\Template\Templater->widgetPosition('forum_list_side...', Array)
#6 src/XF/Template/Templater.php(1651): XF\Template\Templater->{closure}(Object(SV\StandardLib\XF\Template\Templater), Array, NULL)
#7 src/XF/Template/Template.php(24): XF\Template\Templater->renderTemplate('forum_list', Array)
#8 src/XF/Mvc/Renderer/Html.php(50): XF\Template\Template->render()
#9 src/XF/Mvc/Dispatcher.php(460): XF\Mvc\Renderer\Html->renderView('XF:Forum\\Listin...', 'public:forum_li...', Array)
#10 src/XF/Mvc/Dispatcher.php(442): XF\Mvc\Dispatcher->renderView(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#11 src/XF/Mvc/Dispatcher.php(402): XF\Mvc\Dispatcher->renderReply(Object(XF\Mvc\Renderer\Html), Object(XF\Mvc\Reply\View))
#12 src/XF/Mvc/Dispatcher.php(60): XF\Mvc\Dispatcher->render(Object(XF\Mvc\Reply\View), 'html')
#13 src/XF/App.php(2351): XF\Mvc\Dispatcher->run()
#14 src/XF.php(517): XF\App->run()
#15 index.php(20): XF::runApp('XF\\Pub\\App')
#16 {main}

Request state
array(4) {
  ["url"] => string(7) "/forum/"
  ["referrer"] => string(52) "https://prekladyher.eu/uzivatele/?key=most_followers"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 
Back
Top Bottom