123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789 |
- <?php
- #declare(strict_types = 1);
-
- function compare($X, $Y)
- {
- return($Y['count'] - $X['count']);
- }
-
- // Build the data for the collage and the torrent list
- // todo: Cache this
- $DB->query("
- SELECT
- ct.`GroupID`,
- ct.`UserID`
- FROM `collages_torrents` AS ct
- JOIN `torrents_group` AS tg ON tg.`ID` = ct.`GroupID`
- WHERE ct.`CollageID` = '$CollageID'
- ORDER BY ct.`Sort`
- ");
-
- $GroupIDs = $DB->collect('GroupID');
- $Contributors = $DB->to_pair('GroupID', 'UserID', false);
-
- if (count($GroupIDs) > 0) {
- $TorrentList = Torrents::get_groups($GroupIDs);
- } else {
- $TorrentList = [];
- }
-
- // Loop through the result set, building up $Collage and $TorrentTable
- // Then we print them.
- $Collage = [];
- $TorrentTable = '';
-
- $NumGroups = count($TorrentList);
- $NumGroupsByUser = 0;
- $TopArtists = [];
- $UserAdditions = [];
- $Number = 0;
-
- foreach ($GroupIDs as $GroupID) {
- if (!isset($TorrentList[$GroupID])) {
- continue;
- }
-
- $Group = $TorrentList[$GroupID];
- extract(Torrents::array_group($Group));
- $UserID = $Contributors[$GroupID];
- $TorrentTags = new Tags($tag_list);
-
- // Handle stats and stuff
- $Number++;
- if ($UserID === $LoggedUser['ID']) {
- $NumGroupsByUser++;
- }
-
- $CountArtists = $Artists;
- if ($CountArtists) {
- foreach ($CountArtists as $Artist) {
- if (!isset($TopArtists[$Artist['id']])) {
- $TopArtists[$Artist['id']] = array('name' => $Artist['name'], 'count' => 1);
- } else {
- $TopArtists[$Artist['id']]['count']++;
- }
- }
- }
-
- if (!isset($UserAdditions[$UserID])) {
- $UserAdditions[$UserID] = 0;
- }
- $UserAdditions[$UserID]++;
-
- $DisplayName = "$Number. ";
- $DisplayName .= "<a class='torrent_title' href='torrents.php?id=$GroupID' ";
-
- if (!isset($LoggedUser['CoverArt']) || $LoggedUser['CoverArt']) {
- $DisplayName .= 'data-cover="'.ImageTools::process($picture, 'thumb').'" ';
- }
-
- $title = empty($title) ? (empty($subject) ? $object : $subject) : $title;
- $DisplayName .= "dir='ltr'>$title</a>";
-
- # Year
- if ($published) {
- $Label = '<br />📅 ';
- $DisplayName .= $Label."<a href='torrents.php?action=search&year=$published'>$published</a>";
- }
-
- # Studio
- if ($workgroup) {
- $Label = ' 📍 ';
- $DisplayName .= $Label."<a href='torrents.php?action=search&location=$workgroup'>$workgroup</a>";
- }
-
- # Catalogue Number
- if ($identifier) {
- $Label = ' 🔑 ';
- $DisplayName .= $Label."<a href='torrents.php?action=search&numbers=$identifier'>$identifier</a>";
- }
-
- # Authors
- if ($Artists) {
- # Emoji in classes/astists.class.php
- $Label = ' ';
- $DisplayName .= $Label.'<div class="torrent_artists">'.Artists::display_artists($Artists).'</div>';
- }
-
- $SnatchedGroupClass = ($GroupFlags['IsSnatched'] ? ' snatched_group' : '');
- // Start an output buffer, so we can store this output in $TorrentTable
- ob_start();
-
- if (count($Torrents) > 1) {
- // Grouped torrents
- $ShowGroups = !(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] === 1); ?>
-
- <tr class="group <?=$SnatchedGroupClass?>"
- id="group_<?=$GroupID?>">
- <td class="center">
- <div id="showimg_<?=$GroupID?>"
- class="<?=($ShowGroups ? 'hide' : 'show')?>_torrents">
- <a class="tooltip show_torrents_link"
- onclick="toggle_group(<?=$GroupID?>, this, event);"
- title="Collapse this group. Hold "Ctrl" while clicking to collapse all groups on this page."></a>
- </div>
- </td>
-
- <td class="center">
- <div title="<?=$TorrentTags->title()?>"
- class="tooltip <?=Format::css_category($GroupCategoryID)?> <?=$TorrentTags->css_name()?>">
- </div>
- </td>
-
- <td colspan="5">
- <?=$DisplayName?>
- <?php if (Bookmarks::has_bookmarked('torrent', $GroupID)) { ?>
- <span class="remove_bookmark float_right">
- <a class="float_right" href="#"
- id="bookmarklink_torrent_<?=$GroupID?>"
- class="remove_bookmark brackets"
- onclick="Unbookmark('torrent', <?=$GroupID?>, 'Bookmark'); return false;">Remove
- bookmark</a>
- </span>
- <?php } else { ?>
- <span class="add_bookmark float_right">
- <a class="float_right" href="#"
- id="bookmarklink_torrent_<?=$GroupID?>"
- class="add_bookmark brackets"
- onclick="Bookmark('torrent', <?=$GroupID?>, 'Remove bookmark'); return false;">Bookmark</a>
- </span>
- <?php
- } ?>
- <div class="tags"><?=$TorrentTags->format()?>
- </div>
- </td>
- </tr>
-
- <?php
- foreach ($Torrents as $TorrentID => $Torrent) {
- $SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : ''; ?>
- <tr
- class="group_torrent torrent_row groupid_<?=$GroupID?> <?=$SnatchedTorrentClass . $SnatchedGroupClass . (!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping'] === 1 ? ' hidden' : '')?>">
-
- <td colspan="3">
- <span class="brackets">
- <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>"
- class="tooltip" title="Download">DL</a>
- <?php if (Torrents::can_use_token($Torrent)) { ?>
- | <a
- href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1"
- class="tooltip" title="Use a FL Token"
- onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
- <?php } ?>
- | <a href="reportsv2.php?action=report&id=<?=$TorrentID?>"
- class="tooltip" title="Report">RP</a>
- </span>
- »
- <a
- href="torrents.php?id=<?=$GroupID?>&torrentid=<?=$TorrentID?>"><?=Torrents::torrent_info($Torrent)?></a>
- </td>
-
- <td class="number_column nobr">
- <?=Format::get_size($Torrent['Size'])?>
- </td>
-
- <td class="number_column">
- <?=number_format($Torrent['Snatched'])?>
- </td>
-
- <td
- class="number_column<?=(($Torrent['Seeders'] === 0) ? ' r00' : '')?>">
- <?=number_format($Torrent['Seeders'])?>
- </td>
-
- <td class="number_column"><?=number_format($Torrent['Leechers'])?>
- </td>
- </tr>
-
- <?php
- }
- } else {
- // Viewing a type that does not require grouping
- $Data = current($Torrents);
- $ExtraInfo = Torrents::torrent_info($Data, true, true);
- $DisplayName .= "<span style='font-weight: normal;'>$ExtraInfo</span>";
-
- /*
- $TorrentID = key($Torrents);
- $Torrent = current($Torrents);
-
- if ($Torrent['IsLeeching']) {
- $DisplayName .= ' ' . Format::torrent_label('Leeching', 'important_text');
- } elseif ($Torrent['IsSeeding']) {
- $DisplayName .= ' ' . Format::torrent_label('Seeding', 'important_text_alt');
- } elseif ($Torrent['IsSnatched']) {
- $DisplayName .= ' ' . Format::torrent_label('Snatched', 'bold');
- }
-
- if ($Torrent['FreeTorrent'] == '1') {
- $DisplayName .= ' | ' . Format::torrent_label('Freeleech!', 'important_text_alt');
- } elseif ($Torrent['FreeTorrent'] == '2') {
- $DisplayName .= ' | ' . Format::torrent_label('Neutral Leech!', 'bold');
- } elseif ($Torrent['PersonalFL']) {
- $DisplayName .= ' | ' . Format::torrent_label('Personal Freeleech!', 'important_text_alt');
- }
-
- $SnatchedTorrentClass = ($Torrent['IsSnatched'] ? ' snatched_torrent' : ''); ?>
- */ ?>
-
- <tr
- class="torrent torrent_row<?=$SnatchedTorrentClass . $SnatchedGroupClass?>"
- id="group_<?=$GroupID?>">
- <td></td>
-
- <td class="center">
- <div title="<?=$TorrentTags->title()?>"
- class="tooltip <?=Format::css_category($GroupCategoryID)?> <?=$TorrentTags->css_name()?>">
- </div>
- </td>
-
- <td>
- <span class="brackets">
- <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>"
- class="tooltip" title="Download">DL</a>
- <?php if (Torrents::can_use_token($Torrent)) { ?>
- | <a
- href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1"
- class="tooltip" title="Use a FL Token"
- onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
- <?php } ?>
- | <a href="reportsv2.php?action=report&id=<?=$TorrentID?>"
- class="tooltip" title="Report">RP</a>
- </span>
- <?=$DisplayName?>
- <div class="tags"><?=$TorrentTags->format()?>
- </div>
- </td>
-
- <td class="number_column nobr">
- <?=Format::get_size($Torrent['Size'])?>
- </td>
-
- <td class="number_column">
- <?=number_format($Torrent['Snatched'])?>
- </td>
-
- <td
- class="number_column<?=(($Torrent['Seeders'] === 0) ? ' r00' : '')?>">
- <?=number_format($Torrent['Seeders'])?>
- </td>
-
- <td class="number_column">
- <?=number_format($Torrent['Leechers'])?>
- </td>
- </tr>
-
- <?php
- }
- $TorrentTable .= ob_get_clean();
-
- // Album art
-
- ob_start();
-
- $DisplayName = '';
-
- #$DisplayName .= Artists::display_artists($Artists, false);
- $DisplayName .= $title;
-
- if ($GroupYear > 0) {
- $DisplayName = "$DisplayName [$GroupYear]";
- }
-
- $Tags = display_str($TorrentTags->format());
- $PlainTags = implode(', ', $TorrentTags->get_tags()); ?>
-
- <div class="collage_image image_group_<?=$GroupID?>">
- <a href="torrents.php?id=<?=$GroupID?>">
- <?php if (!$picture) {
- $picture = STATIC_SERVER.'common/noartwork/music.png';
- } ?>
- <img class="tooltip_interactive"
- src="<?=ImageTools::process($picture, 'thumb')?>"
- alt="<?=$DisplayName?>"
- title="<?=$DisplayName?>"
- data-title-plain="<?="$DisplayName ($PlainTags)"?>"
- width="100%" />
- </a>
- </div>
-
- <?php
- $Collage[] = ob_get_clean();
- }
-
- if ($CollageCategoryID === '0' && !check_perms('site_collages_delete')) {
- if (!check_perms('site_collages_personal') || $CreatorID !== $LoggedUser['ID']) {
- $PreventAdditions = true;
- }
- }
-
- if (!check_perms('site_collages_delete')
- && (
- $Locked
- || ($MaxGroups > 0 && $NumGroups >= $MaxGroups)
- || ($MaxGroupsPerUser > 0 && $NumGroupsByUser >= $MaxGroupsPerUser)
- )
- ) {
- $PreventAdditions = true;
- }
-
- // Silly hack for people who are on the old setting
- $CollageCovers = isset($LoggedUser['CollageCovers']) ? $LoggedUser['CollageCovers'] : 25 * (abs($LoggedUser['HideCollage'] - 1));
- $CollagePages = [];
-
- if ($CollageCovers) {
- for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) {
- $Groups = array_slice($Collage, $i * $CollageCovers, $CollageCovers);
- $CollagePage = '';
- foreach ($Groups as $Group) {
- $CollagePage .= $Group;
- }
- $CollagePages[] = $CollagePage;
- }
- }
-
- View::show_header(
- $Name,
- 'browse,collage,bbcode,recommend,wall'
- );
- ?>
-
- <div>
- <div class="header">
- <h2><?=$Name?>
- </h2>
- <div class="linkbox">
- <a href="collages.php" class="brackets">List of collections</a>
- <?php if (check_perms('site_collages_create')) { ?>
- <a href="collages.php?action=new" class="brackets">New collection</a>
- <?php } ?>
- <br /><br />
- <?php if (check_perms('site_collages_subscribe')) { ?>
- <a href="#" id="subscribelink<?=$CollageID?>" class="brackets"
- onclick="CollageSubscribe(<?=$CollageID?>); return false;"><?=(in_array($CollageID, $CollageSubscriptions) ? 'Unsubscribe' : 'Subscribe')?></a>
- <?php
- }
- if (check_perms('site_collages_delete') || (check_perms('site_edit_wiki') && !$Locked)) {
- ?>
- <a href="collages.php?action=edit&collageid=<?=$CollageID?>"
- class="brackets">Edit description</a>
- <?php
- } else { ?>
- <span class="brackets">Locked</span>
- <?php
- }
- if (Bookmarks::has_bookmarked('collage', $CollageID)) {
- ?>
- <a href="#" id="bookmarklink_collage_<?=$CollageID?>"
- class="brackets"
- onclick="Unbookmark('collage', <?=$CollageID?>, 'Bookmark'); return false;">Remove
- bookmark</a>
- <?php
- } else { ?>
- <a href="#" id="bookmarklink_collage_<?=$CollageID?>"
- class="brackets"
- onclick="Bookmark('collage', <?=$CollageID?>, 'Remove bookmark'); return false;">Bookmark</a>
- <?php } ?>
- <!-- <a href="#" id="recommend" class="brackets">Recommend</a> -->
- <?php
- if (check_perms('site_collages_manage') && !$Locked) {
- ?>
- <a href="collages.php?action=manage&collageid=<?=$CollageID?>"
- class="brackets">Manage torrents</a>
- <?php
- } ?>
- <a href="reports.php?action=report&type=collage&id=<?=$CollageID?>"
- class="brackets">Report collection</a>
- <?php if (check_perms('site_collages_delete') || $CreatorID == $LoggedUser['ID']) { ?>
- <a href="collages.php?action=delete&collageid=<?=$CollageID?>&auth=<?=$LoggedUser['AuthKey']?>"
- class="brackets" onclick="return confirm('Are you sure you want to delete this collage?');">Delete</a>
- <?php } ?>
- </div>
- </div>
- <?php /* Misc::display_recommend($CollageID, "collage"); */ ?>
- <div class="sidebar">
- <div class="box box_category">
- <div class="head"><strong>Category</strong></div>
- <div class="pad"><a
- href="collages.php?action=search&cats[<?=(int)$CollageCategoryID?>]=1"><?=$CollageCats[(int)$CollageCategoryID]?></a></div>
- </div>
- <div class="box box_description">
- <div class="head"><strong>Description</strong></div>
- <div class="pad"><?=Text::full_format($Description)?>
- </div>
- </div>
- <?php
- // I'm actually commenting this out
- /*
- if (check_perms('zip_downloader')) {
- if (isset($LoggedUser['Collector'])) {
- list($ZIPList, $ZIPPrefs) = $LoggedUser['Collector'];
- $ZIPList = explode(':', $ZIPList);
- } else {
- $ZIPList = array('00', '11');
- $ZIPPrefs = 1;
- }
- ?>
- <div class="box box_zipdownload">
- <div class="head colhead_dark"><strong>Collector</strong></div>
- <div class="pad">
- <form class="download_form" name="zip" action="collages.php" method="post">
- <input type="hidden" name="action" value="download" />
- <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
- <input type="hidden" name="collageid" value="<?=$CollageID?>" />
- <ul id="list" class="nobullet">
- <? foreach ($ZIPList as $ListItem) { ?>
- <li id="list<?=$ListItem?>">
- <input type="hidden" name="list[]" value="<?=$ListItem?>" />
- <span class="float_left"><?=$ZIPOptions[$ListItem]['2']?></span>
- <span class="remove remove_collector"><a href="#" onclick="remove_selection('<?=$ListItem?>'); return false;" class="float_right brackets">X</a></span>
- <br style="clear: all;" />
- </li>
- <? } ?>
- </ul>
- <select id="formats" style="width: 180px;">
- <?
- $OpenGroup = false;
- $LastGroupID = -1;
-
- foreach ($ZIPOptions as $Option) {
- list($GroupID, $OptionID, $OptName) = $Option;
-
- if ($GroupID != $LastGroupID) {
- $LastGroupID = $GroupID;
- if ($OpenGroup) {
- ?>
- </optgroup>
- <?php } ?>
- <optgroup label="<?=$ZIPGroups[$GroupID]?>">
- <?
- $OpenGroup = true;
- }
- ?>
- <option id="opt<?=$GroupID.$OptionID?>" value="<?=$GroupID.$OptionID?>"<? if (in_array($GroupID.$OptionID, $ZIPList)) { echo ' disabled="disabled"'; }?>><?=$OptName?></option>
- <?
- }
- ?>
- </optgroup>
- </select>
- <button type="button" onclick="add_selection();">+</button>
- <select name="preference" style="width: 210px;">
- <option value="0"<? if ($ZIPPrefs == 0) { echo ' selected="selected"'; } ?>>Prefer Original</option>
- <option value="1"<? if ($ZIPPrefs == 1) { echo ' selected="selected"'; } ?>>Prefer Best Seeded</option>
- <option value="2"<? if ($ZIPPrefs == 2) { echo ' selected="selected"'; } ?>>Prefer Bonus Tracks</option>
- </select>
- <input type="submit" style="width: 210px;" value="Download" />
- </form>
- </div>
- </div>
- <? }
- */
- ?>
-
- <div class="box box_info box_statistics_collage_torrents">
- <div class="head">
- <strong>Statistics</strong>
- </div>
-
- <ul class="stats nobullet">
- <li>
- Torrents: <?=number_format($NumGroups)?>
- </li>
-
- <?php if (!empty($TopArtists)) { ?>
- <li>
- Artists: <?=number_format(count($TopArtists))?>
- </li>
- <?php } ?>
-
- <li>
- Subscribers: <?=number_format((int)$Subscribers)?>
- </li>
-
- <li>
- Built by <?=number_format(count($UserAdditions))?>
- user<?=(count($UserAdditions) > 1 ? 's' : '')?>
- </li>
-
- <li>
- Last updated: <?=time_diff($Updated)?>
- </li>
- </ul>
- </div>
-
- <div class="box box_tags">
- <div class="head">
- <strong>Top Tags</strong>
- </div>
-
- <div class="pad tags">
- <ol style="padding-left: 5px">
- <?php Tags::format_top(5, 'collages.php?action=search&tags='); ?>
- </ol>
- </div>
- </div>
-
- <?php if (!empty($TopArtists)) { ?>
- <div class="box box_artists">
- <div class="head">
- <strong>Top Artists</strong>
- </div>
-
- <div class="pad">
- <ol style="padding-left: 5px;">
- <?php
- uasort($TopArtists, 'compare');
- $i = 0;
- foreach ($TopArtists as $ID => $Artist) {
- $i++;
- if ($i > 10) {
- break;
- } ?>
-
- <li>
- <a href="artist.php?id=<?=$ID?>"><?=$Artist['name']?></a> (<?=number_format($Artist['count'])?>)
- </li>
- <?php
- } ?>
- </ol>
- </div>
- </div>
- <?php } ?>
-
- <div class="box box_contributors">
- <div class="head"><strong>Top Contributors</strong></div>
- <div class="pad">
- <ol style="padding-left: 5px;">
- <?php
- arsort($UserAdditions);
- $i = 0;
- foreach ($UserAdditions as $UserID => $Additions) {
- $i++;
- if ($i > 5) {
- break;
- } ?>
- <li>
- <?=Users::format_username($UserID, false, false, false)?>
- (<?=number_format($Additions)?>)
- </li>
- <?php
- } ?>
- </ol>
- </div>
- </div>
-
- <?php if (check_perms('site_collages_manage') && !isset($PreventAdditions)) { ?>
- <div class="box box_addtorrent">
- <div class="head"><strong>Add Torrent Group</strong><span class="float_right"><a href="#"
- onclick="$('.add_torrent_container').toggle_class('hidden'); this.innerHTML = (this.innerHTML == 'Batch add' ? 'Individual add' : 'Batch add'); return false;"
- class="brackets">Batch add</a></span></div>
- <div class="pad add_torrent_container">
- <form class="add_form" name="torrent" action="collages.php" method="post">
- <input type="hidden" name="action" value="add_torrent" />
- <input type="hidden" name="auth"
- value="<?=$LoggedUser['AuthKey']?>" />
- <input type="hidden" name="collageid"
- value="<?=$CollageID?>" />
- <div>
- <input type="text" size="20" name="url" />
- </div>
- <div class="submit_div">
- <input type="submit" value="Add" />
- </div>
- <span style="font-style: italic;">Enter the URL of a torrent group on the site.</span>
- </form>
- </div>
-
- <div class="pad hidden add_torrent_container">
- <form class="add_form" name="torrents" action="collages.php" method="post">
- <input type="hidden" name="action" value="add_torrent_batch" />
- <input type="hidden" name="auth"
- value="<?=$LoggedUser['AuthKey']?>" />
- <input type="hidden" name="collageid"
- value="<?=$CollageID?>" />
- <div>
- <textarea name="urls" rows="5" cols="25"
- style="white-space: pre; word-wrap: normal; overflow: auto;"></textarea>
- </div>
-
- <div class="submit_div">
- <input type="submit" value="Add" />
- </div>
- <span style="font-style: italic;">Enter the URLs of torrent groups on the site, one per line.</span>
- </form>
- </div>
- </div>
- <?php } ?>
-
- <h3>Comments</h3>
- <?php
- if ($CommentList === null) {
- $DB->query("
- SELECT
- c.ID,
- c.Body,
- c.AuthorID,
- um.Username,
- c.AddedTime
- FROM comments AS c
- LEFT JOIN users_main AS um ON um.ID = c.AuthorID
- WHERE c.Page = 'collages'
- AND c.PageID = $CollageID
- ORDER BY c.ID DESC
- LIMIT 15");
- $CommentList = $DB->to_array(false, MYSQLI_NUM);
- }
- foreach ($CommentList as $Comment) {
- list($CommentID, $Body, $UserID, $Username, $CommentTime) = $Comment; ?>
- <div class="box comment">
- <div class="head">
- <?=Users::format_username($UserID, false, false, false) ?>
- <?=time_diff($CommentTime) ?>
- <br />
- <a href="reports.php?action=report&type=comment&id=<?=$CommentID?>"
- class="brackets">Report</a>
- </div>
- <div class="pad"><?=Text::full_format($Body)?>
- </div>
- </div>
- <?php
- }
- ?>
-
- <div class="box pad">
- <a href="collages.php?action=comments&collageid=<?=$CollageID?>"
- class="brackets">View all comments</a>
- </div>
-
- <?php
- if (!$LoggedUser['DisablePosting']) {
- ?>
- <div class="box box_addcomment">
- <div class="head"><strong>Comment</strong></div>
- <form class="send_form" name="comment" id="quickpostform" onsubmit="quickpostform.submit_button.disabled = true;"
- action="comments.php" method="post">
- <input type="hidden" name="action" value="take_post" />
- <input type="hidden" name="page" value="collages" />
- <input type="hidden" name="auth"
- value="<?=$LoggedUser['AuthKey']?>" />
- <input type="hidden" name="pageid" value="<?=$CollageID?>" />
- <div class="pad">
- <div>
- <textarea name="body" cols="24" rows="5"></textarea>
- </div>
- <div class="submit_div">
- <input type="submit" id="submit_button" value="Post" />
- </div>
- </div>
- </form>
- </div>
- <?php
- }
- ?>
- </div>
-
- <div class="main_column">
- <?php
- if ($CollageCovers != 0) { ?>
- <div id="coverart" class="box">
- <div class="head" id="coverhead"><strong>Pictures</strong></div>
- <div class="collage_images" id="collage_page0" data-wall-child=".collage_image" data-wall-size="4"
- data-wall-min="2">
- <?php
- $Page1 = array_slice($Collage, 0, $CollageCovers);
- foreach ($Page1 as $Group) {
- echo $Group;
- }
- ?>
- </div>
- </div>
-
- <?php if ($NumGroups > $CollageCovers) { ?>
- <div class="linkbox pager" style="clear: left;" id="pageslinksdiv">
-
- <span id="firstpage" class="invisible">
- <a href="#" class="pageslink" onclick="collageShow.page(0, this); return false;">
- <strong>« First</strong>
- </a> |
- </span>
-
- <span id="prevpage" class="invisible">
- <a href="#" class="pageslink" onclick="collageShow.prevPage(); return false;">
- <strong>‹ Prev</strong>
- </a> |
- </span>
-
- <?php for ($i = 0; $i < $NumGroups / $CollageCovers; $i++) { ?>
- <span id="pagelink<?=$i?>"
- class="<?=(($i > 4) ? 'hidden' : '')?><?=(($i == 0) ? 'selected' : '')?>">
- <a href="#" class="pageslink"
- onclick="collageShow.page(<?=$i?>, this); return false;">
- <strong><?=$CollageCovers * $i + 1?>-<?=min($NumGroups, $CollageCovers * ($i + 1))?></strong>
- </a>
- <?=(($i != ceil($NumGroups / $CollageCovers) - 1) ? ' | ' : '')?>
- </span>
- <?php } ?>
-
- <span id="nextbar"
- class="<?=($NumGroups / $CollageCovers > 5) ? 'hidden' : ''?>">
- | </span>
-
- <span id="nextpage">
- <a href="#" class="pageslink" onclick="collageShow.nextPage(); return false;">
- <strong>Next ›</strong>
- </a>
- </span>
-
- <span id="lastpage"
- class="<?=(ceil($NumGroups / $CollageCovers) == 2 ? 'invisible' : '')?>">
- |
- <a href="#" class="pageslink"
- onclick="collageShow.page(<?=ceil($NumGroups / $CollageCovers) - 1?>, this); return false;">
- <strong>Last »</strong>
- </a>
- </span>
- </div>
-
- <script type="text/javascript">
- $(() => collageShow.init( <?=json_encode($CollagePages)?> ));
- </script>
- <?php
- }
- }
- ?>
-
- <div class="box">
- <table class="torrent_table grouping cats" id="discog_table">
- <tr class="colhead_dark">
- <td>
- <!-- Expand/Collapse -->
- </td>
-
- <td>
- <!-- Category -->
- </td>
-
- <td width="70%"><strong>Torrents</strong></td>
-
- <td>Size</td>
-
- <td class="sign snatches">
- ↻
- </td>
-
- <td class="sign seeders">
- ↑
- </td>
-
- <td class="sign leechers">
- ↓
- </td>
- </tr>
-
- <?=$TorrentTable?>
-
- </table>
- </div>
- </div>
- </div>
- <?php View::show_footer();
|