Esempio n. 1
0
            }
            if ($HasCue == "'1'") {
                $Title .= ' / Cue';
            }
            $Title .= ' / ' . trim($Media);
            if ($Scene == '1') {
                $Title .= ' / Scene';
            }
            if ($Freeleech == '1') {
                $Title .= ' / Freeleech!';
            }
            if ($Freeleech == '2') {
                $Title .= ' / Neutral leech!';
            }
            $UploaderInfo = Users::user_info($UploaderID);
            $Item = $Feed->item($Title, Text::strip_bbcode($Body), 'torrents.php?action=download&authkey=[[AUTHKEY]]&torrent_pass=[[PASSKEY]]&id=' . $TorrentID, $UploaderInfo['Username'], "torrents.php?id={$PageID}", trim($TagList));
            $Feed->populate('torrents_bookmarks_t_' . $LoggedUser['torrent_pass'], $Item);
        }
    } elseif ($Type == 'request') {
        $DB->query("\n\t\t\tSELECT UserID\n\t\t\tFROM {$Table}\n\t\t\tWHERE {$Col} = '" . db_string($PageID) . "'");
        if ($DB->record_count() < 100) {
            // Sphinx doesn't like huge MVA updates. Update sphinx_requests_delta
            // and live with the <= 1 minute delay if we have more than 100 bookmarkers
            $Bookmarkers = implode(',', $DB->collect('UserID'));
            $SphQL = new SphinxqlQuery();
            $SphQL->raw_query("UPDATE requests, requests_delta SET bookmarker = ({$Bookmarkers}) WHERE id = {$PageID}");
        } else {
            Requests::update_sphinx_requests($PageID);
        }
    }
}
Esempio n. 2
0
    // maybe there are torrents in the same release as the new torrent. Let's find out (for notifications)
    $GroupInfo = get_group_info($GroupID, true, 0, false);
    $ThisMedia = display_str($Properties['Media']);
    $ThisRemastered = display_str($Properties['Remastered']);
    $ThisRemasterYear = display_str($Properties['RemasterYear']);
    $ThisRemasterTitle = display_str($Properties['RemasterTitle']);
    $ThisRemasterRecordLabel = display_str($Properties['RemasterRecordLabel']);
    $ThisRemasterCatalogueNumber = display_str($Properties['RemasterCatalogueNumber']);
    foreach ($GroupInfo[1] as $TorrentInfo) {
        if ($TorrentInfo['Media'] == $ThisMedia && $TorrentInfo['Remastered'] == $ThisRemastered && $TorrentInfo['RemasterYear'] == (int) $ThisRemasterYear && $TorrentInfo['RemasterTitle'] == $ThisRemasterTitle && $TorrentInfo['RemasterRecordLabel'] == $ThisRemasterRecordLabel && $TorrentInfo['RemasterCatalogueNumber'] == $ThisRemasterCatalogueNumber && $TorrentInfo['ID'] != $TorrentID) {
            $UsedFormatBitrates[] = array('format' => $TorrentInfo['Format'], 'bitrate' => $TorrentInfo['Encoding']);
        }
    }
}
// For RSS
$Item = $Feed->item($Title, Text::strip_bbcode($Body), 'torrents.php?action=download&amp;authkey=[[AUTHKEY]]&amp;torrent_pass=[[PASSKEY]]&amp;id=' . $TorrentID, $LoggedUser['Username'], 'torrents.php?id=' . $GroupID, trim($Properties['TagList']));
//Notifications
$SQL = "\n\tSELECT unf.ID, unf.UserID, torrent_pass\n\tFROM users_notify_filters AS unf\n\t\tJOIN users_main AS um ON um.ID = unf.UserID\n\tWHERE um.Enabled = '1'";
if (empty($ArtistsUnescaped)) {
    $ArtistsUnescaped = $ArtistForm;
}
if (!empty($ArtistsUnescaped)) {
    $ArtistNameList = array();
    $GuestArtistNameList = array();
    foreach ($ArtistsUnescaped as $Importance => $Artists) {
        foreach ($Artists as $Artist) {
            if ($Importance == 1 || $Importance == 4 || $Importance == 5 || $Importance == 6) {
                $ArtistNameList[] = "Artists LIKE '%|" . db_string(str_replace('\\', '\\\\', $Artist['name']), true) . "|%'";
            } else {
                $GuestArtistNameList[] = "Artists LIKE '%|" . db_string(str_replace('\\', '\\\\', $Artist['name']), true) . "|%'";
            }