2016-09-09, 01:09 PM
Hello
I modified slightly plugin dvz shoutbox typing him a piece of code at the statistics, namely that looks, and now my question is how to hide the contents of these statistics for users not logged in, are caused by variables in the template index - the main page
I modified slightly plugin dvz shoutbox typing him a piece of code at the statistics, namely that looks, and now my question is how to hide the contents of these statistics for users not logged in, are caused by variables in the template index - the main page
function dvz_shoutbox_stats()
{
global $db, $mybb, $templates, $theme, $wpisy, $users, $top_spamer, $users_online_o, $top_spamer_noformatted, $shshshs, $our_shouts, $timesearch, $shouts, $username, $user, $users_online, $anon_online, $invisiblemark, $onlinemembers, $guests_online, $spiders, $cache, $bots_online;
// Statystyki
$query = $db->query("SELECT count(id) as id FROM ".TABLE_PREFIX."dvz_shoutbox");
$row = $db->fetch_array($query);
$wpisy = $row['id'];
$query3 = $db->query("SELECT d.uid, u.username, u.usergroup, u.displaygroup, u.uid, u.avatar, count(*) as shouters
FROM ".TABLE_PREFIX."dvz_shoutbox d
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=d.uid)
GROUP BY d.uid
ORDER BY shouters
DESC LIMIT 1");
$row3 = $db->fetch_array($query3);
$shouts = $row3['shouters'];
$top_spamer_noformatted = $row3['username'];
$top_spamer = build_profile_link(format_name($row3['username'], $row3['usergroup'], $row3['displaygroup']), $row3['uid']);
$query4 = $db->query("SELECT count(id) as id, uid FROM ".TABLE_PREFIX."dvz_shoutbox WHERE uid='".$mybb->user['uid']."'");
$our_shouts = $db->fetch_field($query4, "id");
}