function DISPLAY_show_torrent($torrent) { if (!($link = db_init(true))) { break; } $result = mysqli_query($link, 'SELECT * FROM `users` WHERE `id`=' . mysqli_real_escape_string($link, $torrent['uploader']) . ';'); $uploader = @mysqli_fetch_all($result, MYSQLI_ASSOC)[0]; $uploader = is_array($uploader) ? $uploader['username'] : '******'; mysqli_free_result($result); mysqli_close($link); unset($link); echo '<tr>'; echo '<td><a href="info.php?id=' . $torrent['id'] . '"><b>' . $torrent['torrentname'] . '</b></a></td>'; echo '<td><a href="user.php?id=' . $torrent['uploader'] . '"><i>' . $uploader . '</a></i></td>'; echo '<td>' . getHumanDate(new DateTime($torrent['created']), new DateTime(date('Y-n-d H:i:s', time()))) . '</td>'; echo '<td>' . getHumanFilesize(getTorrent(unserialize(_CONFIG)['torrents']['dir'] . DIRECTORY_SEPARATOR . $torrent['filename'] . '.torrent')->size()) . '</td>'; echo '<td>' . $torrent['downloads'] . '</td>'; echo '<td><font color="green">TBD</font></td>'; echo '<td><font color="blue">TBD</font></td>'; echo '</tr>'; }
if (is_array($user)) { echo '<a href="user.php?id=' . $user['id'] . '">' . $user['username'] . '</a>'; } else { echo '<i>Deleted user</i>'; } ?> </td> </tr> </tbody> </table> <br> <h5>Contents</h5> <ul class="collection"> <?php foreach ($explode->content() as $file => $size) { echo '<li class="collection-item">' . $file . '<a class="secondary-content">' . getHumanFilesize($size, 2) . '</a></li>'; } ?> </ul> <br> <h5>Description</h5> <blockquote> <?php echo (bool) unserialize(_CONFIG)['descriptions']['monospace'] ? '<pre>' : ''; echo file_get_contents(unserialize(_CONFIG)['descriptions']['dir'] . DIRECTORY_SEPARATOR . $torrent['filename']); echo (bool) unserialize(_CONFIG)['descriptions']['monospace'] ? '</pre>' : ''; ?> </blockquote> <br> <h5>Download</h5> <a title="Download .torrent"