= 30
SQL;
$subres = mysqli_query($mysqli, $query);
$subrow = mysqli_fetch_assoc($subres);
if ($subrow['downloadcount'] > 0) {
?>
10 day statistics (= $subrow['downloadcount'] ?> downloads)
Average Time |
= mkprettytime2((int) $subrow['avgdownloadtime']) ?> |
Average Speed |
= mksize($size / $subrow['avgdownloadtime']) ?>/s |
Best Time |
= mkprettytime2((int) $subrow['mindownloadtime']) ?> |
Best Speed |
= mksize($size / $subrow['mindownloadtime']) ?>/s |
Worst Time |
= mkprettytime2((int) $subrow['maxdownloadtime']) ?> |
Worst Speed |
= mksize($size / $subrow['maxdownloadtime']) ?>/s |
= UC_MODERATOR) {
$owned = $moderator = 1;
} elseif ($user_id !== null && $user_id === (int)$row["owner"]) {
$owned = 1;
}
if (!$row || ($row["banned"] === "yes" && !$moderator && !$dmca)) {
stdnotfound("Error", "No torrent exists with that ID or you don't have permission to view it.");
}
if ($_GET["hit"]) {
mysqli_query($mysqli, "UPDATE torrents SET views = views + 1 WHERE id = $id");
}
if ($CURUSER["id"] == $row["owner"] || get_user_class() >= UC_MODERATOR) {
$owned = 1;
} else {
$owned = 0;
}
$url = "/edit/$info_hash";
if (isset($_GET["returnto"])) {
$addthis = "&returnto=" . urlencode($_GET["returnto"]);
$url .= $addthis;
$keepget .= $addthis;
}
$editlink = "a href=\"$url\" class=\"sublink\"";
// get author info
prof_flag("Get authors");
$authors_str = "";
$authors_str_ascii = "";
if (!empty($row["authors"])) {
$authors_raw = $row["authors"];
$authors = array_map('trim', explode(" and ", $authors_raw));
if ($authors) {
$author_links = array();
$author_names = array();
foreach ($authors as $author) {
$safe_author = htmlspecialchars($author);
$author_links[] = "" . $safe_author . "";
$author_names[] = $safe_author;
}
$authors_str = implode(" and ", $author_links);
$authors_str_ascii = implode(" and ", $author_names);
}
} else {
// old format
prof_flag("Select authors");
$authors = mysqli_query($mysqli, "SELECT authorid, name FROM authors_group WHERE authorid in (SELECT authorid FROM torrents_authors WHERE torrentid = $id)") or die("Error with authors" . logerror("Details Query", mysqli_error($mysqli)));
$author_links = array();
$author_names = array();
while ($subrow = mysqli_fetch_assoc($authors)) {
if (trim($subrow["name"]) !== "") {
$safe_name = htmlspecialchars($subrow["name"]);
$author_links[] = "" . $safe_name . "";
$author_names[] = $safe_name;
}
}
$authors_str = implode(" and ", $author_links);
$authors_str_ascii = implode(" and ", $author_names);
}
$title = htmlspecialchars($row["name"]);
$description = htmlspecialchars($row["descr"]);
prof_flag("Parse bibtex");
require_once("res/bibtex/BibtexParser.php");
try {
$bibtex_parsed = BibtexParser::parse_string($description);
$bibtex_abstract = $bibtex_parsed[0]["abstract"];
$bibtex_license = $bibtex_parsed[0]["license"];
} catch (Exception $e) {
logerror("details", "bibtext not parsed correctly, {$info_hash} {$e}");
$bibtex_abstract = $description;
}
if (substr($bibtex_license, 0, 4) != "http") {
$bibtex_license = "https://academictorrents.com/nolicensespecified";
}
$bibtex_abstract = substr($bibtex_abstract, 0, 1000);
$bibtex_abstract = addslashes($bibtex_abstract);
if ($bibtex_abstract == "") {
$bibtex_abstract = $title;
}
// remove urls from description text
$bibtex_abstract = preg_replace('/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', '', $bibtex_abstract);
if (strlen($bibtex_abstract) < 60) {
$bibtex_abstract = "A BitTorrent file to download data with the title '" . $title . "'";
}
if ($authors_str_ascii == "") {
$authors_str_ascii = "None";
}
$torrenttype = $row["cat_name"];
if ($torrenttype == "Course") {
$torrenttype = "Dataset";
}
$meta = <<
META;
$pagetitle = $title;
if ($_GET['target'] == 'tech') {
$pagetitle .= " - Technical";
} else if ($_GET['target'] == 'comments') {
$pagetitle .= " - Comments";
} else if ($_GET['target'] == 'collections') {
$pagetitle .= " - Collections";
}
if ($row["private"] == "1") {
// don't index private torrents
$meta .= '';
}
$pattern = '/https?:\/\/[^( |\n)]+?(?:\.jpg|\.png|\.gif)/';
preg_match($pattern, $description, $matches);
if (count($matches) > 0) {
$imgurl = $matches[0];
}
prof_flag("Write header");
setCacheControlShorter();
stdhead($pagetitle, true, $meta, $imgurl);
$info_hash_db = db_to_infohash($row["info_hash"]);
// get comment count to display
$subres = mysqli_query($mysqli, "SELECT COUNT(*) as cnt FROM comments WHERE torrent = $id");
$subrow = mysqli_fetch_assoc($subres);
$commentcount = $subrow ? $subrow['cnt'] : 0;
?>
Collection created, now you can add to this collection.
Your search for " = htmlspecialchars($_GET["searched"]) ?> gave a single result:
Rating added!