mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-31 02:21:36 +00:00
Empty commit
This commit is contained in:
parent
ac74044ec2
commit
2ab1207afa
@ -40,7 +40,8 @@ class CACHE extends Memcache {
|
||||
'top10tor_*',
|
||||
'query_lock_*',
|
||||
'top10votes_*',
|
||||
'similar_albums_*'
|
||||
'similar_albums_*',
|
||||
'users_snatched_*'
|
||||
);
|
||||
|
||||
public $CanClear = false;
|
||||
@ -129,8 +130,8 @@ public function get_value($Key, $NoCache=false) {
|
||||
}
|
||||
|
||||
$Return = $this->get($Key);
|
||||
if ($Return !== false && !$NoCache) {
|
||||
$this->CacheHits[$Key] = $Return;
|
||||
if ($Return !== false) {
|
||||
$this->CacheHits[$Key] = $NoCache ? null : $Return;
|
||||
}
|
||||
$this->Time+=(microtime(true)-$StartTime)*1000;
|
||||
return $Return;
|
||||
|
@ -658,11 +658,12 @@ private function to_html ($Array) {
|
||||
break;
|
||||
case 'headline':
|
||||
$text = $this->to_html($Block['Val']);
|
||||
$raw = $this->raw_text($Block['Val']);
|
||||
if(!in_array($Block['Attr'], $this->HeadlineLevels)) {
|
||||
$Str .= sprintf('%1$s%2$s%1$s', str_repeat('=', $Block['Attr'] + 1), $text);
|
||||
} else {
|
||||
$id = '_' . crc32($text . $this->HeadlineID);
|
||||
if ($this->InQuotes === 0) $this->Headlines[] = array($Block['Attr'], $text, $id);
|
||||
$id = '_' . crc32($raw . $this->HeadlineID);
|
||||
if ($this->InQuotes === 0) $this->Headlines[] = array($Block['Attr'], $raw, $id);
|
||||
|
||||
$Str .= sprintf('<h%1$d id="%3$s">%2$s</h%1$d>', ($Block['Attr']+2), $text, $id);
|
||||
$this->HeadlineID++;
|
||||
|
@ -24,7 +24,7 @@ class Torrents {
|
||||
* GroupID, Media, Format, Encoding, RemasterYear, Remastered,
|
||||
* RemasterTitle, RemasterRecordLabel, RemasterCatalogueNumber, Scene,
|
||||
* HasLog, HasCue, LogScore, FileCount, FreeTorrent, Size, Leechers,
|
||||
* Seeders, Snatched, Time, HasFile, PersonalFL
|
||||
* Seeders, Snatched, Time, HasFile, PersonalFL, IsSnatched
|
||||
* }
|
||||
* }
|
||||
* ExtendedArtists => {
|
||||
@ -34,7 +34,7 @@ class Torrents {
|
||||
* }
|
||||
*/
|
||||
public static function get_groups($GroupIDs, $Return = true, $GetArtists = true, $Torrents = true) {
|
||||
global $DB, $Cache;
|
||||
global $DB, $Cache, $Debug;
|
||||
|
||||
// Make sure there's something in $GroupIDs, otherwise the SQL
|
||||
// will break
|
||||
@ -99,6 +99,7 @@ public static function get_groups($GroupIDs, $Return = true, $GetArtists = true,
|
||||
$Cache->cache_value('torrent_group_light_'.$Torrent['GroupID'],
|
||||
array('ver'=>4, 'd'=>$Found[$Torrent['GroupID']]), 0);
|
||||
}
|
||||
|
||||
} else {
|
||||
foreach ($Found as $Group) {
|
||||
$Cache->cache_value('torrent_group_light_'.$Group['ID'], array('ver'=>4, 'd'=>$Found[$Group['ID']]), 0);
|
||||
@ -129,6 +130,7 @@ public static function get_groups($GroupIDs, $Return = true, $GetArtists = true,
|
||||
array_walk($Group['Torrents'], 'self::torrent_properties');
|
||||
}
|
||||
}
|
||||
|
||||
$Matches = array('matches'=>$Found, 'notfound'=>array_flip($NotFound));
|
||||
|
||||
return $Matches;
|
||||
@ -144,6 +146,7 @@ public static function get_groups($GroupIDs, $Return = true, $GetArtists = true,
|
||||
*/
|
||||
public static function torrent_properties(&$Torrent, $TorrentID) {
|
||||
$Torrent['PersonalFL'] = empty($Torrent['FreeTorrent']) && self::has_token($TorrentID);
|
||||
$Torrent['IsSnatched'] = self::has_snatched($TorrentID);
|
||||
}
|
||||
|
||||
|
||||
@ -441,7 +444,7 @@ public static function torrent_info($Data, $ShowMedia = false, $ShowEdition = fa
|
||||
if (!empty($Data['RemasterTitle'])) { $EditionInfo[]=$Data['RemasterTitle']; }
|
||||
if (count($EditionInfo)) { $Info[]=implode(' ',$EditionInfo); }
|
||||
}
|
||||
if ($Data['SnatchedTorrent'] == '1') { $Info[]='<strong>Snatched!</strong>'; }
|
||||
if ($Data['IsSnatched']) { $Info[]='<strong class="snatched_torrent">Snatched!</strong>'; }
|
||||
if ($Data['FreeTorrent'] == '1') { $Info[]='<strong>Freeleech!</strong>'; }
|
||||
if ($Data['FreeTorrent'] == '2') { $Info[]='<strong>Neutral Leech!</strong>'; }
|
||||
if ($Data['PersonalFL']) { $Info[]='<strong>Personal Freeleech!</strong>'; }
|
||||
@ -505,6 +508,7 @@ public static function freeleech_groups($GroupIDs, $FreeNeutral = 1, $FreeLeechT
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if the logged in user has an active freeleech token
|
||||
*
|
||||
@ -513,7 +517,7 @@ public static function freeleech_groups($GroupIDs, $FreeNeutral = 1, $FreeLeechT
|
||||
*/
|
||||
public static function has_token($TorrentID) {
|
||||
global $DB, $Cache, $LoggedUser;
|
||||
if (empty($LoggedUser) || empty($LoggedUser['ID'])) {
|
||||
if (empty($LoggedUser)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -539,7 +543,7 @@ public static function has_token($TorrentID) {
|
||||
*/
|
||||
public static function can_use_token($Torrent) {
|
||||
global $LoggedUser;
|
||||
if (empty($LoggedUser) || empty($LoggedUser['ID'])) {
|
||||
if (empty($LoggedUser)) {
|
||||
return false;
|
||||
}
|
||||
return ($LoggedUser['FLTokens'] > 0
|
||||
@ -549,22 +553,72 @@ public static function can_use_token($Torrent) {
|
||||
&& $LoggedUser['CanLeech'] == '1');
|
||||
}
|
||||
|
||||
public static function get_snatched_torrents($UserID = false) {
|
||||
|
||||
public static function has_snatched($TorrentID) {
|
||||
global $DB, $Cache, $LoggedUser;
|
||||
if($LoggedUser['ShowSnatched']) {
|
||||
$UserID = $LoggedUser['ID'];
|
||||
$SnatchedTorrents = $Cache->get_value('users_snatched_'.$UserID);
|
||||
if (empty($SnatchedTorrents)) {
|
||||
$DB->query("SELECT DISTINCT fid as TorrentID FROM xbt_snatched WHERE uid='$UserID'");
|
||||
$SnatchedTorrents = array_flip($DB->collect('TorrentID'));
|
||||
$Cache->cache_value('users_snatched_'.$UserID, $SnatchedTorrents, 86400);
|
||||
if (empty($LoggedUser) || !$LoggedUser['ShowSnatched']) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$UserID = $LoggedUser['ID'];
|
||||
$Buckets = 64;
|
||||
$LastBucket = $Buckets - 1;
|
||||
$BucketID = $TorrentID & $LastBucket;
|
||||
static $SnatchedTorrents = array(), $LastUpdate = 0;
|
||||
|
||||
if (empty($SnatchedTorrents)) {
|
||||
$SnatchedTorrents = array_fill(0, $Buckets, false);
|
||||
$LastUpdate = $Cache->get_value('users_snatched_'.$UserID.'_lastupdate') ?: 0;
|
||||
} else if (isset($SnatchedTorrents[$BucketID][$TorrentID])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Torrent was not found in the previously inspected snatch lists
|
||||
$CurSnatchedTorrents =& $SnatchedTorrents[$BucketID];
|
||||
if (empty($CurSnatchedTorrents)) {
|
||||
$CurTime = time();
|
||||
// This bucket hasn't been checked before
|
||||
$CurSnatchedTorrents = $Cache->get_value('users_snatched_'.$UserID.'_'.$BucketID, true);
|
||||
if ($CurSnatchedTorrents === false || $CurTime - $LastUpdate > 1800) {
|
||||
if ($CurSnatchedTorrents === false) {
|
||||
// Not found in cache. Since we don't have a suitable index, it's faster to update everything
|
||||
$DB->query("SELECT fid, tstamp AS TorrentID FROM xbt_snatched WHERE uid='$UserID'");
|
||||
} elseif (isset($CurSnatchedTorrents[$TorrentID])) {
|
||||
// Old cache, but torrent is snatched, so no need to update
|
||||
return true;
|
||||
} else {
|
||||
// Old cache, check if torrent has been snatched recently
|
||||
$DB->query("SELECT fid AS TorrentID FROM xbt_snatched WHERE uid='$UserID' AND tstamp>=".$LastUpdate);
|
||||
}
|
||||
$Updated = array();
|
||||
while (list($ID) = $DB->next_record(MYSQLI_NUM, false)) {
|
||||
$CurBucketID = $ID & $LastBucket;
|
||||
if ($SnatchedTorrents[$CurBucketID] === false) {
|
||||
$SnatchedTorrents[$CurBucketID] = $Cache->get_value('users_snatched_'.$UserID.'_'.$CurBucketID, true);
|
||||
if ($SnatchedTorrents[$CurBucketID] === false) {
|
||||
$SnatchedTorrents[$CurBucketID] = array();
|
||||
}
|
||||
}
|
||||
$SnatchedTorrents[$CurBucketID][(int)$ID] = true;
|
||||
$Updated[$CurBucketID] = true;
|
||||
}
|
||||
for ($i = 0; $i < $Buckets; $i++) {
|
||||
if (empty($SnatchedTorrents[$i])) {
|
||||
$SnatchedTorrents[$i] = $Cache->get_value('users_snatched_'.$UserID.'_'.$i, true);
|
||||
if ($SnatchedTorrents[$i] === false) {
|
||||
// No snatched torrents with this bucket number
|
||||
$SnatchedTorrents[$i] = array();
|
||||
$Updated[$i] = true;
|
||||
}
|
||||
}
|
||||
if ($Updated[$i]) {
|
||||
$Cache->cache_value('users_snatched_'.$UserID.'_'.$i, $SnatchedTorrents[$i], 0);
|
||||
}
|
||||
}
|
||||
$Cache->cache_value('users_snatched_'.$UserID.'_lastupdate', $CurTime, 21600);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$SnatchedTorrents = array();
|
||||
}
|
||||
return $SnatchedTorrents;
|
||||
return isset($CurSnatchedTorrents[$TorrentID]);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
@ -487,25 +487,4 @@ function bookmark_data ($UserID)
|
||||
|
||||
return array($K, $GroupIDs, $CollageDataList, $TorrentList);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of torrents that a user has spent tokens on
|
||||
* @global CACHE $Cache
|
||||
* @global DB_MYSQL $DB
|
||||
* @param type $UserID
|
||||
* @return type
|
||||
*/
|
||||
function token_torrents ($UserID)
|
||||
{
|
||||
global $Cache, $DB;
|
||||
|
||||
$UserID = (int) $UserID;
|
||||
$TokenTorrents = $Cache->get_value('users_tokens_'.$UserID);
|
||||
if (empty($TokenTorrents)) {
|
||||
$DB->query("SELECT TorrentID FROM users_freeleeches WHERE UserID=$UserID AND Expired=FALSE");
|
||||
$TokenTorrents = $DB->collect('TorrentID');
|
||||
$Cache->cache_value('users_tokens_'.$UserID, $TokenTorrents);
|
||||
}
|
||||
return $TokenTorrents;
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -39,6 +39,13 @@
|
||||
}
|
||||
$Type = ($_REQUEST['vote'] == 'up')?"Up":"Down";
|
||||
|
||||
// Update the two votes tables if needed
|
||||
$DB->query("INSERT IGNORE INTO users_votes (UserID, GroupID, Type) VALUES ($UserID, $GroupID, '$Type')");
|
||||
if ($DB->affected_rows() == 0) {
|
||||
echo 'noaction';
|
||||
die();
|
||||
}
|
||||
|
||||
// Update the group's cache key
|
||||
$GroupVotes['Total'] += 1;
|
||||
if ($Type == "Up") {
|
||||
@ -46,15 +53,13 @@
|
||||
}
|
||||
$Cache->cache_value('votes_'.$GroupID, $GroupVotes);
|
||||
|
||||
// Update the two votes tables
|
||||
$DB->query("INSERT INTO users_votes (UserID, GroupID, Type) VALUES ($UserID, $GroupID, '$Type') ON DUPLICATE KEY UPDATE Type = '$Type'");
|
||||
// If the group has no votes yet, we need an insert, otherwise an update
|
||||
// so we can cut corners and use the magic of INSERT...ON DUPLICATE KEY UPDATE...
|
||||
// to accomplish both in one query
|
||||
$DB->query("INSERT INTO torrents_votes (GroupID, Total, Ups, Score)
|
||||
VALUES ($GroupID, 1, ".($Type=='Up'?1:0).", 0)
|
||||
ON DUPLICATE KEY UPDATE Total = Total + 1,
|
||||
Score = binomial_ci(".$GroupVotes['Ups'].",". $GroupVotes['Total'].")".
|
||||
Score = IFNULL(binomial_ci(".$GroupVotes['Ups'].",". $GroupVotes['Total']."),0)".
|
||||
($Type=='Up'?', Ups = Ups+1':''));
|
||||
|
||||
$UserVotes[$GroupID] = array('GroupID' => $GroupID, 'Type' => $Type);
|
||||
@ -137,7 +142,7 @@
|
||||
$Cache->cache_value('votes_'.$GroupID, $GroupVotes);
|
||||
|
||||
$DB->query("UPDATE torrents_votes SET Total = GREATEST(0, Total - 1),
|
||||
Score = binomial_ci(".$GroupVotes['Ups'].",".$GroupVotes['Total'].")".
|
||||
Score = IFNULL(binomial_ci(".$GroupVotes['Ups'].",".$GroupVotes['Total']."),0)".
|
||||
($Type=='Up'?', Ups = GREATEST(0, Ups - 1)':'')."
|
||||
WHERE GroupID=$GroupID");
|
||||
// Update paired cache keys
|
||||
|
@ -23,16 +23,20 @@ function compare($X, $Y){
|
||||
|
||||
if(!empty($_GET['revisionid'])) { // if they're viewing an old revision
|
||||
$RevisionID=$_GET['revisionid'];
|
||||
if(!is_number($RevisionID)){ error(0); }
|
||||
$Data = $Cache->get_value("artist_$ArtistID"."_revision_$RevisionID");
|
||||
if(!is_number($RevisionID)) {
|
||||
error(0);
|
||||
}
|
||||
$Data = $Cache->get_value("artist_$ArtistID"."_revision_$RevisionID", true);
|
||||
} else { // viewing the live version
|
||||
$Data = $Cache->get_value('artist_'.$ArtistID);
|
||||
$Data = $Cache->get_value('artist_'.$ArtistID, true);
|
||||
$RevisionID = false;
|
||||
}
|
||||
if($Data) {
|
||||
$Data = unserialize($Data);
|
||||
list($K, list($Name, $Image, $Body, $NumSimilar, $SimilarArray, $TorrentList, $Importances, $VanityHouseArtist)) = each($Data);
|
||||
|
||||
if($Data) {
|
||||
if (!is_array($Data)) {
|
||||
$Data = unserialize($Data);
|
||||
}
|
||||
list($K, list($Name, $Image, $Body, $NumSimilar, $SimilarArray, ,,,, $VanityHouseArtist)) = each($Data);
|
||||
} else {
|
||||
if ($RevisionID) {
|
||||
$sql = "SELECT
|
||||
@ -61,14 +65,6 @@ function compare($X, $Y){
|
||||
list($Name, $Image, $Body, $VanityHouseArtist) = $DB->next_record(MYSQLI_NUM, array(0));
|
||||
}
|
||||
|
||||
$TokenTorrents = $Cache->get_value('users_tokens_'.$UserID);
|
||||
if (empty($TokenTorrents)) {
|
||||
$DB->query("SELECT TorrentID FROM users_freeleeches WHERE UserID=$UserID AND Expired=FALSE");
|
||||
$TokenTorrents = $DB->collect('TorrentID');
|
||||
$Cache->cache_value('users_tokens_'.$UserID, $TokenTorrents);
|
||||
}
|
||||
|
||||
$SnatchedTorrents = Torrents::get_snatched_torrents();
|
||||
|
||||
//----------------- Build list and get stats
|
||||
|
||||
@ -102,23 +98,22 @@ function compare($X, $Y){
|
||||
}
|
||||
$NumRequests = count($Requests);
|
||||
|
||||
|
||||
$LastReleaseType = 0;
|
||||
if(empty($Importances) || empty($TorrentList)) {
|
||||
$DB->query("SELECT
|
||||
DISTINCTROW ta.GroupID, ta.Importance, tg.VanityHouse, tg.ReleaseType
|
||||
FROM torrents_artists AS ta
|
||||
JOIN torrents_group AS tg ON tg.ID=ta.GroupID
|
||||
WHERE ta.ArtistID='$ArtistID'
|
||||
ORDER BY IF(ta.Importance IN ('2', '3', '4', '7'),1000 + ta.Importance, tg.ReleaseType) ASC,
|
||||
tg.Year DESC, tg.Name DESC");
|
||||
$GroupIDs = $DB->collect('GroupID');
|
||||
$Importances = $DB->to_array(false, MYSQLI_BOTH, false);
|
||||
if(count($GroupIDs)>0) {
|
||||
$TorrentList = Torrents::get_groups($GroupIDs, true,true);
|
||||
$TorrentList = $TorrentList['matches'];
|
||||
} else {
|
||||
$TorrentList = array();
|
||||
}
|
||||
$DB->query("SELECT
|
||||
DISTINCTROW ta.GroupID, ta.Importance, tg.VanityHouse, tg.Year
|
||||
FROM torrents_artists AS ta
|
||||
JOIN torrents_group AS tg ON tg.ID=ta.GroupID
|
||||
WHERE ta.ArtistID='$ArtistID'
|
||||
ORDER BY IF(ta.Importance IN ('2', '3', '4', '7'),1000 + ta.Importance, tg.ReleaseType) ASC,
|
||||
tg.Year DESC, tg.Name DESC");
|
||||
$GroupIDs = $DB->collect('GroupID');
|
||||
$Importances = $DB->to_array(false, MYSQLI_BOTH, false);
|
||||
if(count($GroupIDs)>0) {
|
||||
$TorrentList = Torrents::get_groups($GroupIDs, true,true);
|
||||
$TorrentList = $TorrentList['matches'];
|
||||
} else {
|
||||
$TorrentList = array();
|
||||
}
|
||||
$NumGroups = count($TorrentList);
|
||||
|
||||
@ -182,10 +177,16 @@ function compare($X, $Y){
|
||||
$SortOrder = array_keys($LoggedUser['SortHide']);
|
||||
uasort($Importances, function ($a, $b) {
|
||||
global $SortOrder;
|
||||
// global $Debug;
|
||||
// $Debug->log_var($a);
|
||||
$c = array_search($a['ReleaseType'], $SortOrder);
|
||||
$d = array_search($b['ReleaseType'], $SortOrder);
|
||||
if ($c == $d) {
|
||||
return 0;
|
||||
if ($a['Year'] == $b['Year']) {
|
||||
return 0;
|
||||
} else {
|
||||
return ($a['Year'] > $b['Year']) ? -1 : 1;
|
||||
}
|
||||
}
|
||||
return $c < $d ? -1 : 1;
|
||||
});
|
||||
@ -449,16 +450,11 @@ function compare($X, $Y){
|
||||
<td colspan="2">
|
||||
<span>
|
||||
[ <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download"><?=$Torrent['HasFile'] ? 'DL' : 'Missing'?></a>
|
||||
<? if (($LoggedUser['FLTokens'] > 0) && ($Torrent['Size'] < 1073741824)
|
||||
&& !$Torrent['PersonalFL'] && empty($Torrent['FreeTorrent']) && ($LoggedUser['CanLeech'] == '1')) { ?>
|
||||
<? if (Torrents::can_use_token($Torrent)) { ?>
|
||||
| <a href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
||||
<? } ?> ]
|
||||
</span>
|
||||
<? if(array_key_exists($TorrentID, $SnatchedTorrents)) {
|
||||
$Torrent['SnatchedTorrent'] = '1';
|
||||
}
|
||||
?>
|
||||
» <a href="torrents.php?id=<?=$GroupID?>&torrentid=<?=$TorrentID?>"><?=Torrents::torrent_info($Torrent)?></a>
|
||||
» <a href="torrents.php?id=<?=$GroupID?>&torrentid=<?=$TorrentID?>"><?=Torrents::torrent_info($Torrent)?></a>
|
||||
</td>
|
||||
<td class="nobr"><?=Format::get_size($Torrent['Size'])?></td>
|
||||
<td><?=number_format($Torrent['Snatched'])?></td>
|
||||
@ -967,7 +963,7 @@ function require(file, callback) {
|
||||
|
||||
//---------- Begin printing
|
||||
foreach($Thread as $Key => $Post){
|
||||
list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
|
||||
list($PostID, $AuthorID, $AddedTime, $CommentBody, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
|
||||
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
|
||||
?>
|
||||
<table class="forum_post box vertical_margin<?=$HeavyInfo['DisableAvatars'] ? ' noavatar' : ''?>" id="post<?=$PostID?>">
|
||||
@ -1014,7 +1010,7 @@ function require(file, callback) {
|
||||
?>
|
||||
<td class="body" valign="top">
|
||||
<div id="content<?=$PostID?>">
|
||||
<?=$Text->full_format($Body)?>
|
||||
<?=$Text->full_format($CommentBody)?>
|
||||
<? if($EditedUserID){ ?>
|
||||
<br />
|
||||
<br />
|
||||
@ -1088,7 +1084,7 @@ function require(file, callback) {
|
||||
$Key = 'artist_'.$ArtistID;
|
||||
}
|
||||
|
||||
$Data = serialize(array(array($Name, $Image, $Body, $NumSimilar, $SimilarArray, $TorrentList, $Importances, $VanityHouseArtist)));
|
||||
$Data = array(array($Name, $Image, $Body, $NumSimilar, $SimilarArray, array(), array(), $VanityHouseArtist));
|
||||
|
||||
$Cache->cache_value($Key, $Data, 3600);
|
||||
?>
|
||||
|
@ -25,15 +25,6 @@ function compare($X, $Y){
|
||||
|
||||
list($K, $GroupIDs, $CollageDataList, $TorrentList) = Users::bookmark_data($UserID);
|
||||
|
||||
$TokenTorrents = Users::token_torrents($UserID);
|
||||
|
||||
$TokenTorrents = $Cache->get_value('users_tokens_'.$UserID);
|
||||
if (empty($TokenTorrents)) {
|
||||
$DB->query("SELECT TorrentID FROM users_freeleeches WHERE UserID=$UserID AND Expired=FALSE");
|
||||
$TokenTorrents = $DB->collect('TorrentID');
|
||||
$Cache->cache_value('users_tokens_'.$UserID, $TokenTorrents);
|
||||
}
|
||||
$SnatchedTorrents = Torrents::get_snatched_torrents();
|
||||
$Title = ($Sneaky)?"$Username's bookmarked torrents":'Your bookmarked torrents';
|
||||
|
||||
// Loop through the result set, building up $Collage and $TorrentTable
|
||||
@ -177,16 +168,11 @@ function compare($X, $Y){
|
||||
<tr class="group_torrent groupid_<?=$GroupID?> edition_<?=$EditionID?><? if(!empty($LoggedUser['TorrentGrouping']) && $LoggedUser['TorrentGrouping']==1) { echo ' hidden'; } ?>">
|
||||
<td colspan="3">
|
||||
<span>[ <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download">DL</a>
|
||||
<? if (($LoggedUser['FLTokens'] > 0) && ($Torrent['Size'] < 1073741824)
|
||||
&& !$Torrent['PersonalFL'] && empty($Torrent['FreeTorrent']) && ($LoggedUser['CanLeech'] == '1')) { ?>
|
||||
<? if (Torrents::can_use_token($Torrent)) { ?>
|
||||
| <a href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
||||
<? } ?>
|
||||
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a> ]
|
||||
</span>
|
||||
<? if(array_key_exists($TorrentID, $SnatchedTorrents)) {
|
||||
$Torrent['SnatchedTorrent'] = '1';
|
||||
}
|
||||
?>
|
||||
» <a href="torrents.php?id=<?=$GroupID?>&torrentid=<?=$TorrentID?>"><?=Torrents::torrent_info($Torrent)?></a>
|
||||
</td>
|
||||
<td class="nobr"><?=Format::get_size($Torrent['Size'])?></td>
|
||||
@ -203,9 +189,14 @@ function compare($X, $Y){
|
||||
|
||||
$DisplayName = '<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
|
||||
if(!empty($Torrent['FreeTorrent'])) {
|
||||
$DisplayName .=' <strong>Freeleech!</strong>';
|
||||
} elseif($Torrent['PersonalFL']) {
|
||||
if ($Torrent['IsSnatched']) {
|
||||
$DisplayName .= ' <strong class="snatched_torrent">Snatched!</strong>';
|
||||
}
|
||||
if ($Torrent['FreeTorrent'] == '1') {
|
||||
$DisplayName .= ' <strong>Freeleech!</strong>';
|
||||
} elseif ($Torrent['FreeTorrent'] == '2') {
|
||||
$DisplayName .= ' <strong>Neutral Leech!</strong>';
|
||||
} elseif ($Torrent['PersonalFL']) {
|
||||
$DisplayName .= '<strong>Personal Freeleech!</strong>';
|
||||
}
|
||||
?>
|
||||
@ -218,8 +209,7 @@ function compare($X, $Y){
|
||||
<td>
|
||||
<span>
|
||||
[ <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download">DL</a>
|
||||
<? if (($LoggedUser['FLTokens'] > 0) && ($Torrent['Size'] < 1073741824)
|
||||
&& !$Torrent['PersonalFL'] && empty($Torrent['FreeTorrent']) && ($LoggedUser['CanLeech'] == '1')) { ?>
|
||||
<? if (Torrents::can_use_token($Torrent)) { ?>
|
||||
| <a href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
||||
<? } ?>
|
||||
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a> ]
|
||||
|
@ -16,19 +16,13 @@ function compare($X, $Y){
|
||||
$CollageID = $_GET['id'];
|
||||
if(!is_number($CollageID)) { error(0); }
|
||||
|
||||
$TokenTorrents = $Cache->get_value('users_tokens_'.$UserID);
|
||||
if (empty($TokenTorrents)) {
|
||||
$DB->query("SELECT TorrentID FROM users_freeleeches WHERE UserID=$UserID AND Expired=FALSE");
|
||||
$TokenTorrents = $DB->collect('TorrentID');
|
||||
$Cache->cache_value('users_tokens_'.$UserID, $TokenTorrents);
|
||||
}
|
||||
$SnatchedTorrents = Torrents::get_snatched_torrents();
|
||||
|
||||
$Data = $Cache->get_value('collage_'.$CollageID);
|
||||
|
||||
if($Data) {
|
||||
$Data = unserialize($Data);
|
||||
list($K, list($Name, $Description, $CollageDataList, $TorrentList, $CommentList, $Deleted, $CollageCategoryID, $CreatorID)) = each($Data);
|
||||
if (!is_array($Data)) {
|
||||
$Data = unserialize($Data);
|
||||
}
|
||||
list($K, list($Name, $Description, ,,,, $CommentList, $Deleted, $CollageCategoryID, $CreatorID)) = each($Data);
|
||||
} else {
|
||||
$DB->query("SELECT Name, Description, UserID, Deleted, CategoryID, Locked, MaxGroups, MaxGroupsPerUser FROM collages WHERE ID='$CollageID'");
|
||||
if($DB->record_count() > 0) {
|
||||
@ -69,28 +63,27 @@ function compare($X, $Y){
|
||||
|
||||
|
||||
// Build the data for the collage and the torrent list
|
||||
if(!is_array($TorrentList)) {
|
||||
$DB->query("SELECT ct.GroupID,
|
||||
tg.WikiImage,
|
||||
tg.CategoryID,
|
||||
um.ID,
|
||||
um.Username
|
||||
FROM collages_torrents AS ct
|
||||
JOIN torrents_group AS tg ON tg.ID=ct.GroupID
|
||||
LEFT JOIN users_main AS um ON um.ID=ct.UserID
|
||||
WHERE ct.CollageID='$CollageID'
|
||||
ORDER BY ct.Sort");
|
||||
$DB->query("SELECT ct.GroupID,
|
||||
tg.WikiImage,
|
||||
tg.CategoryID,
|
||||
um.ID,
|
||||
um.Username
|
||||
FROM collages_torrents AS ct
|
||||
JOIN torrents_group AS tg ON tg.ID=ct.GroupID
|
||||
LEFT JOIN users_main AS um ON um.ID=ct.UserID
|
||||
WHERE ct.CollageID='$CollageID'
|
||||
ORDER BY ct.Sort");
|
||||
|
||||
$GroupIDs = $DB->collect('GroupID');
|
||||
$CollageDataList=$DB->to_array('GroupID', MYSQLI_ASSOC);
|
||||
if(count($GroupIDs)>0) {
|
||||
$TorrentList = Torrents::get_groups($GroupIDs);
|
||||
$TorrentList = $TorrentList['matches'];
|
||||
} else {
|
||||
$TorrentList = array();
|
||||
}
|
||||
$GroupIDs = $DB->collect('GroupID');
|
||||
$CollageDataList = $DB->to_array('GroupID', MYSQLI_ASSOC);
|
||||
if(count($GroupIDs)>0) {
|
||||
$TorrentList = Torrents::get_groups($GroupIDs);
|
||||
$TorrentList = $TorrentList['matches'];
|
||||
} else {
|
||||
$TorrentList = array();
|
||||
}
|
||||
|
||||
|
||||
// Loop through the result set, building up $Collage and $TorrentTable
|
||||
// Then we print them.
|
||||
$Collage = array();
|
||||
@ -246,16 +239,11 @@ function compare($X, $Y){
|
||||
<td colspan="3">
|
||||
<span>
|
||||
[ <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download">DL</a>
|
||||
<? if (($LoggedUser['FLTokens'] > 0) && ($Torrent['Size'] < 1073741824)
|
||||
&& !$Torrent['PersonalFL'] && empty($Torrent['FreeTorrent']) && ($LoggedUser['CanLeech'] == '1')) { ?>
|
||||
<? if (Torrents::can_use_token($Torrent)) { ?>
|
||||
| <a href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
||||
<? } ?>
|
||||
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a> ]
|
||||
</span>
|
||||
<? if(array_key_exists($TorrentID, $SnatchedTorrents)) {
|
||||
$Torrent['SnatchedTorrent'] = '1';
|
||||
}
|
||||
?>
|
||||
» <a href="torrents.php?id=<?=$GroupID?>&torrentid=<?=$TorrentID?>"><?=Torrents::torrent_info($Torrent)?></a>
|
||||
</td>
|
||||
<td class="nobr"><?=Format::get_size($Torrent['Size'])?></td>
|
||||
@ -272,9 +260,14 @@ function compare($X, $Y){
|
||||
|
||||
$DisplayName = '<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
|
||||
if(!empty($Torrent['FreeTorrent'])) {
|
||||
$DisplayName .=' <strong>Freeleech!</strong>';
|
||||
} elseif($Torrent['PersonalFL']) {
|
||||
if ($Torrent['IsSnatched']) {
|
||||
$DisplayName .= ' <strong class="snatched_torrent">Snatched!</strong>';
|
||||
}
|
||||
if ($Torrent['FreeTorrent'] == '1') {
|
||||
$DisplayName .= ' <strong>Freeleech!</strong>';
|
||||
} elseif ($Torrent['FreeTorrent'] == '2') {
|
||||
$DisplayName .= ' <strong>Neutral Leech!</strong>';
|
||||
} elseif ($Torrent['PersonalFL']) {
|
||||
$DisplayName .= $AddExtra.'<strong>Personal Freeleech!</strong>';
|
||||
}
|
||||
?>
|
||||
@ -287,8 +280,7 @@ function compare($X, $Y){
|
||||
<td>
|
||||
<span>
|
||||
[ <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download">DL</a>
|
||||
<? if (($LoggedUser['FLTokens'] > 0) && ($Torrent['Size'] < 1073741824)
|
||||
&& !$Torrent['PersonalFL'] && empty($Torrent['FreeTorrent']) && ($LoggedUser['CanLeech'] == '1')) { ?>
|
||||
<? if (Torrents::can_use_token($Torrent)) { ?>
|
||||
| <a href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
||||
<? } ?>
|
||||
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a> ]
|
||||
@ -570,7 +562,7 @@ function compare($X, $Y){
|
||||
LEFT JOIN users_main AS um ON um.ID=cc.UserID
|
||||
WHERE CollageID='$CollageID'
|
||||
ORDER BY ID DESC LIMIT 15");
|
||||
$CommentList = $DB->to_array();
|
||||
$CommentList = $DB->to_array(false, MYSQLI_NUM);
|
||||
}
|
||||
foreach ($CommentList as $Comment) {
|
||||
list($CommentID, $Body, $UserID, $Username, $CommentTime) = $Comment;
|
||||
@ -651,5 +643,5 @@ function compare($X, $Y){
|
||||
<?
|
||||
View::show_footer();
|
||||
|
||||
$Cache->cache_value('collage_'.$CollageID, serialize(array(array($Name, $Description, $CollageDataList, $TorrentList, $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser))), 3600);
|
||||
$Cache->cache_value('collage_'.$CollageID, array(array($Name, $Description, array(), array(), $CommentList, $Deleted, $CollageCategoryID, $CreatorID, $Locked, $MaxGroups, $MaxGroupsPerUser)), 3600);
|
||||
?>
|
||||
|
@ -80,7 +80,7 @@
|
||||
|
||||
while(list($UserID, $TorrentID, $GroupID, $Title, $PostID, $Body, $AddedTime, $EditedTime, $EditorID) = $DB->next_record()) {
|
||||
$permalink = "torrents.php?id=$GroupID&postid=$PostID#post$PostID";
|
||||
$postheader = " on " . Artists::display_artists($Artists[$GroupID]) . " <a href=\"torrents.php?id=$GroupID?>\">$Title</a>";
|
||||
$postheader = " on " . Artists::display_artists($Artists[$GroupID]) . " <a href=\"torrents.php?id=$GroupID\">$Title</a>";
|
||||
|
||||
comment_body($UserID, $PostID, $postheader, $permalink, $Body, $EditorID, $AddedTime, $EditedTime);
|
||||
|
||||
|
@ -385,7 +385,16 @@
|
||||
list($PostID, $AuthorID, $AddedTime, $Body, $EditedUserID, $EditedTime, $EditedUsername) = array_values($Post);
|
||||
list($AuthorID, $Username, $PermissionID, $Paranoia, $Artist, $Donor, $Warned, $Avatar, $Enabled, $UserTitle) = array_values(Users::user_info($AuthorID));
|
||||
?>
|
||||
<table class="forum_post box vertical_margin<? if (((!$ThreadInfo['IsLocked'] || $ThreadInfo['IsSticky']) && $PostID>$LastRead && strtotime($AddedTime)>$LoggedUser['CatchupTime']) || (isset($RequestKey) && $Key==$RequestKey)) { echo ' forum_unread'; } if($HeavyInfo['DisableAvatars']) { echo ' noavatar'; } ?> <? if($ThreadInfo['OP'] == $AuthorID) { echo "important_user"; }?> id="post<?=$PostID?>">
|
||||
<table class="forum_post box vertical_margin<?
|
||||
if (((!$ThreadInfo['IsLocked'] || $ThreadInfo['IsSticky']) && $PostID>$LastRead && strtotime($AddedTime)>$LoggedUser['CatchupTime']) || (isset($RequestKey) && $Key==$RequestKey)) {
|
||||
echo ' forum_unread';
|
||||
}
|
||||
if ($HeavyInfo['DisableAvatars']) {
|
||||
echo ' noavatar';
|
||||
}
|
||||
if ($ThreadInfo['OP'] == $AuthorID) {
|
||||
echo ' important_user';
|
||||
} ?>" id="post<?=$PostID?>">
|
||||
<tr class="colhead_dark">
|
||||
<td colspan="2">
|
||||
<div style="float:left;"><a class="post_id" href="forums.php?action=viewthread&threadid=<?=$ThreadID?>&postid=<?=$PostID?>#post<?=$PostID?>">#<?=$PostID?></a>
|
||||
@ -528,7 +537,7 @@
|
||||
<?
|
||||
if (!$LoggedUser['DisableAutoSave']) {
|
||||
?>
|
||||
<script type="application/javascript">new StoreText('quickpost', 'quickpostform');</script>
|
||||
<script type="application/javascript">new StoreText('quickpost', 'quickpostform', <?=$ThreadID?>);</script>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
|
@ -26,9 +26,9 @@
|
||||
case 'history' :
|
||||
include(SERVER_ROOT.'/sections/top10/history.php');
|
||||
break;
|
||||
/*case 'votes' :
|
||||
case 'votes' :
|
||||
include(SERVER_ROOT.'/sections/top10/votes.php');
|
||||
break;*/
|
||||
break;
|
||||
default :
|
||||
error(404);
|
||||
break;
|
||||
|
@ -19,9 +19,8 @@
|
||||
<a href="top10.php?type=torrents">[Torrents]</a>
|
||||
<a href="top10.php?type=users">[Users]</a>
|
||||
<a href="top10.php?type=tags"><strong>[Tags]</strong></a>
|
||||
<!-- <a href="top10.php?type=votes">[Favorites]</a>
|
||||
-->
|
||||
</div>
|
||||
<a href="top10.php?type=votes">[Favorites]</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?
|
||||
|
@ -40,7 +40,6 @@
|
||||
$Limit = in_array($Limit, array(10, 100, 250)) ? $Limit : 10;
|
||||
}
|
||||
$Filtered = !empty($Where);
|
||||
$SnatchedTorrents = Torrents::get_snatched_torrents();
|
||||
View::show_header('Top '.$Limit.' Torrents');
|
||||
?>
|
||||
<div class="thin">
|
||||
@ -50,8 +49,7 @@
|
||||
<a href="top10.php?type=torrents"><strong>[Torrents]</strong></a>
|
||||
<a href="top10.php?type=users">[Users]</a>
|
||||
<a href="top10.php?type=tags">[Tags]</a>
|
||||
<!-- <a href="top10.php?type=votes">[Favorites]</a>
|
||||
-->
|
||||
<a href="top10.php?type=votes">[Favorites]</a>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
@ -73,6 +71,7 @@
|
||||
<input type="radio" id="rdoAll" name="anyall" value="all"<?=($_GET['anyall']!='any'?' checked':'')?>><label for="rdoAll"> All</label>
|
||||
<input type="radio" id="rdoAny" name="anyall" value="any"<?=($_GET['anyall']=='any'?' checked':'')?>><label for="rdoAny"> Any</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Format</td>
|
||||
<td>
|
||||
@ -344,7 +343,7 @@
|
||||
|
||||
// generate a table based on data from most recent query to $DB
|
||||
function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
||||
global $LoggedUser,$Categories,$ReleaseTypes, $SnatchedTorrents;
|
||||
global $LoggedUser,$Categories,$ReleaseTypes;
|
||||
?>
|
||||
<h3>Top <?=$Limit.' '.$Caption?>
|
||||
<? if(empty($_GET['advanced'])){ ?>
|
||||
@ -436,6 +435,7 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
||||
if($GroupCategoryID==1 && $ReleaseType > 0) {
|
||||
$DisplayName.= ' ['.$ReleaseTypes[$ReleaseType].']';
|
||||
}
|
||||
|
||||
// append extra info to torrent title
|
||||
$ExtraInfo='';
|
||||
$AddExtra='';
|
||||
@ -448,13 +448,11 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
||||
if($Scene) { $ExtraInfo.=$AddExtra.'Scene'; $AddExtra=' / '; }
|
||||
if($Year>0) { $ExtraInfo.=$AddExtra.$Year; $AddExtra=' '; }
|
||||
if($RemasterTitle) { $ExtraInfo.=$AddExtra.$RemasterTitle; }
|
||||
if(array_key_exists($TorrentID, $SnatchedTorrents)) { $ExtraInfo.=' / <strong>Snatched!</strong>'; }
|
||||
if(Torrents::has_snatched($TorrentID)) { $ExtraInfo.=' / <strong class="snatched_torrent">Snatched!</strong>'; }
|
||||
if($ExtraInfo!='') {
|
||||
$ExtraInfo = "- [$ExtraInfo]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$TagList=array();
|
||||
|
||||
$PrimaryTag = '';
|
||||
|
@ -19,8 +19,7 @@
|
||||
<a href="top10.php?type=torrents">[Torrents]</a>
|
||||
<a href="top10.php?type=users"><strong>[Users]</strong></a>
|
||||
<a href="top10.php?type=tags">[Tags]</a>
|
||||
<!-- <a href="top10.php?type=votes">[Favorites]</a>
|
||||
-->
|
||||
<a href="top10.php?type=votes">[Favorites]</a>
|
||||
</div>
|
||||
</div>
|
||||
<?
|
||||
|
@ -33,14 +33,17 @@
|
||||
}
|
||||
$Filtered = !empty($Where);
|
||||
|
||||
|
||||
$Where = implode(' AND ', $Where);
|
||||
if ($_GET['anyall'] == 'any') {
|
||||
$Where = '('.implode(' OR ', $Where).')';
|
||||
} else {
|
||||
$Where = implode(' AND ', $Where);
|
||||
}
|
||||
$WhereSum = (empty($Where)) ? '' : md5($Where);
|
||||
|
||||
// Unlike the other top 10s, this query just gets some raw stats
|
||||
// We'll need to do some fancy-pants stuff to translate it into
|
||||
// BPCI scores before getting the torrent data
|
||||
$Query = "SELECT v.GroupID
|
||||
$Query = "SELECT v.GroupID, v.Ups, v.Total, v.Score
|
||||
FROM torrents_votes AS v";
|
||||
if (!empty($Where)) {
|
||||
$Query .= " JOIN torrents_group AS g ON g.ID = v.GroupID
|
||||
@ -52,10 +55,12 @@
|
||||
|
||||
$TopVotes = $Cache->get_value('top10votes_'.$Limit.$WhereSum);
|
||||
if ($TopVotes === false) {
|
||||
if (true || $Cache->get_query_lock('top10votes')) {
|
||||
if ($Cache->get_query_lock('top10votes')) {
|
||||
$DB->query($Query);
|
||||
|
||||
$Results = $DB->collect('GroupID');
|
||||
$Data = $DB->to_array('GroupID');
|
||||
|
||||
$Groups = Torrents::get_groups($Results);
|
||||
if (count($Results) > 0) {
|
||||
$DB->query('SELECT ID, CategoryID FROM torrents_group
|
||||
@ -67,6 +72,9 @@
|
||||
foreach ($Results as $GroupID) {
|
||||
$TopVotes[$GroupID] = $Groups['matches'][$GroupID];
|
||||
$TopVotes[$GroupID]['CategoryID'] = $Cats[$GroupID]['CategoryID'];
|
||||
$TopVotes[$GroupID]['Ups'] = $Data[$GroupID]['Ups'];
|
||||
$TopVotes[$GroupID]['Total'] = $Data[$GroupID]['Total'];
|
||||
$TopVotes[$GroupID]['Score'] = $Data[$GroupID]['Score'];
|
||||
}
|
||||
|
||||
$Cache->cache_value('top10votes_'.$Limit.$WhereSum,$TopVotes,60*30);
|
||||
@ -75,7 +83,7 @@
|
||||
$TopVotes = false;
|
||||
}
|
||||
}
|
||||
$SnatchedTorrents = Torrents::get_snatched_torrents();
|
||||
|
||||
View::show_header('Top '.$Limit.' Voted Groups','browse');
|
||||
?>
|
||||
<div class="thin">
|
||||
@ -101,6 +109,13 @@
|
||||
<input type="text" name="tags" size="75" value="<? if(!empty($_GET['tags'])) { echo display_str($_GET['tags']);} ?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<input type="radio" id="rdoAll" name="anyall" value="all"<?=($_GET['anyall']!='any'?' checked':'')?>><label for="rdoAll"> All</label>
|
||||
<input type="radio" id="rdoAny" name="anyall" value="any"<?=($_GET['anyall']=='any'?' checked':'')?>><label for="rdoAny"> Any</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label">Year:</td>
|
||||
<td>
|
||||
@ -154,7 +169,7 @@
|
||||
foreach ($TopVotes as $GroupID=>$Group) {
|
||||
list($GroupID, $GroupName, $GroupYear, $GroupRecordLabel,
|
||||
$GroupCatalogueNumber, $TagList, $ReleaseType, $GroupVanityHouse,
|
||||
$Torrents, $GroupArtists, $ExtendedArtists, $GroupCategoryID) = array_values($Group);
|
||||
$Torrents, $GroupArtists, $ExtendedArtists, $GroupCategoryID,$Ups,$Total,$Score) = array_values($Group);
|
||||
|
||||
// Handle stats and stuff
|
||||
$Number++;
|
||||
@ -200,16 +215,13 @@
|
||||
<td>
|
||||
<strong><?=$DisplayName?></strong>
|
||||
<? if(in_array($GroupID, $Bookmarks)) { ?>
|
||||
<span style="float:right;">[ <a href="#" id="bookmarklink_torrent_<?=$GroupID?>" title="Remove bookmark" onclick="Unbookmark('torrent',<?=$GroupID?>,'Bookmark');return false;">Unbookmark</a> ]</span>
|
||||
<span style="float:right;">[ <a href="#" class="bookmarklink_torrent_<?=$GroupID?>" title="Remove bookmark" onclick="Unbookmark('torrent',<?=$GroupID?>,'Bookmark');return false;">Unbookmark</a> ]</span>
|
||||
<? } else { ?>
|
||||
<span style="float:right;">[ <a href="#" id="bookmarklink_torrent_<?=$GroupID?>" title="Add bookmark" onclick="Bookmark('torrent',<?=$GroupID?>,'Unbookmark');return false;">Bookmark</a> ]</span>
|
||||
<span style="float:right;">[ <a href="#" class="bookmarklink_torrent_<?=$GroupID?>" title="Add bookmark" onclick="Bookmark('torrent',<?=$GroupID?>,'Unbookmark');return false;">Bookmark</a> ]</span>
|
||||
<? } ?>
|
||||
<?=$TorrentTags?>
|
||||
</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td colspan="4" class="votes_info_td"><strong><?=$Ups?></strong> upvotes out of <strong><?=$Total?></strong> total (Score: <?=round($Score*100)?>).</td>
|
||||
</tr>
|
||||
<?
|
||||
$LastRemasterYear = '-';
|
||||
@ -227,10 +239,6 @@
|
||||
$FirstUnknown = !isset($FirstUnknown);
|
||||
}
|
||||
|
||||
if (in_array($TorrentID, $TokenTorrents) && empty($Torrent['FreeTorrent'])) {
|
||||
$Torrent['PersonalFL'] = 1;
|
||||
}
|
||||
|
||||
if($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
|
||||
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] != $LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
|
||||
$EditionID++;
|
||||
@ -274,8 +282,7 @@
|
||||
<td colspan="3">
|
||||
<span>
|
||||
[ <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download">DL</a>
|
||||
<? if (($LoggedUser['FLTokens'] > 0) && ($Torrent['Size'] < 1073741824)
|
||||
&& !in_array($TorrentID, $TokenTorrents) && empty($Torrent['FreeTorrent']) && ($LoggedUser['CanLeech'] == '1')) { ?>
|
||||
<? if (Torrents::can_use_token($Torrent)) { ?>
|
||||
| <a href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
||||
<? } ?>
|
||||
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a> ]
|
||||
@ -295,14 +302,17 @@
|
||||
list($TorrentID, $Torrent) = each($Torrents);
|
||||
|
||||
$DisplayName = $Number .' - <a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
|
||||
if(array_key_exists($TorrentID, $SnatchedTorrents)) { $DisplayName.=' <strong>Snatched!</strong>'; }
|
||||
|
||||
if(!empty($Torrent['FreeTorrent'])) {
|
||||
$DisplayName .=' <strong>Freeleech!</strong>';
|
||||
} elseif(in_array($TorrentID, $TokenTorrents)) {
|
||||
if($Torrent['IsSnatched']) {
|
||||
$DisplayName .= ' <strong class="snatched_torrent">Snatched!</strong>';
|
||||
}
|
||||
if ($Torrent['FreeTorrent'] == '1') {
|
||||
$DisplayName .= ' <strong>Freeleech!</strong>';
|
||||
} elseif ($Torrent['FreeTorrent'] == '2') {
|
||||
$DisplayName .= ' <strong>Neutral Leech!</strong>';
|
||||
} elseif(Torrents::has_token($TorrentID)) {
|
||||
$DisplayName .= $AddExtra.'<strong>Personal Freeleech!</strong>';
|
||||
}
|
||||
|
||||
?>
|
||||
<tr class="torrent" id="group_<?=$GroupID?>">
|
||||
<td></td>
|
||||
@ -313,8 +323,7 @@
|
||||
<td class="nobr">
|
||||
<span>
|
||||
[ <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download">DL</a>
|
||||
<? if (($LoggedUser['FLTokens'] > 0) && ($Torrent['Size'] < 1073741824)
|
||||
&& !in_array($TorrentID, $TokenTorrents) && empty($Torrent['FreeTorrent']) && ($LoggedUser['CanLeech'] == '1')) { ?>
|
||||
<? if (Torrents::can_use_token($Torrent)) { ?>
|
||||
| <a href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
||||
<? } ?>
|
||||
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a>
|
||||
@ -354,7 +363,7 @@
|
||||
<td colspan="7" class="center">Server is busy processing another top list request. Please try again in a minute.</td>
|
||||
</tr>
|
||||
<?
|
||||
} elseif (count($Groups) == 0) { ?>
|
||||
} elseif (count($TopVotes) == 0) { ?>
|
||||
<tr>
|
||||
<td colspan="7" class="center">No torrents were found that meet your criteria.</td>
|
||||
</tr>
|
||||
|
@ -956,8 +956,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
<td colspan="3">
|
||||
<span>
|
||||
[ <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download"><?=$Data['HasFile'] ? 'DL' : 'Missing'?></a>
|
||||
<? if (($LoggedUser['FLTokens'] > 0) && $Data['HasFile'] && ($Data['Size'] < 1073741824)
|
||||
&& !$Data['PersonalFL'] && empty($Data['FreeTorrent']) && ($LoggedUser['CanLeech'] == '1')) { ?>
|
||||
<? if (Torrents::can_use_token($Data)) { ?>
|
||||
| <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
||||
<? } ?>
|
||||
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a> ]
|
||||
@ -980,6 +979,9 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
|
||||
$DisplayName = '<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
|
||||
if ($Data['IsSnatched']) {
|
||||
$DisplayName .= ' <strong class="snatched_torrent">Snatched!</strong>';
|
||||
}
|
||||
if ($Data['FreeTorrent'] == '1') {
|
||||
$DisplayName .= ' <strong>Freeleech!</strong>';
|
||||
} elseif ($Data['FreeTorrent'] == '2') {
|
||||
@ -996,8 +998,7 @@ function header_link($SortKey,$DefaultWay="desc") {
|
||||
<td>
|
||||
<span>
|
||||
[ <a href="torrents.php?action=download&id=<?=$TorrentID?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download">DL</a>
|
||||
<? if (($LoggedUser['FLTokens'] > 0) && $Data['HasFile'] && ($Data['Size'] < 1073741824)
|
||||
&& !$Data['PersonalFL'] && empty($Data['FreeTorrent']) && ($LoggedUser['CanLeech'] == '1')) { ?>
|
||||
<? if (Torrents::can_use_token($Data)) { ?>
|
||||
| <a href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
||||
<? } ?>
|
||||
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a> ]
|
||||
|
@ -80,13 +80,6 @@ function compare($X, $Y){
|
||||
die();
|
||||
}*/
|
||||
|
||||
$TokenTorrents = $Cache->get_value('users_tokens_'.$UserID);
|
||||
if (empty($TokenTorrents)) {
|
||||
$DB->query("SELECT TorrentID FROM users_freeleeches WHERE UserID=$UserID AND Expired=FALSE");
|
||||
$TokenTorrents = $DB->collect('TorrentID');
|
||||
$Cache->cache_value('users_tokens_'.$UserID, $TokenTorrents);
|
||||
}
|
||||
$SnatchedTorrents = Torrents::get_snatched_torrents();
|
||||
// Start output
|
||||
View::show_header($Title,'browse,comments,torrent,bbcode');
|
||||
?>
|
||||
@ -365,8 +358,7 @@ function compare($X, $Y){
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<? //include(SERVER_ROOT.'/sections/torrents/vote.php');
|
||||
?>
|
||||
<? include(SERVER_ROOT.'/sections/torrents/vote.php'); ?>
|
||||
</div>
|
||||
<div class="main_column">
|
||||
<table class="torrent_table details" id="torrent_details">
|
||||
@ -404,7 +396,7 @@ function filelist($Str) {
|
||||
$Snatched, $FreeTorrent, $TorrentTime, $Description, $FileList,
|
||||
$FilePath, $UserID, $LastActive, $BadTags, $BadFolders, $BadFiles,
|
||||
$CassetteApproved, $LossymasterApproved, $LossywebApproved, $LastReseedRequest,
|
||||
$LogInDB, $HasFile, $PersonalFL) = array_values($Torrent);
|
||||
$LogInDB, $HasFile, $PersonalFL, $IsSnatched) = array_values($Torrent);
|
||||
|
||||
if($Remastered && !$RemasterYear) {
|
||||
$FirstUnknown = !isset($FirstUnknown);
|
||||
@ -473,7 +465,7 @@ function filelist($Str) {
|
||||
if(!$ExtraInfo) {
|
||||
$ExtraInfo = $GroupName ; $AddExtra=' / ';
|
||||
}
|
||||
if(array_key_exists($TorrentID, $SnatchedTorrents)) {$ExtraInfo.=$AddExtra.'<strong>Snatched!</strong>'; $AddExtra=' / '; }
|
||||
if($IsSnatched) { $ExtraInfo.=$AddExtra.'<strong class="snatched_torrent">Snatched!</strong>'; $AddExtra=' / '; }
|
||||
if($FreeTorrent == '1') { $ExtraInfo.=$AddExtra.'<strong>Freeleech!</strong>'; $AddExtra=' / '; }
|
||||
if($FreeTorrent == '2') { $ExtraInfo.=$AddExtra.'<strong>Neutral Leech!</strong>'; $AddExtra=' / '; }
|
||||
if($PersonalFL) { $ExtraInfo.=$AddExtra.'<strong>Personal Freeleech!</strong>'; $AddExtra=' / '; }
|
||||
@ -535,8 +527,7 @@ function filelist($Str) {
|
||||
<tr class="releases_<?=$ReleaseType?> groupid_<?=$GroupID?> edition_<?=$EditionID?> group_torrent" style="font-weight: normal;" id="torrent<?=$TorrentID?>">
|
||||
<td>
|
||||
<span>[ <a href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>" title="Download"><?=$HasFile ? 'DL' : 'Missing'?></a>
|
||||
<? if (($LoggedUser['FLTokens'] > 0) && $HasFile && ($Size < 1073741824)
|
||||
&& !$PersonalFL && ($FreeTorrent == '0') && ($LoggedUser['CanLeech'] == '1')) { ?>
|
||||
<? if (Torrents::can_use_token($Torrent)) { ?>
|
||||
| <a href="torrents.php?action=download&id=<?=$TorrentID ?>&authkey=<?=$LoggedUser['AuthKey']?>&torrent_pass=<?=$LoggedUser['torrent_pass']?>&usetoken=1" title="Use a FL Token" onclick="return confirm('Are you sure you want to use a freeleech token here?');">FL</a>
|
||||
<? } ?>
|
||||
| <a href="reportsv2.php?action=report&id=<?=$TorrentID?>" title="Report">RP</a>
|
||||
@ -740,7 +731,7 @@ function filelist($Str) {
|
||||
<?
|
||||
}
|
||||
// Matched Votes
|
||||
//include(SERVER_ROOT.'/sections/torrents/voter_picks.php');
|
||||
include(SERVER_ROOT.'/sections/torrents/voter_picks.php');
|
||||
?>
|
||||
<div class="box">
|
||||
<div class="head"><strong><?=(!empty($ReleaseType) ? $ReleaseTypes[$ReleaseType].' info' : 'Info' )?></strong></div>
|
||||
|
@ -144,30 +144,6 @@
|
||||
|
||||
$DB->query("INSERT IGNORE INTO users_downloads (UserID, TorrentID, Time) VALUES ('$UserID', '$TorrentID', '".sqltime()."')");
|
||||
|
||||
$SnatchedTorrents = $Cache->get_value('users_snatched_'.$UserID);
|
||||
if (empty($SnatchedTorrents)) {
|
||||
$DB->query("SELECT DISTINCT fid as TorrentID FROM xbt_snatched WHERE uid='$UserID' ORDER BY TorrentID ASC");
|
||||
$SnatchedTorrents = array_flip($DB->collect('TorrentID'));
|
||||
$Cache->cache_value('users_snatched_'.$UserID, $SnatchedTorrents, 86400);
|
||||
}
|
||||
if(!array_key_exists($TorrentID, $SnatchedTorrents)) {
|
||||
$SnatchedTorrents[$TorrentID] = 1;
|
||||
$Cache->cache_value('users_snatched_'.$UserID, $SnatchedTorrents, 86400);
|
||||
}
|
||||
|
||||
|
||||
$SnatchedTorrents = $Cache->get_value('users_snatched_'.$UserID);
|
||||
if (empty($SnatchedTorrents)) {
|
||||
$DB->query("SELECT DISTINCT fid as TorrentID FROM xbt_snatched WHERE uid='$UserID' ORDER BY TorrentID ASC");
|
||||
$SnatchedTorrents = array_flip($DB->collect('TorrentID'));
|
||||
$Cache->cache_value('users_snatched_'.$UserID, $SnatchedTorrents, 86400);
|
||||
}
|
||||
if(!array_key_exists($TorrentID, $SnatchedTorrents)) {
|
||||
$SnatchedTorrents[$TorrentID] = 1;
|
||||
$Cache->cache_value('users_snatched_'.$UserID, $SnatchedTorrents, 86400);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$DB->query("SELECT File FROM torrents_files WHERE TorrentID='$TorrentID'");
|
||||
|
||||
|
@ -65,7 +65,7 @@ function header_link($SortKey, $DefaultWay = "desc") {
|
||||
|
||||
$DB->query("CREATE TEMPORARY TABLE temp_notify_torrents
|
||||
(TorrentID int, GroupID int, UnRead tinyint, FilterID int, Year smallint, PRIMARY KEY(GroupID, TorrentID), KEY(Year)) ENGINE=MyISAM");
|
||||
$DB->query("INSERT INTO temp_notify_torrents (TorrentID, GroupID, UnRead, FilterID)
|
||||
$DB->query("INSERT IGNORE INTO temp_notify_torrents (TorrentID, GroupID, UnRead, FilterID)
|
||||
SELECT t.ID, t.GroupID, unt.UnRead, unt.FilterID
|
||||
FROM users_notify_torrents AS unt JOIN torrents AS t ON t.ID=unt.TorrentID
|
||||
WHERE unt.UserID=$UserID".
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
arsort($GroupScores);
|
||||
$Top10 = array_slice($GroupScores, 0, 10, true);
|
||||
$Cache->cache_value('similar_albums_'.$GroupID, $Top10, 12*3600);
|
||||
$Cache->cache_value('similar_albums_'.$GroupID, $Top10, 2*3600);
|
||||
}
|
||||
if (count($Top10) > 0) {
|
||||
?>
|
||||
|
@ -52,9 +52,6 @@ function checked($Checked) {
|
||||
return $Checked ? 'checked="checked"' : '';
|
||||
}
|
||||
|
||||
$DB->query("SELECT COUNT(x.uid) FROM xbt_snatched AS x INNER JOIN torrents AS t ON t.ID=x.fid WHERE x.uid='$UserID'");
|
||||
list($Snatched) = $DB->next_record();
|
||||
|
||||
if ($SiteOptions) {
|
||||
$SiteOptions = unserialize($SiteOptions);
|
||||
} else {
|
||||
@ -142,7 +139,6 @@ function checked($Checked) {
|
||||
<input type="checkbox" name="showsnatched" id="showsnatched" <? if (!empty($SiteOptions['ShowSnatched'])) { ?>checked="checked"<? } ?> />
|
||||
<label for="showsnatched">"Snatched!" next to snatched torrents</label>
|
||||
</td>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="label"><strong>Posts per page (Forum)</strong></td>
|
||||
@ -303,7 +299,6 @@ function checked($Checked) {
|
||||
<label for="disableavatars">Disable avatars</label>
|
||||
</td>
|
||||
</tr>
|
||||
<? /*
|
||||
<tr>
|
||||
<td class="label"><strong>Push Notifications</strong></td>
|
||||
<td>
|
||||
@ -327,15 +322,13 @@ function checked($Checked) {
|
||||
<br />
|
||||
<input type="checkbox" name="pushfilters[]" value="News" <? if(isset($PushOptions['PushFilters']['News'])) { ?> checked="checked" <? } ?>/>Announcements<br />
|
||||
<input type="checkbox" name="pushfilters[]" value="PM" <? if(isset($PushOptions['PushFilters']['PM'])) { ?> checked="checked" <? } ?>/>Private Messages<br />
|
||||
<?
|
||||
<input type="checkbox" name="pushfilters[]" value="Rippy" <? if(isset($PushOptions['PushFilters']['Rippy'])) { ?> checked="checked" <? } ?>/>Rippys<br />
|
||||
?>
|
||||
<? /* <input type="checkbox" name="pushfilters[]" value="Rippy" <? if(isset($PushOptions['PushFilters']['Rippy'])) { ?> checked="checked" <? } ?>/>Rippys<br /> */ ?>
|
||||
|
||||
[<a href="user.php?action=take_push&push=1&userid=<?=$UserID?>&auth=<?=$LoggedUser['AuthKey']?>">Test Push</a>]
|
||||
[<a href="wiki.php?action=article&id=1017>">Wiki Guide</a>]
|
||||
[<a href="wiki.php?action=article&id=1017">Wiki Guide</a>]
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
*/ ?>
|
||||
<tr>
|
||||
<td class="label"><strong>Rippy!</strong></td>
|
||||
<td>
|
||||
@ -407,7 +400,7 @@ function checked($Checked) {
|
||||
<td class="label"> </td>
|
||||
<td>
|
||||
<p><span class="warning">Note: Paranoia has nothing to do with your security on this site; the only thing affected by this setting is other users' ability to see your site activity and taste in music.</span></p>
|
||||
<p>Select the elements <strong>you want to show</strong> on your profile. For example, if you tick "Show count" for "Snatched", users will be able to see that you have snatched <?=number_format($Snatched)?> torrents. If you tick "Show list", they will be able to see the full list of torrents you've snatched.</p>
|
||||
<p>Select the elements <strong>you want to show</strong> on your profile. For example, if you tick "Show count" for "Snatched", users will be able to see how many torrents you have snatched. If you tick "Show list", they will be able to see the full list of torrents you've snatched.</p>
|
||||
<p><span class="warning">Some information will still be available in the site log.</span></p>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -196,7 +196,6 @@
|
||||
$Options['ShowSnatched'] = (!empty($_POST['showsnatched']) ? 1 : 0);
|
||||
|
||||
|
||||
|
||||
if(isset($LoggedUser['DisableFreeTorrentTop10'])) {
|
||||
$Options['DisableFreeTorrentTop10'] = $LoggedUser['DisableFreeTorrentTop10'];
|
||||
}
|
||||
|
@ -365,7 +365,7 @@
|
||||
}
|
||||
|
||||
if ($Warned == 1 && $Cur['Warned']=='0000-00-00 00:00:00' && check_perms('users_warn')) {
|
||||
Misc::send_pm($UserID,0,db_string('You have received a warning'),db_string("You have been [url=http://".NONSSL_SITE_URL."/wiki.php?action=article&id=218]warned for $WarnLength week(s)[/url] by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason"));
|
||||
Misc::send_pm($UserID,0,db_string('You have received a warning'),db_string("You have been [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&id=218]warned for $WarnLength week(s)[/url] by [user]".$LoggedUser['Username']."[/user]. The reason given was: $WarnReason"));
|
||||
$UpdateSet[]="Warned='".sqltime()."' + INTERVAL $WarnLength WEEK";
|
||||
$Msg = "warned for $WarnLength week(s)";
|
||||
if ($WarnReason) { $Msg.=" for $WarnReason"; }
|
||||
@ -444,7 +444,7 @@
|
||||
$EditSummary[]="avatar status changed";
|
||||
$HeavyUpdates['DisableAvatar']=$DisableAvatar;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your avatar privileges have been disabled'),db_string("Your avatar privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=http://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, db_string('Your avatar privileges have been disabled'),db_string("Your avatar privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
}
|
||||
}
|
||||
|
||||
@ -454,7 +454,7 @@
|
||||
$HeavyUpdates['DisableLeech']=$DisableLeech;
|
||||
$HeavyUpdates['CanLeech']=$DisableLeech;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your leeching privileges have been disabled'),db_string("Your leeching privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=http://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, db_string('Your leeching privileges have been disabled'),db_string("Your leeching privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
}
|
||||
Tracker::update_tracker('update_user', array('passkey' => $Cur['torrent_pass'], 'can_leech' => $DisableLeech));
|
||||
}
|
||||
@ -464,7 +464,7 @@
|
||||
if ($DisableInvites == 1) {
|
||||
//$UpdateSet[]="Invites='0'";
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your invite privileges have been disabled'),db_string("Your invite privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=http://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, db_string('Your invite privileges have been disabled'),db_string("Your invite privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
}
|
||||
}
|
||||
$EditSummary[]="invites status changed";
|
||||
@ -476,7 +476,7 @@
|
||||
$EditSummary[]="posting status changed";
|
||||
$HeavyUpdates['DisablePosting']=$DisablePosting;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your forum posting privileges have been disabled'),db_string("Your forum posting privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=http://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, db_string('Your forum posting privileges have been disabled'),db_string("Your forum posting privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
}
|
||||
}
|
||||
|
||||
@ -485,7 +485,7 @@
|
||||
$EditSummary[]="forums status changed";
|
||||
$HeavyUpdates['DisableForums']=$DisableForums;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your forum privileges have been disabled'),db_string("Your forum privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=http://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, db_string('Your forum privileges have been disabled'),db_string("Your forum privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
}
|
||||
}
|
||||
|
||||
@ -494,7 +494,7 @@
|
||||
$EditSummary[]="tagging status changed";
|
||||
$HeavyUpdates['DisableTagging']=$DisableTagging;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your tagging privileges have been disabled'),db_string("Your tagging privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=http://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, db_string('Your tagging privileges have been disabled'),db_string("Your tagging privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
}
|
||||
}
|
||||
|
||||
@ -503,7 +503,7 @@
|
||||
$EditSummary[]="upload status changed";
|
||||
$HeavyUpdates['DisableUpload']=$DisableUpload;
|
||||
if ($DisableUpload == 1) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your upload privileges have been disabled'),db_string("Your upload privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=http://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, db_string('Your upload privileges have been disabled'),db_string("Your upload privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
}
|
||||
}
|
||||
|
||||
@ -513,7 +513,7 @@
|
||||
$HeavyUpdates['DisableWiki']=$DisableWiki;
|
||||
$HeavyUpdates['site_edit_wiki']=0;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your site editing privileges have been disabled'),db_string("Your site editing privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=http://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, db_string('Your site editing privileges have been disabled'),db_string("Your site editing privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
}
|
||||
|
||||
}
|
||||
@ -523,7 +523,7 @@
|
||||
$EditSummary[]="PM status changed";
|
||||
$HeavyUpdates['DisablePM']=$DisablePM;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your PM privileges have been disabled'),db_string("Your PM privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=http://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
Misc::send_pm($UserID, 0, db_string('Your PM privileges have been disabled'),db_string("Your PM privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]."));
|
||||
}
|
||||
}
|
||||
|
||||
@ -532,7 +532,7 @@
|
||||
$EditSummary[]="IRC status changed";
|
||||
$HeavyUpdates['DisableIRC']=$DisableIRC;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your IRC privileges have been disabled'),db_string("Your IRC privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=http://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled."));
|
||||
Misc::send_pm($UserID, 0, db_string('Your IRC privileges have been disabled'),db_string("Your IRC privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled."));
|
||||
}
|
||||
}
|
||||
|
||||
@ -541,7 +541,7 @@
|
||||
$EditSummary[]="request status changed";
|
||||
$HeavyUpdates['DisableRequests']=$DisableRequests;
|
||||
if (!empty($UserReason)) {
|
||||
Misc::send_pm($UserID, 0, db_string('Your request privileges have been disabled'),db_string("Your request privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=http://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled."));
|
||||
Misc::send_pm($UserID, 0, db_string('Your request privileges have been disabled'),db_string("Your request privileges have been disabled. The reason given was: $UserReason. If you would like to discuss this please join ".BOT_DISABLED_CHAN." on our IRC network. Instructions can be found [url=https://".NONSSL_SITE_URL."/wiki.php?action=article&name=IRC+-+How+to+join]here[/url]. This loss of privileges does not affect the ability to join and talk to staff in #what.cd-disabled."));
|
||||
}
|
||||
}
|
||||
|
||||
@ -614,10 +614,10 @@
|
||||
$DB->query("SELECT ID, Uploaded, Downloaded FROM users_main WHERE Username LIKE '".$MergeStatsFrom."'");
|
||||
if($DB->record_count() > 0) {
|
||||
list($MergeID, $MergeUploaded, $MergeDownloaded) = $DB->next_record();
|
||||
$DB->query("UPDATE users_main AS um JOIN users_info AS ui ON um.ID=ui.UserID SET um.Uploaded = 0, um.Downloaded = 0, ui.AdminComment = CONCAT('".sqltime()." - Stats merged into http://".NONSSL_SITE_URL."/user.php?id=".$UserID." (".$Cur['Username'].") by ".$LoggedUser['Username']."\n\n', ui.AdminComment) WHERE ID = ".$MergeID);
|
||||
$DB->query("UPDATE users_main AS um JOIN users_info AS ui ON um.ID=ui.UserID SET um.Uploaded = 0, um.Downloaded = 0, ui.AdminComment = CONCAT('".sqltime()." - Stats merged into https://".NONSSL_SITE_URL."/user.php?id=".$UserID." (".$Cur['Username'].") by ".$LoggedUser['Username']."\n\n', ui.AdminComment) WHERE ID = ".$MergeID);
|
||||
$UpdateSet[]="Uploaded = Uploaded + '$MergeUploaded'";
|
||||
$UpdateSet[]="Downloaded = Downloaded + '$MergeDownloaded'";
|
||||
$EditSummary[]="stats merged from http://".NONSSL_SITE_URL."/user.php?id=".$MergeID." (".$MergeStatsFrom.")";
|
||||
$EditSummary[]="stats merged from https://".NONSSL_SITE_URL."/user.php?id=".$MergeID." (".$MergeStatsFrom.")";
|
||||
$Cache->delete_value('users_stats_'.$UserID);
|
||||
$Cache->delete_value('users_stats_'.$MergeID);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@
|
||||
<div class="header">
|
||||
<h2>
|
||||
Quote notifications
|
||||
<?=$NumResults ? " ($NumResults new)" : ""
|
||||
<?=$NumResults && !empty($UnreadSQL) ? " ($NumResults new)" : ""
|
||||
?>
|
||||
</h2>
|
||||
<div class="linkbox pager">
|
||||
|
@ -244,37 +244,46 @@ function AddPollOption(id) {
|
||||
* HTML5-compatible storage system
|
||||
* Tries to use 'oninput' event to detect text changes and sessionStorage to save it.
|
||||
*
|
||||
* new StoreText('some_textarea_id', 'some_form_id')
|
||||
* new StoreText('some_textarea_id', 'some_form_id', 'some_topic_id')
|
||||
* The form is required to remove the stored text once it is submitted.
|
||||
*
|
||||
* Topic ID is required to retrieve the right text on the right topic
|
||||
**/
|
||||
function StoreText (field, form) {
|
||||
function StoreText (field, form, topic) {
|
||||
this.field = document.getElementById(field);
|
||||
this.form = document.getElementById(form);
|
||||
this.key = 'auto_save_temp';
|
||||
this.keyID = 'auto_save_temp_id';
|
||||
this.topic = +topic;
|
||||
this.load();
|
||||
}
|
||||
StoreText.prototype = {
|
||||
constructor : StoreText,
|
||||
load : function () {
|
||||
if(this.field && this.enabled()){
|
||||
if (this.enabled() && this.valid()) {
|
||||
this.retrieve();
|
||||
this.autosave();
|
||||
this.clearForm();
|
||||
}
|
||||
},
|
||||
valid : function () {
|
||||
return this.field && this.form && !isNaN(this.topic);
|
||||
},
|
||||
enabled : function () {
|
||||
return window.sessionStorage && typeof window.sessionStorage === 'object';
|
||||
},
|
||||
retrieve : function () {
|
||||
var r = sessionStorage.getItem(this.key);
|
||||
if (r) {
|
||||
this.field.value = sessionStorage.getItem(this.key);
|
||||
if (this.topic === +sessionStorage.getItem(this.keyID) && r) {
|
||||
this.field.value = r;
|
||||
}
|
||||
},
|
||||
remove : function () {
|
||||
sessionStorage.removeItem(this.keyID);
|
||||
sessionStorage.removeItem(this.key);
|
||||
},
|
||||
save : function () {
|
||||
sessionStorage.setItem(this.keyID, this.topic);
|
||||
sessionStorage.setItem(this.key, this.field.value);
|
||||
},
|
||||
autosave : function () {
|
||||
|
@ -253,7 +253,12 @@ function Vote(amount, requestid) {
|
||||
);
|
||||
}
|
||||
|
||||
var voteLock = false;
|
||||
function DownVoteGroup(groupid, authkey) {
|
||||
if (voteLock) {
|
||||
return;
|
||||
}
|
||||
voteLock = true;
|
||||
ajax.get('ajax.php?action=votefavorite&do=vote&groupid='+groupid+'&vote=down'+'&auth='+authkey, function (response) {
|
||||
if (response == 'noaction') {
|
||||
//No increment
|
||||
@ -266,9 +271,14 @@ function DownVoteGroup(groupid, authkey) {
|
||||
$('#unvote_message').show();
|
||||
$('#upvoted').hide();
|
||||
$('#downvoted').show();
|
||||
voteLock = false;
|
||||
}
|
||||
|
||||
function UpVoteGroup(groupid, authkey) {
|
||||
if (voteLock) {
|
||||
return;
|
||||
}
|
||||
voteLock = true;
|
||||
ajax.get('ajax.php?action=votefavorite&do=vote&groupid='+groupid+'&vote=up'+'&auth='+authkey, function (response) {
|
||||
if (response == 'noaction') {
|
||||
//No increment
|
||||
@ -283,9 +293,14 @@ function UpVoteGroup(groupid, authkey) {
|
||||
$('#unvote_message').show();
|
||||
$('#upvoted').show();
|
||||
$('#downvoted').hide();
|
||||
voteLock = false;
|
||||
}
|
||||
|
||||
function UnvoteGroup(groupid, authkey) {
|
||||
if (voteLock) {
|
||||
return;
|
||||
}
|
||||
voteLock = true;
|
||||
ajax.get('ajax.php?action=votefavorite&do=unvote&groupid='+groupid+'&auth='+authkey, function (response) {
|
||||
if (response == 'noaction') {
|
||||
//No increment
|
||||
@ -301,4 +316,5 @@ function UnvoteGroup(groupid, authkey) {
|
||||
$('#unvote_message').hide();
|
||||
$('#upvoted').hide();
|
||||
$('#downvoted').hide();
|
||||
voteLock = false;
|
||||
}
|
@ -238,8 +238,6 @@ span.secondary_class {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
<<<<<<<
|
||||
HEAD
|
||||
.paranoia_override {
|
||||
font-style: italic;
|
||||
}
|
||||
@ -331,7 +329,8 @@ tr.torrent .bookmark>a:after {
|
||||
width: 50%;
|
||||
|
||||
}
|
||||
.navigation_list {
|
||||
.navigation_list,
|
||||
.navigation_list ol {
|
||||
list-style-position: inside;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 20px;
|
||||
@ -349,5 +348,7 @@ tr.torrent .bookmark>a:after {
|
||||
list-style-type: lower-alpha;
|
||||
}
|
||||
|
||||
.torrent_table .group .votes_info_td strong { font-size: inherit; }
|
||||
|
||||
.text_preview { min-height: 100px }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user