コード例 #1
0
ファイル: extra-stats.php プロジェクト: Karpec/gizd
function usertableb($res, $frame_caption)
{
    global $STYLEPATH, $extratpl, $language;
    $num = 0;
    $userb = array();
    foreach ($res as $id => $a) {
        $num++;
        $userb[$num - 1]["rank"] = $num;
        $userb[$num - 1]["username"] = $a["id"] > 1 ? "<a href=\"index.php?page=userdetails&amp;id=" . $a["id"] . "\"><b>" . stripslashes($a["prefixcolor"]) . $a["username"] . stripslashes($a["suffixcolor"]) . "</b></a>" : "<b>" . stripslashes($a["prefixcolor"]) . $a["username"] . stripslashes($a["suffixcolor"]) . "</b>";
        $userb[$num - 1]["online"] = NDF($a["tot_on"]);
    }
    $extratpl->set("language", $language);
    $extratpl->set("userb", $userb);
    return set_block($frame_caption, "center", $extratpl->fetch(load_template("extra-stats.userb.tpl")));
}
コード例 #2
0
ファイル: functions.php プロジェクト: Karpec/gizd
function ishappyHour($n)
{
    global $TABLE_PREFIX;
    $happyHour = mysqli_result(mysqli_query($GLOBALS["___mysqli_ston"], "SELECT UNIX_TIMESTAMP(value_s) FROM {$TABLE_PREFIX}avps WHERE arg='happyhour'"), 0);
    $happyDate = date("Y-m-d H:i", $happyHour);
    $curDate = date("Y-m-d H:i");
    $nextDate = date("Y-m-d H:i", $happyHour + 3600);
    if ($n == "check") {
        if ($happyDate < $curDate && $nextDate >= $curDate) {
            return true;
        }
    }
    if ($n == "time") {
        $timeLeft = $happyHour + 3600 - time();
        return NDF($timeLeft);
    }
}
コード例 #3
0
ファイル: online_block.php プロジェクト: Karpec/gizd
         echo "</td></tr></table>";
     } else {
         echo $dtinv . $star . $war . $spp . $staf . $imgdt;
     }
 }
 $sql = "SELECT * FROM {$TABLE_PREFIX}mostonline";
 $result = mysqli_query($GLOBALS["___mysqli_ston"], $sql);
 $details = mysqli_fetch_array($result);
 if ($total_online > $details['amount']) {
     mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE {$TABLE_PREFIX}mostonline SET amount = {$total_online}");
     mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE {$TABLE_PREFIX}mostonline SET date = now()");
 }
 $date = date("D, d M Y ", strtotime($details['date']));
 $restt = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM {$TABLE_PREFIX}users WHERE id=" . $CURUSER["uid"]);
 $roww = mysqli_fetch_array($restt);
 $ontime = NDF($roww["tot_on"]);
 $midnight = date("Y-m-d 00:00:00");
 $sql = "SELECT {$TABLE_PREFIX}users_level.prefixcolor AS prefixcolor, {$TABLE_PREFIX}users_level.suffixcolor AS suffixcolor, {$TABLE_PREFIX}users_level.id_level AS levelorder, {$TABLE_PREFIX}users.id AS id,{$TABLE_PREFIX}users.donor AS donor,{$TABLE_PREFIX}users.immunity AS immunity ,{$TABLE_PREFIX}users.warn AS warn , {$TABLE_PREFIX}users.username AS username, {$TABLE_PREFIX}users.invisible AS invisible FROM {$TABLE_PREFIX}users INNER JOIN {$TABLE_PREFIX}users_level ON {$TABLE_PREFIX}users.id_level={$TABLE_PREFIX}users_level.id WHERE lastconnect >='{$midnight}' ORDER BY levelorder, prefixcolor,username DESC";
 $qry = mysqli_query($GLOBALS["___mysqli_ston"], $sql);
 $counter = 0;
 echo "<tr><td><table border='0' align='center' cellpadding='0' cellspacing='0' width='100%'>";
 echo "<tr><td align=\"left\">&nbsp;<img src=\"images/whos_online.gif\"><b>&nbsp;  (V tuto chvíli online: <font color ='red'>" . $total_online . "</font>)</b></td><td align=\"center\"><img src=\"images/clock.gif\"><b>&nbsp; (Celkově online: <font color ='green'>" . $ontime . "</font>)</b></td><td align=\"right\"><img src=\"images/whos_online.gif\"><b> &nbsp; (Nejvíce:  <font color ='red'>" . $details['amount'] . "</font> on " . $date . ")&nbsp;</b></td></tr></table>";
 echo "<br><tr><td><center><hr><b> Online uživatelé dnes </b></center></tr></td><tr><td><center>";
 while ($res = mysqli_fetch_array($qry)) {
     if (!empty($res["immunity"])) {
         if ($res["immunity"] == "no") {
             $sp = "";
         } else {
             $sp = "<img src='images/shield.png'>";
         }
     }
コード例 #4
0
ファイル: userdetails.php プロジェクト: Karpec/gizd
     }
     $torhistory[$i]["ratio"] = unesc($peerratio);
     $torhistory[$i]["seedscolor"] = linkcolor($torlist['seeds']);
     $torhistory[$i]["seeds"] = "<a href=\"javascript:poppeer('index.php?page=peers&amp;id=" . $torlist['info_hash'] . "')\">" . $torlist['seeds'] . "</a>";
     $torhistory[$i]["leechcolor"] = linkcolor($torlist['leechers']);
     $torhistory[$i]["leechs"] = "<a href=\"javascript:poppeer('index.php?page=peers&amp;id=" . $torlist['info_hash'] . "')\">" . $torlist['leechers'] . "</a>";
     $torhistory[$i]["completed"] = "<a href=\"javascript:poppeer('index.php?page=torrent_history&amp;id=" . $torlist['info_hash'] . "\">" . $torlist['finished'] . "</a>";
     $i++;
     $userdetailtpl->set("torhistory", $torhistory);
 } else {
     $torhistory[$i]["filename"] = "<a href=\"index.php?page=torrent-details&amp;id=" . $torlist['info_hash'] . "\" title=\"" . $language["VIEW_DETAILS"] . ": " . $torlist['filename'] . "\">" . $filename . "</a>";
     getmoderdetails(getmoderstatusbyhash($torlist->infohash), $torlist->infohash);
     $torhistory[$i]["size"] = makesize($torlist['size']);
     $torhistory[$i]["agent"] = htmlspecialchars($torlist['agent']);
     $torhistory[$i]["status"] = $torlist['active'] == 'yes' ? $language["ACTIVATED"] : 'Stopped';
     $torhistory[$i]["seed"] = NDF($torlist['seed']);
     $torhistory[$i]["downloaded"] = makesize($torlist['downloaded']);
     $torhistory[$i]["uploaded"] = makesize($torlist['uploaded']);
     if ($torlist['downloaded'] > 0) {
         $peerratio = number_format($torlist['uploaded'] / $torlist['downloaded'], 2);
     } else {
         $peerratio = '&#8734;';
     }
     $torhistory[$i]["ratio"] = unesc($peerratio);
     $torhistory[$i]["seedscolor"] = linkcolor($torlist['seeds']);
     $torhistory[$i]["seeds"] = "<a href=\"index.php?page=peers&amp;id=" . $torlist['info_hash'] . "\">" . $torlist['seeds'] . "</a>";
     $torhistory[$i]["leechcolor"] = linkcolor($torlist['leechers']);
     $torhistory[$i]["leechs"] = "<a href=\"index.php?page=peers&amp;id=" . $torlist['info_hash'] . "\">" . $torlist['leechers'] . "</a>";
     $torhistory[$i]["completed"] = "<a href=\"index.php?page=torrent_history&amp;id=" . $torlist['info_hash'] . "\">" . $torlist['finished'] . "</a>";
     $i++;
     $userdetailtpl->set("torhistory", $torhistory);