Empty commit

This commit is contained in:
Git 2013-12-25 08:01:15 +00:00
parent 39e692c98f
commit efe5f9d750
6 changed files with 92 additions and 10 deletions

View File

@ -3,7 +3,7 @@ class Torrents {
const FILELIST_DELIM = 0xF7; // Hex for ÷ Must be the same as phrase_boundary in sphinx.conf!
const SNATCHED_UPDATE_INTERVAL = 3600; // How often we want to update users' snatch lists
/*
/**
* Function to get data and torrents for an array of GroupIDs. Order of keys doesn't matter
*
* @param array $GroupIDs
@ -882,6 +882,68 @@ public static function has_snatched($TorrentID, $AllUsers = false) {
return isset($CurSnatchedTorrents[$TorrentID]);
}
// Some constants for self::display_string's $Mode parameter
const DISPLAYSTRING_HTML = 1; // Whether or not to use HTML for the output (e.g. VH tooltip)
const DISPLAYSTRING_ARTISTS = 2; // Whether or not to display artists
const DISPLAYSTRING_YEAR = 4; // Whether or not to display the group's year
const DISPLAYSTRING_VH = 8; // Whether or not to display the VH flag
const DISPLAYSTRING_RELEASETYPE = 16; // Whether or not to display the release type
const DISPLAYSTRING_LINKED = 33; // Whether or not to link artists and the group
// The constant for linking is 32, but because linking only works with HTML, this constant is defined as 32|1 = 33, i.e. LINKED also includes HTML
// Keep this in mind when defining presets below!
// Presets to facilitate the use of $Mode
const DISPLAYSTRING_DEFAULT = 63; // HTML|ARTISTS|YEAR|VH|RELEASETYPE|LINKED = 63
const DISPLAYSTRING_SHORT = 6; // Very simple format, only artists and year, no linking (e.g. for forum thread titles)
/**
* Return the display string for a given torrent group $GroupID.
* @param int $GroupID
* @return string
*/
public static function display_string($GroupID, $Mode = self::DISPLAYSTRING_DEFAULT) {
global $ReleaseTypes; // I hate this
$GroupInfo = self::get_groups(array($GroupID), true, true, false)[$GroupID];
$ExtendedArtists = $GroupInfo['ExtendedArtists'];
if ($Mode & self::DISPLAYSTRING_ARTISTS) {
if (!empty($ExtendedArtists[1])
|| !empty($ExtendedArtists[4])
|| !empty($ExtendedArtists[5])
|| !empty($ExtendedArtists[6])
) {
unset($ExtendedArtists[2], $ExtendedArtists[3]);
$DisplayName = Artists::display_artists($ExtendedArtists, ($Mode & self::DISPLAYSTRING_LINKED));
} else {
$DisplayName = '';
}
}
if ($Mode & self::DISPLAYSTRING_LINKED) {
$DisplayName .= "<a href=\"torrents.php?id=$GroupID\" class=\"tooltip\" title=\"View torrent group\" dir=\"ltr\">$GroupInfo[Name]</a>";
} else {
$DisplayName .= $GroupInfo['Name'];
}
if (($Mode & self::DISPLAYSTRING_YEAR) && $GroupInfo['Year'] > 0) {
$DisplayName .= " [$GroupInfo[Year]]";
}
if (($Mode & self::DISPLAYSTRING_VH) && $GroupInfo['VanityHouse']) {
if ($Mode & self::DISPLAYSTRING_HTML) {
$DisplayName .= ' [<abbr class="tooltip" title="This is a Vanity House release">VH</abbr>]';
} else {
$DisplayName .= ' [VH]';
}
}
if (($Mode & self::DISPLAYSTRING_RELEASETYPE) && $GroupInfo['ReleaseType'] > 0) {
$DisplayName .= ' ['.$ReleaseTypes[$GroupInfo['ReleaseType']].']';
}
return $DisplayName;
}
public static function edition_string(array $Torrent, array $Group) {
if ($Torrent['Remastered'] && $Torrent['RemasterYear'] != 0) {

View File

@ -1,5 +1,14 @@
CHANGE LOG
2013-12-25 by Ajax
Custom date input for manual additions to the changelog
2013-12-24 by Y
Split the "Wiki" class (which has nothing to do with the wiki but deals with revisions on artist and torrent pages) into RevisionHistory + RevisionHistoryView
2013-12-24 by Y
New Wiki class that handles the stuff ALIAS did before; various changes to the horrible wiki system, including the deletion of some obsolete files
2013-12-23 by alderaan
Clear "user_info_$UserID" for each user that gets disabled for having never logged in

View File

@ -121,6 +121,7 @@
LastPostAuthorID = '$NewLastAuthorID',
LastPostTime = '$NewLastAddedTime'
WHERE ID = '$ForumID'");
$Cache->delete_value("forums_$ForumID");
$Cache->delete_value("thread_$TopicID");

View File

@ -99,12 +99,13 @@
}
$DB->query("
SELECT ID
SELECT GroupID
FROM torrents
WHERE ID = $TorrentID");
if (!$DB->has_results()) {
$Err = "A torrent with that ID doesn't exist!";
}
list($GroupID) = $DB->next_record();
if (!empty($Err)) {
error($Err);

View File

@ -9,9 +9,13 @@
if ($_POST['perform'] === 'add' && !empty($_POST['message'])) {
$Message = db_string($_POST['message']);
$Author = db_string($_POST['author']);
$Date = db_string($_POST['date']);
if (!is_valid_date($Date)) {
$Date = sqltime();
}
$DB->query("
INSERT INTO changelog (Message, Author, Time)
VALUES ('$Message', '$Author', NOW())");
VALUES ('$Message', '$Author', '$Date')");
$ID = $DB->inserted_id();
// SiteHistory::add_event(sqltime(), "Change log $ID", "tools.php?action=change_log", 1, 3, "", $Message, $LoggedUser['ID']);
@ -30,15 +34,15 @@
ID,
Message,
Author,
Date(Time) as Time
Date(Time) as Time2
FROM changelog
ORDER BY ID DESC
ORDER BY Time DESC
LIMIT $Limit");
$ChangeLog = $DB->to_array();
$DB->query('SELECT FOUND_ROWS()');
list($NumResults) = $DB->next_record();
View::show_header('Gazelle Change Log');
View::show_header('Gazelle Change Log', 'datetime_picker', 'datetime_picker');
?>
<div class="thin">
<h2>Gazelle Change Log</h2>
@ -62,6 +66,11 @@
<br />
<textarea name="message" rows="2"></textarea>
</div>
<div class="field_div" id="cl_date">
<span class="label">Date:</span>
<br />
<input type="text" class="date_picker" name="date" />
</div>
<div class="field_div" id="cl_author">
<span class="label">Author:</span>
<br />
@ -80,7 +89,7 @@
?>
<div class="box box2 change_log_entry">
<div class="head">
<span><?=$Change['Time']?> by <?=$Change['Author']?></span>
<span><?=$Change['Time2']?> by <?=$Change['Author']?></span>
<? if ($CanEdit) { ?>
<span style="float: right;">
<form id="delete_<?=$Change['ID']?>" method="post" action="">

View File

@ -601,7 +601,7 @@ function filelist($Str) {
<div class="filelist_title" style="float: left;">File Names' . $RegenLink . '</div>
<div class="filelist_path" style="float: right;">' . ($FilePath ? "/$FilePath/" : '') . '</div>
</td>
<td>
<td class="nobr">
<strong>Size</strong>
</td>
</tr>';
@ -614,13 +614,13 @@ function filelist($Str) {
$Name = str_replace(' ', '&nbsp;', substr($Name, 0, $Spaces)) . substr($Name, $Spaces);
}
$FileSize = substr($File, $NameEnd + 3, -3);
$FileTable .= sprintf("\n<tr><td>%s</td><td class=\"number_column\">%s</td></tr>", $Name, Format::get_size($FileSize));
$FileTable .= sprintf("\n<tr><td>%s</td><td class=\"number_column nobr\">%s</td></tr>", $Name, Format::get_size($FileSize));
}
} else {
$FileListSplit = explode("\n", $FileList);
foreach ($FileListSplit as $File) {
$FileInfo = Torrents::filelist_get_file($File);
$FileTable .= sprintf("\n<tr><td>%s</td><td class=\"number_column\">%s</td></tr>", $FileInfo['name'], Format::get_size($FileInfo['size']));
$FileTable .= sprintf("\n<tr><td>%s</td><td class=\"number_column nobr\">%s</td></tr>", $FileInfo['name'], Format::get_size($FileInfo['size']));
}
}
$FileTable .= '