xref: /web-bugs/www/rss/search.php (revision 9d47b05f)
1<?php
2
3/* Generates an RSS/RDF feed for a set of bugs
4 * based on search criteria as provided.
5 *
6 * Search code borrowed from /search.php (As of Revision: 1.82)
7 * and accepts the same parameters.
8 *
9 * When changes are made to that API,
10 * they should be reflected here for consistency
11 *
12 * borrowed from php-bugs-web, implementation by Sara Golemon <pollita@php.net>
13 * ported by Gregory Beaver <cellog@php.net>
14 */
15
16$format = (isset($_GET['format']) && $_GET['format'] === 'rss2') ? 'rss2' : 'rdf';
17
18// Maximum number of bugs to return
19if ($format === 'rss2') {
20    // RSS channel shows way more data (e.g. no bug description) thus
21    // we can fetch more rows
22    define ('MAX_BUGS_RETURN', 500);
23} else {
24    define ('MAX_BUGS_RETURN', 150);
25}
26
27// Obtain common includes
28require_once '../../include/prepend.php';
29require "{$ROOT_DIR}/include/query.php";
30
31if ($format === 'rss2') {
32    require "{$ROOT_DIR}/templates/search-rss2.php";
33} else {
34    require "{$ROOT_DIR}/templates/search-rdf.php";
35}
36
37if (count($warnings) > 0) {
38    echo "<!--\n\n";
39    echo "The following warnings occured during your request:\n\n";
40    foreach($warnings as $warning) {
41        echo clean('* ' . $warning) . "\n";
42    }
43    echo "-->\n";
44}
45