We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

most popular groups shown first on widget | Forum

Joseph
Joseph Mar 7 '14
how do I get my index group widget to show the most popular groups first?
Daisy Team
Daisy Mar 19 '14
You should go to /groups/components/groups_widget.php file and replace this code:

if ( $this->assignList('latest', $latest) )
        {
            $this->setSettingValue(self::SETTING_TOOLBAR, $toolbars['latest']);
            $menuItems[] = array(
                'label' => $lang->text('groups', 'group_list_menu_item_latest'),
                'id' => 'groups-widget-menu-latest',
                'contId' => 'groups-widget-latest',
                'active' => true
            );
        }

        if ( $this->assignList('popular', $popular) )
        {
            $menuItems[] = array(
                'label' => $lang->text('groups', 'group_list_menu_item_popular'),
                'id' => 'groups-widget-menu-popular',
                'contId' => 'groups-widget-popular',
                'active' => empty($menuItems)
            );
        }

with this one:

if ( $this->assignList('popular', $popular) )
        {
            $menuItems[] = array(
                'label' => $lang->text('groups', 'group_list_menu_item_popular'),
                'id' => 'groups-widget-menu-popular',
                'contId' => 'groups-widget-popular',
                'active' => true
            );
        }

        if ( $this->assignList('latest', $latest) )
        {
            $this->setSettingValue(self::SETTING_TOOLBAR, $toolbars['latest']);
            $menuItems[] = array(
                'label' => $lang->text('groups', 'group_list_menu_item_latest'),
                'id' => 'groups-widget-menu-latest',
                'contId' => 'groups-widget-latest',
                'active' => empty($menuItems)
            );
        }

Then go to /groups/views/components/groups_widget.html file and find the following strings:

First string:  <div class="ow_lp_groups ow_hidden" id="{$menuItems.1.contId}">
Second string: <div class="ow_lp_groups" id="{$menuItems.0.contId}">

Change the $menuItems.1.contId to $menuItems.0.contId in the fist string and $menuItems.0.contId to $menuItems.1.contId in the second string.

That's it.
Sarachem
Sarachem Jun 14 '17
Its not working well, because not counting group members.