Example #1
0
unset($resuploaded);
$utorrents = intval($CURUSER["torrentsperpage"]);
if ($numtorrent > 0) {
    list($pagertop, $pagerbottom, $limit) = pager($utorrents == 0 ? 15 : $utorrents, $numtorrent, "index.php?page=usercp&uid={$uid}&", array("pagename" => "ucp_uploaded"));
    $usercptpl->set("pagertop", $pagertop);
    $resuploaded = get_result("SELECT f.filename, UNIX_TIMESTAMP(f.data) as added, f.size, {$tseeds} as seeds, {$tleechs} as leechers, {$tcompletes} as finished, f.info_hash as hash FROM {$ttables} WHERE uploader={$uid} ORDER BY data DESC {$limit}", true, $btit_settings['cache_duration']);
}
if ($resuploaded && count($resuploaded) > 0) {
    include "include/offset.php";
    $usercptpl->set("RESULTS", true, true);
    $uptortpl = array();
    $i = 0;
    foreach ($resuploaded as $id => $rest) {
        $uptortpl[$i]["filename"] = cut_string(unesc($rest["filename"]), intval($btit_settings["cut_name"]));
        $uptortpl[$i]["added"] = date("d/m/Y", $rest["added"] - $offset);
        $uptortpl[$i]["moder"] = getmoderdetails(getmoderstatusbyhash($rest['hash']), $rest['hash']);
        $uptortpl[$i]["size"] = makesize($rest["size"]);
        $uptortpl[$i]["seedcolor"] = linkcolor($rest["seeds"]);
        $uptortpl[$i]["seeds"] = $rest[seeds];
        $uptortpl[$i]["leechcolor"] = linkcolor($rest["leechers"]);
        $uptortpl[$i]["leechers"] = $rest[leechers];
        $uptortpl[$i]["completed"] = $rest["finished"] > 0 ? $rest["finished"] : "---";
        $uptortpl[$i]["editlink"] = "index.php?page=edit&info_hash=" . $rest["hash"] . "&returnto=" . urlencode("index.php?page=torrents") . "";
        $uptortpl[$i]["dellink"] = "index.php?page=delete&info_hash=" . $rest["hash"] . "&returnto=" . urlencode("index.php?page=torrents") . "";
        $uptortpl[$i]["editimg"] = image_or_link("{$STYLEPATH}/images/edit.png", "", $language["EDIT"]);
        $uptortpl[$i]["delimg"] = image_or_link("{$STYLEPATH}/images/delete.png", "", $language["DELETE"]);
        $i++;
    }
    $usercptpl->set("uptor", $uptortpl);
} else {
    $usercptpl->set("RESULTS", false, true);
Example #2
0
     if ($torlist['downloaded'] > 0) {
         $peerratio = number_format($torlist['uploaded'] / $torlist['downloaded'], 2);
     } else {
         $peerratio = '∞';
     }
     $tortpl[$i]["peerratio"] = unesc($peerratio);
     $tortpl[$i]["seedscolor"] = linkcolor($torlist['seeds']);
     $tortpl[$i]["seeds"] = "<a href=\"javascript:poppeer('index.php?page=peers&amp;id=" . $torlist['infohash'] . "')\">" . $torlist['seeds'] . "</a>";
     $tortpl[$i]["leechcolor"] = linkcolor($torlist['leechers']);
     $tortpl[$i]["leechs"] = "<a href=\"javascript:poppeer('index.php?page=peers&amp;id=" . $torlist['infohash'] . "')\">" . $torlist['leechers'] . "</a>";
     $tortpl[$i]["completed"] = "<a href=\"javascript:poppeer('index.php?page=torrent_history.php&amp;id=" . $torlist['infohash'] . "')\">" . $torlist['finished'] . "</a>";
     $i++;
     $userdetailtpl->set("tortpl", $tortpl);
 } else {
     $tortpl[$i]["filename"] = "<a href=\"index.php?page=torrent-details&amp;id=" . $torlist['infohash'] . "\" title=\"" . $language["VIEW_DETAILS"] . ": " . $torlist['filename'] . "\">" . $filename . "</a>";
     getmoderdetails(getmoderstatusbyhash($torlist->infohash), $torlist->infohash);
     $tortpl[$i]["size"] = makesize($torlist['size']);
     $tortpl[$i]["status"] = unesc($torlist['status']);
     $tortpl[$i]["downloaded"] = makesize($torlist['downloaded']);
     $tortpl[$i]["uploaded"] = makesize($torlist['uploaded']);
     if ($torlist['downloaded'] > 0) {
         $peerratio = number_format($torlist['uploaded'] / $torlist['downloaded'], 2);
     } else {
         $peerratio = '&#8734;';
     }
     $tortpl[$i]["peerratio"] = unesc($peerratio);
     $tortpl[$i]["seedscolor"] = linkcolor($torlist['seeds']);
     $tortpl[$i]["seeds"] = "<a href=\"index.php?page=peers&amp;id=" . $torlist['infohash'] . "\">" . $torlist['seeds'] . "</a>";
     $tortpl[$i]["leechcolor"] = linkcolor($torlist['leechers']);
     $tortpl[$i]["leechs"] = "<a href=\"index.php?page=peers&amp;id=" . $torlist['infohash'] . "\">" . $torlist['leechers'] . "</a>";
     $tortpl[$i]["completed"] = "<a href=\"index.php?page=torrent_history&amp;id=" . $torlist['infohash'] . "\">" . $torlist['finished'] . "</a>";