From 657896cf60c0a4d23de13b342a0608858d995b02 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sat, 16 Sep 2006 19:49:51 +0000 Subject: [PATCH] r1148: Change the way we generate the feed. Less looping is better. --- syndicate.php | 98 ++++++++++++++++++++++----------------------------- 1 file changed, 43 insertions(+), 55 deletions(-) diff --git a/syndicate.php b/syndicate.php index 41de1e9..cd500d2 100644 --- a/syndicate.php +++ b/syndicate.php @@ -2,7 +2,7 @@ /*=====================================================================*\ || ################################################################### || # Bugdar [#]version[#] -|| # Copyright ©2002-[#]year[#] Blue Static +|| # Copyright ©2002-[#]year[#] Blue Static || # || # This program is free software; you can redistribute it and/or modify || # it under the terms of the GNU General Public License as published by @@ -29,8 +29,10 @@ if (!can_perform('canviewbugs')) } // ################################################################### -// get the syndicated items and prepare their content +header('Content-type: application/xml'); + +$syndicate = ''; $timestamp = (can_perform('canviewhidden', 0, fetch_guest_user()) ? 'lastposttime' : 'hiddenlastposttime'); $lastupdated = 0; $buglist = array(); @@ -46,46 +48,46 @@ $bugs_fetch = $db->query(" ); while ($bug = $db->fetch_array($bugs_fetch)) { - $bug['storytext'] = htmlspecialchars(sprintf( - _(' - - - - - - - - - - - - - - - - - - - -
Bug ID:%1$s
Summary:%2$s
Product/Component/Version:%3$s
Status:%4$s
Severity:%5$s
- -

%6$s

'), - $bug['bugid'], - $bug['summary'], - $bugsys->datastore['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? $bugsys->datastore['product']["$bug[component]"]['title'] . '/' : '') . $bugsys->datastore['version']["$bug[version]"]['version'], - $bugsys->datastore['status']["$bug[status]"]['status'], - $bugsys->datastore['severity']["$bug[severity]"]['severity'], - $bug['comment_parsed'] - )); - $buglist["$bug[bugid]"] = $bug; + $syndicate .= ' + + ' . $bugsys->options['trackertitle'] . '/showreport.php?bugid=' . $bug['bugid'] . ' + ' . $bug['summary'] . ' + ' . gmdate('Y-m-d\TH:i:s\Z', $bug["$timestamp"]) . ' + + ' . $bug['username'] . ' + + + ' . htmlspecialchars(' + + + + + + + + + + + + + + + + + + + +
' . _('Bug ID') . ':' . $bug['bugid'] . '
' . _('Summary') . ':' . $bug['summary'] . '
' . _('Product/Component/Version') . ':' . $bugsys->datastore['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? $bugsys->datastore['product']["$bug[component]"]['title'] . '/' : '') . $bugsys->datastore['version']["$bug[version]"]['version'] . '
' . _('Status') . ':' . $bugsys->datastore['status']["$bug[status]"]['status'] . '
' . _('Severity') . ':' . $bugsys->datastore['severity']["$bug[severity]"]['severity'] . '
+ +

' . $bug['comment_parsed'] . '

') . ' +
+ ' . htmlspecialchars($bug['comment_parsed']) . ' + +
'; + $lastupdated = $bug["$timestamp"]; } -// ################################################################### -// generate the actual feed - -header('Content-type: application/xml'); - echo ' @@ -95,22 +97,8 @@ echo ' '; - -foreach ($buglist AS $bug) -{ - echo ' - - ' . $bugsys->options['trackertitle'] . '/showreport.php?bugid=' . $bug['bugid'] . ' - ' . $bug['summary'] . ' - ' . gmdate('Y-m-d\TH:i:s\Z', $bug["$timestamp"]) . ' - - ' . $bug['username'] . ' - - ' . $bug['storytext'] . ' - ' . htmlspecialchars($bug['comment_parsed']) . ' - - '; -} + +echo $syndicate; echo ' -- 2.22.5