2 // export projects release news in RSS 2.0
3 // Author: Scott Grayban <sgrayban@borgnet.us>
6 require_once '../env.inc.php';
7 require_once $gfwww.'include/pre.php';
8 require_once $gfwww.'export/rss_utils.inc';
10 header("Content-Type: text/xml");
11 print '<?xml version="1.0" encoding="UTF-8"?>
15 $group_id = getIntFromRequest('group_id');
16 $limit = getIntFromRequest('limit', 10);
18 if ($limit > 100) $limit = 100;
21 $where = "frs_package.group_id=$group_id AND ";
22 $res = db_query("SELECT group_name FROM groups WHERE group_id=$group_id");
23 $row = db_fetch_array($res);
24 $title = ": ".$row['group_name']." - ";
25 $link = "/project/showfiles.php?group_id=$group_id";
26 $description = " of ".$row['group_name'];
27 $querywm = "SELECT users.user_name,users.realname FROM user_group,users WHERE group_id=$group_id AND admin_flags='A' AND users.user_id=user_group.user_id ORDER BY users.add_date";
28 $reswm = db_query($querywm,1);
29 if ($rowwm = db_fetch_array($reswm)) {
30 $webmaster = $rowwm['user_name']."@".$GLOBALS['sys_users_host']." (".$rowwm['realname'].")";
32 $webmaster = $GLOBALS['sys_admin_email'];
39 $webmaster = $GLOBALS['sys_admin_email'];
44 print " <title>".$GLOBALS['sys_name']." Project$title Releases</title>\n";
45 print " <link>http://".$GLOBALS['sys_default_domain']."$link</link>\n";
46 print " <description>".$GLOBALS['sys_name']." Project Releases$description</description>\n";
47 print " <language>en-us</language>\n";
48 print " <copyright>Copyright 2000-".date("Y")." ".$GLOBALS['sys_name']." OSI</copyright>\n";
49 print " <webMaster>$webmaster</webMaster>\n";
50 print " <lastBuildDate>".gmdate('D, d M Y G:i:s',time())." GMT</lastBuildDate>\n";
51 print " <docs>http://blogs.law.harvard.edu/tech/rss</docs>\n";
53 print " <url>http://".$GLOBALS['sys_default_domain']."/images/bflogo-88.png</url>\n";
54 print " <title>".$GLOBALS['sys_name']." Developer</title>\n";
55 print " <link>http://".$GLOBALS['sys_default_domain']."/</link>\n";
56 print " <width>124</width>\n";
57 print " <heigth>32</heigth>\n";
60 $res = db_query("SELECT groups.group_name AS group_name,"
61 . "frs_package.group_id AS group_id,"
62 . "groups.unix_group_name AS unix_group_name,"
63 . "groups.short_description AS short_description,"
64 . "groups.license AS license,"
65 . "users.user_name AS user_name,"
66 . "users.user_id AS user_id,"
67 . "users.realname AS realname,"
68 . "frs_package.name AS package_name,"
69 . "frs_release.package_id AS filemodule_id,"
70 . "frs_release.name AS module_name,"
71 . "frs_release.notes AS module_notes,"
72 . "frs_release.status_id AS release_status,"
73 . "frs_release.release_date AS release_date,"
74 . "frs_file.release_time AS release_time,"
75 . "frs_file.filename AS filename,"
76 . "frs_file.release_id AS filerelease_id "
77 . "FROM users,frs_file,frs_release,frs_package,groups WHERE "
78 . "frs_release.released_by=users.user_id AND "
79 . "frs_release.package_id=frs_package.package_id AND "
80 . "frs_package.group_id=groups.group_id AND "
81 . "frs_release.status_id=1 AND "
83 . "frs_file.release_id=frs_release.release_id "
84 . "ORDER BY frs_file.release_time DESC",($limit * 3));
90 while ($row = db_fetch_array($res)) {
91 if (!isset ($seen[$row['filerelease_id']])) {
93 print " <title>".htmlspecialchars($row['package_name'])." ".htmlspecialchars($row['module_name'])."</title>\n";
94 print " <link>http://".$GLOBALS['sys_default_domain']."/project/showfiles.php?group_id=".$row['group_id']."&release_id=".$row['filerelease_id']."</link>\n";
95 print " <description>".rss_description($row['module_notes'])."</description>\n";
96 print " <author>".$row['user_name']."@".$GLOBALS['sys_users_host']." (".$row['realname'].")</author>\n";
97 print " <comment>http://".$GLOBALS['sys_default_domain']."/project/shownotes.php?group_id=".$row['group_id']."&release_id=".$row['filerelease_id']."</comment>\n";
98 print " <pubDate>".gmdate('D, d M Y G:i:s',$row['release_date'])." GMT</pubDate>\n";
99 print " <guid>http://".$GLOBALS['sys_default_domain']."/project/showfiles.php?group_id=".$row['group_id']."&release_id=".$row['filerelease_id']."</guid>\n";
103 // eliminate dupes, only do $limit of these
104 $seen[$row['filerelease_id']] = 1;
105 if ($outputtotal >= $limit) break;
108 print " </channel>\n";