Dołącz do zespołu ekspertów! Backend lub Frontend Developer?

Sprawdź najnowsze oferty pracy naszego partnera - 8lines.io!

Błąd w panelu bocznym - nie równe nicki

Błąd   Założony przez  Chrupek235.

wersja skryptu MyBB: 1.8.7
adres forum: csultimatum.pl
na czym polega problem (screen, opis, komunikaty, nazwa stylu/theme/szablonu): Witam, mam taki problem, a mianowicie w panelu bocznym  na moim forum nicki są nie równo (tylko przy niektórych tabelach). Nie wiem jak to opisać, dlatego pokażę ss. Chciałbym żeby te nicki były wyrównane do lewej strony. Z góry dziękuję za pomoc.

[Obrazek: 4Jsxc.png]
Miejsca nie ma to tekst przeskakuje. Powieksz panel boczny to bedzie dobrze.
Jak czytasz mój post to sprawdź czy go nie zedytowałem bo niezdecydowany jestem.
A jak to poszerzyć? Która funkcja za to odpowiada? Mógłbym dostać jakieś konkretne info? :)
Konkretniej zbadaj element patrzysz jaka klasa/id
Wchodzisz w global.css w twoim szablonie i zmieniasz szerokosc.
http://www.kurshtml.edu.pl/css/width,css.html po Polskiemu lepsiejszego nie znalazlem :/
Jak nadal nie ogarniasz to polecam html dla zielonych.
Jak czytasz mój post to sprawdź czy go nie zedytowałem bo niezdecydowany jestem.
Pokaż szablon "index".
Cytat:w pół dnia stałeś się lepszym pytonistą niż kawenanowo kiedykolwiek programisto :3 ~ Riess 13.11.2018 16:28
Cytat:ale z tą nazwą to fyeem ma racje  ~ Divir 29.07.2019 16:08
Proszę:

<div style="text-align: right; position: fixed; margin: 0 auto; z-index: 9999; bottom: -3px; left: 0; padding: 0; width: 763px;right: 0;">
<iframe src="http://stats.radiors.pl/player/player_online.php?auto=true" scrolling="no" border="0" marginwidth="0" marginheight="0" frameborder="no" width="763" height="60"></iframe>
</div>
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}{$recentthread_headerinclude}
<script type="text/javascript">
<!--
    lang.no_new_posts = "{$lang->no_new_posts}";
    lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>
<body>
{$header}
{$serversboard}
<br class="clear" />
<div class="forums float-left">{$dvz_shoutbox}<br>
{$forums}</div>
<aside class="main-aside float-right">

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead">
<div class="cat-icon float-left"><i class="fa fa-commenting" aria-hidden="true"></i></div>
<div class="tborder-name">Kontakt z Administracją</div>
<span style="text-shadow: 1px 1px 10px  red; color:   #FF2400; font-weight: bold; background: url(http://przemo.org/phpBB2/forum/files/gwiazdki_209.gif)"><strong>Tasman</strong></span> <b>GG: 53490238</b><br>
<span style="text-shadow: 1px 1px 10px  red; color:   #FF2400; font-weight: bold; background: url(http://przemo.org/phpBB2/forum/files/gwiazdki_209.gif)">
<strong>Chrupek</strong></span> <b>GG: 50654146</b>
</td>
</tr>
<tr>
</tr>
</table>
<br />

{$topStats['LastThreads']}
{$topStats['LastActiveThreads']}
{$topStats['Posters']}
{$topStats['Reputation']}
{$topStats['TimeOnline']}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead">
<div class="cat-icon float-left"><i class="fa fa-money" aria-hidden="true"></i></div>
<div class="tborder-name">Wspomóż nasze serwery</div>
<iframe src="http://cssetti.pl/widget/v1/19940" style="width: 240px; height: 320px; border: none; padding: 0, margin: 0"></iframe>
</td>
</tr>
<tr>
</tr>
</table>
</aside>
<br class="clear" />
    {$boardstats}
<br style="clear: both" />
{$footer}
</body>
</html>
W style.css w klasie main-aside zwiększ, a w klasie forums pomniejsz wartość width.
Kodowanie, edycja i tworzenie styli, for, stron, poszczególnych elementów - polecane szczególnie dla osób, które nie potrafią sobie poradzić z problemami.
<div style="text-align: right; position: fixed; margin: 0 auto; z-index: 9999; bottom: -3px; left: 0; padding: 0; width: 763px;right: 0;">
<iframe src="http://stats.radiors.pl/player/player_online.php?auto=true" scrolling="no" border="0" marginwidth="0" marginheight="0" frameborder="no" width="763" height="60"></iframe>
</div>
<html>
<head>
<title>{$mybb->settings['bbname']}</title>
{$headerinclude}{$recentthread_headerinclude}
<script type="text/javascript">
<!--
   lang.no_new_posts = "{$lang->no_new_posts}";
   lang.click_mark_read = "{$lang->click_mark_read}";
// -->
</script>
</head>
<body>
{$header}
{$serversboard}
<br class="clear" />
<div class="forums" style="float: left;width: 75%;">{$dvz_shoutbox}<br>
{$forums}</div>
<div class="forums" style="float: right;width: 24%;">

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead">
<div class="cat-icon float-left"><i class="fa fa-commenting" aria-hidden="true"></i></div>
<div class="tborder-name">Kontakt z Administracją</div>
<span style="text-shadow: 1px 1px 10px  red; color:   #FF2400; font-weight: bold; background: url(http://przemo.org/phpBB2/forum/files/gwiazdki_209.gif)"><strong>Tasman</strong></span> <b>GG: 53490238</b><br>
<span style="text-shadow: 1px 1px 10px  red; color:   #FF2400; font-weight: bold; background: url(http://przemo.org/phpBB2/forum/files/gwiazdki_209.gif)">
<strong>Chrupek</strong></span> <b>GG: 50654146</b>
</td>
</tr>
<tr>
</tr>
</table>
<br />

{$topStats['LastThreads']}
{$topStats['LastActiveThreads']}
{$topStats['Posters']}
{$topStats['Reputation']}
{$topStats['TimeOnline']}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead">
<div class="cat-icon float-left"><i class="fa fa-money" aria-hidden="true"></i></div>
<div class="tborder-name">Wspomóż nasze serwery</div>
<iframe src="http://cssetti.pl/widget/v1/19940" style="width: 240px; height: 320px; border: none; padding: 0, margin: 0"></iframe>
</td>
</tr>
<tr>
</tr>
</table>
</div>
<br class="clear" />
   {$boardstats}
<br style="clear: both" />
{$footer}
</body>
</html>

Spróbuj tak, ewentualnie zmień wartości
<div class="forums" style="float: right;width: 24%;">
<div class="forums" style="float: left;width: 75%;">
24 na większe a 75 na mniejsze.
Cytat:w pół dnia stałeś się lepszym pytonistą niż kawenanowo kiedykolwiek programisto :3 ~ Riess 13.11.2018 16:28
Cytat:ale z tą nazwą to fyeem ma racje  ~ Divir 29.07.2019 16:08
Niestety rozszerzenie panelu nie pomogło :/ Ale mam pomysł jak to poprawić tylko musicie mi pomóc heh :)

A mianowicie chodzi mi o coś takiego jak na tym ss:

[Obrazek: 4oHCh.png]

Można by tak zrobić, żeby jak w przypadku tego ss'a temat jakiegoś tematu był na pierwszym miejscu, niżej kto go stworzył i na samym końcu datę dodania. Tylko jak ten kod przerobić by to funkcjonowało? Chyba że też trzeba będzie ingerować w kod pluginu na ftp strony. Jak myślicie? Proszę o jakieś sugestie jak to wykonać :)
W sumie, wystarczyłoby zmienić width oraz height avatara w topstats ;)
Cytat:w pół dnia stałeś się lepszym pytonistą niż kawenanowo kiedykolwiek programisto :3 ~ Riess 13.11.2018 16:28
Cytat:ale z tą nazwą to fyeem ma racje  ~ Divir 29.07.2019 16:08
Jakaś mała pomoc? :) Byłbym wdzięczny :)

topStats
<?php
/**
* This file is part of Top Stats plugin for MyBB.
* Copyright (C) 2010-2013 baszaR & LukasAMD & Supryk
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* Disallow direct access to this file for security reasons
*
*/
if (!defined("IN_MYBB")) exit;

/**
* Create plugin object
*
*/
$plugins->objects['topStats'] = new topStats();

/**
* Standard MyBB info function
*
*/
function topStats_info()
{
    global $lang;
    $lang->load("topStats");
    return array(
        'name'          => $lang->topStats_Name,
        'description'   => $lang->topStats_NameDesc,
        'website'        => 'https://webboard.pl/',
        'author'        => 'baszaR & LukasAMD & Supryk',
        'authorsite'    => 'https://webboard.pl/',
        'version'        => '1.0.4',
        'guid'            => '',
        'compatibility' => '18*',
        'codename' => 'topStats_',
    );
}

/**
* Standard MyBB installation functions
*
*/
function topStats_install()
{
    require_once('topStats.settings.php');
    topStatsInstaller::install();
    rebuild_settings();

}

function topStats_is_installed()
{

    global $mybb;
    return (isset($mybb->settings['topStats_Status_LastThreads']));
}

function topStats_uninstall()
{

    require_once('topStats.settings.php');
    topStatsInstaller::uninstall();
    rebuild_settings();
}
  
/**
* Standard MyBB activation functions
*
*/
function topStats_activate()
{

    require_once('topStats.tpl.php');
    topStatsActivator::activate();
}

function topStats_deactivate()
{
    require_once('topStats.tpl.php');
    topStatsActivator::deactivate();
}



/**
* Plugin Class
*
*/
class topStats
{
    /**
     * Constructor - add plugin hooks
     *      
     */
    public function __construct()
    {
        global $plugins;

        $plugins->hooks["global_start"][10]["topStats_addHooks"] = array("function" => create_function('', 'global $plugins; $plugins->objects[\'topStats\']->addHooks();'));
    }

    /**
     * Add all needed hooks
     *      
     */
    public function addHooks()
    {
        global $lang, $mybb, $plugins, $templatelist, $topStats;

        $topStats = array(
            'LastThreads'   => '',
            'LastActiveThreads'   => '',
            'MostViews'     => '',
            'Posters'       => '',
            'Reputation'    => '',
            'Referrals' => '',
            'TimeOnline'    => '',
            'NewestUsers'   => '',
            'Moderators'   => '',
        );

        if (!$this->getConfig('Status_All'))
        {
            return;
        }

        $lang->load("topStats");
        if ($this->getConfig('Status_LastThreads'))
        {
            $plugins->hooks["index_start"][10]["topStats_LastThreads"] = array("function" => create_function('', 'global $plugins; $plugins->objects[\'topStats\']->widget_LastThreads();'));
            $templatelist .= ',topStats_LastThreads,topStats_LastThreadsRow,topStats_LastThreadsAvatar';    
        }
        if ($this->getConfig('Status_LastActiveThreads'))
        {
            $plugins->hooks["index_start"][10]["topStats_LastActiveThreads"] = array("function" => create_function('', 'global $plugins; $plugins->objects[\'topStats\']->widget_LastActiveThreads();'));
            $templatelist .= ',topStats_LastActiveThreads,topStats_LastActiveThreadsRow,topStats_LastActiveThreadsAvatar';    
        }
        if ($this->getConfig('Status_MostViews'))
        {
            $plugins->hooks["index_start"][10]["topStats_MostViews"] = array("function" => create_function('', 'global $plugins; $plugins->objects[\'topStats\']->widget_MostViews();'));
            $templatelist .= ',topStats_MostViews,topStats_MostViewsRow,topStats_MostViewsAvatar';    
        }
        if ($this->getConfig('Status_Posters'))
        {
            $plugins->hooks["index_start"][10]["topStats_Posters"] = array("function" => create_function('', 'global $plugins; $plugins->objects[\'topStats\']->widget_Posters();'));
            $templatelist .= ',topStats_Posters,topStats_PostersRow,topStats_PostersAvatar';    
        }
        if ($this->getConfig('Status_Reputation'))
        {
            $plugins->hooks["index_start"][10]["topStats_Reputation"] = array("function" => create_function('', 'global $plugins; $plugins->objects[\'topStats\']->widget_Reputation();'));
            $templatelist .= ',topStats_Reputation,topStats_ReputationRow,topStats_ReputationAvatar';    
        }
        if ($this->getConfig('Status_Referrals'))
        {
            $plugins->hooks["index_start"][10]["topStats_Referrals"] = array("function" => create_function('', 'global $plugins; $plugins->objects[\'topStats\']->widget_Referrals();'));
            $templatelist .= ',topStats_Referrals,topStats_ReferralsRow,topStats_ReferralsAvatar';    
        }
        if ($this->getConfig('Status_TimeOnline'))
        {
            $plugins->hooks["index_start"][10]["topStats_TimeOnline"] = array("function" => create_function('', 'global $plugins; $plugins->objects[\'topStats\']->widget_TimeOnline();'));
            $templatelist .= ',topStats_TimeOnline,topStats_TimeOnlineRow,topStats_TimeOnlineAvatar';    
        }
        if ($this->getConfig('Status_NewestUsers'))
        {
            $plugins->hooks["index_start"][10]["topStats_NewestUsers"] = array("function" => create_function('', 'global $plugins; $plugins->objects[\'topStats\']->widget_NewestUsers();'));
            $templatelist .= ',topStats_NewestUsers,topStats_NewestUsersRow,topStats_NewestUsersAvatar';    
        }  
        if ($this->getConfig('Status_Moderators'))
        {
            $plugins->hooks["index_start"][10]["topStats_Moderators"] = array("function" => create_function('', 'global $plugins; $plugins->objects[\'topStats\']->widget_Moderators();'));
            $templatelist .= ',topStats_Moderators,topStats_ModeratorsRow,topStats_ModeratorsAvatar';    
        }  
    }
    
    /**
     * Widget with last threads list
     *  
     */
    public function widget_LastThreads()
    {  
        global $db, $lang, $mybb, $templates, $theme, $topStats;
        require_once MYBB_ROOT."inc/functions_search.php";
        $permsql = "";
        $onlyusfids = array();
        $group_permissions = forum_permissions();
        foreach($group_permissions as $fid => $forum_permissions)
        {
            if(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1)
            {
                $onlyusfids[] = $fid;
            }
        }
        if(!empty($onlyusfids))
        {
            $permsql .= "AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";
        }

        $unsearchforums = get_unsearchable_forums();
        if($unsearchforums)
        {
            $permsql .= " AND t.fid NOT IN ($unsearchforums)";
        }
        $inactiveforums = get_inactive_forums();
        if($inactiveforums)
        {
            $permsql .= " AND t.fid NOT IN ($inactiveforums)";
        }
        
        $tpl['ignore_forums'] = '';
        if(!empty($mybb->settings['topStats_IgnoreForums_LastThreads']))
        {
            $tpl['ignore_forums'] = "AND t.fid NOT IN ({$mybb->settings['topStats_IgnoreForums_LastThreads']})";
        }    

        $tpl['row'] = '';
    
        $sql = "SELECT t.uid, t.tid, t.subject, t.dateline, t.fid, u.usergroup, u.displaygroup, u.avatar, u.avatardimensions, u.username, u.uid
                FROM ".TABLE_PREFIX."threads AS t
                INNER JOIN ".TABLE_PREFIX."users AS u USING (uid)
                WHERE 1=1 {$tpl['ignore_forums']} {$unapproved_where} {$permsql} AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
                ORDER BY t.tid DESC LIMIT ". (int)$this->getConfig('Limit_LastThreads') ."";
        $result = $db->query($sql);
        while ($row = $db->fetch_array($result))
        {
            $tpl['subject'] = (my_strlen($row['subject']) > 30) ? my_substr($row['subject'], 0, 30) . "..." : $row['subject'];
            $tpl['username'] = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
            $tpl['profilelink'] = build_profile_link($tpl['username'], $row['uid']);
            $tpl['date'] = my_date('relative', $row['dateline']);
            $tpl['subjectlink'] = get_thread_link($row['tid']);
            $useravatar = format_avatar(htmlspecialchars_uni($row['avatar']), $row['avatardimensions'], my_strtolower($this->getConfig('AvatarWidth')));
            (!$this->getConfig('Status_Avatar')) ? '' : eval("\$tpl['avatar'] = \"".$templates->get("topStats_LastThreadsAvatar")."\";");
            eval("\$tpl['row'] .= \"" . $templates->get("topStats_LastThreadsRow") . "\";");
        }
        eval("\$topStats['LastThreads'] = \"" . $templates->get("topStats_LastThreads") . "\";");
    }
    
    /**
     * Widget with last active threads list
     *  
     */
    public function widget_LastActiveThreads()
    {  
        global $db, $lang, $mybb, $templates, $theme, $topStats;
        
        require_once MYBB_ROOT."inc/functions_search.php";
        $permsql = "";
        $onlyusfids = array();
        $group_permissions = forum_permissions();
        foreach($group_permissions as $fid => $forum_permissions)
        {
            if(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1)
            {
                $onlyusfids[] = $fid;
            }
        }
        if(!empty($onlyusfids))
        {
            $permsql .= "AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";
        }

        $unsearchforums = get_unsearchable_forums();
        if($unsearchforums)
        {
            $permsql .= " AND t.fid NOT IN ($unsearchforums)";
        }
        $inactiveforums = get_inactive_forums();
        if($inactiveforums)
        {
            $permsql .= " AND t.fid NOT IN ($inactiveforums)";
        }
        
        $tpl['ignore_forums'] = '';
        if(!empty($mybb->settings['topStats_IgnoreForums_LastActiveThreads']))
        {
            $tpl['ignore_forums'] = "AND t.fid NOT IN ({$mybb->settings['topStats_IgnoreForums_LastActiveThreads']})";
        }    

        $tpl['row'] = '';
    
        $sql = "SELECT t.lastposteruid, t.tid, t.subject, t.lastpost, t.fid, u.usergroup, u.displaygroup, u.avatar, u.avatardimensions, u.username, u.uid
                FROM ".TABLE_PREFIX."threads t
                INNER JOIN ".TABLE_PREFIX."users u ON (u.uid=t.lastposteruid)
                WHERE 1=1 {$tpl['ignore_forums']} {$unapproved_where} {$permsql} AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
                ORDER BY t.lastpost DESC LIMIT ". (int)$this->getConfig('Limit_LastActiveThreads') ."";
        $result = $db->query($sql);
        while ($row = $db->fetch_array($result))
        {
            $tpl['subject'] = (my_strlen($row['subject']) > 30) ? my_substr($row['subject'], 0, 30) . "..." : $row['subject'];
            $tpl['username'] = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
            $tpl['profilelink'] = build_profile_link($tpl['username'], $row['uid']);
            $tpl['date'] = my_date('relative', $row['lastpost']);
            $tpl['subjectlink'] = get_thread_link($row['tid']);
            $useravatar = format_avatar(htmlspecialchars_uni($row['avatar']), $row['avatardimensions'], my_strtolower($this->getConfig('AvatarWidth')));
            (!$this->getConfig('Status_Avatar')) ? '' : eval("\$tpl['avatar'] = \"".$templates->get("topStats_LastActiveThreadsAvatar")."\";");
            eval("\$tpl['row'] .= \"" . $templates->get("topStats_LastActiveThreadsRow") . "\";");
        }
        eval("\$topStats['LastActiveThreads'] = \"" . $templates->get("topStats_LastActiveThreads") . "\";");
    }
    
    /**
     * Widget with most views threads
     *  
     */
    public function widget_MostViews()
    {
        global $db, $lang, $mybb, $templates, $theme, $topStats;

        require_once MYBB_ROOT."inc/functions_search.php";
        $permsql = "";
        $onlyusfids = array();
        $group_permissions = forum_permissions();
        foreach($group_permissions as $fid => $forum_permissions)
        {
            if(isset($forum_permissions['canonlyviewownthreads']) && $forum_permissions['canonlyviewownthreads'] == 1)
            {
                $onlyusfids[] = $fid;
            }
        }
        if(!empty($onlyusfids))
        {
            $permsql .= "AND ((t.fid IN(".implode(',', $onlyusfids).") AND t.uid='{$mybb->user['uid']}') OR t.fid NOT IN(".implode(',', $onlyusfids)."))";
        }

        $unsearchforums = get_unsearchable_forums();
        if($unsearchforums)
        {
            $permsql .= " AND t.fid NOT IN ($unsearchforums)";
        }
        $inactiveforums = get_inactive_forums();
        if($inactiveforums)
        {
            $permsql .= " AND t.fid NOT IN ($inactiveforums)";
        }
        
        $tpl['ignore_forums'] = '';
        
        if(!empty($mybb->settings['topStats_IgnoreForums_MostViews']))
        {
            $tpl['ignore_forums'] = "AND t.fid NOT IN ({$mybb->settings['topStats_IgnoreForums_MostViews']})";
        }        

        $tpl['row'] = '';
    
        $sql = "SELECT t.uid, t.tid, t.subject, t.dateline, t.fid, t.views, u.usergroup, u.displaygroup, u.avatar, u.avatardimensions, u.username, u.uid
                FROM ".TABLE_PREFIX."threads AS t
                INNER JOIN ".TABLE_PREFIX."users AS u USING (uid)
                WHERE 1=1 {$tpl['ignore_forums']} {$unapproved_where} {$permsql} AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
                ORDER BY t.views DESC LIMIT ". (int)$this->getConfig('Limit_MostViews') ."";
        $result = $db->query($sql);
        while ($row = $db->fetch_array($result))
        {
            $tpl['subject'] = (my_strlen($row['subject']) > 30) ? my_substr($row['subject'], 0, 30) . "..." : $row['subject'];
            $tpl['username'] = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
            $tpl['profilelink'] = build_profile_link($tpl['username'], $row['uid']);
            $tpl['date'] = my_date('relative', $row['dateline']);
            $tpl['subjectlink'] = get_thread_link($row['tid']);
            $tpl['views'] = my_number_format($row['views']);
            $useravatar = format_avatar(htmlspecialchars_uni($row['avatar']), $row['avatardimensions'], my_strtolower($this->getConfig('AvatarWidth')));
            (!$this->getConfig('Status_Avatar')) ? '' : eval("\$tpl['avatar'] = \"".$templates->get("topStats_MostViewsAvatar")."\";");
            eval("\$tpl['row'] .= \"" . $templates->get("topStats_MostViewsRow") . "\";");
        }
        eval("\$topStats['MostViews'] = \"" . $templates->get("topStats_MostViews") . "\";");
    }
    
    /**
     * Widget with most posters list
     *  
     */
    public function widget_Posters()
    {
        global $db, $lang, $mybb, $templates, $theme, $topStats;

        $tpl['ignore_groups'] = '';
        
        if(!empty($mybb->settings['topStats_IgnoreGroups_Posters']))
        {
            $tpl['ignore_groups'] = " AND usergroup NOT IN ({$mybb->settings['topStats_IgnoreGroups_Posters']})";
        }        
        
        $lang->topStats_topPosters = $lang->sprintf($lang->topStats_topPosters, (int)$this->getConfig('Limit_Posters'));
        
        $tpl['row'] = '';
    
        $sql = "SELECT username, usergroup, displaygroup, postnum, uid, avatar, avatardimensions
                FROM ".TABLE_PREFIX."users
                WHERE uid != '' ". $tpl['ignore_groups'] . "
                ORDER BY postnum DESC
                LIMIT ".(int)$this->getConfig('Limit_Posters')."";
        $result = $db->query($sql);
        while ($row = $db->fetch_array($result))
        {
            $tpl['username'] = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
            $tpl['profilelink'] = build_profile_link($tpl['username'], $row['uid']);
            $tpl['postnum'] = my_number_format($row['postnum']);
            $useravatar = format_avatar(htmlspecialchars_uni($row['avatar']), $row['avatardimensions'], my_strtolower($this->getConfig('AvatarWidth')));
            (!$this->getConfig('Status_Avatar')) ? '' : eval("\$tpl['avatar'] = \"".$templates->get("topStats_PostersAvatar")."\";");
            eval("\$tpl['row'] .= \"" . $templates->get("topStats_PostersRow") . "\";");
        }
        eval("\$topStats['Posters'] = \"" . $templates->get("topStats_Posters") . "\";");
    }
    /**
     * Widget with reputation list
     *  
     */
    public function widget_Reputation()
    {
        global $db, $lang, $mybb, $templates, $theme, $topStats;

        $tpl['ignore_groups'] = '';
        
        if(!empty($mybb->settings['topStats_IgnoreGroups_Reputation']))
        {
            $tpl['ignore_groups'] = " AND usergroup NOT IN ({$mybb->settings['topStats_IgnoreGroups_Reputation']})";
        }    
        
        $lang->topStats_topReputation = $lang->sprintf($lang->topStats_topReputation, (int)$this->getConfig('Limit_Reputation'));
        
        $tpl['row'] = '';
    
        $sql = "SELECT username, usergroup, displaygroup, reputation, uid, avatar, avatardimensions
                FROM ".TABLE_PREFIX."users
                WHERE uid != '' ". $tpl['ignore_groups'] . "
                ORDER BY reputation DESC
                LIMIT ". (int) $this->getConfig('Limit_Reputation') ."";
        $result = $db->query($sql);
        while ($row = $db->fetch_array($result))        
        {
            $tpl['username'] = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
            $tpl['profilelink'] = build_profile_link($tpl['username'], $row['uid']);
            $tpl['reputation'] = my_number_format($row['reputation']);
            $useravatar = format_avatar(htmlspecialchars_uni($row['avatar']), $row['avatardimensions'], my_strtolower($this->getConfig('AvatarWidth')));
            (!$this->getConfig('Status_Avatar')) ? '' : eval("\$tpl['avatar'] = \"".$templates->get("topStats_ReputationAvatar")."\";");      
            eval("\$tpl['row'] .= \"" . $templates->get("topStats_ReputationRow") . "\";");
        }
        eval("\$topStats['Reputation'] = \"" . $templates->get("topStats_Reputation") . "\";");
    }
    /**
     * Widget with referrals list
     *  
     */
    public function widget_Referrals()
    {
        global $db, $lang, $mybb, $templates, $theme, $topStats;

        $tpl['ignore_groups'] = '';
        
        if(!empty($mybb->settings['topStats_IgnoreGroups_Referrals']))
        {
            $tpl['ignore_groups'] = " AND usergroup NOT IN ({$mybb->settings['topStats_IgnoreGroups_Referrals']})";
        }    
        
        $lang->topStats_topReferrals = $lang->sprintf($lang->topStats_topReferrals, (int)$this->getConfig('Limit_Referrals'));
        
        $tpl['row'] = '';
    
        $sql = "SELECT username, usergroup, displaygroup, referrals, uid, avatar, avatardimensions
                FROM ".TABLE_PREFIX."users
                WHERE uid != '' ". $tpl['ignore_groups'] . "
                ORDER BY referrals DESC
                LIMIT ". (int) $this->getConfig('Limit_Referrals') ."";
        $result = $db->query($sql);
        while ($row = $db->fetch_array($result))        
        {
            $tpl['limit'] = (int) $this->getConfig('Limit_Referrals');
            $tpl['username'] = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
            $tpl['profilelink'] = build_profile_link($tpl['username'], $row['uid']);
            $tpl['referrals'] = my_number_format($row['referrals']);
            $useravatar = format_avatar(htmlspecialchars_uni($row['avatar']), $row['avatardimensions'], my_strtolower($this->getConfig('AvatarWidth')));
            (!$this->getConfig('Status_Avatar')) ? '' : eval("\$tpl['avatar'] = \"".$templates->get("topStats_ReferralsAvatar")."\";");      
            eval("\$tpl['row'] .= \"" . $templates->get("topStats_ReferralsRow") . "\";");
        }
        eval("\$topStats['Referrals'] = \"" . $templates->get("topStats_Referrals") . "\";");
    }

    /**
     * Widget with users online time
     *  
     */
    public function widget_TimeOnline()
    {
        global $db, $lang, $mybb, $templates, $theme, $topStats;

        $tpl['ignore_groups'] = '';
        
        if(!empty($mybb->settings['topStats_IgnoreGroups_TimeOnline']))
        {
            $tpl['ignore_groups'] = " AND usergroup NOT IN ({$mybb->settings['topStats_IgnoreGroups_TimeOnline']})";
        }    
        
        $lang->topStats_topOnline = $lang->sprintf($lang->topStats_topOnline, (int)$this->getConfig('Limit_TimeOnline'));
        
        $tpl['row'] = '';

        $sql = "SELECT username, usergroup, displaygroup, TimeOnline, uid, avatar, avatardimensions
                FROM ".TABLE_PREFIX."users
                WHERE uid != '' ". $tpl['ignore_groups'] . "
                ORDER BY TimeOnline DESC
                LIMIT ". (int) $this->getConfig('Limit_TimeOnline')."";
        $result = $db->query($sql);
        while ($row = $db->fetch_array($result))        
        {
            $tpl['limit'] = (int) $this->getConfig('Limit_TimeOnline');
            $tpl['username'] = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
            $tpl['profilelink'] = build_profile_link($tpl['username'], $row['uid']);
            $tpl['time'] = ($row['TimeOnline'] > 0) ? nice_time($row['TimeOnline'], array('years' => false, 'seconds' => false, 'short' => 1)) : $lang->none_registered;;
            $useravatar = format_avatar(htmlspecialchars_uni($row['avatar']), $row['avatardimensions'], my_strtolower($this->getConfig('AvatarWidth')));
            (!$this->getConfig('Status_Avatar')) ? '' : eval("\$tpl['avatar'] = \"".$templates->get("topStats_NewestUsersAvatar")."\";");
            eval("\$tpl['row'] .= \"" . $templates->get("topStats_TimeOnlineRow") . "\";");
        }
        eval("\$topStats['TimeOnline'] = \"" . $templates->get("topStats_TimeOnline") . "\";");
    }
    
        /**
     * Widget with newest users
     *  
     */
    public function widget_NewestUsers()
    {
        global $db, $lang, $mybb, $templates, $theme, $topStats;

        $tpl['ignore_groups'] = '';
        
        if(!empty($mybb->settings['topStats_IgnoreGroups_NewestUsers']))
        {
            $tpl['ignore_groups'] = " AND usergroup NOT IN ({$mybb->settings['topStats_IgnoreGroups_NewestUsers']})";
        }    
        
        $lang->topStats_NewestUsers = $lang->sprintf($lang->topStats_NewestUsers, (int)$this->getConfig('Limit_NewestUsers'));
        
        $tpl['row'] = '';
    
        $sql = "SELECT username, usergroup, displaygroup, regdate, postnum, uid, avatar, avatardimensions
                FROM ".TABLE_PREFIX."users
                WHERE 1=1 {$tpl['ignore_groups']}
                ORDER BY regdate DESC
                LIMIT ".(int) $this->getConfig('Limit_NewestUsers')."";
        $result = $db->query($sql);
        while ($row = $db->fetch_array($result))        
        {
            $tpl['username'] = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
            $tpl['profilelink'] = build_profile_link($tpl['username'], $row['uid']);
            $tpl['date'] = my_date('relative', $row['regdate']);
            $useravatar = format_avatar(htmlspecialchars_uni($row['avatar']), $row['avatardimensions'], my_strtolower($this->getConfig('AvatarWidth')));
            (!$this->getConfig('Status_Avatar')) ? '' : eval("\$tpl['avatar'] = \"".$templates->get("topStats_NewestUsersAvatar")."\";");  
            eval("\$tpl['row'] .= \"" . $templates->get("topStats_NewestUsersRow") . "\";");
        }
        eval("\$topStats['NewestUsers'] = \"" . $templates->get("topStats_NewestUsers") . "\";");
    }
    
        /**
     * Widget with most activ moderators
     *  
     */
    public function widget_Moderators()
    {
        global $db, $lang, $mybb, $templates, $theme, $topStats;
        
        $lang->topStats_topModerators = $lang->sprintf($lang->topStats_topModerators, (int)$this->getConfig('Limit_Moderators'));

        $tpl['row'] = '';
    
        $sql = "SELECT ml.uid, u.username, u.usergroup, u.displaygroup, u.uid, u.avatar, u.avatardimensions, count(*) as totalactions
                FROM ".TABLE_PREFIX."moderatorlog as ml
                 INNER JOIN ".TABLE_PREFIX."users as u ON (ml.uid=u.uid)
                WHERE 1=1
                GROUP BY ml.uid
                ORDER BY totalactions  DESC
                LIMIT ".(int) $this->getConfig('Limit_Moderators')."";
        $result = $db->query($sql);
        while ($row = $db->fetch_array($result))        
        {
            $tpl['username'] = format_name($row['username'], $row['usergroup'], $row['displaygroup']);
            $tpl['profilelink'] = build_profile_link($tpl['username'], $row['uid']);
            $tpl['actions'] = my_number_format($row['totalactions']);
            $useravatar = format_avatar(htmlspecialchars_uni($row['avatar']), $row['avatardimensions'], my_strtolower($this->getConfig('AvatarWidth')));
            (!$this->getConfig('Status_Avatar')) ? '' : eval("\$tpl['avatar'] = \"".$templates->get("topStats_ModeratorsAvatar")."\";");  
            eval("\$tpl['row'] .= \"" . $templates->get("topStats_ModeratorsRow") . "\";");
        }
        eval("\$topStats['Moderators'] = \"" . $templates->get("topStats_Moderators") . "\";");
    }
    
    /**
     * Helper function to get variable from config
     *
     * @param string $name Name of config to get
     * @return string Data config from MyBB Settings
     */
    private function getConfig($name)
    {
        global $mybb;
    
        return $mybb->settings["topStats_{$name}"];
    }

}

topStats.settings
<?php
/**
* This file is part of Top Stats plugin for MyBB.
* Copyright (C) 2010-2013 baszaR & LukasAMD & Supryk
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
*
*/

/**
* Disallow direct access to this file for security reasons
*
*/
if (!defined("IN_MYBB")) exit;

class topStatsInstaller
{
    public static function install()
    {
        global $db,$lang, $mybb;
        self::uninstall();
        
        $result = $db->simple_select('settinggroups', 'MAX(disporder) AS max_disporder');
        $max_disporder = $db->fetch_field($result, 'max_disporder');
        $disporder = 1;

        $settings_group = array(
            'gid' => 'NULL',
            'name' => 'topStats',
            'title' => $db->escape_string($lang->topStats),
            'description' => $db->escape_string($lang->topStats_Desc),
            'disporder' => $max_disporder + 1,
            'isdefault' => '0'
        );
        $db->insert_query('settinggroups', $settings_group);
        $gid = (int) $db->insert_id();
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Status_All',
            'title' => $db->escape_string($lang->topStats_Status_All),
            'description' => $db->escape_string($lang->topStats_Status_AllDesc),
            'optionscode' => 'onoff',
            'value' => '1',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Status_LastThreads',
            'title' => $db->escape_string($lang->topStats_Status_LastThreads),
            'description' =>  $db->escape_string($lang->topStats_Status_LastThreadsDesc),
            'optionscode' => 'onoff',
            'value' => '1',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_IgnoreForums_LastThreads',
            'title' => $db->escape_string($lang->topStats_IgnoreForums_LastThreads),
            'description' =>  $db->escape_string($lang->topStats_IgnoreForums_LastThreadsDesc),
            'optionscode' => 'forumselect',
            'value' => '',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Limit_LastThreads',
            'title' => $db->escape_string($lang->topStats_Limit_LastThreads),
            'description' =>  $db->escape_string($lang->topStats_Limit_LastThreadsDesc),
            'optionscode' => 'text',
            'value' => '5',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        
                
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Status_LastActiveThreads',
            'title' => $db->escape_string($lang->topStats_Status_LastActiveThreads),
            'description' =>  $db->escape_string($lang->topStats_Status_LastActiveThreadsDesc),
            'optionscode' => 'onoff',
            'value' => '1',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_IgnoreForums_LastActiveThreads',
            'title' => $db->escape_string($lang->topStats_IgnoreForums_LastActiveThreads),
            'description' =>  $db->escape_string($lang->topStats_IgnoreForums_LastActiveThreadsDesc),
            'optionscode' => 'forumselect',
            'value' => '',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Limit_LastActiveThreads',
            'title' => $db->escape_string($lang->topStats_Limit_LastActiveThreads),
            'description' =>  $db->escape_string($lang->topStats_Limit_LastActiveThreadsDesc),
            'optionscode' => 'text',
            'value' => '5',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        

        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Status_MostViews',
            'title' => $db->escape_string($lang->topStats_Status_MostViews),
            'description' =>  $db->escape_string($lang->topStats_Status_MostViewsDesc),
            'optionscode' => 'onoff',
            'value' => '1',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_IgnoreForums_MostViews',
            'title' => $db->escape_string($lang->topStats_IgnoreForums_MostViews),
            'description' =>  $db->escape_string($lang->topStats_IgnoreForums_MostViewsDesc),
            'optionscode' => 'forumselect',
            'value' => '',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Limit_MostViews',
            'title' => $db->escape_string($lang->topStats_Limit_MostViews),
            'description' =>  $db->escape_string($lang->topStats_Limit_MostViewsDesc),
            'optionscode' => 'text',
            'value' => '5',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Status_Posters',
            'title' => $db->escape_string($lang->topStats_Status_Posters),
            'description' =>  $db->escape_string($lang->topStats_Status_PostersDesc),
            'optionscode' => 'onoff',
            'value' => '1',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_IgnoreGroups_Posters',
            'title' => $db->escape_string($lang->topStats_IgnoreGroups_Posters),
            'description' =>  $db->escape_string($lang->topStats_IgnoreGroups_PostersDesc),
            'optionscode' => 'groupselect',
            'value' => '',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Limit_Posters',
            'title' => $db->escape_string($lang->topStats_Limit_Posters),
            'description' =>  $db->escape_string($lang->topStats_Limit_PostersDesc),
            'optionscode' => 'text',
            'value' => '5',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
    
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Status_Reputation',
            'title' => $db->escape_string($lang->topStats_Status_Reputation),
            'description' =>  $db->escape_string($lang->topStats_Status_ReputationDesc),
            'optionscode' => 'onoff',
            'value' => '1',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_IgnoreGroups_Reputation',
            'title' => $db->escape_string($lang->topStats_IgnoreGroups_Reputation),
            'description' =>  $db->escape_string($lang->topStats_IgnoreGroups_ReputationDesc),
            'optionscode' => 'groupselect',
            'value' => '',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Limit_Reputation',
            'title' => $db->escape_string($lang->topStats_Limit_Reputation),
            'description' =>  $db->escape_string($lang->topStats_Limit_ReputationDesc),
            'optionscode' => 'text',
            'value' => '5',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Status_Referrals',
            'title' => $db->escape_string($lang->topStats_Status_Referrals),
            'description' =>  $db->escape_string($lang->topStats_Status_ReferralsDesc),
            'optionscode' => 'onoff',
            'value' => '1',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_IgnoreGroups_Referrals',
            'title' => $db->escape_string($lang->topStats_IgnoreGroups_Referrals),
            'description' =>  $db->escape_string($lang->topStats_IgnoreGroups_ReferralsDesc),
            'optionscode' => 'groupselect',
            'value' => '',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Limit_Referrals',
            'title' => $db->escape_string($lang->topStats_Limit_Referrals),
            'description' =>  $db->escape_string($lang->topStats_Limit_ReferralsDesc),
            'optionscode' => 'text',
            'value' => '5',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Status_TimeOnline',
            'title' => $db->escape_string($lang->topStats_Status_TimeOnline),
            'description' =>  $db->escape_string($lang->topStats_Status_TimeOnlineDesc),
            'optionscode' => 'onoff',
            'value' => '1',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_IgnoreGroups_TimeOnline',
            'title' => $db->escape_string($lang->topStats_IgnoreGroups_TimeOnline),
            'description' =>  $db->escape_string($lang->topStats_IgnoreGroups_TimeOnlineDesc),
            'optionscode' => 'groupselect',
            'value' => '',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Limit_TimeOnline',
            'title' => $db->escape_string($lang->topStats_Limit_TimeOnline),
            'description' =>  $db->escape_string($lang->topStats_Limit_TimeOnlineDesc),
            'optionscode' => 'text',
            'value' => '5',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Status_NewestUsers',
            'title' => $db->escape_string($lang->topStats_Status_NewestUsers),
            'description' =>  $db->escape_string($lang->topStats_Status_NewestUsersDesc),
            'optionscode' => 'onoff',
            'value' => '1',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_IgnoreGroups_NewestUsers',
            'title' => $db->escape_string($lang->topStats_IgnoreGroups_NewestUsers),
            'description' =>  $db->escape_string($lang->topStats_IgnoreGroups_NewestUsersDesc),
            'optionscode' => 'groupselect',
            'value' => '',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Limit_NewestUsers',
            'title' => $db->escape_string($lang->topStats_Limit_NewestUsers),
            'description' =>  $db->escape_string($lang->topStats_Limit_NewestUsersDesc),
            'optionscode' => 'text',
            'value' => '5',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        
                $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Status_Moderators',
            'title' => $db->escape_string($lang->topStats_Status_Moderators),
            'description' =>  $db->escape_string($lang->topStats_Status_ModeratorsDesc),
            'optionscode' => 'onoff',
            'value' => '1',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Limit_Moderators',
            'title' => $db->escape_string($lang->topStats_Limit_Moderators),
            'description' =>  $db->escape_string($lang->topStats_Limit_ModeratorsDesc),
            'optionscode' => 'text',
            'value' => '5',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_Status_Avatar',
            'title' =>  $db->escape_string($lang->topStats_Status_Avatar),
            'description' =>   $db->escape_string($lang->topStats_Status_AvatarDesc),
            'optionscode' => 'onoff',
            'value' => '1',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
        
        $setting = array(
            'sid' => 'NULL',
            'name' => 'topStats_AvatarWidth',
            'title' =>  $db->escape_string($lang->topStats_AvatarWidth),
            'description' =>  $db->escape_string($lang->topStats_AvatarWidthDesc),
            'optionscode' => 'text',
            'value' => '32x32',
            'disporder' => $disporder++,
            'gid' => $gid
        );
        $db->insert_query('settings', $setting);
    }
    
    public static function uninstall()
    {
        global $db;
        
        $result = $db->simple_select('settinggroups', 'gid', "name = 'topStats'");
        $gid = (int) $db->fetch_field($result, "gid");
        
        if ($gid > 0)
        {
            $db->delete_query('settings', "gid = '{$gid}'");
        }
        $db->delete_query('settinggroups', "gid = '{$gid}'");
    }
}
A po co mi plugin? To zrobisz w CSS bądź w szablonie.

Głupoty opowiadam.. :D

Szerokość i wysokość avatara
Ustaw szerokość i wysokość awatara np.: 32x32.

Ustawienia pluginu Statystyki Top w ACP
Cytat:w pół dnia stałeś się lepszym pytonistą niż kawenanowo kiedykolwiek programisto :3 ~ Riess 13.11.2018 16:28
Cytat:ale z tą nazwą to fyeem ma racje  ~ Divir 29.07.2019 16:08
Hmm.. tyle, że taka wartość jest ustawiona już domyślnie :/

--

Teraz to ja głupoty piszę heh xd, pomniejszyłem i pomogło mi to :) dzięki wielkie za pomoc !



Użytkownicy przeglądający ten wątek:

3 gości