[Fusionforge-commits] r9591 - trunk/gforge/www/export

Roland Mas lolando at libremir.placard.fr.eu.org
Fri Apr 23 11:29:00 CEST 2010


Author: lolando
Date: 2010-04-23 11:29:00 +0200 (Fri, 23 Apr 2010)
New Revision: 9591

Modified:
   trunk/gforge/www/export/rss20_docman.php
   trunk/gforge/www/export/rss20_forum.php
   trunk/gforge/www/export/rss20_tasks.php
   trunk/gforge/www/export/rss20_tracker.php
Log:
Use config API

Modified: trunk/gforge/www/export/rss20_docman.php
===================================================================
--- trunk/gforge/www/export/rss20_docman.php	2010-04-23 09:28:49 UTC (rev 9590)
+++ trunk/gforge/www/export/rss20_docman.php	2010-04-23 09:29:00 UTC (rev 9591)
@@ -70,31 +70,31 @@
 
 //**************************************************************++
 function beginFeed($groupname = "", $link = "") {
-	global $sys_default_domain, $sys_name, $sys_admin_email;
+	global  $sys_admin_email;
 	header("Content-Type: text/xml");
 	print '<?xml version="1.0" encoding="UTF-8"?>
 			<rss version="2.0">
 			';
 	print " <channel>\n";
-	print "  <title>".$sys_name." Project \"".$groupname."\" Documents</title>\n";
-	print "  <link>http://".$sys_default_domain.$link."</link>\n";
-	print "  <description>".$sys_name." Documents of \"".$groupname."\"</description>\n";
+	print "  <title>".forge_get_config('forge_name')." Project \"".$groupname."\" Documents</title>\n";
+	print "  <link>http://".forge_get_config('web_host').$link."</link>\n";
+	print "  <description>".forge_get_config('forge_name')." Documents of \"".$groupname."\"</description>\n";
 	print "  <language>en-us</language>\n";
-	print "  <copyright>Copyright 2000-".date("Y")." ".$sys_name."</copyright>\n";
+	print "  <copyright>Copyright 2000-".date("Y")." ".forge_get_config('forge_name')."</copyright>\n";
 	print "  <webMaster>".$sys_admin_email."</webMaster>\n";
 	print "  <lastBuildDate>".gmdate('D, d M Y G:i:s',time())." GMT</lastBuildDate>\n";
 	print "  <docs>http://blogs.law.harvard.edu/tech/rss</docs>\n";
 	print "  <image>\n";
-	print "    <url>http://".$sys_default_domain."/images/bflogo-88.png</url>\n";
-	print "    <title>".$sys_name." Developer</title>\n";
-	print "    <link>http://".$sys_default_domain."/</link>\n";
+	print "    <url>http://".forge_get_config('web_host')."/images/bflogo-88.png</url>\n";
+	print "    <title>".forge_get_config('forge_name')." Developer</title>\n";
+	print "    <link>http://".forge_get_config('web_host')."/</link>\n";
 	print "    <width>124</width>\n";
 	print "    <heigth>32</heigth>\n";
 	print "  </image>\n";
 }
 
 function writeFeed($d_arr, $group_id){
-	global $sys_default_domain;
+
 	// ## default limit
 	//if (isset($limit) ||empty($limit)) $limit = 10;
 	//if ($limit > 100) $limit = 100;
@@ -125,7 +125,7 @@
 						"<description>".rss_description($d_arr[$j]->getErrorMessage())."</decription>";
 			} else {				
 				print "   <title>".$d_arr[$j]->getName()."</title>\n"; 
-				print "   <link>http://".$sys_default_domain."/".$link."</link>\n";
+				print "   <link>http://".forge_get_config('web_host')."/".$link."</link>\n";
 				print "   <category>".$d_arr[$j]->getDocGroupName()."</category>\n";
 				
 				print "   <description>".

Modified: trunk/gforge/www/export/rss20_forum.php
===================================================================
--- trunk/gforge/www/export/rss20_forum.php	2010-04-23 09:28:49 UTC (rev 9590)
+++ trunk/gforge/www/export/rss20_forum.php	2010-04-23 09:29:00 UTC (rev 9591)
@@ -30,8 +30,8 @@
 require_once $gfcommon.'forum/ForumMessage.class.php';
 require_once $gfcommon.'forum/ForumMessageFactory.class.php';
 
-global $sys_name, $sys_default_domain;
 
+
 //Initialize
 $groups = array();
 $forums = array();
@@ -172,9 +172,9 @@
 
 // ------------- general settings and defaults for filtered and non-filtered feeds -------------
 $feed_title_desc = $show_threads ? "Current threads" : "Recent postings";
-$feed_title = $sys_name." Forums: ".$feed_title_desc; //all site's forums
-$feed_link = "http://".$sys_default_domain;
-$feed_desc = $sys_name." Forums";
+$feed_title = forge_get_config('forge_name')." Forums: ".$feed_title_desc; //all site's forums
+$feed_link = "http://".forge_get_config('web_host');
+$feed_desc = forge_get_config('forge_name')." Forums";
 
 
 // -------------for filtered feeds - set feed title, link and description-------------
@@ -275,7 +275,7 @@
 
 //*********************** HELPER FUNCTIONS ***************************************
 function beginForumFeed($feed_title, $feed_link, $feed_desc) {
-	global $sys_default_domain, $sys_name, $sys_admin_email;
+	global  $sys_admin_email;
 	header("Content-Type: text/xml");
 	print '<?xml version="1.0" encoding="UTF-8"?>
 			<rss version="2.0">
@@ -285,28 +285,28 @@
 	print "  <link>".$feed_link."</link>\n";
 	print "  <description>".$feed_desc."</description>\n";
 	print "  <language>en-us</language>\n";
-	print "  <copyright>Copyright 2000-".date("Y")." ".$sys_name."</copyright>\n";
+	print "  <copyright>Copyright 2000-".date("Y")." ".forge_get_config('forge_name')."</copyright>\n";
 	print "  <webMaster>".$sys_admin_email."</webMaster>\n";
 	print "  <lastBuildDate>".gmdate('D, d M Y G:i:s',time())." GMT</lastBuildDate>\n";
 	print "  <docs>http://blogs.law.harvard.edu/tech/rss</docs>\n";
 	print "  <image>\n";
-	print "    <url>http://".$sys_default_domain."/images/bflogo-88.png</url>\n";
-	print "    <title>".$sys_name." Developer</title>\n";
-	print "    <link>http://".$sys_default_domain."/</link>\n";
+	print "    <url>http://".forge_get_config('web_host')."/images/bflogo-88.png</url>\n";
+	print "    <title>".forge_get_config('forge_name')." Developer</title>\n";
+	print "    <link>http://".forge_get_config('web_host')."/</link>\n";
 	print "    <width>124</width>\n";
 	print "    <heigth>32</heigth>\n";
 	print "  </image>\n";
 }
 
 function writeForumFeed($msg, $item_cat){
-    global $sys_default_domain, $show_threads;
+    global  $show_threads;
             
     $link = "forum/message.php?msg_id=".$msg['msg_id'];
 
     //------------ build one feed item ------------
     print "  <item>\n";					
         print "   <title>".$msg['subject']."</title>\n"; 
-        print "   <link>http://".$sys_default_domain."/".$link."</link>\n";
+        print "   <link>http://".forge_get_config('web_host')."/".$link."</link>\n";
         print "   <category>".$item_cat."</category>\n";
                 //print "   <description>".rss_description($item_desc)."</description>\n";
         print "   <author>".$msg['user_realname']."</author>\n";

Modified: trunk/gforge/www/export/rss20_tasks.php
===================================================================
--- trunk/gforge/www/export/rss20_tasks.php	2010-04-23 09:28:49 UTC (rev 9590)
+++ trunk/gforge/www/export/rss20_tasks.php	2010-04-23 09:29:00 UTC (rev 9591)
@@ -4,8 +4,8 @@
 require_once $gfwww.'include/pre.php';
 require_once $gfwww.'export/rss_utils.inc';
 
-global $sys_name, $sys_default_domain;
 
+
 //Default Vars
 $number_items = 10;
 $max_number_items = 100;
@@ -139,7 +139,7 @@
 $res=pg_query($sql);
 $i=0;
 
-beginTaskFeed('evolvis: Current Tasks',$sys_default_domain,'See all the tasks you want to see!');
+beginTaskFeed('evolvis: Current Tasks',forge_get_config('web_host'),'See all the tasks you want to see!');
 if(0<pg_num_rows($res))
 {
 	while($i<pg_num_rows($res))
@@ -223,7 +223,7 @@
 
 
 function beginTaskFeed($feed_title, $feed_link, $feed_desc) {
-	global $sys_default_domain, $sys_name, $sys_admin_email;
+	global  $sys_admin_email;
 	header("Content-Type: text/xml");
 	print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
 	print "<rss version=\"2.0\">\n";
@@ -232,28 +232,28 @@
 	print "  <link>".$feed_link."</link>\n";
 	print "  <description>".$feed_desc."</description>\n";
 	print "  <language>en-us</language>\n";
-	print "  <copyright>Copyright 2000-".date("Y")." ".$sys_name."</copyright>\n";
+	print "  <copyright>Copyright 2000-".date("Y")." ".forge_get_config('forge_name')."</copyright>\n";
 	print "  <webMaster>".$sys_admin_email."</webMaster>\n";
 	print "  <lastBuildDate>".gmdate('D, d M Y G:i:s',time())." GMT</lastBuildDate>\n";
 	print "  <docs>http://blogs.law.harvard.edu/tech/rss</docs>\n";
 	print "  <image>\n";
-	print "    <url>http://".$sys_default_domain."/images/bflogo-88.png</url>\n";
-	print "    <title>".$sys_name." Developer</title>\n";
-	print "    <link>http://".$sys_default_domain."/</link>\n";
+	print "    <url>http://".forge_get_config('web_host')."/images/bflogo-88.png</url>\n";
+	print "    <title>".forge_get_config('forge_name')." Developer</title>\n";
+	print "    <link>http://".forge_get_config('web_host')."/</link>\n";
 	print "    <width>124</width>\n";
 	print "    <heigth>32</heigth>\n";
 	print "  </image>\n";
 }
 
 function writeTaskFeed($msg, $item_cat){
-    global $sys_default_domain, $show_threads;
+    global  $show_threads;
             
   $link = "pm/task.php?func=detailtask&amp;project_task_id=".$msg['project_task_id']."&amp;group_project_id=".$msg['group_project_id']."&amp;group_id=".$msg['group_id'];//group_id missing
 
     //------------ build one feed item ------------
     print "  <item>\n";					
         print "   <title>".$msg['subject']."</title>\n"; 
-        print "   <link>http://".$sys_default_domain."/".$link."</link>\n";
+        print "   <link>http://".forge_get_config('web_host')."/".$link."</link>\n";
         print "   <category>".$item_cat."</category>\n";
         print "   <description>".$msg['details']."</description>\n";
         print "   <author>".$msg['user_realname']."</author>\n";

Modified: trunk/gforge/www/export/rss20_tracker.php
===================================================================
--- trunk/gforge/www/export/rss20_tracker.php	2010-04-23 09:28:49 UTC (rev 9590)
+++ trunk/gforge/www/export/rss20_tracker.php	2010-04-23 09:29:00 UTC (rev 9591)
@@ -59,31 +59,31 @@
 
 //**************************************************************++
 function beginFeed($groupname = "", $link = "") {
-	global $sys_default_domain, $sys_name, $sys_admin_email;
+	global  $sys_admin_email;
 	header("Content-Type: text/xml");
 	print '<?xml version="1.0" encoding="UTF-8"?>
 			<rss version="2.0">
 			';
 	print " <channel>\n";
-	print "  <title>".$sys_name." Project \"".$groupname."\" Bug Trackers</title>\n";
-	print "  <link>http://".$sys_default_domain.$link."</link>\n";
-	print "  <description>".$sys_name." Bug Trackers of \"".$groupname."\"</description>\n";
+	print "  <title>".forge_get_config('forge_name')." Project \"".$groupname."\" Bug Trackers</title>\n";
+	print "  <link>http://".forge_get_config('web_host').$link."</link>\n";
+	print "  <description>".forge_get_config('forge_name')." Bug Trackers of \"".$groupname."\"</description>\n";
 	print "  <language>en-us</language>\n";
-	print "  <copyright>Copyright 2000-".date("Y")." ".$sys_name."</copyright>\n";
+	print "  <copyright>Copyright 2000-".date("Y")." ".forge_get_config('forge_name')."</copyright>\n";
 	print "  <webMaster>".$sys_admin_email."</webMaster>\n";
 	print "  <lastBuildDate>".gmdate('D, d M Y G:i:s',time())." GMT</lastBuildDate>\n";
 	print "  <docs>http://blogs.law.harvard.edu/tech/rss</docs>\n";
 	print "  <image>\n";
-	print "    <url>http://".$sys_default_domain."/images/bflogo-88.png</url>\n";
-	print "    <title>".$sys_name." Developer</title>\n";
-	print "    <link>http://".$sys_default_domain."/</link>\n";
+	print "    <url>http://".forge_get_config('web_host')."/images/bflogo-88.png</url>\n";
+	print "    <title>".forge_get_config('forge_name')." Developer</title>\n";
+	print "    <link>http://".forge_get_config('web_host')."/</link>\n";
 	print "    <width>124</width>\n";
 	print "    <heigth>32</heigth>\n";
 	print "  </image>\n";
 }
 
 function writeFeed($at_arr, $group_id){
-	global $sys_default_domain;
+
 	// ## default limit
 	//if (isset($limit) ||empty($limit)) $limit = 10;
 	//if ($limit > 100) $limit = 100;
@@ -106,7 +106,7 @@
 						"<description>".rss_description($at_arr[$j]->getErrorMessage())."</decription>";
 			} else {				
 				print "   <title>".$at_arr[$j]->getName()."</title>\n";
-				print "   <link>http://".$sys_default_domain."/tracker?atid=".$at_arr[$j]->getID()."&amp;group_id=".$group_id."&amp;func=browse</link>\n";
+				print "   <link>http://".forge_get_config('web_host')."/tracker?atid=".$at_arr[$j]->getID()."&amp;group_id=".$group_id."&amp;func=browse</link>\n";
 				print "   <description>".
 						rss_description($at_arr[$j]->getDescription()).
 						" - Open Bugs: ".(int) $at_arr[$j]->getOpenCount() .




More information about the Fusionforge-commits mailing list