?> </td> </tr> <?php } if ($ExtraIDs) { ?> <tr> <td class="label">Relevant other torrents:</td> <td colspan="3"> <?php $First = true; $Extras = explode(' ', $ExtraIDs); foreach ($Extras as $ExtraID) { $DB->query("\n\t\t\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\t\t\ttg.Name,\n\t\t\t\t\t\t\t\t\ttg.ID,\n\t\t\t\t\t\t\t\t\tCASE COUNT(ta.GroupID)\n\t\t\t\t\t\t\t\t\t\tWHEN 1 THEN aa.ArtistID\n\t\t\t\t\t\t\t\t\t\tWHEN 0 THEN '0'\n\t\t\t\t\t\t\t\t\t\tELSE '0'\n\t\t\t\t\t\t\t\t\tEND AS ArtistID,\n\t\t\t\t\t\t\t\t\tCASE COUNT(ta.GroupID)\n\t\t\t\t\t\t\t\t\t\tWHEN 1 THEN aa.Name\n\t\t\t\t\t\t\t\t\t\tWHEN 0 THEN ''\n\t\t\t\t\t\t\t\t\t\tELSE 'Various Artists'\n\t\t\t\t\t\t\t\t\tEND AS ArtistName,\n\t\t\t\t\t\t\t\t\ttg.Year,\n\t\t\t\t\t\t\t\t\tt.Time,\n\t\t\t\t\t\t\t\t\tt.Remastered,\n\t\t\t\t\t\t\t\t\tt.RemasterTitle,\n\t\t\t\t\t\t\t\t\tt.RemasterYear,\n\t\t\t\t\t\t\t\t\tt.Media,\n\t\t\t\t\t\t\t\t\tt.Format,\n\t\t\t\t\t\t\t\t\tt.Encoding,\n\t\t\t\t\t\t\t\t\tt.Size,\n\t\t\t\t\t\t\t\t\tt.HasCue,\n\t\t\t\t\t\t\t\t\tt.HasLog,\n\t\t\t\t\t\t\t\t\tt.LogScore,\n\t\t\t\t\t\t\t\t\tt.UserID AS UploaderID,\n\t\t\t\t\t\t\t\t\tuploader.Username\n\t\t\t\t\t\t\t\tFROM torrents AS t\n\t\t\t\t\t\t\t\t\tLEFT JOIN torrents_group AS tg ON tg.ID = t.GroupID\n\t\t\t\t\t\t\t\t\tLEFT JOIN torrents_artists AS ta ON ta.GroupID = tg.ID AND ta.Importance = '1'\n\t\t\t\t\t\t\t\t\tLEFT JOIN artists_alias AS aa ON aa.AliasID = ta.AliasID\n\t\t\t\t\t\t\t\t\tLEFT JOIN users_main AS uploader ON uploader.ID = t.UserID\n\t\t\t\t\t\t\t\tWHERE t.ID = '{$ExtraID}'\n\t\t\t\t\t\t\t\tGROUP BY tg.ID"); list($ExtraGroupName, $ExtraGroupID, $ExtraArtistID, $ExtraArtistName, $ExtraYear, $ExtraTime, $ExtraRemastered, $ExtraRemasterTitle, $ExtraRemasterYear, $ExtraMedia, $ExtraFormat, $ExtraEncoding, $ExtraSize, $ExtraHasCue, $ExtraHasLog, $ExtraLogScore, $ExtraUploaderID, $ExtraUploaderName) = Misc::display_array($DB->next_record()); if ($ExtraGroupName) { $ExtraRemasterDisplayString = Reports::format_reports_remaster_info($ExtraRemastered, $ExtraRemasterTitle, $ExtraRemasterYear); if ($ArtistID == 0 && empty($ArtistName)) { $ExtraLinkName = "<a href=\"torrents.php?id={$ExtraGroupID}\">{$ExtraGroupName}" . ($ExtraYear ? " ({$ExtraYear})" : '') . "</a> <a href=\"torrents.php?torrentid={$ExtraID}\"> [{$ExtraFormat}/{$ExtraEncoding}/{$ExtraMedia}]{$ExtraRemasterDisplayString}</a> " . ($ExtraHasLog == '1' ? " <a href=\"torrents.php?action=viewlog&torrentid={$ExtraID}&groupid={$ExtraGroupID}\">(Log: {$ExtraLogScore}%)</a>" : '') . ' (' . number_format($ExtraSize / (1024 * 1024), 2) . ' MB)'; } elseif ($ArtistID == 0 && $ArtistName == 'Various Artists') { $ExtraLinkName = "Various Artists - <a href=\"torrents.php?id={$ExtraGroupID}\">{$ExtraGroupName}" . ($ExtraYear ? " ({$ExtraYear})" : '') . "</a> <a href=\"torrents.php?torrentid={$ExtraID}\"> [{$ExtraFormat}/{$ExtraEncoding}/{$ExtraMedia}]{$ExtraRemasterDisplayString}</a> " . ($ExtraHasLog == '1' ? " <a href=\"torrents.php?action=viewlog&torrentid={$ExtraID}&groupid={$ExtraGroupID}\">(Log: {$ExtraLogScore}%)</a>" : '') . ' (' . number_format($ExtraSize / (1024 * 1024), 2) . ' MB)'; } else { $ExtraLinkName = "<a href=\"artist.php?id={$ExtraArtistID}\">{$ExtraArtistName}</a> - <a href=\"torrents.php?id={$ExtraGroupID}\">{$ExtraGroupName}" . ($ExtraYear ? " ({$ExtraYear})" : '') . "</a> <a href=\"torrents.php?torrentid={$ExtraID}\"> [{$ExtraFormat}/{$ExtraEncoding}/{$ExtraMedia}]{$ExtraRemasterDisplayString}</a> " . ($ExtraHasLog == '1' ? " <a href=\"torrents.php?action=viewlog&torrentid={$ExtraID}&groupid={$ExtraGroupID}\">(Log: {$ExtraLogScore}%)</a>" : '') . ' (' . number_format($ExtraSize / (1024 * 1024), 2) . ' MB)'; } ?> <?php echo $First ? '' : '<br />'; ?> <?php echo $ExtraLinkName;
function to_array($Key = false, $Type = MYSQLI_BOTH, $Escape = true) { $Return = array(); while ($Row = mysqli_fetch_array($this->QueryID, $Type)) { if ($Escape !== false) { $Row = Misc::display_array($Row, $Escape); } if ($Key !== false) { $Return[$Row[$Key]] = $Row; } else { $Return[] = $Row; } } mysqli_data_seek($this->QueryID, 0); return $Return; }
function audiobook_form() { $Torrent = $this->Torrent; ?> <table cellpadding="3" cellspacing="1" border="0" class="layout border slice" width="100%"> <?php if ($this->NewTorrent) { ?> <tr id="title_tr"> <td class="label">Author - Title:</td> <td> <input type="text" id="title" name="title" size="60" value="<?php echo display_str($Torrent['Title']); ?> " /> <p class="min_padding">Should only include the author if applicable.</p> </td> </tr> <?php } ?> <tr id="year_tr"> <td class="label">Year:</td> <td><input type="text" id="year" name="year" size="5" value="<?php echo display_str($Torrent['Year']); ?> " /></td> </tr> <tr> <td class="label">Format:</td> <td> <select name="format" onchange="Format()"> <option value="">---</option> <?php foreach (Misc::display_array($this->Formats) as $Format) { echo "\t\t\t\t\t\t<option value=\"{$Format}\""; if ($Format == $Torrent['Format']) { echo ' selected="selected"'; } echo '>'; echo $Format; echo "</option>\n"; } ?> </select> </td> </tr> <tr> <td class="label">Bitrate:</td> <td> <select id="bitrate" name="bitrate" onchange="Bitrate()"> <option value="">---</option> <?php if (!$Torrent['Bitrate'] || $Torrent['Bitrate'] && !in_array($Torrent['Bitrate'], $this->Bitrates)) { $OtherBitrate = true; if (substr($Torrent['Bitrate'], strlen($Torrent['Bitrate']) - strlen(' (VBR)')) == ' (VBR)') { $Torrent['Bitrate'] = substr($Torrent['Bitrate'], 0, strlen($Torrent['Bitrate']) - 6); $VBR = true; } } else { $OtherBitrate = false; } foreach (Misc::display_array($this->Bitrates) as $Bitrate) { echo "\t\t\t\t\t\t<option value=\"{$Bitrate}\""; if ($Bitrate == $Torrent['Bitrate'] || $OtherBitrate && $Bitrate == 'Other') { echo ' selected="selected"'; } echo '>'; echo $Bitrate; echo "</option>\n"; } ?> </select> <span id="other_bitrate_span"<?php if (!$OtherBitrate) { echo ' class="hidden"'; } ?> > <input type="text" name="other_bitrate" size="5" id="other_bitrate"<?php if ($OtherBitrate) { echo ' value="' . display_str($Torrent['Bitrate']) . '"'; } ?> onchange="AltBitrate()" /> <input type="checkbox" id="vbr" name="vbr"<?php if (isset($VBR)) { echo ' checked="checked"'; } ?> /><label for="vbr"> (VBR)</label> </span> </td> </tr> <?php if ($this->NewTorrent) { ?> <tr> <td class="label">Tags:</td> <td> <input type="text" id="tags" name="tags" size="60" value="<?php echo display_str($Torrent['TagList']); ?> "<?php Users::has_autocomplete_enabled('other'); ?> /> </td> </tr> <tr> <td class="label">Image (optional):</td> <td><input type="text" id="image" name="image" size="60" value="<?php echo display_str($Torrent['Image']); ?> "<?php echo $this->Disabled; ?> /></td> </tr> <tr> <td class="label">Description:</td> <td> <?php new TEXTAREA_PREVIEW('album_desc', 'album_desc', display_str($Torrent['GroupDescription']), 60, 8); ?> <p class="min_padding">Contains information like the track listing, a review, a link to Discogs or MusicBrainz, etc.</p> </td> </tr> <?php } ?> <tr> <td class="label">Release description (optional):</td> <td> <?php new TEXTAREA_PREVIEW('release_desc', 'release_desc', display_str($Torrent['TorrentDescription']), 60, 8); ?> <p class="min_padding">Contains information like encoder settings. For analog rips, this frequently contains lineage information.</p> </td> </tr> </table> <?php TEXTAREA_PREVIEW::JavaScript(false); }
<?php $GenreTags = $Cache->get_value('genre_tags'); if (!$GenreTags) { $DB->query(' SELECT Name FROM tags WHERE TagType = \'genre\' ORDER BY Name'); $GenreTags = $DB->collect('Name'); $Cache->cache_value('genre_tags', $GenreTags, 3600 * 6); } ?> <select id="genre_tags" name="genre_tags" onchange="add_tag(); return false;"> <option>---</option> <?php foreach (Misc::display_array($GenreTags) as $Genre) { ?> <option value="<?php echo $Genre; ?> "><?php echo $Genre; ?> </option> <?php } ?> </select> <input type="text" id="tags" name="tags" size="45" value="<?php echo !empty($Tags) ? display_str($Tags) : ''; ?>