From 47e96f1ec1c2e7478c95545fa6208137a5a7ab07 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 14 Aug 2006 21:42:31 +0000 Subject: [PATCH] r1032: - Removing concat $feed variable in place of just echo()ing out content - Include bug.initialreport information in the output - Use a table to format data - Convert all angle brackets to entities in to make things render in RSS browsers --- syndicate.php | 60 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/syndicate.php b/syndicate.php index 1537cb8..226825d 100644 --- a/syndicate.php +++ b/syndicate.php @@ -45,24 +45,47 @@ $timestamp = (can_perform('canviewhidden', 0, fetch_guest_user()) ? 'lastposttim $lastupdated = 0; $buglist = array(); $bugs_fetch = $db->query(" - SELECT * FROM " . TABLE_PREFIX . "bug - WHERE product IN (" . fetch_on_bits('canviewbugs', fetch_guest_user()) . ") - AND (!hidden OR (hidden AND product IN (" . fetch_on_bits('canviewhidden', fetch_guest_user()) . "))) - ORDER BY " . (can_perform('canviewhidden', 0, fetch_guest_user()) ? "lastposttime" : "hiddenlastposttime") . " DESC + SELECT bug.*, comment.comment_parsed + FROM " . TABLE_PREFIX . "bug + LEFT JOIN " . TABLE_PREFIX . "comment + ON (bug.initialreport = comment.commentid) + WHERE bug.product IN (" . fetch_on_bits('canviewbugs', fetch_guest_user()) . ") + AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden', fetch_guest_user()) . "))) + ORDER BY " . (can_perform('canviewhidden', 0, fetch_guest_user()) ? "bug.lastposttime" : "bug.hiddenlastposttime") . " DESC LIMIT " . $bugsys->options['syndicateditems'] ); while ($bug = $db->fetch_array($bugs_fetch)) { - $bug['storytext'] = sprintf($lang->string('
Bug ID: %1$s
-
Summary: %2$s
-
Product/Component/Version: %3$s
-
Status: %4$s
-
Severity: %5$s
'), + $bug['storytext'] = sprintf(str_replace(array('<', '>'), array('<', '>'), + $lang->string(' + + + + + + + + + + + + + + + + + + +
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'] + $bugsys->datastore['severity']["$bug[severity]"]['severity'], + $bug['comment_parsed'] ); $buglist["$bug[bugid]"] = $bug; $lastupdated = $bug["$timestamp"]; @@ -73,7 +96,9 @@ while ($bug = $db->fetch_array($bugs_fetch)) if (SYND_TYPE == 'atom') { - $feed = ' + header('Content-type: application/xml'); + + echo ' ' . sprintf($lang->string('%1$s Syndication Feed'), $bugsys->options['trackertitle']) . ' @@ -85,7 +110,7 @@ if (SYND_TYPE == 'atom') foreach ($buglist AS $bug) { - $feed .= ' + echo ' ' . $bugsys->options['trackertitle'] . '/showreport.php?bugid=' . $bug['bugid'] . ' ' . $bug['summary'] . ' @@ -94,21 +119,16 @@ if (SYND_TYPE == 'atom') ' . $bug['username'] . ' ' . $bug['storytext'] . ' - - - + ' . htmlspecialchars($bug['comment_parsed']) . ' '; } - $feed .= ' + echo ' '; - - header('Content-type: application/xml'); - echo $feed; - + exit; } -- 2.43.5