MyBB Community Forums

Full Version: user "stats"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can i add 3 new things under "online"?

[Image: statsjm4.png]

something like this:
[Image: stats2gg4.png]
(i added those in postbit_online)
What 'stats' do you want to add ?
i've integrated mybb into tbdev (php peer-to-peer) and i want to add stats like uploaded / downloaded / ratio for ex the sql from the tbdev goes like this
$stats = sql_query("SELECT * FROM users where enabled='yes' and status='confirmed' and id=" . $CURUSER["id"] . "") or sqlerr(__FILE__, __LINE__);
	$arr2 = mysql_fetch_assoc($stats);
	$uploaded = mksize($arr2["uploaded"]);
	$downloaded = mksize($arr2["downloaded"]);
$ratio = $arr2['uploaded'] / $arr2['downloaded'];
$ratio = number_format($ratio, 3);
$color = get_ratio_color($ratio);
if ($color)
 $ratio = "<font color=$color>$ratio</font>";
}
else
if ($arr2["uploaded"] > 0)
    $ratio = "Inf.";
else
$ratio = "---";
and ratio color
function get_ratio_color($ratio)
{
    if ($ratio < 0.1) return "#ff0000";
    if ($ratio < 0.2) return "#ee0000";
    if ($ratio < 0.3) return "#dd0000";
    if ($ratio < 0.4) return "#cc0000";
    if ($ratio < 0.5) return "#bb0000";
    if ($ratio < 0.6) return "#aa0000";
    if ($ratio < 0.7) return "#990000";
    if ($ratio < 0.8) return "#880000";
    if ($ratio < 0.9) return "#770000";
    if ($ratio < 1) return "#660000";
    return "";
}
i don't know where to add them in mybb..and how to print them.. Sad
Any help would be appreciated
so...no idea?
Quote:i've integrated mybb into tbdev (php peer-to-peer)

I would like to know how you did this? At least to what degree. Would you be willing to share the work? I have this on my list of things to code. That's if no one does it before me and releases it.

Did you do full user integration?

And to answer your question...your best solution is to create a plugin and avoid core file changes. I would be willing to help if you have some good coding done for the integration.
well, when u login in the tracker youre logged into the forum (same at logout), when u change your pass in the tracker, it's changed in the forum too (same with username/e-mail/class), when u singup ure automatically signed up to the forum

(the mod isn't made by me, i ripped it from a source) if u want the files just pm me with a msn/icq/yahoo id and maybe you can help in creating such plugin for those stats Smile