Spróbuj to
<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$plugins->add_hook("index_start", "statsuserindex");
function statsuserindex_info()
{
//info
$website = "https://webboard.pl";
return array(
"name" => "Statystyki użytkownika na stronie głównej",
"description" => "---",
"website" => "{$website}",
"author" => "Snake_",
"authorsite" => "{$website}/uzytkownik-snake_19523",
"version" => "0.1",
);
}
function statsuserindex_activate()
{
}
function statsuserindex_deactivate()
{
}
function statsuserindex()
{
global $mybb, $cache, $statsuserlog, $theme, $groupscache, $lastvisit;
//ogolna funkcja
if($mybb->user['uid']) {
$tekst_wyswietlany_w_thead = "Statystyki użytkownika {$mybb->user['username']}.";
$nick_usera = build_profile_link(format_name($mybb->user['username'], $mybb->user['usergroup'], $mybb->user['displaygroup']), $mybb->user['uid']);
$nick_usera = "<span style=\"font-size: 20px;\">{$nick_usera}</span>";
$avatar_usera = '<img src="' . (empty($mybb->user['avatar']) ? 'images/default_avatar.png' : $mybb->user['avatar']) . '" title="' . $mybb->user['username'] . '" class="avatar_usera"/>';
$reputacja_usera = $mybb->user['reputation'];
$email_usera = "<a href=\"mailto:{$mybb->user['email']}\">{$mybb->user['email']}</a>";
$postow_usera = $mybb->user['postnum'];
}
else {
$tekst_wyswietlany_w_thead = "Twoje statystyki";
$nick_usera = "Gość";
$avatar_usera = '<img src="images/default_avatar.png" class="avatar_usera" />';
$reputacja_usera = 0;
$email_usera = "<i>Nie zidentyfikowano</i>";
$postow_usera = 0;
}
if(!is_array($groupscache))
$groupscache = $cache->read("usergroups");
$grupa_usera = $groupscache[$mybb->user['usergroup']]['title'];
$ostatnio_tu_bylem = $mybb->user['lastvisit'];
$ip = $_SERVER['REMOTE_ADDR'];
$statsuserlog = "
<table border=\"0\" cellspacing=\"{$theme['borderwidth']}\" cellpadding=\"{$theme['tablespace']}\" style=\"width: 100%;\">
<tr>
<td class=\"thead\"><strong>
{$tekst_wyswietlany_w_thead}
</strong></td>
</tr>
<tr>
<td class=\"trow2\">
<div style=\"text-align: center;\">
{$nick_usera}
<br />
<br>
</br>
<div>
{$avatar_usera}
</div>
<br />
<div>
<div class=\"staty_author\"><div class=\"staty_left_a\" style= "background-image:linear-gradient(to bottom, #2A2A2A, #3A3A3A); !important!;">Grupa:</div><div class=\"staty_right_a\" style= "background-image:linear-gradient(to bottom, #2A2A2A, #3A3A3A); !important!;"> {$grupa_usera}</div></div>
<div class=\"staty_author\"><div class=\"staty_left_a\" style= "background-image:linear-gradient(to bottom, #2A2A2A, #3A3A3A); !important!;">Reputacja:</div><div class=\"staty_right_a\" style= "background-image:linear-gradient(to bottom, #2A2A2A, #3A3A3A); !important!;">> {$reputacja_usera}</div></div>
<div class=\"staty_author\"><div class=\"staty_left_a\" style= "background-image:linear-gradient(to bottom, #2A2A2A, #3A3A3A); !important!;">Liczba postów:</div><div class=\"staty_right_a\" style= "background-image:linear-gradient(to bottom, #2A2A2A, #3A3A3A); !important!;"> {$postow_usera}</div></div>
<div class=\"staty_author\"><div class=\"staty_left_a\" style= "background-image:linear-gradient(to bottom, #2A2A2A, #3A3A3A); !important!;">E-mail:</div><div class=\"staty_right_a\" style= "background-image:linear-gradient(to bottom, #2A2A2A, #3A3A3A); !important!;"> {$email_usera}</div></div>
<div class=\"staty_author\"><div class=\"staty_left_a\" style= "background-image:linear-gradient(to bottom, #2A2A2A, #3A3A3A); !important!;">Moje IP:</div><div class=\"staty_right_a\" style= "background-image:linear-gradient(to bottom, #2A2A2A, #3A3A3A); !important!;"> {$ip}</div></div>
<div class=\"staty_author\"><div class=\"staty_left_a\" style= "background-image:linear-gradient(to bottom, #2A2A2A, #3A3A3A); !important!;">Ostatnia wizyta:</div><div class=\"staty_right_a\" style= "background-image:linear-gradient(to bottom, #2A2A2A, #3A3A3A); !important!;"> {$lastvisit}</div></div>
</div>
</td>
</tr>
</table>";
}
?>