diff --git a/classes/class_text.php b/classes/class_text.php index 7c276572..6eaeeae4 100644 --- a/classes/class_text.php +++ b/classes/class_text.php @@ -519,7 +519,10 @@ function to_html($Array) { if(!$this->valid_url($Block['Val'], '\.(jpe?g|gif|png|bmp|tiff)')) { $Str.='[img]'.$Block['Val'].'[/img]'; } else { - if(check_perms('site_proxy_images')) { + $LocalURL = $this->local_url($Block['Val']); + if($LocalURL) { + $Str.=''.$Block['Val'].''; + } elseif(check_perms('site_proxy_images')) { $Str.=''.$Block['Val'].''; } else { $Str.=''.$Block['Val'].''; diff --git a/classes/script_start.php b/classes/script_start.php index 043a8a8c..ae1cd3dd 100644 --- a/classes/script_start.php +++ b/classes/script_start.php @@ -591,7 +591,7 @@ function get_cc($IP) { function display_ip($IP) { $Line = display_str($IP).' ('.get_cc($IP).') '; - $Line .= '[S]'; + $Line .= '[S]'; return $Line; } @@ -2104,9 +2104,10 @@ function freeleech_groups($GroupIDs, $FreeNeutral = 1, $FreeLeechType = 0) { } $DB->query("SELECT ID from torrents WHERE GroupID IN (".implode(", ", $GroupIDs).")"); - $TorrentIDs = $DB->collect('ID'); - - freeleech_torrents($TorrentIDs, $FreeNeutral, $FreeLeechType); + if($DB->record_count()) { + $TorrentIDs = $DB->collect('ID'); + freeleech_torrents($TorrentIDs, $FreeNeutral, $FreeLeechType); + } } diff --git a/sections/artist/rename.php b/sections/artist/rename.php index fe30095b..4daa4853 100644 --- a/sections/artist/rename.php +++ b/sections/artist/rename.php @@ -48,18 +48,28 @@ $DB->query("UPDATE artists_alias SET Redirect='$TargetAliasID' WHERE AliasID='$OldAliasID'"); $DB->query("UPDATE artists_group SET Name='".db_string($NewName)."' WHERE ArtistID='$ArtistID'"); + $DB->query("SELECT GroupID FROM torrents_artists WHERE AliasID='$OldAliasID'"); $Groups = $DB->collect('GroupID'); $DB->query("UPDATE IGNORE torrents_artists SET AliasID='$TargetAliasID' WHERE AliasID='$OldAliasID'"); $DB->query("DELETE FROM torrents_artists WHERE AliasID='$OldAliasID'"); - if(!empty($Groups)) { foreach($Groups as $GroupID) { $Cache->delete_value('groups_artists_'.$GroupID); // Delete group artist cache update_hash($GroupID); } } - + + $DB->query("SELECT RequestID FROM requests_artists WHERE AliasID='$OldAliasID'"); + $Requests = $DB->collect('RequestID'); + $DB->query("UPDATE IGNORE requests_artists SET AliasID='$TargetAliasID' WHERE AliasID='$OldAliasID'"); + $DB->query("DELETE FROM requests_artists WHERE AliasID='$OldAliasID'"); + if(!empty($Requests)) { + foreach($Requests as $RequestID) { + $Cache->delete_value('request_artists_'.$RequestID); // Delete group artist cache + update_sphinx_requests($RequestID); + } + } $TargetArtistID = $ArtistID; } else { // Merge stuff @@ -74,31 +84,49 @@ $DB->query("SELECT GroupID FROM torrents_artists WHERE AliasID='$OldAliasID'"); $Groups = $DB->collect('GroupID'); - $DB->query("UPDATE IGNORE torrents_artists SET AliasID='$TargetAliasID',ArtistID='$TargetArtistID' WHERE AliasID='$OldAliasID'"); $DB->query("DELETE FROM torrents_artists WHERE AliasID='$OldAliasID'"); - if(!empty($Groups)) { foreach($Groups as $GroupID) { $Cache->delete_value('groups_artists_'.$GroupID); update_hash($GroupID); } } + + $DB->query("SELECT RequestID FROM requests_artists WHERE AliasID='$OldAliasID'"); + $Requests = $DB->collect('RequestID'); + $DB->query("UPDATE IGNORE requests_artists SET AliasID='$TargetAliasID',ArtistID='$TargetArtistID' WHERE AliasID='$OldAliasID'"); + $DB->query("DELETE FROM requests_artists WHERE AliasID='$OldAliasID'"); + if(!empty($Requests)) { + foreach($Requests as $RequestID) { + $Cache->delete_value('request_artists_'.$RequestID); + update_sphinx_requests($RequestID); + } + } + if($ArtistID != $TargetArtistID) { $DB->query("SELECT GroupID FROM torrents_artists WHERE ArtistID='$ArtistID'"); $Groups = $DB->collect('GroupID'); - $DB->query("UPDATE IGNORE torrents_artists SET ArtistID='$TargetArtistID' WHERE ArtistID='$ArtistID'"); $DB->query("DELETE FROM torrents_artists WHERE ArtistID='$ArtistID'"); - if(!empty($Groups)) { foreach($Groups as $GroupID) { $Cache->delete_value('groups_artists_'.$GroupID); update_hash($GroupID); } } + + $DB->query("SELECT RequestID FROM requests_artists WHERE ArtistID='$ArtistID'"); + $Requests = $DB->collect('RequestID'); + $DB->query("UPDATE IGNORE requests_artists SET ArtistID='$TargetArtistID' WHERE ArtistID='$ArtistID'"); + $DB->query("DELETE FROM requests_artists WHERE ArtistID='$ArtistID'"); + if(!empty($Requests)) { + foreach($Requests as $RequestID) { + $Cache->delete_value('request_artists_'.$RequestID); + update_sphinx_requests($RequestID); + } + } } - } $Cache->delete_value('artist_'.$ArtistID); @@ -111,6 +139,8 @@ $Cache->delete_value('artist_'.$ArtistID); $Cache->delete_value('artist_'.$TargetArtistID); +$Cache->delete_value('artists_requests_'.$TargetArtistID); +$Cache->delete_value('artists_requests_'.$ArtistID); header('Location: artist.php?id='.$TargetArtistID); diff --git a/sections/requests/takeunfill.php b/sections/requests/takeunfill.php index 8b947543..17c8b27c 100644 --- a/sections/requests/takeunfill.php +++ b/sections/requests/takeunfill.php @@ -66,6 +66,14 @@ update_sphinx_requests($RequestID); +if(!empty($ArtistForm)) { + foreach($ArtistForm as $ArtistType) { + foreach($ArtistType as $Artist) { + $Cache->delete_value('artist_'.$Artist['id']); + $Cache->delete_value('artists_requests_'.$Artist['id']); + } + } +} header('Location: requests.php?action=view&id='.$RequestID); diff --git a/sections/user/user.php b/sections/user/user.php index b83f1f0c..d8303953 100644 --- a/sections/user/user.php +++ b/sections/user/user.php @@ -187,7 +187,7 @@ function check_paranoia_here($Setting) { - [FL Tokens] + [FL Tokens] @@ -222,7 +222,7 @@ function check_paranoia_here($Setting) {
  • Required ratio:
  • -
  • Tokens:
  • +
  • Tokens:
  • @@ -389,7 +389,7 @@ function check_paranoia_here($Setting) { if (check_perms('users_view_keys',$Class) || $OwnProfile) { ?> -
  • Passkey: +
  • Passkey:
  • Recent Snatches - + @@ -655,6 +655,7 @@ function check_paranoia_here($Setting) { + + >
    Recent Uploads
    @@ -690,6 +691,7 @@ function check_paranoia_here($Setting) {