Wer ist online? Alphabetisch

Aktuelle Version: 2.1.0
Veröffentlicht: 26.10.2015
Forum rules
Vor dem erstellen neuer Supportanfragen bitte zuerst in die board3 Portal FAQ schauen und die Suche benutzen!
Viele Fragen sind bereits schon gestellt und beantwortet worden.
Bitte auch unsere Forumsregeln lesen und beachten!
Locked

Topic author
Hand of Shadow
Active Member
Posts: 30
Joined: 12. October 2008 11:58

Wer ist online? Alphabetisch

Post by Hand of Shadow »

Deine Portal Version: 2.1.0-rc1
Typ Deines phpBB Forums: Standard phpBB3
MODs installiert: Ja
Dein Wissensstand: Fortgeschritten

Was hast Du gemacht, bevor das Problem aufgetreten ist?


Was hast Du bereits versucht um das Problem zu lösen?


Fehlerbeschreibung und Nachricht
Moin ich weiß nicht ob es eine Einstellungssache ist .. oder ein feature oder ein bug ist ...

im Berreich Wer ist online? werden die Gruppen Alphabetisch und nicht wie in ACP auf wunsch angezeigt
User avatar

Kirk
Dev
Posts: 1950
Joined: 27. July 2010 18:02
phpBB.de User: Kirk
Contact:

Re: Wer ist online? Alphabetisch

Post by Kirk »

Hallo
Dazu muss die whois_online.php geändert werden.
Öffne: root/ext/board3/portal/modules/whois_online.php
Ersetze den gesamten Code durch diesen hier:

Code: Select all

<?php
/**
*
* @package Board3 Portal v2.1
* @copyright (c) 2013 Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

namespace board3\portal\modules;

/**
* @package Who is online
*/
class whois_online extends module_base
{
    /**
    * Allowed columns: Just sum up your options (Exp: left + right = 10)
    * top        1
    * left        2
    * center    4
    * right        8
    * bottom    16
    */
    public $columns = 31;

    /**
    * Default modulename
    */
    public $name = 'PORTAL_WHOIS_ONLINE';

    /**
    * Default module-image:
    * file must be in "{T_THEME_PATH}/images/portal/"
    */
    public $image_src = 'portal_friends.png';

    /**
    * module-language file
    * file must be in "language/{$user->lang}/mods/portal/"
    */
    public $language = 'portal_whois_online_module';

    /**
    * custom acp template
    * file must be in "adm/style/portal/"
    */
    public $custom_acp_tpl = '';

    /** @var \phpbb\auth\auth */
    protected $auth;

    /** @var \phpbb\db\driver */
    protected $db;

    /** @var \phpbb\config\config */
    protected $config;

    /** @var \phpbb\template */
    protected $template;

    /** @var \phpbb\user */
    protected $user;

    /** @var string phpBB root path */
    protected $phpbb_root_path;

    /** @var string PHP file extension */
    protected $php_ext;

    /**
    * Construct a user menu object
    *
    * @param \phpbb\config\config $config phpBB config
    * @param \phpbb\auth\auth $auth phpBB auth
    * @param \phpbb\db\driver $db phpBB db driver
    * @param \phpbb\template $template phpBB template
    * @param \phpbb\user $user phpBB user
    * @param string $phpbb_root_path phpBB root path
    * @param string $phpEx php file extension
    */
    public function __construct($auth, $db, $template, $user, $phpbb_root_path, $phpEx)
    {
        $this->auth = $auth;
        $this->db = $db;
        $this->template = $template;
        $this->user = $user;
        $this->phpbb_root_path = $phpbb_root_path;
        $this->php_ext = $phpEx;
    }

    /**
    * {@inheritdoc}
    */
    public function get_template_center($module_id)
    {
$order_legend = ($this->config['legend_sort_groupname']) ? 'group_name' : 'group_legend';
        // Grab group details for legend display
        if ($this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
        {
    $sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend
        FROM ' . GROUPS_TABLE . '
        WHERE group_legend > 0
        ORDER BY ' . $order_legend . ' ASC';
        }
        else
        {
            $sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend
                FROM ' . GROUPS_TABLE . ' g
                LEFT JOIN ' . USER_GROUP_TABLE . ' ug
                    ON (
                        g.group_id = ug.group_id
                        AND ug.user_id = ' . $this->user->data['user_id'] . '
                        AND ug.user_pending = 0
                    )
                WHERE g.group_legend > 0
                    AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $this->user->data['user_id'] . ')
        ORDER BY g.' . $order_legend . ' ASC';
        }
        $result = $this->db->sql_query($sql);

        $legend = array();
        while ($row = $this->db->sql_fetchrow($result))
        {
            $colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
            $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $this->user->lang['G_' . $row['group_name']] : $row['group_name'];

            if ($row['group_name'] == 'BOTS' || ($this->user->data['user_id'] != ANONYMOUS && !$this->auth->acl_get('u_viewprofile')))
            {
                $legend[] = '<span' . $colour_text . '>' . $group_name . '</span>';
            }
            else
            {
                $legend[] = '<a' . $colour_text . ' href="' . append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=group&g=' . $row['group_id']) . '">' . $group_name . '</a>';
            }
        }
        $this->db->sql_freeresult($result);

        $legend = implode(', ', $legend);

        $this->template->assign_var('PORTAL_LEGEND', $legend);

        return 'whois_online_center.html';
    }

    /**
    * {@inheritdoc}
    */
    public function get_template_side($module_id)
    {
        return 'whois_online_side.html';
    }

    /**
    * {@inheritdoc}
    */
    public function get_template_acp($module_id)
    {
        return array(
            'title'    => 'PORTAL_WHOIS_ONLINE',
            'vars'    => array(),
        );
    }
}
Damit werden die Positionen der Gruppen die du im ACP festlegst im diesem Modul angezeigt.
Gruß Udo

Topic author
Hand of Shadow
Active Member
Posts: 30
Joined: 12. October 2008 11:58

Re: Wer ist online? Alphabetisch

Post by Hand of Shadow »

Danke ;-)

Frohes Fest !!!
Locked

Return to “Board3 Portal 2.1.x - Deutscher Support”