2 /*=====================================================================*\
3 || ###################################################################
4 || # Bugdar [#]version[#]
5 || # Copyright ©2002-[#]year[#] Iris Studios, Inc.
7 || # This program is free software; you can redistribute it and/or modify
8 || # it under the terms of the GNU General Public License as published by
9 || # the Free Software Foundation; version [#]gpl[#] of the License.
11 || # This program is distributed in the hope that it will be useful, but
12 || # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 || # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 || # You should have received a copy of the GNU General Public License along
17 || # with this program; if not, write to the Free Software Foundation, Inc.,
18 || # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 || ###################################################################
20 \*=====================================================================*/
22 define('NO_TEMPLATES', 1);
24 require_once('./global.php');
26 if (in_array($bugsys->in
['type'], array('rss', 'atom')))
28 define('SYND_TYPE', $bugsys->in
['type']);
31 if (!defined('SYND_TYPE'))
33 define('SYND_TYPE', 'atom');
36 // ###################################################################
37 // get the syndicated items and prepare their content
39 $timestamp = (can_perform('canviewhidden', 0, fetch_guest_user()) ?
'lastposttime' : 'hiddenlastposttime');
42 $bugs_fetch = $db->query("
43 SELECT * FROM " . TABLE_PREFIX
. "bug
44 WHERE productid IN (" . fetch_on_bits('canviewbugs', fetch_guest_user()) . ")
45 AND (!hidden OR (hidden AND productid IN (" . fetch_on_bits('canviewhidden', fetch_guest_user()) . ")))
46 ORDER BY " . (can_perform('canviewhidden', 0, fetch_guest_user()) ?
"lastposttime" : "hiddenlastposttime") . " DESC
47 LIMIT 10" // #*# let this be a setting
49 while ($bug = $db->fetch_array($bugs_fetch))
51 $bug['storytext'] = sprintf($lang->string('<div><strong>Bug ID:</strong> %1$s</div>
52 <div><strong>Summary:</strong> %2$s</div>
53 <div><strong>Product/Component/Version:</strong> %3$s</div>
54 <div><strong>Status:</strong> %4$s</div>
55 <div><strong>Severity:</strong> %5$s</div>'),
58 $bugsys->datastore
['product']["$bug[productid]"]['title'] . '/' . (($bug['componentid']) ?
$bugsys->datastore
['product']["$bug[componentid]"]['title'] . '/' : '') . $bugsys->datastore
['version']["$bug[versionid]"]['version'],
59 $bugsys->datastore
['status']["$bug[status]"]['status'],
60 $bugsys->datastore
['severity']["$bug[severity]"]['severity']
62 $buglist["$bug[bugid]"] = $bug;
63 $lastupdated = $bug["$timestamp"];
66 // ###################################################################
69 if (SYND_TYPE
== 'atom')
71 $feed = '<?xml version="1.0" encoding="utf-8"?>
72 <feed xmlns="http://www.w3.org/2005/Atom">
74 <title>' . sprintf($lang->string('%1$s Syndication Feed'), $bugsys->options
['trackertitle']) . '</title>
75 <link href="' . $bugsys->options
['trackerurl'] . '"/>
76 <updated>' . $datef->format('Y-m-d\TH:i:s\Z', $lastupdated) . '</updated>
81 foreach ($buglist AS $bug)
85 <id>' . $bugsys->options
['trackertitle'] . '/showreport.php?bugid=' . $bug['bugid'] . '</id>
86 <title>' . $bug['summary'] . '</title>
87 <updated>' . $datef->format('Y-m-d\TH:i:s\Z', $bug["$timestamp"]) . '</updated>
89 <name>' . $bug['username'] . '</name>
91 <content>' . $bug['storytext'] . '</content>
93 <!-- firstreport goes here -->
95 <link rel="alternate" href="' . $bugsys->options
['trackerurl'] . '/showreport.php?bugid=' . $bug['bugid'] . '"/>
104 header('Content-type: application/xml');
110 // ###################################################################
113 else if (SYND_TYPE
== 'rss')
115 // not going to be implemented in 1.1 because I don't want to clutter the templates with multiple feed icons and such...
118 /*=====================================================================*\
119 || ###################################################################
122 || ###################################################################
123 \*=====================================================================*/