예제 #1
0
파일: records.php 프로젝트: knytrune/ABXD
$crumbs = new PipeMenu();
$crumbs->add(new PipeMenuLinkEntry(__("Records"), "records"));
makeBreadcrumbs($crumbs);
$df = "l, F jS Y, G:i:s";
$maxUsersText = $misc['maxuserstext'];
if ($maxUsersText[0] == ":") {
    $users = explode(":", $maxUsersText);
    $maxUsersText = "";
    foreach ($users as $user) {
        if (!$user) {
            continue;
        }
        if ($maxUsersText) {
            $maxUsersText .= ", ";
        }
        $maxUsersText .= UserLinkById($user);
    }
}
// Awesome way of calculating the mean birth date.
// I'm not sure if there's any problems with overflows and all.
// But it seems to work fine :3
$sumAge = FetchResult("SELECT SUM(birthday) FROM {users} WHERE birthday != 0");
$countAge = FetchResult("SELECT COUNT(*) FROM {users} WHERE birthday != 0");
if ($countAge > 0) {
    $avgAge = (int) ($sumAge / $countAge);
    $avgAge = formatBirthday($avgAge);
} else {
    $avgAge = -1;
}
write("\n<table class=\"outline margin width75\">\n\t<tr class=\"header0\">\n\t\t<th colspan=\"2\">\n\t\t\t" . __("Highest Numbers") . "\n\t\t</th>\n\t</tr>\n\t<tr class=\"cell0\">\n\t\t<td>\n\t\t\t" . __("Highest number of posts in 24 hours") . "\n\t\t</td>\n\t\t<td>\n\t\t\t" . __("<strong>{0}</strong>, on {1} GMT") . "\n\t\t</td>\n\t</tr>\n\t<tr class=\"cell1\">\n\t\t<td>\n\t\t\t" . __("Highest number of posts in one hour") . "\n\t\t</td>\n\t\t<td>\n\t\t\t" . __("<strong>{2}</strong>, on {3} GMT") . "\n\t\t</td>\n\t</tr>\n\t<tr class=\"cell0\">\n\t\t<td>\n\t\t\t" . __("Highest number of users in five minutes") . "\n\t\t</td>\n\t\t<td>\n\t\t\t" . __("<strong>{4}</strong>, on {5} GMT") . "\n\t\t</td>\n\t</tr>\n\t<tr class=\"cell1\">\n\t\t<td></td>\n\t\t<td>\n\t\t\t{6}\n\t\t</td>\n\t</tr>\n\t" . ($avgAge > -1 ? "<tr class=\"cell0\">\n\t\t<td>\n\t\t\t" . __("Average age of members") . "\n\t\t</td>\n\t\t<td>\n\t\t\t" . $avgAge . "\n\t\t</td>\n\t</tr>" : '') . "\n</table>\n", $misc['maxpostsday'], gmdate($df, $misc['maxpostsdaydate']), $misc['maxpostshour'], gmdate($df, $misc['maxpostshourdate']), $misc['maxusers'], gmdate($df, $misc['maxusersdate']), $maxUsersText);
$rStats = Query("show table status");
function bbcodeUser($contents, $arg, $parenttag)
{
    return UserLinkById((int) $arg);
}
예제 #3
0
파일: bbcode.php 프로젝트: knytrune/ABXD
function bbcodeUser($dom, $nothing, $id)
{
    return markupToMarkup($dom, UserLinkById((int) $id));
}