6 * Author: 2006, Daniel A. Perez <daniel@gforgegroup.com>
11 * This file is part of GForge.
13 * GForge is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
18 * GForge is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with GForge; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 include "rss_utils.inc";
32 if (!$limit) $limit = 10;
33 if ($limit > 100) $limit = 100;
35 $group_id = getIntFromRequest('group_id');
38 $where = "group_id=$group_id and is_public=1";
39 $query = "SELECT group_name FROM groups WHERE $where";
40 $res = db_query($query,1);
41 $row = db_fetch_array($res);
42 $title = "".$row[group_name]." - ";
43 $link = "?group_id=$group_id";
44 $description = " of ".$row[group_name];
45 $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";
46 $reswm = db_query($querywm,1);
47 if ($rowwm = db_fetch_array($reswm)) {
48 $webmaster = $rowwm[user_name]."@".$GLOBALS[sys_users_host]." (".$rowwm[realname].")";
50 $webmaster = "admin@".$GLOBALS[sys_default_domain];
52 $sql="SELECT * FROM activity_vw WHERE activity_date BETWEEN '".(time()-(30*86400))."' AND '".time()."'
53 AND activity_vw.group_id = groups.group_id AND groups.is_public=1 AND activity_vw.group_id='$group_id' ORDER BY activity_date DESC";
56 header("Content-Type: text/xml");
57 print '<?xml version="1.0" encoding="UTF-8"?>
61 print " <title>".$GLOBALS[sys_default_name]." $title Activity</title>\n";
62 print " <link>http://".$GLOBALS[sys_default_domain]."/activity/$link</link>\n";
63 print " <description>".$GLOBALS[sys_name]." Project Activity$description</description>\n";
64 print " <language>en-us</language>\n";
65 print " <copyright>Copyright 2000-".date("Y")." ".$GLOBALS[sys_name]." OSI</copyright>\n";
66 print " <webMaster>$webmaster</webMaster>\n";
67 print " <lastBuildDate>".gmdate('D, d M Y G:i:s',time())." GMT</lastBuildDate>\n";
68 print " <docs>http://blogs.law.harvard.edu/tech/rss</docs>\n";
69 print " <generator>".$GLOBALS[sys_name]." RSS generator</generator>\n";
71 print " <url>http://".$GLOBALS[sys_default_domain]."/images/bflogo-88.png</url>\n";
72 print " <title>".$GLOBALS[sys_name]." Developer</title>\n";
73 print " <link>http://".$GLOBALS[sys_default_domain]."/</link>\n";
74 print " <width>124</width>\n";
75 print " <heigth>32</heigth>\n";
78 $res = db_query($sql, $limit);
81 while ($arr = db_fetch_array($res)) {
84 switch ($arr['section']) {
86 print " <title>".htmlspecialchars('Commit for Tracker Item [#'.$arr['subref_id'].'] '.$arr['description'])."</title>\n";
87 print " <link>http://".$GLOBALS[sys_default_domain].'/tracker/?func=detail&atid='.$arr['ref_id'].'&aid='.$arr['subref_id'].'&group_id='.$arr['group_id']."</link>\n";
88 print " <comment>http://".$GLOBALS[sys_default_domain].'/tracker/?func=detail&atid='.$arr['ref_id'].'&aid='.$arr['subref_id'].'&group_id='.$arr['group_id']."</comment>\n";
92 print " <title>".htmlspecialchars('Tracker Item [#'.$arr['subref_id'].' '.$arr['description'].'] Opened')."</title>\n";
93 print " <link>http://".$GLOBALS[sys_default_domain].'/tracker/?func=detail&atid='.$arr['ref_id'].'&aid='.$arr['subref_id'].'&group_id='.$arr['group_id']."</link>\n";
94 print " <comment>http://".$GLOBALS[sys_default_domain].'/tracker/?func=detail&atid='.$arr['ref_id'].'&aid='.$arr['subref_id'].'&group_id='.$arr['group_id']."</comment>\n";
97 case 'trackerclose': {
98 print " <title>".htmlspecialchars('Tracker Item [#'.$arr['subref_id'].' '.$arr['description'].'] Closed')."</title>\n";
99 print " <link>http://".$GLOBALS[sys_default_domain].'/tracker/?func=detail&atid='.$arr['ref_id'].'&aid='.$arr['subref_id'].'&group_id='.$arr['group_id']."</link>\n";
100 print " <comment>http://".$GLOBALS[sys_default_domain].'/tracker/?func=detail&atid='.$arr['ref_id'].'&aid='.$arr['subref_id'].'&group_id='.$arr['group_id']."</comment>\n";
104 print " <title>".htmlspecialchars('FRS Release [#'.$arr['description'].']')."</title>\n";
105 print " <link>http://".$GLOBALS[sys_default_domain].'/frs/?release_id='.$arr['subref_id'].'&group_id='.$arr['group_id']."</link>\n";
106 print " <comment>http://".$GLOBALS[sys_default_domain].'/frs/?release_id='.$arr['subref_id'].'&group_id='.$arr['group_id']."</comment>\n";
110 print " <title>".htmlspecialchars('Forum Post [#'.$arr['subref_id'].'] '.$arr['description'])."</title>\n";
111 print " <link>http://".$GLOBALS[sys_default_domain].'/forum/message.php?forum_id='.$arr['ref_id'].'&msg_id='.$arr['subref_id'].'&group_id='.$arr['group_id']."</link>\n";
112 print " <comment>http://".$GLOBALS[sys_default_domain].'/forum/message.php?forum_id='.$arr['ref_id'].'&msg_id='.$arr['subref_id'].'&group_id='.$arr['group_id']."</comment>\n";
117 print " <description>".rss_description($arr[description])."</description>\n";
118 print " <author>".$row[user_name]."@".$GLOBALS[sys_users_host]." (".$row[realname].")</author>\n";
119 print " <pubDate>".gmdate('D, d M Y G:i:s',$row[activity_date])." GMT</pubDate>\n";
123 print " </channel>\n";
127 // Print error showing no group was selected
129 echo "<br><h2><font color='red'> Error: No group selected</font></h2>";