当前位置: 首页>>代码示例>>PHP>>正文


PHP mkprettytime函数代码示例

本文整理汇总了PHP中mkprettytime函数的典型用法代码示例。如果您正苦于以下问题:PHP mkprettytime函数的具体用法?PHP mkprettytime怎么用?PHP mkprettytime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mkprettytime函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: happyHour

function happyHour($action)
{
    global $CACHE;
    //generate happy hour
    if ($action == "generate") {
        $nextDay = date("Y-m-d", time() + 86400);
        $nextHoura = mt_rand(0, 2);
        if ($nextHoura == 2) {
            $nextHourb = mt_rand(0, 3);
        } else {
            $nextHourb = mt_rand(0, 9);
        }
        $nextHour = $nextHoura . $nextHourb;
        $nextMina = mt_rand(0, 5);
        $nextMinb = mt_rand(0, 9);
        $nextMin = $nextMina . $nextMinb;
        $happyHour = $nextDay . " " . $nextHour . ":" . $nextMin . "";
        return $happyHour;
    }
    $file = "{$CACHE}/happyhour.txt";
    //==linux
    //$file = "C://AppServ/www/cache/happyhour.txt"; //==windows *change* appserv if you use xammp
    $happy = unserialize(file_get_contents($file));
    $happyHour = strtotime($happy["time"]);
    $happyDate = $happyHour;
    $curDate = time();
    $nextDate = $happyHour + 3600;
    //action check
    if ($action == "check") {
        if ($happyDate < $curDate && $nextDate >= $curDate) {
            return true;
        }
    }
    //action time left
    if ($action == "time") {
        $timeLeft = mkprettytime($happyHour + 3600 - time());
        $timeLeft = explode(":", $timeLeft);
        $time = $timeLeft[0] . " min : " . $timeLeft[1] . " sec";
        return $time;
    }
    //this will set all torrent free or just one category
    if ($action == "todo") {
        $act = rand(1, 2);
        if ($act == 1) {
            $todo = 255;
        } elseif ($act == 2) {
            $todo = rand(1, 16);
        }
        // only one cat will be free || remember to change the number of categories i have 16 but you may have more
        return $todo;
    }
    //this will generate the multiplier so every torrent downloaded in the happy hour will have upload multiplied but this
    if ($action == "multiplier") {
        $multiplier = rand(11, 55) / 10;
        //max value of the multiplier will be 5,5 || you could change it to a higher or a lower value
        return $multiplier;
    }
}
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:58,代码来源:function_happyhour.php

示例2: dltable

function dltable($name, $arr, $torrent)
{
    global $CURUSER, $lang;
    $htmlout = '';
    if (!count($arr)) {
        return $htmlout = "<div align='left'><b>{$lang['peerslist_no']} {$name} {$lang['peerslist_data_available']}</b></div>\n";
    }
    $htmlout = "\n";
    $htmlout .= "<table width='100%' class='main' border='1' cellspacing='0' cellpadding='5'>\n";
    $htmlout .= "<tr><td colspan='11' class='colhead'>" . count($arr) . " {$name}</td></tr>" . "<tr><td class='colhead'>{$lang['peerslist_user_ip']}</td>" . "<td class='colhead' align='center'>{$lang['peerslist_connectable']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_uploaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_downloaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_ratio']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_complete']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_connected']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_idle']}</td>" . "<td class='colhead' align='left'>{$lang['peerslist_client']}</td></tr>\n";
    $now = time();
    //$moderator = (isset($CURUSER) && get_user_class() >= UC_MODERATOR);
    //$mod = get_user_class() >= UC_MODERATOR;
    foreach ($arr as $e) {
        // user/ip/port
        // check if anyone has this ip
        //($unr = mysql_query("SELECT username, privacy FROM users WHERE id=$e[userid] ORDER BY last_access DESC LIMIT 1")) or die;
        //$una = mysql_fetch_assoc($unr);
        if ($e["privacy"] == "strong") {
            continue;
        }
        $htmlout .= "<tr>\n";
        if ($e["username"]) {
            $htmlout .= "<td><a href='userdetails.php?id={$e['userid']}'><b>{$e['username']}</b></a></td>\n";
        } else {
            $htmlout .= "<td>" . ($mod ? $e["ip"] : preg_replace('/\\.\\d+$/', ".xxx", $e["ip"])) . "</td>\n";
        }
        $secs = max(1, $now - $e["st"] - ($now - $e["la"]));
        //$revived = $e["revived"] == "yes";
        $htmlout .= "<td align='center'>" . ($e['connectable'] == "yes" ? "{$lang['peerslist_yes']}" : "<font color='red'>{$lang['peerslist_no']}</font>") . "</td>\n";
        $htmlout .= "<td align='right'>" . mksize($e["uploaded"]) . "</td>\n";
        $htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["uploaded"] - $e["uploadoffset"]) / $secs) . "/s</span></td>\n";
        $htmlout .= "<td align='right'>" . mksize($e["downloaded"]) . "</td>\n";
        if ($e["seeder"] == "no") {
            $htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / $secs) . "/s</span></td>\n";
        } else {
            $htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1, $e["finishedat"] - $e['st'])) . "/s</span></td>\n";
        }
        if ($e["downloaded"]) {
            $ratio = floor($e["uploaded"] / $e["downloaded"] * 1000) / 1000;
            $htmlout .= "<td align=\"right\"><font color='" . get_ratio_color($ratio) . "'>" . number_format($ratio, 3) . "</font></td>\n";
        } else {
            if ($e["uploaded"]) {
                $htmlout .= "<td align='right'>{$lang['peerslist_inf']}</td>\n";
            } else {
                $htmlout .= "<td align='right'>---</td>\n";
            }
        }
        $htmlout .= "<td align='right'>" . sprintf("%.2f%%", 100 * (1 - $e["to_go"] / $torrent["size"])) . "</td>\n";
        $htmlout .= "<td align='right'>" . mkprettytime($now - $e["st"]) . "</td>\n";
        $htmlout .= "<td align='right'>" . mkprettytime($now - $e["la"]) . "</td>\n";
        $htmlout .= "<td align='left'>" . htmlspecialchars(getagent($e["agent"], $e['peer_id'])) . "</td>\n";
        $htmlout .= "</tr>\n";
    }
    $htmlout .= "</table>\n";
    return $htmlout;
}
开发者ID:CHEZDESIGN,项目名称:mytorrent,代码行数:57,代码来源:peerlist.php

示例3: snatchtable_staff

function snatchtable_staff($res)
{
    global $INSTALLER09, $lang, $CURUSER, $id;
    $htmlout_snatch = '';
    $count2 = 0;
    //    $htmlout_snatch .= "<tr><td class='one' align='right' valign='top'><b>{$lang['userdetails_snatched']}</b></td><td class='one'>";
    $htmlout_snatch .= "<table border='1' cellspacing='0' cellpadding='5' align='center'><tr><td class='colhead' align='center'>{$lang['userdetails_s_cat']}</td><td class='colhead' align='left'>{$lang['userdetails_s_torr']}</td>" . "<td class='colhead' align='center'>{$lang['userdetails_s_sl']}</td><td class='colhead' align='center'>{$lang['userdetails_s_up']}" . ($INSTALLER09['ratio_free'] ? "" : "{$lang['userdetails_s_down']}") . "</td><td class='colhead' align='center'>{$lang['userdetails_s_tsize']}</td>" . "<td class='colhead' align='center'>{$lang['userdetails_ratio']}</td><td class='colhead' align='center'>{$lang['userdetails_client']}</td></tr>";
    while ($arr = mysqli_fetch_assoc($res)) {
        //=======change colors
        $count2 = ++$count2 % 2;
        $class = $count2 == 0 ? 'one' : 'two';
        //=== speed color red fast green slow ;)
        if ($arr["upspeed"] > 0) {
            $ul_speed = $arr["upspeed"] > 0 ? mksize($arr["upspeed"]) : ($arr["seedtime"] > 0 ? mksize($arr["uploaded"] / ($arr["seedtime"] + $arr["leechtime"])) : mksize(0));
        } else {
            $ul_speed = mksize($arr["uploaded"] / ($arr['l_a'] - $arr['s'] + 1));
        }
        if ($arr["downspeed"] > 0) {
            $dl_speed = $arr["downspeed"] > 0 ? mksize($arr["downspeed"]) : ($arr["leechtime"] > 0 ? mksize($arr["downloaded"] / $arr["leechtime"]) : mksize(0));
        } else {
            $dl_speed = mksize($arr["downloaded"] / ($arr['c'] - $arr['s'] + 1));
        }
        switch (true) {
            case $dl_speed > 600:
                $dlc = 'red';
                break;
            case $dl_speed > 300:
                $dlc = 'orange';
                break;
            case $dl_speed > 200:
                $dlc = 'yellow';
                break;
            case $dl_speed < 100:
                $dlc = 'Chartreuse';
                break;
        }
        if ($arr["downloaded"] > 0) {
            $ratio = number_format($arr["uploaded"] / $arr["downloaded"], 3);
            $ratio = "<font color='" . get_ratio_color($ratio) . "'><b>{$lang['userdetails_s_ratio']}</b><br />{$ratio}</font>";
        } else {
            if ($arr["uploaded"] > 0) {
                $ratio = $lang['userdetails_inf'];
            } else {
                $ratio = "N/A";
            }
        }
        if (XBT_TRACKER === false) {
            $htmlout_snatch .= "<tr><td class='{$class}' align='center'>" . ($arr['owner'] == $id ? "<b><font color='orange'>{$lang['userdetails_s_towner']}</font></b><br />" : "" . ($arr['complete_date'] != '0' ? "<b><font color='lightgreen'>{$lang['userdetails_s_fin']}</font></b><br />" : "<b><font color='red'>{$lang['userdetails_s_nofin']}</font></b><br />") . "") . "<img src='{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/" . htmlsafechars($arr['image']) . "' alt='" . htmlsafechars($arr['name']) . "' title='" . htmlsafechars($arr['name']) . "' /></td>" . "\n    <td class='{$class}'><a class='altlink' href='{$INSTALLER09['baseurl']}/details.php?id=" . (int) $arr['torrentid'] . "'><b>" . htmlsafechars($arr['torrent_name']) . "</b></a>" . ($arr['complete_date'] != '0' ? "<br /><font color='yellow'>{$lang['userdetails_s_started']}" . get_date($arr['start_date'], 0, 1) . "</font><br />" : "<font color='yellow'>{$lang['userdetails_s_started']}" . get_date($arr['start_date'], 0, 1) . "</font><br /><font color='orange'>{$lang['userdetails_s_laction']}" . get_date($arr['last_action'], 0, 1) . "</font>" . get_date($arr['complete_date'], 0, 1) . " " . ($arr['complete_date'] == '0' ? "" . ($arr['owner'] == $id ? "" : "[ " . mksize($arr["size"] - $arr["downloaded"]) . "{$lang['userdetails_s_still']}]") . "" : "") . "") . $lang['userdetails_s_finished'] . get_date($arr['complete_date'], 0, 1) . "" . ($arr['complete_date'] != '0' ? "<br /><font color='silver'>{$lang['userdetails_s_ttod']}" . ($arr['leechtime'] != '0' ? mkprettytime($arr['leechtime']) : mkprettytime($arr['c'] - $arr['s']) . "") . "</font> <font color='{$dlc}'>[ {$lang['userdetails_s_dled']} {$dl_speed} ]</font><br />" : "<br />") . "<font color='lightblue'>" . ($arr['seedtime'] != '0' ? $lang['userdetails_s_tseed'] . mkprettytime($arr['seedtime']) . " </font><font color='{$dlc}'> " : $lang['userdetails_s_tseedn']) . "</font><font color='lightgreen'> [ {$lang['userdetails_s_uspeed']} " . $ul_speed . " ] </font>" . ($arr['complete_date'] == '0' ? "<br /><font color='{$dlc}'>{$lang['userdetails_s_dspeed']}{$dl_speed}</font>" : "") . "</td>" . "\n    <td align='center' class='{$class}'>{$lang['userdetails_s_seed']}" . (int) $arr['seeders'] . "<br />{$lang['userdetails_s_leech']}" . (int) $arr['leechers'] . "</td><td align='center' class='{$class}'><font color='lightgreen'>{$lang['userdetails_s_upld']}<br /><b>" . mksize($arr["uploaded"]) . "</b></font>" . ($INSTALLER09['ratio_free'] ? "" : "<br /><font color='orange'>{$lang['userdetails_s_dld']}<br /><b>" . mksize($arr["downloaded"]) . "</b></font>") . "</td><td align='center' class='{$class}'>" . mksize($arr["size"]) . "" . ($INSTALLER09['ratio_free'] ? "" : "<br />{$lang['userdetails_s_diff']}<br /><font color='orange'><b>" . mksize($arr['size'] - $arr["downloaded"]) . "</b></font>") . "</td><td align='center' class='{$class}'>" . $ratio . "<br />" . ($arr['seeder'] == 'yes' ? "<font color='lightgreen'><b>{$lang['userdetails_s_seeding']}</b></font>" : "<font color='red'><b>{$lang['userdetails_s_nseeding']}</b></font>") . "</td><td align='center' class='{$class}'>" . htmlsafechars($arr["agent"]) . "<br />{$lang['userdetails_s_port']}" . (int) $arr["port"] . "<br />" . ($arr["connectable"] == 'yes' ? "<b>{$lang['userdetails_s_conn']}</b> <font color='lightgreen'>{$lang['userdetails_yes']}</font>" : "<b>{$lang['userdetails_s_conn']}</b> <font color='red'><b>{$lang['userdetails_no']}</b></font>") . "</td></tr>\n";
        } else {
            $htmlout_snatch .= "<tr><td class='{$class}' align='center'>" . ($arr['owner'] == $id ? "<b><font color='orange'>{$lang['userdetails_s_towner']}</font></b><br />" : "" . ($arr['completedtime'] != '0' ? "<b><font color='lightgreen'>{$lang['userdetails_s_fin']}</font></b><br />" : "<b><font color='red'>{$lang['userdetails_s_nofin']}</font></b><br />") . "") . "<img src='{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/" . htmlsafechars($arr['image']) . "' alt='" . htmlsafechars($arr['name']) . "' title='" . htmlsafechars($arr['name']) . "' /></td>" . "\n    <td class='{$class}'><a class='altlink' href='{$INSTALLER09['baseurl']}/details.php?id=" . (int) $arr['fid'] . "'><b>" . htmlsafechars($arr['torrent_name']) . "</b></a>" . ($arr['completedtime'] != '0' ? "<br /><font color='yellow'>{$lang['userdetails_s_started']}" . get_date($arr['started'], 0, 1) . "</font><br />" : "<font color='yellow'>started:" . get_date($arr['started'], 0, 1) . "</font><br /><font color='orange'>{$lang['userdetails_s_laction']}" . get_date($arr['mtime'], 0, 1) . "</font>" . get_date($arr['completedtime'], 0, 1) . " " . ($arr['completedtime'] == '0' ? "" . ($arr['owner'] == $id ? "" : "[ " . mksize($arr["size"] - $arr["downloaded"]) . "{$lang['userdetails_s_still']}]") . "" : "") . "") . "{$lang['userdetails_s_finished']}" . get_date($arr['completedtime'], 0, 1) . "" . ($arr['completedtime'] != '0' ? "<br /><font color='silver'>{$lang['userdetails_s_ttod']}" . ($arr['leechtime'] != '0' ? mkprettytime($arr['leechtime']) : mkprettytime($arr['c'] - $arr['s']) . "") . "</font> <font color='{$dlc}'>[ {$lang['userdetails_s_dled']} {$dl_speed} ]</font><br />" : "<br />") . "<font color='lightblue'>" . ($arr['seedtime'] != '0' ? "{$lang['userdetails_s_tseed']}" . mkprettytime($arr['seedtime']) . " </font><font color='{$dlc}'> " : "{$lang['userdetails_s_tseedn']}") . "</font><font color='lightgreen'> [{$lang['userdetails_s_uspeed']}" . $ul_speed . " ] </font>" . ($arr['completedtime'] == '0' ? "<br /><font color='{$dlc}'>{$lang['userdetails_s_dspeed']} {$dl_speed}</font>" : "") . "</td>" . "\n    <td align='center' class='{$class}'>{$lang['userdetails_s_seed']}" . (int) $arr['seeders'] . "<br />{$lang['userdetails_s_leech']}" . (int) $arr['leechers'] . "</td><td align='center' class='{$class}'><font color='lightgreen'>{$lang['userdetails_s_upld']}<br /><b>" . mksize($arr["uploaded"]) . "</b></font>" . ($INSTALLER09['ratio_free'] ? "" : "<br /><font color='orange'>{$lang['userdetails_s_dld']}<br /><b>" . mksize($arr["downloaded"]) . "</b></font>") . "</td><td align='center' class='{$class}'>" . mksize($arr["size"]) . "" . ($INSTALLER09['ratio_free'] ? "" : "<br />{$lang['userdetails_s_diff']}<br /><font color='orange'><b>" . mksize($arr['size'] - $arr["downloaded"]) . "</b></font>") . "</td><td align='center' class='{$class}'>" . $ratio . "<br />" . ($arr['active'] == 1 ? "<font color='lightgreen'><b>{$lang['userdetails_s_seeding']}</b></font>" : "<font color='red'><b>{$lang['userdetails_s_nseeding']}</b></font>") . "</td><td align='center' class='{$class}'>" . htmlsafechars($arr["peer_id"]) . "<br />" . ($arr["connectable"] == 1 ? "<b>{$lang['userdetails_s_conn']}</b> <font color='lightgreen'>{$lang['userdetails_yes']}</font>" : "<b>{$lang['userdetails_s_conn']}</b> <font color='red'><b>{$lang['userdetails_no']}</b></font>") . "</td></tr>\n";
        }
    }
    $htmlout_snatch .= "</table>\n";
    return $htmlout_snatch;
}
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:55,代码来源:snatched_staff.php

示例4: dltable

function dltable($name, $arr, $torrent)
{
    global $CURUSER, $lang;
    $htmlout = '';
    if (!count($arr)) {
        return $htmlout = "<div align='left'><b>{$lang['peerslist_no']} {$name} {$lang['peerslist_data_available']}</b></div>\n";
    }
    $htmlout = "\n";
    $htmlout .= "<table width='100%' class='main' border='1' cellspacing='0' cellpadding='5'>\n";
    $htmlout .= "<tr><td colspan='11' class='colhead'>" . count($arr) . " {$name}</td></tr>" . "<tr><td class='colhead'>{$lang['peerslist_user_ip']}</td>" . "<td class='colhead' align='center'>{$lang['peerslist_connectable']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_uploaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_downloaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_ratio']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_complete']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_connected']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_idle']}</td>" . "<td class='colhead' align='left'>{$lang['peerslist_client']}</td></tr>\n";
    $now = time();
    $mod = $CURUSER['class'] >= UC_MODERATOR;
    foreach ($arr as $e) {
        if ($e["privacy"] == "strong") {
            continue;
        }
        $htmlout .= "<tr>\n";
        if ($e['username']) {
            if (($e['tanonymous'] == 'yes' && $e['owner'] == $e['userid'] || $e['anonymous'] == 'yes' && $CURUSER['id'] != $e['userid']) && $CURUSER['class'] < UC_MODERATOR) {
                $htmlout .= "<td><b>Anonymous</b></td>\n";
            } else {
                $htmlout .= "<td><a href='userdetails.php?id=" . $e['userid'] . "'><b>" . $e['username'] . "</b></a></td>\n";
            }
        } else {
            $htmlout .= "<td>" . ($mod ? $e["ip"] : preg_replace('/\\.\\d+$/', ".xxx", $e["ip"])) . "</td>\n";
        }
        $secs = max(1, $now - $e["st"] - ($now - $e["la"]));
        $htmlout .= "<td align='center'>" . ($e['connectable'] == "yes" ? "{$lang['peerslist_yes']}" : "<font color='red'>{$lang['peerslist_no']}</font>") . "</td>\n";
        $htmlout .= "<td align='right'>" . mksize($e["uploaded"]) . "</td>\n";
        $htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["uploaded"] - $e["uploadoffset"]) / $secs) . "/s</span></td>\n";
        $htmlout .= "<td align='right'>" . mksize($e["downloaded"]) . "</td>\n";
        if ($e["seeder"] == "no") {
            $htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / $secs) . "/s</span></td>\n";
        } else {
            $htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1, $e["finishedat"] - $e['st'])) . "/s</span></td>\n";
        }
        if ($e["downloaded"]) {
            $ratio = floor($e["uploaded"] / $e["downloaded"] * 1000) / 1000;
            $htmlout .= "<td align=\"right\"><font color='" . get_ratio_color($ratio) . "'>" . number_format($ratio, 3) . "</font></td>\n";
        } else {
            if ($e["uploaded"]) {
                $htmlout .= "<td align='right'>{$lang['peerslist_inf']}</td>\n";
            } else {
                $htmlout .= "<td align='right'>---</td>\n";
            }
        }
        $htmlout .= "<td align='right'>" . sprintf("%.2f%%", 100 * (1 - $e["to_go"] / $torrent["size"])) . "</td>\n";
        $htmlout .= "<td align='right'>" . mkprettytime($now - $e["st"]) . "</td>\n";
        $htmlout .= "<td align='right'>" . mkprettytime($now - $e["la"]) . "</td>\n";
        $htmlout .= "<td align='left'>" . htmlspecialchars(getagent($e["agent"], $e['peer_id'])) . "</td>\n";
        $htmlout .= "</tr>\n";
    }
    $htmlout .= "</table>\n";
    return $htmlout;
}
开发者ID:thefkboss,项目名称:U-232,代码行数:55,代码来源:peerlist.php

示例5: snatchtable

function snatchtable($res)
{
    $table = "<table class=main border=1 cellspacing=0 cellpadding=5>\r\n<tr>\r\n<td class=colhead>Category</td>\r\n<td class=colhead>Torrent</td>\r\n<td class=colhead>S.id</td>\r\n<td class=colhead>Up.</td>\r\n<td class=colhead>Rate</td>\r\n<td class=colhead>Downl.</td>\r\n<td class=colhead>Rate</td>\r\n<td class=colhead>Ratio</td>\r\n<td class=colhead>Activity</td>\r\n<td class=colhead>Finished</td>\r\n</tr>";
    while ($arr = mysql_fetch_assoc($res)) {
        $upspeed = $arr["upspeed"] > 0 ? prefixed($arr["upspeed"]) : ($arr["seedtime"] > 0 ? prefixed($arr["uploaded"] / ($arr["seedtime"] + $arr["leechtime"])) : prefixed(0));
        $downspeed = $arr["downspeed"] > 0 ? prefixed($arr["downspeed"]) : ($arr["leechtime"] > 0 ? prefixed($arr["downloaded"] / $arr["leechtime"]) : prefixed(0));
        $ratio = $arr["downloaded"] > 0 ? number_format($arr["uploaded"] / $arr["downloaded"], 3) : ($arr["uploaded"] > 0 ? "Inf." : "---");
        $id = $arr["id"];
        $table .= "<tr>\r\n<td style='padding: 0px'><img src='pic/" . safeChar($arr["catimg"]) . "' alt='" . safeChar($arr["catname"]) . "' width=42 height=42></td>\r\n<td><a href=details.php?id={$arr['torrentid']}><b>" . (strlen($arr["name"]) > 50 ? substr($arr["name"], 0, 50 - 3) . "..." : $arr["name"]) . "</b></a></td>\r\n<td>" . $arr["id"] . "</td>\r\n<td>" . prefixed($arr["uploaded"]) . "</td>\r\n<td>{$upspeed}/s</td>\r\n<td>" . prefixed($arr["downloaded"]) . "</td>\r\n<td>{$downspeed}/s</td>\r\n<td>{$ratio}</td>\r\n<td>" . mkprettytime($arr["seedtime"] + $arr["leechtime"]) . "</td>\r\n<td>" . ($arr["complete_date"] != "0000-00-00 00:00:00" ? "<font color=green><b>Yes</b></font>" : "<font color=red><b>No</b></font>") . "</td>\r\n</tr>\n";
    }
    $table .= "</table>\n";
    return $table;
}
开发者ID:ZenoX2012,项目名称:CyBerFuN-CoDeX,代码行数:13,代码来源:userdetails.php

示例6: snatchtable

function snatchtable($res)
{
    global $INSTALLER09, $lang;
    $htmlout = '';
    $htmlout = "<table class='main' border='1' cellspacing='0' cellpadding='5'>\r\n <tr>\r\n <td class='colhead'>Category</td>\r\n <td class='colhead'>Torrent</td>\r\n <td class='colhead'>Up.</td>\r\n <td class='colhead'>Rate</td>\r\n <td class='colhead'>Downl.</td>\r\n <td class='colhead'>Rate</td>\r\n <td class='colhead'>Ratio</td>\r\n <td class='colhead'>Activity</td>\r\n <td class='colhead'>Finished</td>\r\n </tr>";
    while ($arr = mysql_fetch_assoc($res)) {
        $upspeed = $arr["upspeed"] > 0 ? mksize($arr["upspeed"]) : ($arr["seedtime"] > 0 ? mksize($arr["uploaded"] / ($arr["seedtime"] + $arr["leechtime"])) : mksize(0));
        $downspeed = $arr["downspeed"] > 0 ? mksize($arr["downspeed"]) : ($arr["leechtime"] > 0 ? mksize($arr["downloaded"] / $arr["leechtime"]) : mksize(0));
        $ratio = $arr["downloaded"] > 0 ? number_format($arr["uploaded"] / $arr["downloaded"], 3) : ($arr["uploaded"] > 0 ? "Inf." : "---");
        $htmlout .= "<tr>\r\n <td style='padding: 0px'><img src='pic/" . htmlspecialchars($arr["catimg"]) . "' alt='" . htmlspecialchars($arr["catname"]) . "' width='42' height='42' /></td>\r\n <td><a href='details.php?id={$arr['torrentid']}'><b>" . (strlen($arr["name"]) > 50 ? substr($arr["name"], 0, 50 - 3) . "..." : $arr["name"]) . "</b></a></td>\r\n <td>" . mksize($arr["uploaded"]) . "</td>\r\n <td>{$upspeed}/s</td>\r\n <td>" . mksize($arr["downloaded"]) . "</td>\r\n <td>{$downspeed}/s</td>\r\n <td>{$ratio}</td>\r\n <td>" . mkprettytime($arr["seedtime"] + $arr["leechtime"]) . "</td>\r\n <td>" . ($arr["complete_date"] != "0" ? "<font color='green'><b>Yes</b></font>" : "<font color='red'><b>No</b></font>") . "</td>\r\n </tr>\n";
    }
    $htmlout .= "</table>\n";
    return $htmlout;
}
开发者ID:CharlieHD,项目名称:U-232-V2,代码行数:14,代码来源:userdetails.php

示例7: snatchtable

function snatchtable($res)
{
    global $INSTALLER09, $lang, $CURUSER;
    $htmlout = '';
    $htmlout = "<table class='main' border='1' cellspacing='0' cellpadding='5'>\n <tr>\n<td class='colhead'>{$lang['userdetails_s_cat']}</td>\n<td class='colhead'>{$lang['userdetails_s_torr']}</td>\n<td class='colhead'>{$lang['userdetails_s_up']}</td>\n<td class='colhead'>{$lang['userdetails_rate']}</td>\n" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead'>{$lang['userdetails_downl']}</td>") . "\n" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead'>{$lang['userdetails_rate']}</td>") . "\n<td class='colhead'>{$lang['userdetails_ratio']}</td>\n<td class='colhead'>{$lang['userdetails_activity']}</td>\n<td class='colhead'>{$lang['userdetails_s_fin']}</td>\n</tr>";
    while ($arr = mysqli_fetch_assoc($res)) {
        $upspeed = $arr["upspeed"] > 0 ? mksize($arr["upspeed"]) : ($arr["seedtime"] > 0 ? mksize($arr["uploaded"] / ($arr["seedtime"] + $arr["leechtime"])) : mksize(0));
        $downspeed = $arr["downspeed"] > 0 ? mksize($arr["downspeed"]) : ($arr["leechtime"] > 0 ? mksize($arr["downloaded"] / $arr["leechtime"]) : mksize(0));
        $ratio = $arr["downloaded"] > 0 ? number_format($arr["uploaded"] / $arr["downloaded"], 3) : ($arr["uploaded"] > 0 ? "Inf." : "---");
        $XBT_or_PHP = XBT_TRACKER == true ? $arr['fid'] : $arr['torrentid'];
        $XBT_or_PHP_TIME = XBT_TRACKER == true ? $arr["completedtime"] : $arr["complete_date"];
        $htmlout .= "<tr>\n <td style='padding: 0px'><img src='{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/" . htmlsafechars($arr["catimg"]) . "' alt='" . htmlsafechars($arr["catname"]) . "' width='42' height='42' /></td>\n <td><a href='details.php?id=" . (int) $XBT_or_PHP . "'><b>" . (strlen($arr["name"]) > 50 ? substr($arr["name"], 0, 50 - 3) . "..." : htmlsafechars($arr["name"])) . "</b></a></td>\n <td>" . mksize($arr["uploaded"]) . "</td>\n <td>{$upspeed}/s</td>\n " . ($INSTALLER09['ratio_free'] ? "" : "<td>" . mksize($arr["downloaded"]) . "</td>") . "\n " . ($INSTALLER09['ratio_free'] ? "" : "<td>{$downspeed}/s</td>") . "\n <td>{$ratio}</td>\n <td>" . mkprettytime($arr["seedtime"] + $arr["leechtime"]) . "</td>\n <td>" . ($XBT_or_PHP_TIME != 0 ? "<font color='green'><b>{$lang['userdetails_yes']}</b></font>" : "<font color='red'><b>{$lang['userdetails_no']}</b></font>") . "</td>\n </tr>\n";
    }
    $htmlout .= "</table>\n";
    return $htmlout;
}
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:16,代码来源:snatched_block.php

示例8: dltable

function dltable($name, $arr, $torrent)
{
    global $CURUSER, $lang, $INSTALLER09;
    $htmlout = '';
    if (!count($arr)) {
        return $htmlout = "<div align='left'><b>{$lang['peerslist_no']} {$name} {$lang['peerslist_data_available']}</b></div>\n";
    }
    $htmlout = "\n";
    $htmlout .= "<table width='100%' class='main' border='1' cellspacing='0' cellpadding='5'>\n";
    $htmlout .= "<tr><td colspan='11' class='colhead'>" . count($arr) . " {$name}</td></tr>" . "<tr><td class='colhead'>{$lang['peerslist_user_ip']}</td>" . "<td class='colhead' align='center'>{$lang['peerslist_connectable']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_uploaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead' align='right'>{$lang['peerslist_downloaded']}</td>") . "" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>") . "" . "<td class='colhead' align='right'>{$lang['peerslist_ratio']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_complete']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_connected']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_idle']}</td>" . "<td class='colhead' align='left'>{$lang['peerslist_client']}</td></tr>\n";
    $now = TIME_NOW;
    $mod = $CURUSER['class'] >= UC_STAFF;
    foreach ($arr as $e) {
        $htmlout .= "<tr>\n";
        if ($e['username']) {
            if (($e['tanonymous'] == 'yes' && $e['owner'] == $e['userid'] || $e['anonymous'] == 'yes' or $e['paranoia'] >= 2) && $CURUSER['id'] != $e['userid'] && $CURUSER['class'] < UC_STAFF) {
                $htmlout .= "<td><b>Kezer Soze</b></td>\n";
            } else {
                $htmlout .= "<td><a href='userdetails.php?id=" . (int) $e['userid'] . "'><b>" . htmlsafechars($e['username']) . "</b></a></td>\n";
            }
        } else {
            $htmlout .= "<td>" . ($mod ? $e["ip"] : preg_replace('/\\.\\d+$/', ".xxx", $e["ip"])) . "</td>\n";
        }
        $secs = max(1, $now - $e["st"] - ($now - $e["la"]));
        $htmlout .= "<td align='center'>" . ($e['connectable'] == "yes" ? "{$lang['peerslist_yes']}" : "<font color='red'>{$lang['peerslist_no']}</font>") . "</td>\n";
        $htmlout .= "<td align='right'>" . mksize($e["uploaded"]) . "</td>\n";
        $htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["uploaded"] - $e["uploadoffset"]) / $secs) . "/s</span></td>\n";
        $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'>" . mksize($e["downloaded"]) . "</td>") . "\n";
        if ($e["seeder"] == "no") {
            $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / $secs) . "/s</span></td>") . "\n";
        } else {
            $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'><span style=\"white-space: nowrap;\">" . mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1, $e["finishedat"] - $e['st'])) . "/s</span></td>") . "\n";
        }
        $htmlout .= "<td align=\"right\">" . member_ratio($e['uploaded'], $INSTALLER09['ratio_free'] ? "0" : $e['downloaded']) . "</td>\n";
        $htmlout .= "<td align='right'>" . sprintf("%.2f%%", 100 * (1 - $e["to_go"] / $torrent["size"])) . "</td>\n";
        $htmlout .= "<td align='right'>" . mkprettytime($now - $e["st"]) . "</td>\n";
        $htmlout .= "<td align='right'>" . mkprettytime($now - $e["la"]) . "</td>\n";
        $htmlout .= "<td align='left'>" . htmlsafechars(getagent($e["agent"], $e['peer_id'])) . "</td>\n";
        $htmlout .= "</tr>\n";
    }
    $htmlout .= "</table>\n";
    return $htmlout;
}
开发者ID:UniversalAdministrator,项目名称:U-232-V4,代码行数:43,代码来源:peerlist.php

示例9: dltable

function dltable($name, $arr, $torrent)
{
    global $CURUSER, $lang, $INSTALLER09;
    $htmlout = '';
    if (!count($arr)) {
        return $htmlout = "<div align='left'><b>{$lang['peerslist_no']} {$name} {$lang['peerslist_data_available']}</b></div>\n";
    }
    $htmlout = "\n";
    $htmlout .= "<table class='table table-bordered'>\n";
    $htmlout .= "<tr><td colspan='11' class='colhead'>" . count($arr) . " {$name}</td></tr>" . "<tr><td class='colhead'>{$lang['peerslist_user_ip']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_uploaded']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead' align='right'>{$lang['peerslist_downloaded']}</td>") . "" . "" . ($INSTALLER09['ratio_free'] ? "" : "<td class='colhead' align='right'>{$lang['peerslist_rate']}</td>") . "" . "<td class='colhead' align='right'>{$lang['peerslist_ratio']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_complete']}</td>" . "<td class='colhead' align='right'>{$lang['peerslist_idle']}</td>" . "<td class='colhead' align='left'>{$lang['peerslist_client']}</td></tr>\n";
    $now = TIME_NOW;
    $mod = $CURUSER['class'] >= UC_STAFF;
    foreach ($arr as $e) {
        $htmlout .= "<tr>\n";
        $upspeed = $e["upspeed"] > 0 ? mksize($e["upspeed"]) : ($e["seedtime"] > 0 ? mksize($e["uploaded"] / ($e["seedtime"] + $e["leechtime"])) : mksize(0));
        $downspeed = $e["downspeed"] > 0 ? mksize($e["downspeed"]) : ($e["leechtime"] > 0 ? mksize($e["downloaded"] / $e["leechtime"]) : mksize(0));
        if ($e['username']) {
            if (($e['tanonymous'] == 'yes' && $e['owner'] == $e['uid'] || $e['anonymous'] == 'yes' or $e['paranoia'] >= 2 && $CURUSER['id'] != $e['uid']) && $CURUSER['class'] < UC_STAFF) {
                $htmlout .= "<td><b>Kezer Soze</b></td>\n";
            } else {
                $htmlout .= "<td><a href='userdetails.php?id=" . (int) $e['uid'] . "'><b>" . htmlsafechars($e['username']) . "</b></a></td>\n";
            }
        } else {
            $htmlout .= "<td>" . ($mod ? XBT_IP_CONVERT($e["ipa"]) : preg_replace('/\\.\\d+$/', ".xxx", XBT_IP_CONVERT($e["ipa"]))) . "</td>\n";
        }
        $htmlout .= "<td align='right'>" . mksize($e["uploaded"]) . "</td>\n";
        $htmlout .= "<td align='right'><span style=\"white-space: nowrap;\">" . htmlsafechars($upspeed) . "/s</span></td>\n";
        $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'>" . mksize($e["downloaded"]) . "</td>") . "\n";
        $htmlout .= "" . ($INSTALLER09['ratio_free'] ? "" : "<td align='right'><span style=\"white-space: nowrap;\">" . htmlsafechars($downspeed) . "/s</span></td>") . "\n";
        $htmlout .= "<td align=\"right\">" . member_ratio($e['uploaded'], $INSTALLER09['ratio_free'] ? "0" : $e['downloaded']) . "</td>\n";
        $htmlout .= "<td align='right'>" . sprintf("%.2f%%", 100 * (1 - $e["left"] / $torrent["size"])) . "</td>\n";
        $htmlout .= "<td align='right'>" . mkprettytime($now - $e["la"]) . "</td>\n";
        $htmlout .= "<td align='left'>" . htmlsafechars(getagent($e["peer_id"], $e['peer_id'])) . "</td>\n";
        $htmlout .= "</tr>\n";
    }
    $htmlout .= "</table>\n";
    return $htmlout;
}
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:38,代码来源:peerlist_xbt.php

示例10: foreach

    if (isset($free) && count($free) >= 1) {
        foreach ($free as $fl) {
            switch ($fl['modifier']) {
                case 1:
                    $mode = 'All Torrents Free';
                    break;
                case 2:
                    $mode = 'All Double Upload';
                    break;
                case 3:
                    $mode = 'All Torrents Free and Double Upload';
                    break;
                case 4:
                    $mode = 'All Torrents Silver';
                    break;
                default:
                    $mode = 0;
            }
            $htmlout .= $fl['modifier'] != 0 && $fl['expires'] > TIME_NOW ? '
     <li>
     <a class="sa-tooltip" href="#"><b class="btn btn-info btn-sm">' . $lang['gl_freeleech'] . '</b>
	 <span class="custom info alert alert-info"><em>' . $fl['title'] . '</em>
     ' . $mode . '<br />
     ' . $fl['message'] . ' ' . $lang['gl_freeleech_sb'] . ' ' . $fl['setby'] . '<br />' . ($fl['expires'] != 1 ? '' . $lang['gl_freeleech_u'] . ' ' . get_date($fl['expires'], 'DATE') . ' (' . mkprettytime($fl['expires'] - TIME_NOW) . ' ' . $lang['gl_freeleech_tg'] . ')' : '') . '  
     </span></a></li>' : '';
        }
    }
}
//=== free addon end
// End Class
// End File
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:31,代码来源:freeleech.php

示例11: get_date

<?php

//==Freeleech info
$HTMLOUT .= "<tr><td class='rowhead'>Freeleech Slots</td><td align='left'>" . (int) $user['freeslots'] . "</td></tr>";
$HTMLOUT .= "<tr><td class='rowhead'>Freeleech Status</td><td align='left'>" . ($user['free_switch'] != 0 ? 'FREE Status ' . ($user['free_switch'] > 1 ? 'Expires: ' . get_date($user['free_switch'], 'DATE') . ' (' . mkprettytime($user['free_switch'] - TIME_NOW) . ' to go) <br />' : 'Unlimited<br />') : 'None') . "</td></tr>";
//==end
// End Class
// End File
开发者ID:CharlieHD,项目名称:U-232-V3,代码行数:8,代码来源:freestuffs.php

示例12: torrenttable

function torrenttable($res, $variant = "index")
{
    global $TBDEV, $CURUSER, $lang, $free;
    $htmlout = '';
    /** ALL FREE/DOUBLE **/
    foreach ($free as $fl) {
        switch ($fl['modifier']) {
            case 1:
                $free_display = '[Free]';
                break;
            case 2:
                $free_display = '[Double]';
                break;
            case 3:
                $free_display = '[Free and Double]';
                break;
        }
        $all_free_tag = $fl['modifier'] != 0 && ($fl['expires'] > TIME_NOW || $fl['expires'] == 1) ? ' <a class="info" href="#">
            <b>' . $free_display . '</b> 
            <span>' . ($fl['expires'] != 1 ? '
            Expires: ' . get_date($fl['expires'], 'DATE') . '<br />
            (' . mkprettytime($fl['expires'] - time()) . ' to go)</span></a><br />' : 'Unlimited</span></a><br />') : '';
    }
    $prevdate = "";
    $count_get = 0;
    $oldlink = $char = $description = $type = $sort = $row = '';
    foreach ($_GET as $get_name => $get_value) {
        $get_name = strip_tags(str_replace(array("\"", "'"), array("", ""), $get_name));
        $get_value = strip_tags(str_replace(array("\"", "'"), array("", ""), $get_value));
        if ($get_name != "sort" && $get_name != "type") {
            if ($count_get > 0) {
                $oldlink = $oldlink . "&amp;" . $get_name . "=" . $get_value;
            } else {
                $oldlink = $oldlink . $get_name . "=" . $get_value;
            }
            $count_get++;
        }
    }
    if ($count_get > 0) {
        $oldlink = $oldlink . "&amp;";
    }
    $links = array('link1', 'link2', 'link3', 'link4', 'link5', 'link6', 'link7', 'link8', 'link9');
    $i = 1;
    foreach ($links as $link) {
        if (isset($_GET['sort']) && $_GET['sort'] == $i) {
            ${$link} = isset($_GET['type']) && $_GET['type'] == 'desc' ? 'asc' : 'desc';
        } else {
            ${$link} = 'desc';
        }
        $i++;
    }
    $htmlout .= "<table border='1' cellspacing='0' cellpadding='5'>\r\n   <tr>\r\n   <td class='colhead' align='center'>{$lang["torrenttable_type"]}</td>\r\n   <td class='colhead' align='left'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=1&amp;type={$link1}'>{$lang["torrenttable_name"]}</a></td>\r\n   <td class='colhead' align='left'><img src='" . $TBDEV['pic_base_url'] . "zip.gif' border='0' alt='Download' title='Download' /></td>";
    $htmlout .= $variant == 'index' ? "<td class='colhead' align='center'><a href='" . $TBDEV['baseurl'] . "/bookmarks.php'><img src='" . $TBDEV['pic_base_url'] . "bookmark.gif'  border='0' alt='Bookmark' title='Go To My Bookmarks' /></a></td>" : '';
    if ($variant == "mytorrents") {
        $htmlout .= "<td class='colhead' align='center'>{$lang["torrenttable_edit"]}</td>\n";
        $htmlout .= "<td class='colhead' align='center'>{$lang["torrenttable_visible"]}</td>\n";
    }
    $htmlout .= "<td class='colhead' align='right'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=2&amp;type={$link2}'>{$lang["torrenttable_files"]}</a></td>\r\n   <td class='colhead' align='right'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=3&amp;type={$link3}'>{$lang["torrenttable_comments"]}</a></td>\r\n   <td class='colhead' align='center'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=4&amp;type={$link4}'>{$lang["torrenttable_added"]}</a></td>\r\n   <td class='colhead' align='center'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=5&amp;type={$link5}'>{$lang["torrenttable_size"]}</a></td>\r\n   <td class='colhead' align='center'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=6&amp;type={$link6}'>{$lang["torrenttable_snatched"]}</a></td>\r\n   <td class='colhead' align='right'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=7&amp;type={$link7}'>{$lang["torrenttable_seeders"]}</a></td>\r\n   <td class='colhead' align='right'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=8&amp;type={$link8}'>{$lang["torrenttable_leechers"]}</a></td>";
    if ($variant == 'index') {
        $htmlout .= "<td class='colhead' align='center'><a href='{$TBDEV['baseurl']}/browse.php?{$oldlink}sort=9&amp;type={$link9}'>{$lang["torrenttable_uppedby"]}</a></td>\n";
    }
    $htmlout .= "</tr>\n";
    while ($row = mysql_fetch_assoc($res)) {
        $id = $row["id"];
        if ($row["sticky"] == "yes") {
            $htmlout .= "<tr class='highlight'>\n";
        } else {
            $htmlout .= "<tr>\n";
        }
        $htmlout .= "<td align='center' style='padding: 0px'>";
        if (isset($row["cat_name"])) {
            $htmlout .= "<a href='browse.php?cat={$row['category']}'>";
            if (isset($row["cat_pic"]) && $row["cat_pic"] != "") {
                $htmlout .= "<img border='0' src='{$TBDEV['pic_base_url']}caticons/{$row['cat_pic']}' alt='{$row['cat_name']}' />";
            } else {
                $htmlout .= $row["cat_name"];
            }
            $htmlout .= "</a>";
        } else {
            $htmlout .= "-";
        }
        $htmlout .= "</td>\n";
        $dispname = htmlspecialchars($row["name"]);
        $checked = !empty($row['checked_by']) && $CURUSER['class'] >= UC_USER ? "&nbsp;<img src='{$TBDEV['pic_base_url']}mod.gif' width='15' border='0' alt='Checked - by " . htmlspecialchars($row['checked_by']) . "' title='Checked - by " . htmlspecialchars($row['checked_by']) . "' />" : "";
        $poster = empty($row["poster"]) ? "<img src=\\'{$TBDEV['pic_base_url']}noposter.png\\' width=\\'150\\' height=\\'220\\' border=\\'0\\' alt=\\'Poster\\' title=\\'poster\\' />" : "<img src=\\'" . htmlspecialchars($row['poster']) . "\\' width=\\'150\\' height=\\'220\\' border=\\'0\\' alt=\\'Poster\\' title=\\'poster\\' />";
        if ($row["descr"]) {
            $descr = str_replace("\"", "&quot;", readMore($row["descr"], 350, "details.php?id=" . $row["id"] . "&amp;hit=1"));
        }
        $htmlout .= "<td align='left'><a href='details.php?";
        $htmlout .= "<td align='left'><a href='details.php?";
        if ($variant == "mytorrents") {
            $htmlout .= "returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "&amp;";
        }
        $htmlout .= "id={$id}";
        if ($variant == "index") {
            $htmlout .= "&amp;hit=1";
        }
        $sticky = $row['sticky'] == "yes" ? "<img src='{$TBDEV['pic_base_url']}sticky.gif' border='0' alt='Sticky' title='Sticky !' />" : "";
        $nuked = $row["nuked"] == "yes" ? "<img src='{$TBDEV['pic_base_url']}nuked.gif' style='border:none' alt='Nuked'  align='right' title='Reason :" . htmlspecialchars($row["nukereason"]) . "' />" : "";
        /** FREE Torrent **/
//.........这里部分代码省略.........
开发者ID:thefkboss,项目名称:U-232,代码行数:101,代码来源:torrenttable_functions.php

示例13: htmlsafechars

    $HTMLOUT .= "<div class='col-sm-10'><input class='form-control' placeholder='Nuke Reason' type='text' name='nukereason' value='" . htmlsafechars($row["nukereason"]) . "' /></div></div>";
}
$HTMLOUT .= "<br><div class='row'><div class='col-sm-12'></div></div>";
$HTMLOUT .= "<br><div class='row'>\n<div class='col-sm-4'>";
if ($CURUSER['class'] >= UC_STAFF && XBT_TRACKER == false) {
    $HTMLOUT .= tr("Free Leech", $row['free'] != 0 ? "<input type='checkbox' name='fl' value='1' /> Remove Freeleech" : "\n    <select name='free_length'>\n    <option value='0'>------</option>\n    <option value='42'>Free for 1 day</option>\n    <option value='1'>Free for 1 week</option>\n    <option value='2'>Free for 2 weeks</option>\n    <option value='4'>Free for 4 weeks</option>\n    <option value='8'>Free for 8 weeks</option>\n    <option value='255'>Unlimited</option>\n    </select>", 1);
    if ($row['free'] != 0) {
        $HTMLOUT .= "<br>";
        $HTMLOUT .= tr("Free Leech Duration", $row['free'] != 1 ? "Until " . get_date($row['free'], 'DATE') . " \n\t\t (" . mkprettytime($row['free'] - TIME_NOW) . " to go)" : 'Unlimited', 1);
    }
}
$HTMLOUT .= "</div>";
$HTMLOUT .= "<div class='col-sm-4'>";
$HTMLOUT .= tr("Silver torrent ", $row['silver'] != 0 ? "<input type='checkbox' name='slvr' value='1' /> Remove Silver torrent" : "\n    <select name='half_length'>\n    <option value='0'>------</option>\n    <option value='42'>Silver for 1 day</option>\n    <option value='1'>Silver for 1 week</option>\n    <option value='2'>Silver for 2 weeks</option>\n    <option value='4'>Silver for 4 weeks</option>\n    <option value='8'>Silver for 8 weeks</option>\n    <option value='255'>Unlimited</option>\n    </select>", 1);
if ($row['silver'] != 0) {
    $HTMLOUT .= tr("Silver Torrent Duration", $row['silver'] != 1 ? "Until " . get_date($row['silver'], 'DATE') . " \n\t\t (" . mkprettytime($row['silver'] - TIME_NOW) . " to go)" : 'Unlimited', 1);
}
$HTMLOUT .= "</div>";
// ===09 Allow Comments
if ($CURUSER['class'] >= UC_STAFF && $CURUSER['class'] == UC_MAX) {
    if ($row["allow_comments"] == "yes") {
        $messc = "&nbsp;<br>Comments are allowed for everyone on this torrent!";
    } else {
        $messc = "&nbsp;<br>Only staff members are able to comment on this torrent!";
    }
    $HTMLOUT .= "<div class='col-sm-4'><font color='red'>&nbsp;*&nbsp;</font><b>&nbsp;{$lang['edit_comment']}</b>\n    <select name='allow_comments'>\n    <option value='" . htmlsafechars($row["allow_comments"]) . "'>" . htmlsafechars($row["allow_comments"]) . "</option>\n    <option value='yes'>Yes</option><option value='no'>No</option></select>{$messc}\n";
}
// ===end
$HTMLOUT .= "</div></div>";
$HTMLOUT .= "<br><div class='row'><div class='col-sm-12'></div></div>";
$HTMLOUT .= "<div class='row'>";
开发者ID:Bigjoos,项目名称:U-232-V5,代码行数:31,代码来源:edit.php

示例14: get_date

     <option value="8">' . $lang['userdetails_warn8'] . '</option>
     <option value="255">' . $lang['userdetails_warninf'] . '</option>
     </select></td></tr>
     <tr><td colspan="2" align="left">' . $lang['userdetails_pm_comm'] . '<input type="text" size="60" name="warned_pm" /></td></tr>';
     }
 }
 //==End
 //==Games disable
 if ($CURUSER['class'] >= UC_STAFF) {
     $game_access = $user['game_access'] != 1;
     $HTMLOUT .= "<tr><td class='rowhead'" . (!$game_access ? ' rowspan="2"' : '') . ">{$lang['userdetails_games']}</td>\n           <td align='left' width='20%'>" . ($game_access ? "<input name='game_access' value='42' type='radio' />{$lang['userdetails_remove_game_d']}" : $lang['userdetails_no_disablement']) . "</td>\n";
     if ($game_access) {
         if ($user['game_access'] == 0) {
             $HTMLOUT .= '<td align="center">(' . $lang['userdetails_unlimited_d'] . ')</td></tr>';
         } else {
             $HTMLOUT .= "<td align='center'>{$lang['userdetails_until']} " . get_date($user['game_access'], 'DATE') . " (" . mkprettytime($user['game_access'] - TIME_NOW) . " {$lang['userdetails_togo']})</td></tr>";
         }
     } else {
         $HTMLOUT .= '<td>' . $lang['userdetails_disable_for'] . ' <select name="game_access">
     <option value="0">------</option>
     <option value="1">1 ' . $lang['userdetails_week'] . '</option>
     <option value="2">2 ' . $lang['userdetails_weeks'] . '</option>
     <option value="4">4 ' . $lang['userdetails_weeks'] . '</option>
     <option value="8">8 ' . $lang['userdetails_weeks'] . '</option>
     <option value="255">' . $lang['userdetails_unlimited'] . '</option>
     </select></td></tr>
     <tr><td colspan="2" align="left">' . $lang['userdetails_pm_comment'] . ':<input type="text" size="60" name="game_disable_pm" /></td></tr>';
     }
 }
 if (XBT_TRACKER == true) {
     // == Wait time
开发者ID:UniversalAdministrator,项目名称:U-232-V4,代码行数:31,代码来源:userdetails.php

示例15: torrenttable

function torrenttable($res, $variant = "index")
{
    global $INSTALLER09, $CURUSER, $lang, $free, $mc1;
    require_once INCL_DIR . 'bbcode_functions.php';
    $htmlout = $prevdate = $free_slot = $free_color = $slots_check = $double_slot = $private = $newgenre = $oldlink = $char = $description = $type = $sort = $row = $youtube = '';
    $count_get = 0;
    /** ALL FREE/DOUBLE **/
    foreach ($free as $fl) {
        switch ($fl['modifier']) {
            case 1:
                $free_display = '[Free]';
                break;
            case 2:
                $free_display = '[Double]';
                break;
            case 3:
                $free_display = '[Free and Double]';
                break;
            case 4:
                $free_display = '[Silver]';
                break;
        }
        $slot = make_freeslots($CURUSER['id'], 'fllslot_');
        $book = make_bookmarks($CURUSER['id'], 'bookmm_');
        $all_free_tag = $fl['modifier'] != 0 && ($fl['expires'] > TIME_NOW || $fl['expires'] == 1) ? ' <a class="info" href="#">
            <b>' . $free_display . '</b> 
            <span>' . ($fl['expires'] != 1 ? '
            Expires: ' . get_date($fl['expires'], 'DATE') . '<br />
            (' . mkprettytime($fl['expires'] - TIME_NOW) . ' to go)</span></a><br />' : 'Unlimited</span></a><br />') : '';
    }
    $oldlink = array();
    foreach ($_GET as $key => $var) {
        if (in_array($key, array('sort', 'type'))) {
            continue;
        }
        if (is_array($var)) {
            foreach ($var as $s_var) {
                $oldlink[] = sprintf('%s=%s', urlencode($key) . '%5B%5D', urlencode($s_var));
            }
        } else {
            $oldlink[] = sprintf('%s=%s', urlencode($key), urlencode($var));
        }
    }
    $oldlink = !empty($oldlink) ? join('&amp;', array_map('htmlsafechars', $oldlink)) . '&amp;' : '';
    $links = array('link1', 'link2', 'link3', 'link4', 'link5', 'link6', 'link7', 'link8', 'link9');
    $i = 1;
    foreach ($links as $link) {
        if (isset($_GET['sort']) && $_GET['sort'] == $i) {
            ${$link} = isset($_GET['type']) && $_GET['type'] == 'desc' ? 'asc' : 'desc';
        } else {
            ${$link} = 'desc';
        }
        $i++;
    }
    $htmlout .= "<!--<div class='global_icon'><img src='images/global.design/torrents.png' alt='' title='Categorys' class='global_image' width='25'/></div>\n    <div class='global_head'>Torrents</div><br />\n    <div class='global_text'><br />-->\n   <table border='1' cellspacing='0' cellpadding='5'>\n   <tr>\n   <td class='colhead' align='center'>{$lang["torrenttable_type"]}</td>\n   <td class='colhead' align='left'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=1&amp;type={$link1}'>{$lang["torrenttable_name"]}</a></td>\n   <td class='colhead' align='left'><img src='{$INSTALLER09['pic_base_url']}zip.gif' border='0' alt='Download' title='Download' /></td>";
    $htmlout .= $variant == 'index' ? "<td class='colhead' align='center'><a href='{$INSTALLER09['baseurl']}/bookmarks.php'><img src='{$INSTALLER09['pic_base_url']}bookmarks.png'  border='0' alt='Bookmark' title='Go To My Bookmarks' /></a></td>" : '';
    if ($variant == "mytorrents") {
        $htmlout .= "<td class='colhead' align='center'>{$lang["torrenttable_edit"]}</td>\n";
        $htmlout .= "<td class='colhead' align='center'>{$lang["torrenttable_visible"]}</td>\n";
    }
    $htmlout .= "<td class='colhead' align='right'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=2&amp;type={$link2}'>{$lang["torrenttable_files"]}</a></td>\n   <td class='colhead' align='right'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=3&amp;type={$link3}'>{$lang["torrenttable_comments"]}</a></td>\n   <td class='colhead' align='center'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=4&amp;type={$link4}'>{$lang["torrenttable_added"]}</a></td>\n   <td class='colhead' align='center'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=5&amp;type={$link5}'>{$lang["torrenttable_size"]}</a></td>\n   <td class='colhead' align='center'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=6&amp;type={$link6}'>{$lang["torrenttable_snatched"]}</a></td>\n   <td class='colhead' align='right'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=7&amp;type={$link7}'>{$lang["torrenttable_seeders"]}</a></td>\n   <td class='colhead' align='right'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=8&amp;type={$link8}'>{$lang["torrenttable_leechers"]}</a></td>";
    if ($variant == 'index') {
        $htmlout .= "<td class='colhead' align='center'><a href='{$_SERVER["PHP_SELF"]}?{$oldlink}sort=9&amp;type={$link9}'>{$lang["torrenttable_uppedby"]}</a></td>\n";
    }
    $htmlout .= "</tr>\n";
    $categories = genrelist();
    foreach ($categories as $key => $value) {
        $change[$value['id']] = array('id' => $value['id'], 'name' => $value['name'], 'image' => $value['image']);
    }
    while ($row = mysqli_fetch_assoc($res)) {
        //== @author StarionTurbo @copyright 2007 @modname Show torrents by day @version v1.0
        if ($CURUSER['split'] == 'yes') {
            if (get_date($row['added'], 'DATE') == $prevdate) {
                $cleandate = '';
            } else {
                $htmlout .= "<tr><td colspan='12' class='colhead' align='left'><b>{$lang['torrenttable_upped']} " . get_date($row['added'], 'DATE') . "</b></td></tr>";
            }
            $prevdate = get_date($row['added'], 'DATE');
        }
        $row['cat_name'] = htmlsafechars($change[$row['category']]['name']);
        $row['cat_pic'] = htmlsafechars($change[$row['category']]['image']);
        /** Freeslot/doubleslot in Use **/
        $id = $row["id"];
        foreach ($slot as $sl) {
            $slots_check = ($sl['torrentid'] == $id && $sl['free'] == 'yes' or $sl['doubleup'] == 'yes');
        }
        if ($row["sticky"] == "yes") {
            $htmlout .= "<tr class='highlight'>\n";
        } else {
            $htmlout .= '<tr class="' . ($free_color && $all_free_tag != '' || $row['free'] != 0 || $slots_check ? 'freeleech_color' : 'browse_color') . '">';
        }
        $htmlout .= "<td align='center' style='padding: 0px'>";
        if (isset($row["cat_name"])) {
            $htmlout .= "<a href='browse.php?cat=" . (int) $row['category'] . "'>";
            if (isset($row["cat_pic"]) && $row["cat_pic"] != "") {
                $htmlout .= "<img border='0' src='{$INSTALLER09['pic_base_url']}caticons/{$CURUSER['categorie_icon']}/{$row['cat_pic']}' alt='{$row['cat_name']}' />";
            } else {
                $htmlout .= htmlsafechars($row["cat_name"]);
            }
            $htmlout .= "</a>";
//.........这里部分代码省略.........
开发者ID:CharlieHD,项目名称:U-232-V3,代码行数:101,代码来源:torrenttable_functions.php


注:本文中的mkprettytime函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。