Exemplo 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);
        }
    }
}
Exemplo n.º 2
0
    $SQL .= " AND (Users LIKE '%|" . $LoggedUser['ID'] . "|%' OR Users = '') ";
}
$SQL .= " AND UserID != '" . $LoggedUser['ID'] . "' ";
$DB->query($SQL);
$Debug->set_flag('upload: notification query finished');
if ($DB->has_results()) {
    $UserArray = $DB->to_array('UserID');
    $FilterArray = $DB->to_array('ID');
    $InsertSQL = '
		INSERT IGNORE INTO users_notify_torrents (UserID, GroupID, TorrentID, FilterID)
		VALUES ';
    $Rows = array();
    foreach ($UserArray as $User) {
        list($FilterID, $UserID, $Passkey) = $User;
        $Rows[] = "('{$UserID}', '{$GroupID}', '{$TorrentID}', '{$FilterID}')";
        $Feed->populate("torrents_notify_{$Passkey}", $Item);
        $Cache->delete_value("notifications_new_{$UserID}");
    }
    $InsertSQL .= implode(',', $Rows);
    $DB->query($InsertSQL);
    $Debug->set_flag('upload: notification inserts finished');
    foreach ($FilterArray as $Filter) {
        list($FilterID, $UserID, $Passkey) = $Filter;
        $Feed->populate("torrents_notify_{$FilterID}_{$Passkey}", $Item);
    }
}
// RSS for bookmarks
$DB->query("\n\tSELECT u.ID, u.torrent_pass\n\tFROM users_main AS u\n\t\tJOIN bookmarks_torrents AS b ON b.UserID = u.ID\n\tWHERE b.GroupID = {$GroupID}");
while (list($UserID, $Passkey) = $DB->next_record()) {
    $Feed->populate("torrents_bookmarks_t_{$Passkey}", $Item);
}