[evolvis-commits] r7411: Solved conflicts arising from 2.6 import/merge. ↵

mirabilos at evolvis.org mirabilos at evolvis.org
Thu Feb 24 15:40:41 CET 2011


Author: mirabilos
Date: 2011-02-24 15:40:41 +0100 (Thu, 24 Feb 2011)
New Revision: 7411

Modified:
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Layout.class
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Theme.class
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/cache.php
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/features_boxes.php
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/frs.class
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/html.php
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/menu.php
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/osdn.php
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/pre.php
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/project_home.php
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/squal_pre.php
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/theme.php
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/user_home.php
   trunk/gforge_base/evolvisforge-5.1/gforge/www/include/vote_function.php
Log:
Solved conflicts arising from 2.6 import/merge.


Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Layout.class
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Layout.class	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Layout.class	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,52 +1,135 @@
 <?php   
+/**
+ * Base layout class.
+ *
+ * Extends the basic Error class to add HTML functions 
+ * for displaying all site dependent HTML, while allowing 
+ * extendibility/overriding by themes via the Theme class.
+ * 
+ * Make sure browser.php is included _before_ you create an instance of this object.
+ * 
+ * Geoffrey Herteg, August 29, 2000
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id$
+ */
 
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//	      
-// $Id$
-
-
-/*
-
-	Extends the basic Error class to add HTML functions for displaying all site dependent HTML, while allowing extendibility/overriding by themes via the Theme class.
-
-	Make sure browser.php is included _before_ you create an instance of this object.
-
-	Geoffrey Herteg, August 29, 2000
-
-*/
-
-
 class Layout extends Error {
 
+	/**
+	 * The root location for images
+	 *
+	 * @var		string	$imgroot
+	 */
 	var $imgroot = '/themes/forged/images/';
 
 	// Color Constants
+	/**
+	 * The content background color
+	 *
+	 * @var		constant		$COLOR_CONTENT_BACK
+	 */
 	var $COLOR_CONTENT_BACK= '#FFFFFF';
+
+	/**
+	 * The primary light background color
+	 *
+	 * @var		constant		$COLOR_LTBACK1
+	 */
 	var $COLOR_LTBACK1= '#EAECEF';
+
+	/**
+	 * The secondary light background color
+	 *
+	 * @var		constant		$COLOR_LTBACk2
+	 */
 	var $COLOR_LTBACK2= '#FAFAFA';
+	
+	/**
+	 * The HTML box title color
+	 *
+	 * @var		constant		$COLOR_HTMLBOX_TITLE
+	 */
 	var $COLOR_HTMLBOX_TITLE = '#D1D5D7';
+
+	/**
+	 * The HTML box background color
+	 *
+	 * @var		constant		$COLOR_HTMLBOX_BACK
+	 */
 	var $COLOR_HTMLBOX_BACK = '#EAECEF';
 
 	// Font Face Constants
+	/**
+	 * The content font
+	 *
+	 * @var		constant		$FONT_CONTENT
+	 */
 	var $FONT_CONTENT = 'Helvetica';
+
+	/**
+	 * The HTML box title font
+	 *
+	 * @var		constant		$FONT_HTMLBOX_TITLE
+	 */
 	var $FONT_HTMLBOX_TITLE = 'Helvetica';
 
 	// Font Color Constants
+	/**
+	 * The HTML box title font color
+	 *
+	 * @var		constant		$FONTCOLOR_HTMLBOX_TITLE
+	 */
 	var $FONTCOLOR_HTMLBOX_TITLE = '#333333';
+
+	/**
+	 * The content font color
+	 *
+	 * @var		constant		$FONTCOLOR_CONTENT
+	 */
 	var $FONTCOLOR_CONTENT = '#333333';
 
 	// Font Size Constants
+	/**
+	 * The font size
+	 *
+	 * @var		constant		$FONTSIZE
+	 */
 	var $FONTSIZE = 'small';
+
+	/**
+	 * The smaller font size
+	 *
+	 * @var		constant		$FONTSIZE_SMALLER
+	 */
 	var $FONTSIZE_SMALLER='x-small';
+
+	/**
+	 * The smallest font size
+	 *
+	 * @var		constnat		$FONTSIZE_SMALLEST
+	 */
 	var $FONTSIZE_SMALLEST='xx-small';
+
+	/**
+	 * The HTML box title font size
+	 *
+	 * @var		constant		$FONTSIZE_HTMLBOX_TITLE
+	 */
 	var $FONTSIZE_HTMLBOX_TITLE = 'small';
 
 	//Define all the icons for this theme
+	/**
+	 * Icons array
+	 *
+	 * @var		array	$icons
+	 */
 	var $icons = array(
 		'Summary' => '/images/ic/anvil24.png',
+		'Admin' => '/images/ic/anvil24.png',
 		'Homepage' => '/images/ic/home.png',
 		'Forums' => '/images/ic/notes.png',
 		'Bugs' => '/images/ic/bug.png',
@@ -61,9 +144,16 @@
 		'Files' => '/images/ic/save.png'
 		);
 
+	/**
+	 * Hell if I know?
+	 *
+	 * @var		array	$bgpri
+	 */
 	var $bgpri = array();
 
-	// Constuctor
+	/**
+	 * Layout() - Constructor
+	 */
 	function Layout() {
 		GLOBAL $bgpri;
 		// Constructor for parent class...
@@ -116,7 +206,14 @@
 		$this->FONTSIZE_HTMLBOX_TITLE = $this->FONTSIZE;
 	}
 
-	// Box Top, equivalent to html_box1_top()
+	/**
+	 * box1_top() - Box Top, equivalent to html_box1_top()
+	 *
+	 * @param	string	The box top title
+	 * @param	bool	Whether to echo or return the output
+	 * @param	string	The box top background color
+	 * @param	bool	Whether to start the first row or not
+	 */
 	function box1_top($title,$echoout=1,$bgcolor='',$start_first_row=1){
 		if (!$bgcolor) {
 			$bgcolor=$this->COLOR_HTMLBOX_BACK;
@@ -139,7 +236,15 @@
 		}
 	}
 
-	// Box Middle, equivalent to html_box1_middle()
+	/**
+	 * box1_middle() - Box Middle, equivalent to html_box1_middle()
+	 *
+	 * @param	string	The box title
+	 * @param	string	The box background color
+	 * @param	string  The title background color
+	 * @param	bool	Whether to start the first row or not
+	 * @returns	Middle box HTML content
+	 */
 	function box1_middle($title,$bgcolor='',$title_bgcolor='',$start_first_row=1) {
 		if (!$bgcolor) {
 			$bgcolor=$this->COLOR_HTMLBOX_BACK;
@@ -164,7 +269,11 @@
 		return $return;
 	}
 
-	// Box Bottom, equivalent to html_box1_bottom()
+	/**
+	 * box1_bottom() - Box Bottom, equivalent to html_box1_bottom()
+	 *
+	 * @param	bool	Whether to echo or return the output
+	 */
 	function box1_bottom($echoout=1) {
 		$return = '
 		</TD>
@@ -178,9 +287,14 @@
 		}
 	}
 
+	/**
+	 * generic_header_start() - Start a generic HTML header
+	 *
+	 * @param	array	Header parameters array
+	 */
 	function generic_header_start($params) {
 
-		global $G_SESSION, $Language;
+		global $G_SESSION, $Language, $sys_name;
 
 		if (!$params['title']) {
 			$params['title'] = "SourceForge";
@@ -191,6 +305,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
 	"http://www.w3.org/TR/REC-html40/loose.dtd">
 
+<!-- Server: <?php echo $sys_name; ?> -->
 <html lang="<?php echo $Language->getLanguageCode(); ?>">
   <head>
 	<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $Language->getEncoding(); ?>">
@@ -198,25 +313,36 @@
 	<SCRIPT language="JavaScript">
 	<!--
 	function help_window(helpurl) {
-		HelpWin = window.open(helpurl,'HelpWindow','scrollbars=yes,resizable=yes,toolbar=no,height=400,width=400');
+		HelpWin = window.open( '<?php echo ((session_issecure()) ? 'https://'.$GLOBALS['sys_default_domain'] : 'http://'.$GLOBALS['sys_default_domain'] ); ?>' + helpurl,'HelpWindow','scrollbars=yes,resizable=yes,toolbar=no,height=400,width=400');
 	}
 	// -->
 	</SCRIPT>
 <?php
 	}
 
+	/**
+	 * generic_header_end() - End a generic HTML header
+	 *
+	 * @param	array	Header parameters array
+	 */
 	function generic_header_end($params) {
 	?>
    </HEAD>
 <?php
 	}
 
+	/**
+	 * generic_footer() - Display a generic HTML footer
+	 *
+	 * @param	array	Footer parameters array
+	 */
 	function generic_footer($params) {
-		global $PHP_SELF;
+		global $PHP_SELF, $sys_name;
 		echo '<P><A HREF="/source.php?page_url='.$PHP_SELF.'"><B><FONT COLOR="WHITE">Show Source</FONT></B></A><P>';
 
 		global $IS_DEBUG,$QUERY_COUNT;
-		if ($IS_DEBUG) {
+		if ($IS_DEBUG && user_isloggedin() && user_ismember(1,'A')) {
+			echo "<CENTER><B><FONT COLOR=RED>Server: $sys_name</FONT ></B></CENTER>";
 			echo "<CENTER><B><FONT COLOR=RED>Query Count: $QUERY_COUNT</FONT ></B></CENTER>";
 			echo "<P>$GLOBALS[G_DEBUGQUERY]";
 		}
@@ -234,22 +360,45 @@
 policy information, please see the <a href="/tos/privacy.php" class="legallink"
 >SourceForge Privacy Policy</a>.
 Content owned by VA Linux Systems is copyright 
-1999-2000 VA Linux Systems, Inc.  All rights reserved.
+1999-2001 VA Linux Systems, Inc.  All rights reserved.
 </font>
 <BR> 
 
+<?php
+
+//
+//  Actual layer call must be outside of table for some reason
+//
+
+if (!session_issecure() && !$GLOBALS['IS_DEBUG']) {
+
+echo '
+<LAYER SRC="http://sfads.osdn.com/1.html" width=468 height=60 visibility=\'hide\' '.
+'onLoad="moveToAbsolute(adlayer.pageX,adlayer.pageY); clip.height=60; clip.width=468; visibility=\'show\';"></LAYER>';
+
+}
+
+?>
+
 </body>
 </html>
 	<?php
 	}
 
+	/**
+	 *	header() - "steel theme" top of page
+	 *
+	 * @param	array	Header parameters array
+	 */
 	function header($params) {
+		global $Language;
+
 		$this->generic_header_start($params); 
 /*
 
 
 
-	WARNING - changing this can affect
+	WARNING - changing this font call can affect
 	INTERNATIONALIZATION
 
 
@@ -261,6 +410,7 @@
 
 	?>
 
+		<link rel="SHORTCUT ICON" href="/images/favicon.ico">
 		<style type="text/css">
 			<!--
 	OL,UL,P,BODY,TD,TR,TH,FORM { font-family: <?php echo $site_fonts; ?>; font-size:<?php echo $this->FONTSIZE; ?>; color: <?php echo $this->FONTCOLOR_CONTENT ?>; }
@@ -327,7 +477,7 @@
 ?>
 <br>
 <!-- start page body -->
-<CENTER>
+<div align="center">
 <table cellpadding="0" cellspacing="0" border="0" width="99%">
 	<tr>
 		<td background="<?php echo $GLOBALS['sys_images_url'] . $this->imgroot; ?>tbar1.png" width="1%" height="17"><?php echo html_image($this->imgroot . "tleft1.png","17","17",array()); ?></td>
@@ -362,9 +512,31 @@
 	<td width="20" background="<?php echo $GLOBALS['sys_images_url'] . $this->imgroot; ?>fade1.png" nowrap> </td>
 	<td valign="top" bgcolor="<?php echo $this->COLOR_CONTENT_BACK; ?>" width="99%">
 	<BR>
-<?php
+
+	<?php
+
+	if ($params['titlevals']) {
+		$title =        $Language->getText($params['pagename'],'title',$params['titlevals']);
+	} else {
+		$title =        $Language->getText($params['pagename'],'title');
 	}
 
+	if ($params['sectionvals']) {
+		$section =      $Language->getText($params['pagename'],'section',$params['sectionvals']);
+	} else {
+		$section =      $Language->getText($params['pagename'],'section');
+	}
+
+	if ($section) {
+		print "<b>$section</b>\n";
+	}
+
+	if ($title) {
+	       print "<h2>$title</h2>\n";
+	}
+
+	}
+
 	function footer($params) {
 	?>
 	<!-- end content -->
@@ -385,6 +557,7 @@
 		<td background="<?php echo $GLOBALS['sys_images_url'] . $this->imgroot; ?>bbar1.png" bgcolor="#7c8188"><?php echo html_image($this->imgroot . "bright1.png","17","17",array()); ?></td>
 	</tr>
 </table>
+</div>
 
 <!-- themed page footer -->
 <?php 
@@ -393,25 +566,31 @@
 
 
 
+	/**
+	 * menuhtml_top() - HTML top menu
+	 *
+	 * Use only for the top most menu
+	 *
+	 * @param	string	Menu title
+	 */
 	function menuhtml_top($title) {
-		/*
-			Use only for the top most menu
-		*/
-	?>
+?>
 <table cellpadding="0" cellspacing="0" border="0" width="140">
 	<tr>
 		<td align="left" valign="middle"><b><?php echo $title; ?></b><br></td>
 	</tr>
 	<tr>
 		<td align="right" valign="middle">
-	<?php
+<?php
 	}
 
 
+	/**
+	 * menuhtml_bottom() - HTML bottom menu
+	 *
+	 * End the table
+	 */
 	function menuhtml_bottom() {
-		/*
-			End the table
-		*/
 		print '
 			<BR>
 			</td>
@@ -424,14 +603,14 @@
 		print "\t".'<A class="menus" href="'.$link.'">'.$title.'</A>  ' . html_image($this->imgroot . "point1.png","7","7",array()) . '<br>';
 	}
 
-	/*!     @function tab_entry
-		@abstract Prints out the a themed tab, used by project_tabs
-		@param  $url is the URL to link to
-			$icon is the image to use (if the theme uses it)
-			$title is the title to use in the link tags
-			$selected is a boolean to test if the tab is 'selected'
-		@result text - echos HTML to the screen directly
-	*/
+	/**
+	 *	tab_entry() - Prints out the a themed tab, used by project_tabs
+	 *
+	 *	@param	string	Is the URL to link to
+	 *	@param	string	Us the image to use (if the theme uses it)
+	 *	@param	string	Is the title to use in the link tags
+	 *	@param	bool	Is a boolean to test if the tab is 'selected'
+	 */
 	function tab_entry($url='http://localhost/', $icon='', $title='Home', $selected=0) {
 		print '
 		<A ';
@@ -443,14 +622,15 @@
 		print 'href="'. $url .'">' . $title . '</A> | ';
 	}
 
-	/*!     @function project_tabs
-		@abstract Prints out the project tabs, contained here in case
-			we want to allow it to be overriden
-		@param 	$toptab is the tab currently selected
-			$group is the group we should look up get title info
-		@result text - echos HTML to the screen directly
-	*/
-	function project_tabs($toptab,$group) {
+	/**
+	 *	project_tabs() - Prints out the project tabs, contained here in case
+	 *		we want to allow it to be overriden
+	 *
+	 *	@param	string	Is the tab currently selected
+	 *	@param	string	Is the group we should look up get title info
+	 *  @param	string	Any extra text to print out
+	 */
+	function project_tabs($toptab,$group,$extra_text='') {
 
 		global $Language;
 
@@ -464,102 +644,132 @@
 			return;
 		}
 
-		print '<H2>'. $project->getPublicName() .' - ';
+/*		print '<H2>'. $project->getPublicName() .' - ';
 		// specific to where we're at
 		switch ($toptab) {
-			case 'home': print $Language->GROUP_SHORT_SUMMARY; break;
-			case 'forums': print $Language->GROUP_SHORT_FORUM; break;
-			case 'bugs': print $Language->GROUP_SHORT_BUGS; break;
-			case 'support': print $Language->GROUP_SHORT_SUPPORT; break;
-			case 'mail': print $Language->GROUP_SHORT_MAIL; break;
-			case 'pm': print $Language->GROUP_SHORT_PM; break;
-			case 'docman': print $Language->GROUP_SHORT_DOCMAN; break;
-			case 'surveys': print $Language->GROUP_SHORT_SURVEY; break;
-			case 'cvs': print $Language->GROUP_SHORT_CVS; break;
-			case 'downloads': print $Language->GROUP_SHORT_FILES; break;
-			case 'news': print $Language->GROUP_SHORT_NEWS; break;
-			case 'patch': print $Language->GROUP_SHORT_PATCH; break;
-			case 'memberlist': print $Language->GROUP_SHORT_MEMBERLIST; break;
-//			default: print "???" . $toptab; break;
-			default: print $Language->GROUP_SHORT_SUMMARY; break;
+			case 'home': print $Language->getText('group','short_summary'); break;
+			case 'admin': print $Language->getText('group','short_admin'); break;
+			case 'forums': print $Language->getText('group','short_forum'); break;
+			case 'tracker': print $Language->getText('group','short_tracker'); break;
+			case 'mail': print $Language->getText('group','short_mail'); break;
+			case 'pm': print $Language->getText('group','short_pm'); break;
+			case 'docman': print $Language->getText('group','short_docman'); break;
+			case 'surveys': print $Language->getText('group','short_survey'); break;
+			case 'cvs': print $Language->getText('group','short_cvs'); break;
+			case 'downloads': print $Language->getText('group','short_files'); break;
+			case 'news': print $Language->getText('group','short_news'); break;
+			case 'memberlist': print $Language->getText('group','short_memberlist'); break;
+			default: print $Language->getText('group','short_summary'); break;
 		}
-	print '</H2>
-	<P>
-	<HR SIZE="1" NoShade>';
 
+		if ($extra_text) {
+			print ' - '.$extra_text;
+		}
+
+*/
+
+		print '</H2>
+		<P>
+		<HR SIZE="1" NoShade>';
+
 		// Summary
 		$this->tab_entry('/projects/'. $project->getUnixName() .'/', $this->icons['Summary'],
-			$Language->GROUP_SHORT_SUMMARY, $toptab == 'home');
+			$Language->getText('group','short_summary'), $toptab == 'home');
 
+		// Project Admin 
+		$this->tab_entry('/project/admin/?group_id='. $group, $this->icons['Admin'],
+			$Language->getText('group','short_admin'), $toptab == 'admin');
+
 		// Homepage
 		$this->tab_entry('http://'. $project->getHomePage(), $this->icons['Homepage'],
-			$Language->GROUP_SHORT_HOMEPAGE);
+			$Language->getText('group','short_homepage'));
 
 		// Forums
 		if ($project->usesForum()) {
 			$this->tab_entry('/forum/?group_id='.$group, $this->icons['Forums'],
-				$Language->GROUP_SHORT_FORUM, $toptab == 'forums');
+				$Language->getText('group','short_forum'), $toptab == 'forums');
 		}
 
-		// Bug Tracking
-		if ($project->usesBugs()) {
-			$this->tab_entry('/bugs/?group_id='.$group, $this->icons['Bugs'],
-				$Language->GROUP_SHORT_BUGS, $toptab == 'bugs');
-		}
+		// Artifact Tracking
+		$this->tab_entry('/tracker/?group_id='.$group, $this->icons['Tracker'],
+			$Language->getText('group','short_tracker'), $toptab == 'tracker');
 
-		// Support Tracking
-		if ($project->usesSupport()) {
-			$this->tab_entry('/support/?group_id='.$group, $this->icons['Support'],
-				$Language->GROUP_SHORT_SUPPORT, $toptab == 'support');
-		}
+/*
+	Messy hack but they insisted on it -
 
-		// Patch Manager
-		if ($project->usesPatch()) {
-			$this->tab_entry('/patch/?group_id='.$group, $this->icons['Patches'],
-				$Language->GROUP_SHORT_PATCH, $toptab == 'patch');
+	We need to get the bug, support, and patch tracker info
+	and display it here if they are public
+*/
+		$res=db_query("SELECT * 
+			FROM artifact_group_list 
+			WHERE group_id='$group'
+			AND is_public='1' 
+			AND datatype > 0
+			ORDER BY datatype ASC");
+		$rows=db_numrows($res);
+//
+//	Iterate through the public pre-defined trackers and add them to nav bar
+//
+		for ($i=0; $i<$rows; $i++) {
+			if (db_result($res,$i,'datatype') == 1) {
+				//bug Tracker
+				$this->tab_entry('/tracker/?group_id='.$group.'&atid='.db_result($res,$i,'group_artifact_id'), 
+				$this->icons['Bugs'],
+				$Language->getText('group','short_bugs'), $toptab == 'bugs');
+			} elseif (db_result($res,$i,'datatype') == 2) {
+				//support Tracker
+				$this->tab_entry('/tracker/?group_id='.$group.'&atid='.db_result($res,$i,'group_artifact_id'), 
+				$this->icons['Support'],
+				$Language->getText('group','short_support'), $toptab == 'support');
+			} elseif (db_result($res,$i,'datatype') == 3) {
+				//patch Tracker
+				$this->tab_entry('/tracker/?group_id='.$group.'&atid='.db_result($res,$i,'group_artifact_id'), 
+				$this->icons['Patches'],
+				$Language->getText('group','short_patch'), $toptab == 'patch');
+			}
 		}
 
 		// Mailing Lists
 		if ($project->usesMail()) {
 			$this->tab_entry('/mail/?group_id='.$group, $this->icons['Lists'], 
-				$Language->GROUP_SHORT_MAIL, $toptab == 'mail');
+				$Language->getText('group','short_mail'), $toptab == 'mail');
 		}
 
 		// Project Manager
 		if ($project->usesPm()) {
 			$this->tab_entry('/pm/?group_id='.$group, $this->icons['Tasks'], 
-				$Language->GROUP_SHORT_PM, $toptab == 'pm');
+				$Language->getText('group','short_pm'), $toptab == 'pm');
 		}
 
 		// Doc Manager
 		if ($project->usesDocman()) {
 			$this->tab_entry('/docman/?group_id='.$group, $this->icons['Docs'], 
-				$Language->GROUP_SHORT_DOCMAN, $toptab == 'docman');
+				$Language->getText('group','short_docman'), $toptab == 'docman');
 		}
 
 		// Surveys
 		if ($project->usesSurvey()) {
 			$this->tab_entry('/survey/?group_id='.$group, $this->icons['Surveys'], 
-				$Language->GROUP_SHORT_SURVEY, $toptab == 'surveys');
+				$Language->getText('group','short_survey'), $toptab == 'surveys');
 		}
 
 		//newsbytes
 		if ($project->usesNews()) {
 			$this->tab_entry('/news/?group_id='.$group, $this->icons['News'], 
-				$Language->GROUP_SHORT_NEWS, $toptab == 'news');
+				$Language->getText('group','short_news'), $toptab == 'news');
 		}
 
 		// CVS
 		if ($project->usesCVS()) {
 			$this->tab_entry('/cvs/?group_id='.$group, $this->icons['CVS'], 
-				$Language->GROUP_SHORT_CVS, $toptab == 'cvs');
+				$Language->getText('group','short_cvs'), $toptab == 'cvs');
 		}
 
 		// Downloads
-		$this->tab_entry('/project/filelist.php?group_id='.$group, $this->icons['Files'], 
-			$Language->GROUP_SHORT_FILES, $toptab == 'downloads');
+		$this->tab_entry('/project/showfiles.php?group_id='.$group, $this->icons['Files'], 
+			$Language->getText('group','short_files'), $toptab == 'downloads');
 
-		print '<HR SIZE="1" NoShade><P>';
+		print '<HR SIZE="1" NoShade><BR>';
 	}
 
 

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Theme.class
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Theme.class	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/Theme.class	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,30 +1,47 @@
 <?php   
+/**
+ * Base theme class.
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id: Theme.class,v 1.7 2001/06/08 14:42:05 dbrogdon Exp $
+ */
 
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//              
-// $Id: Theme.class,v 1.5 2000/11/30 16:13:05 dbrogdon Exp $
-
-
-/*
-
-	Theme class, extends Tim's basic Error class
-
-	Geoffrey Herteg, August 28, 2000
-
-*/
-
-
 class Theme extends Layout {
 
+	/**
+	 * The theme ID
+	 *
+	 * @var		int		$theme_id
+	 */
 	var $theme_id;
+
+	/**
+	 * The long theme name
+	 *
+	 * @var		string	$long_name
+	 */
 	var $long_name;
+
+	/**
+	 * The dir name
+	 *
+	 * @var		string	$dir_name
+	 */
 	var $dir_name;
 
+	/**
+	 * The HTML box title color
+	 * 
+	 * @var		constant		$COLOR_HTMLBOX_TITLE
+	 */
 	var $COLOR_HTMLBOX_TITLE = '#737b9c';
 
+	/**
+	 * Theme() - Constructor
+	 */
 	function Theme() {
 		// Parent constructor
 		$this->Layout();
@@ -42,6 +59,13 @@
 
 	}
 
+	/**
+	 * box1_top() - Top HTML box
+	 *
+	 * @param	string	Box title
+	 * @param	bool	Whether to echo or return the results
+	 * @param	string	The box background color
+	 */
 	function box1_top($title,$echoout=1,$bgcolor='') {
 	        if (!$bgcolor) {
         	        $bgcolor=$this->COLOR_HTMLBOX_BACK;
@@ -62,6 +86,12 @@
         	}
 	}
 
+	/**
+	 * box1_middle() - Middle HTML box
+	 *
+	 * @param	string	Box title
+	 * @param	string	The box background color
+	 */
 	function box1_middle($title,$bgcolor='') {
 	        if (!$bgcolor) {
         	        $bgcolor=$this->COLOR_HTMLBOX_BACK;
@@ -76,6 +106,11 @@
                                 <TD colspan=2>';
 	}
 
+	/**
+	 * box1_bottom() - Bottom HTML box
+	 *
+	 * @param	bool	Whether to echo or return the results
+	 */
 	function box1_bottom($echoout=1) {
         	$return = '
                                 </TD>
@@ -88,8 +123,11 @@
         	}
 	}
 
-	// ############################
-
+	/**
+	 * header() - The page header
+	 *
+	 * @param	array	Array of header parameters
+	 */
 	function header($params) {
 	        $this->generic_header_start($params);
 
@@ -213,10 +251,11 @@
         	<?php
 	}
 
-
-
-	// ############################
-
+	/**
+	 * footer() - page footer
+	 *
+	 * @param	array	Array of footer parameters
+	 */
 	function footer($params) {
 
         ?>
@@ -238,6 +277,11 @@
         	$this->generic_footer($params);
 	}
 
+	/**
+	 * menuhtml_top() - Top HTML menu
+	 *
+	 * @param	string	Menu title
+	 */
 	function menuhtml_top($title) {
 	        /*
                 	Use only for the top most menu
@@ -253,6 +297,9 @@
         <?php
 	}
 
+	/**
+	 * menuhtml_bottom() - Bottom HTML menu
+	 */
 	function menuhtml_bottom() {
 	        /*
                 	End the table
@@ -264,10 +311,24 @@
 ';
 	}
 
+	/**
+	 * menu_entry() - A menu entry
+	 *
+	 * @param	string	The entry link
+	 * @param	string	The entry title
+	 */
 	function menu_entry($link, $title) {
 	        print "\t".'<font face="arial, helvetica" size="2"><A class="menus" href="'.$link.'">'.$title.'</A></font><br>';
 	}
 
+	/**
+	 * tab_entry() - A tab entry
+	 *
+	 * @param	string	The url
+	 * @param	string	The icon image
+	 * @param	string	The title
+	 * @param	bool	Whether this entry is selected (highlighted)
+	 */
 	function tab_entry($url='http://localhost/', $icon='/images/ic/home16b.png', $title='Home', $selected=0) {
 	        print '
                 <A ';
@@ -278,7 +339,5 @@
 	        html_image($icon,'20','20',array('alt'=>"$title",'border'=>($selected?'1':'0')));
         	print '</A>';
 	}
-
-
 }
 ?>

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/cache.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/cache.php	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/cache.php	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,14 +1,23 @@
 <?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: cache.php,v 1.47 2000/12/14 17:56:51 tperdue Exp $
+/**
+ * Cache functions library.
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id: cache.php,v 1.49 2001/06/08 14:56:43 dbrogdon Exp $
+ */
 
-
-// #################################### function cache_display
-
+/**
+ * cache_display() - Cache the output of a function
+ * 
+ * Caches the output of a function for the duration of $time.
+ *
+ * @param		string	The cache name
+ * @param		string	The funcion who's output is to be cached
+ * @param		int		The lenght of time the output should be cached
+ */
 function cache_display($name,$function,$time) {
 	global $Language;
 	$filename = $GLOBALS['sf_cache_dir']."/sfcache_". $Language->getLanguageId() ."_". $GLOBALS['sys_theme'] ."_$name.sf";
@@ -52,7 +61,7 @@
 		return cache_get_new_data($function);
 	}
 	while(!flock($rfh,1+4) && ($counter < 30)) { // obtained non blocking shared lock 
-		usleep(250000); // wait 0.25 seconds for the lock to become available
+		usleep(500000); // wait 0.5 seconds for the lock to become available
 		$counter++;
 	}
 	$result=stripslashes(fread($rfh,200000));
@@ -61,6 +70,11 @@
 	return $result;
 }
 
+/**
+ * cache_get_new_data() - Get new output for a function
+ *
+ * @param		string	The name of the function who's output is to be updated
+ */
 function cache_get_new_data($function) {
 	global $Language;
 	// Here should be localhost! It is chacked in write_cache.php .
@@ -69,5 +83,4 @@
 	eval("\$res= $function;");
 	return $res;
 }
-
 ?>

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/features_boxes.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/features_boxes.php	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/features_boxes.php	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,23 +1,24 @@
 <?php
+
 //
 // SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
+// Copyright 1999-2001 (c) VA Linux Systems
 // http://sourceforge.net
 //
 // $Id$
+//
 
-
 function show_features_boxes() {
 	GLOBAL $HTML,$Language;
-	$return .= $HTML->box1_top($Language->SOURCEFORGE_STATISTICS,0);
+	$return .= $HTML->box1_top($Language->getText('home','sourceforge_statistics'),0);
 	$return .= show_sitestats();
-	// $return .= $HTML->box1_middle($Language->SFOS);
+	// $return .= $HTML->box1_middle($Language->getText('home','sfos'));
 	// $return .= show_sfos();
-	$return .= $HTML->box1_middle($Language->TOP_PROJECT_DOWNLOADS);
+	$return .= $HTML->box1_middle($Language->getText('home','top_project_downloads'));
 	$return .= show_top_downloads();
-	$return .= $HTML->box1_middle($Language->HIGHEST_RANKED_USERS);
+	$return .= $HTML->box1_middle($Language->getText('home','highest_ranked_users'));
 	$return .= show_highest_ranked_users();
-	$return .= $HTML->box1_middle($Language->MOST_ACTIVE_THIS_WEEK);
+	$return .= $HTML->box1_middle($Language->getText('home','most_active_this_week'));
 	$return .= show_highest_ranked_projects();
 	$return .= $HTML->box1_bottom(0);
 	return $return;
@@ -30,43 +31,34 @@
 	GLOBAL $HTML;
 //	$comma_sep_groups=$GLOBALS['foundry']->getProjectsCommaSep();
 
-	$group_id=$GLOBALS['foundry']->getGroupID();
+	$group_id=$GLOBALS['foundry']->getID();
 
 	$return .= $HTML->box1_top('Most Active',0);
 	$return .= foundry_active_projects($group_id);
 	$return .= $HTML->box1_middle('Top Downloads');
-	$return .= foundry_top_downloads($GLOBALS['foundry']->getGroupID());
+	$return .= foundry_top_downloads($GLOBALS['foundry']->getID());
 	$return .= $HTML->box1_middle('Featured Projects');
-	$return .= foundry_featured_projects($GLOBALS['foundry']->getGroupID());
+	$return .= foundry_featured_projects($GLOBALS['foundry']->getID());
 	$return .= $HTML->box1_bottom(0);
 	return $return;
 }
 
 function foundry_active_projects($foundry_id) {
 
-//create index projectweeklymetric_groupid_ranking on project_weekly_metric(group_id,ranking);
+	$sql="SELECT * FROM foundry_project_rankings_agg
+			WHERE foundry_id='$foundry_id'
+			ORDER BY foundry_id ASC, ranking ASC";
 
-	$sql="SELECT groups.group_name,groups.unix_group_name,groups.group_id,
-		project_weekly_metric.ranking,project_weekly_metric.percentile 
-		FROM groups,project_weekly_metric 
-		WHERE groups.group_id=project_weekly_metric.group_id 
-		AND groups.is_public=1 
-		AND groups.type=1 
-		AND EXISTS (SELECT project_id FROM foundry_projects 
-			WHERE project_weekly_metric.group_id=foundry_projects.project_id 
-			AND foundry_projects.foundry_id='$foundry_id')
-		ORDER BY project_weekly_metric.ranking ASC";
-
-	$result=db_query($sql,20);
+	$result=db_query($sql, 20, 0, SYS_DB_STATS);
 	if (!$result || db_numrows($result) < 1) {
-		return '';//db_error();
+		return '';//db_error(SYS_DB_STATS);
 	} else {
 		while ($row=db_fetch_array($result)) {
 			$return .= '<B>( '.$row['percentile'].'% )</B>'
 				.' <A HREF="/projects/'.$row['unix_group_name'].
 			'/">'.$row['group_name'].'</A><BR>';
 		}
-		$return .= '<BR><CENTER><A href="/top/mostactive.php?type=week">[ More ]</A></CENTER>';
+		$return .= '<CENTER><A href="/top/mostactive.php?type=week">[ More ]</A></CENTER>';
 	}
 	return $return;
 }
@@ -97,23 +89,21 @@
 
 function foundry_top_downloads($foundry_id) {
 
-	#get yesterdays day
-	$yesterday = date("Ymd",time()-(3600*24));
+	// TODO yesterday is now defined as two days ago.  Quick fix
+	//      to allow download list to be cached before nightly
+	//      aggregation is done.  TODO jbyers 2001.03.19
+	//
+	$yesterday = date("Ymd",time()-(2*3600*24));
 	
-	$res_topdown = db_query("SELECT groups.group_id,
-		groups.group_name,
-		groups.unix_group_name,
-		frs_dlstats_group_agg.downloads 
-		FROM frs_dlstats_group_agg,groups WHERE day='20001115' 
-		AND frs_dlstats_group_agg.group_id=groups.group_id 
-		AND EXISTS (SELECT project_id FROM foundry_projects 
-			WHERE frs_dlstats_group_agg.group_id=foundry_projects.project_id 
-			AND foundry_projects.foundry_id='$foundry_id') 
-		AND groups.type=1 
-		ORDER BY downloads DESC",10);
+	$res_topdown = db_query("SELECT * 
+		FROM foundry_project_downloads_agg
+		WHERE
+		foundry_id='$foundry_id'
+		ORDER BY foundry_id DESC, downloads DESC
+	", 10, 0, SYS_DB_STATS);
 
 	if (!$res_topdown || db_numrows($res_topdown) < 1) {
-		return db_error();
+		return db_error(SYS_DB_STATS);
 	} else {
 		// print each one
 		while ($row_topdown = db_fetch_array($res_topdown)) {
@@ -127,22 +117,34 @@
 }
 
 function show_top_downloads() {
-	$yesterday = date("Ymd",time()-(3600*24));
 
-	$res_topdown = db_query("SELECT groups.group_id,"
-		."groups.group_name,"
-		."groups.unix_group_name,"
-		."frs_dlstats_group_agg.downloads "
-		."FROM frs_dlstats_group_agg,groups WHERE day=$yesterday "
-		."AND frs_dlstats_group_agg.group_id=groups.group_id "
-		."ORDER BY downloads DESC",10);
+	// TODO yesterday is now defined as two days ago.  Quick fix
+	//      to allow download list to be cached before nightly
+	//      aggregation is done. jbyers 2001.03.19
+	//
+	$month = date("Ym",time()-(2*3600*24));
+	$day = date("d",time()-(2*3600*24));
+
+	$res_topdown = db_query("
+		SELECT groups.group_id,
+		groups.group_name,
+		groups.unix_group_name,
+		frs_dlstats_group_agg.downloads 
+		FROM frs_dlstats_group_agg,groups 
+		WHERE month='$month' 
+		AND day='$day'
+		AND frs_dlstats_group_agg.group_id=groups.group_id 
+		ORDER BY downloads DESC
+	", 10, 0, SYS_DB_STATS);
+//	echo db_error();
+
 	// print each one
 	while ($row_topdown = db_fetch_array($res_topdown)) {
 		if ($row_topdown['downloads'] > 0) 
-			$return .= "<BR>($row_topdown[downloads]) <A href=\"/projects/$row_topdown[unix_group_name]/\">"
-			. "$row_topdown[group_name]</A>\n";
+			$return .= "(" . number_format($row_topdown[downloads], 0) . ") <A href=\"/projects/$row_topdown[unix_group_name]/\">"
+			. "$row_topdown[group_name]</A><BR>\n";
 	}
-	$return .= '<P align="center"><A href="/top/">[ More ]</A>';
+	$return .= '<CENTER><A href="/top/">[ More ]</A></CENTER>';
 	
 	return $return;
 
@@ -231,9 +233,10 @@
 function show_highest_ranked_users() {
 
 	//select out the users information to show the top users on the site
-	$sql="SELECT users.user_name,users.realname,user_metric.metric ".
-		"FROM user_metric,users ".
-		"WHERE users.user_id=user_metric.user_id AND user_metric.ranking < 11";
+	$sql="SELECT users.user_name,users.realname,user_metric.metric
+		FROM user_metric,users 
+		WHERE users.user_id=user_metric.user_id AND user_metric.ranking < 11 
+		ORDER BY ranking ASC";
 	$res=db_query($sql);
 	$rows=db_numrows($res);
 	if (!$res || $rows<1) {
@@ -243,6 +246,7 @@
 			$return .= ($i+1).' - ('. number_format(db_result($res,$i,'metric'),4) .') <A HREF="/users/'. db_result($res,$i,'user_name') .'">'. db_result($res,$i,'realname') .'</A><BR>'; 
 		}
 	}
+	$return .= '<div align="center"><a href="/top/topusers.php">[ More ]</a></div>';
 	return $return;
 }
 
@@ -263,13 +267,13 @@
 				.' <A HREF="/projects/'.$row['unix_group_name'].
 			'/">'.$row['group_name'].'</A><BR>';
 		}
-		$return .= '<BR><CENTER><A href="/top/mostactive.php?type=week">[ More ]</A></CENTER>';
+		$return .= '<CENTER><A href="/top/mostactive.php?type=week">[ More ]</A></CENTER>';
 	}
 	return $return;
 }
 
 function show_sfos() {
-		$return = "Now SourceForge can support your company. Click to learn about <a href='http://www.valinux.com/services/sfos.html'>SourceForge OnSite</a><br>";
+		$return = "Bring SourceForge to your company - support 100 to 10,000+ developers with <a href='http://www.valinux.com/services/sfos.html'>SourceForge OnSite</a>.<br>";
 
 		return $return;
 }

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/frs.class
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/frs.class	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/frs.class	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,55 +1,85 @@
 <?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: frs.class,v 1.6 2000/12/13 19:00:11 dbrogdon Exp $
-
 /**
  * Base class for FRS (File Release System) and QRS (Quick-file Release System)
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
  *
+ * @version   $Id: frs.class,v 1.16 2001/06/08 18:44:05 dbrogdon Exp $
  * @author Darrell Brogdon <dbrogdon at valinux.com>
  */
+
 class FRS extends Error {
 
-	// {{{ Properties
+	/**
+	 * The group ID
+	 *
+	 * @var		int		$group_id
+	 */
+	var $group_id   = "";
 
-	var $group_id   = "";
+	/**
+	 * The package ID
+	 *
+	 * @var		int		$package_id
+	 */
 	var $package_id = "";
+
+	/**
+	 * The release ID
+	 *
+	 * @var		int		$release_id
+	 */
 	var $release_id = "";
+
+	/**
+	 * The project ID
+	 *
+	 * @var		int		$project_id
+	 */
 	var $project_id = "";
+
+	/**
+	 * The file ID
+	 *
+	 * @var		int		$file_id
+	 */
 	var $file_id    = "";
+
+	/**
+	 * The file type
+	 *
+	 * @var		string	$file_type
+	 */
 	var $file_type  = "";
+
+	/**
+	 * The processor type
+	 *
+	 * @var		string	$proc_type
+	 */
 	var $proc_type  = "";
 
-	// }}}
-
-	// {{{ Constructor
-
 	/**
+	 * FRS() - Constructor
+	 * 
 	 * Sets the value of Class vars if the function arguments exist.
 	 *
-	 * @param $group_id int The group ID
-	 * @param $package_id int The package ID
-	 * @param $release_id int The release ID
+	 * @param	int		The group ID
+	 * @param	int		The package ID
+	 * @param	int		The release ID
 	 */
-	function FRS($group_id)
-	{
+	function FRS($group_id) {
 		$this->group_id 	= $group_id;
 	}
 
-	// }}}
-	// {{{ frsAddChangeLog
-
 	/**	
-	 * Add an entry to the change log
+	 * frsAddChangeLog() - Add an entry to the change log
 	 * 
-	 * @param $change_log_text int The text that is to be added to the change log
-	 * @returns True on success, False on error
+	 * @param	int		The text that is to be added to the change log
+	 * @return True on success, False on error
 	 */
-	function frsAddChangeLog($change_log_text)
-	{
+	function frsAddChangeLog($change_log_text) {
 		if( !$this->frsVerifyRelease($release_id, $package_id) ) {
 			$this->setError(' FRS Add Change Log Failed: ' . $this->getErrorMessage());
 			return false;
@@ -69,28 +99,27 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsAddFile
-
 	/**
-	 * Add a new file
+	 * frsAddFile() - Add a new file
 	 *
-	 * @param $release_time int Time of the release
-	 * @param $filename string The name of the file to add
-	 * @param $release_id int The ID of the release this file to which this file is associated
-	 * @param $file_size int The file size
-	 * @param $post_date int THe post date
-	 * @returns True on success, False on error
+	 * @param	int		Time of the release
+	 * @param	string	The name of the file to add
+	 * @param	int		The ID of the release this file to which this file is associated
+	 * @param	int		The file size
+	 * @param	int		The post date
+	 * @param	int		The ide of the release
+	 * @param	int		The ID of the package
 	 */
-	function frsAddFile($release_time, $filename, $group_unix_name, $user_unix_name, $file_size, $post_date, $release_id, $package_id, $type_id, $proc_id)
-	{
+	function frsAddFile($release_time, $filename, $file_size, $post_date, $release_id, $package_id) {
 		if( !$this->frsVerifyRelease($release_id, $package_id) ) {
 			$this->setError(' FRS Add File Failed: ' . $this->getErrorMessage());
 			return false;
 		}
-
-		//exec is crunching var
-		$file=$filename;
+//
+//
+//	filename validation? Use a regex.
+//
+//
 		//move the file to a its project page using a setuid program
 		// The following line is due to PHP braindeadness.
 		// Don't you dare remove it, it'll break.
@@ -104,14 +133,16 @@
 			return false;
 		}
 
-		$res=db_query("INSERT INTO frs_file (release_time,filename,release_id,type_id,processor_id,file_size,post_date) VALUES (" .
-					  "'$release_time'," .
-					  "'$filename'," .
-					  "'$release_id'," .
-					  "'$type_id'," .
-					  "'$proc_id'," .
-					  "'$file_size'," .
-					  "'$post_date') ");
+		$res=db_query("INSERT INTO 
+								frs_file (release_time,filename,release_id,file_size,post_date,processor_id,type_id) 
+				       VALUES (
+								'$release_time',
+								'$filename',
+								'$release_id',
+								'$file_size',
+								'$post_date',
+								'100',
+								'100') ");
 		if (!$res) {
 			$this->setError(' FRS Add File Failed: ' . db_error());
 			return false;
@@ -120,18 +151,14 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsAddRelease
-
 	/**
-	 * Add a new release
+	 * frsAddRelease() - Add a new release
 	 *
-	 * @param $release_name string The name of the new release
-	 * @param $package_id int The ID of the package with which this release is to be associated
-	 * @returns Database result ID
+	 * @param	string	The name of the new release
+	 * @param	int		The ID of the package with which this release is to be associated
+	 * @return Database result ID
 	 */
-	function frsAddRelease($release_name, $package_id, $notes="", $changes="")
-	{
+	function frsAddRelease($release_name, $package_id, $notes="", $changes="") {
 		if( !$this->frsVerifyPackage($package_id) ) {
 			$this->setError(' FRS Add Release Failed: ' . $this->getErrorMessage());
 			return false;
@@ -148,17 +175,13 @@
 		}
 	}
 
-	// }}}
-	// {{{ frsAddNotes
-
 	/**
-	 * Add a new release note
+	 * frsAddNotes() - Add a new release note
 	 *
-	 * @param $notes_text string The text of the release notes
-	 * @returns True on success, False on error
+	 * @param	string	The text of the release notes
+	 * @return True on success, False on error
 	 */
-	function frsAddNotes($notes_text, $release_id)
-	{
+	function frsAddNotes($notes_text, $release_id) {
 		if( !$this->frsVerifyRelease($release_id, $package_id) ) {
 			$this->setError(' FRS Add Notes Failed: ' . $this->getErrorMessage());
 			return false;
@@ -178,18 +201,14 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsChangePackageName
-
 	/**
-	 * Change a package name
+	 * frsChangePackageName() - Change a package name
 	 *
-	 * @param $new_name string The new name to give to a package
-	 * @param $package_id int The package ID for which to change the name
-	 * @returns True on success, False on error
+	 * @param	string	The new name to give to a package
+	 * @param	string	The package ID for which to change the name
+	 * @return True on success, False on error
 	 */
-	function frsChangePackageName($new_name, $package_id)
-	{
+	function frsChangePackageName($new_name, $package_id) {
 		if( !$this->frsVerifyPackage($package_id) ) {
 			$this->setError(' FRS Change Package Name Failed: ' . $this->getErrorMessage());
 			return false;
@@ -211,27 +230,28 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsChangeFile
-
 	/**
-	 * Change a file
+	 * frsChangeFile() - Change a file
 	 *
-	 * @param $release_time int Time of the release
-	 * @param $type_id int ID of the file type
-	 * @param $processor_id int ID of the processor type
-	 * @param $file_id int ID of the file to change
-	 * @param $release_id int ID of the release to which this file is related
-	 * @returns True on success, False on error
+	 * @param	int		Time of the release
+	 * @param	int		ID of the file type
+	 * @param	int		ID of the processor type
+	 * @param	int		ID of the file to change
+	 * @param	int		ID of the release to which this file is related
+	 * @return True on success, False on error
 	 */
-	function frsChangeFile($release_time, $type_id, $processor_id, $file_id, $release_id, $package_id)
-	{
+	function frsChangeFile($release_time, $type_id, $processor_id, $file_id, $release_id, $package_id) {
 		if( !$this->frsVerifyRelease($release_id, $package_id) ) {
 			$this->setError('FRS Change File Failed: ' . $this->getErrorMessage());
 			return false;
 		}
 
 		$date_list = split("-",$release_time,3);
+//
+//
+//	date validation?
+//
+//
 		$unix_release_time = mktime(0,0,0,$date_list[1],$date_list[2],$date_list[0]);
 		$res=db_query("UPDATE 
 							frs_file 
@@ -250,18 +270,14 @@
 		return true;
 	}
 	 
-	// }}}
-	// {{{ frsChangeFileRelease
-
 	/**
-	 * Change a file's release
+	 * frsChangeFileRelease() - Change a file's release
 	 *
-	 * @param $file_id int The ID of the file
-	 * @param $release_id int The ID of the release
-	 * @returns True on success, False on error
+	 * @param	int		The ID of the file
+	 * @param	int		The ID of the release
+	 * @return True on success, False on error
 	 */
-	function frsChangeFileRelease($file_id, $release_id)
-	{
+	function frsChangeFileRelease($file_id, $release_id) {
     	if( !$this->frsVerifyRelease($release_id, $package_id) ) {
 			$this->setError(' FRS Change File Release Failed: ' . $this->getErrorMessage());
 			return false;
@@ -286,23 +302,20 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsChangeRelease
-
 	/**
-	 * Change a release
+	 * frsChangeRelease() - Change a release
 	 *
-	 * @param $release_date int The date of the release
-	 * @param $release_name string The name of the release
-	 * @param $preformatted int The flag to store notes and changes as pre-formatted text
-	 * @param $status_id int The status ID of the release
-	 * @param $package_id int The package ID to which the release is related
-	 * @param $notes string The release notes text
-	 * @param $changes string The change log text
-	 * @param $release_id int The ID of the release
+	 * @param	int		The date of the release
+	 * @param	string	The name of the release
+	 * @param	int		The flag to store notes and changes as pre-formatted text
+	 * @param	int		The status ID of the release
+	 * @param	int		The package ID to which the release is related
+	 * @param	string	The release notes text
+	 * @param	string	The change log text
+	 * @param	int		The ID of the release
 	 */
-	function frsChangeRelease($release_date, $release_name, $preformatted, $status_id, $notes, $changes, $package_id, $release_id)
-	{
+	function frsChangeRelease($release_date, $release_name, $preformatted, $status_id, $notes, $changes, 
+							  $package_id, $release_id) {
 		if( !$this->frsVerifyRelease($release_id, $package_id) ) {
 			$this->setError(' FRS Change Release Failed: ' . $this->getErrorMessage());
 			return false;
@@ -316,6 +329,11 @@
 		} else {
 			$date_expl = explode("-",$release_date);
 		    $release_date = mktime(0,0,0,$date_expl[1],$date_expl[2],$date_expl[0]);
+//
+//
+//	date validation
+//
+//
 		}
 		
 		$res=db_query("UPDATE 
@@ -338,36 +356,33 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsGetReleaseMonitors
-
 	/**
-	 * Get a count of the users that are monitoring a release
+	 * frsGetReleaseMonitors() - Get a count of the users that are monitoring a release
 	 *
-	 * @param $package_id int ID of the package that users are monitoring
-	 * @returns A count of the number of users monitoring $package_id
+	 * @param	int		ID of the package that users are monitoring
+	 * @return A count of the number of users monitoring $package_id
 	 */
-	function frsGetReleaseMonitors($package_id)
-	{
+	function frsGetReleaseMonitors($package_id) {
 		$result=db_result(db_query("SELECT count(*) from filemodule_monitor WHERE filemodule_id='$package_id'"),0,0);
 
 		return $result;
 	}
 
-	// }}}
-	// {{{ frsGetFileList
-	
 	/**
-	 * Get an array of all available files
+	 * frsGetFileList() - Get an array of all available files
 	 *
-	 * @returns An array of the files in the upload directory
+	 * @return An array of the files in the upload directory
 	 */
-	function frsGetFileList()
-	{
+	function frsGetFileList() {
 		$dirhandle = opendir($FTPINCOMING_DIR);
 
 		//iterate and show the files in the upload directory
 		while ($file = readdir($dirhandle)) {
+//
+//
+//	should only show valid filenames
+//
+//
 			if (!ereg('^\.',$file[0])) {
 				$file_list[] = $file;
 			}
@@ -376,17 +391,13 @@
 		return $file_list;
 	}
 
-	// }}}
-	// {{{ frsGetReleaseList
-
 	/**
-	 * Get a list of the releases
+	 * frsGetReleaseList() - Get a list of the releases
 	 *
-	 * @param $pkg_str string Optional string used to narrow the search
-	 * @returns Database result ID
+	 * @param	string	String used to narrow the search
+	 * @return Database result ID
 	 */
-	function frsGetReleaseList($pkg_str="")
-	{
+	function frsGetReleaseList($pkg_str="") {
 		$res=db_query("SELECT 
 							frs_release.release_id,
 							frs_package.name 
@@ -415,29 +426,22 @@
 		return $res;
 	}
 
-	// }}}
-	// {{{ frsGetPackageList
-
 	/**
-	 * Wrapper for getReleaseList
+	 * frsGetPackageList() - Wrapper for getReleaseList
 	 *
-	 * @param $package_id Int The ID of the package... duh!
+	 * @param	int		The ID of the package... duh!
 	 */
-	function frsGetPackageList($package_id) {
+	function frsGetPackageList($package_id) { 
 		return $this->frsGetReleaseList("AND frs_package.package_id='$package_id'");
 	}
 
-	// }}}
-	// {{{ frsGetRelease
-
 	/**
-	 * Get a specific release
+	 * frsGetRelease() - Get a specific release
 	 *
-	 * @param $release_id int ID of the release
-	 * @returns Database result ID
+	 * @param	int		ID of the release
+	 * @return Database result ID
 	 */
-	function frsGetRelease($release_id)
-	{
+	function frsGetRelease($release_id) {
 		$sql="SELECT 
 				frs_release.release_date,
 				frs_release.package_id,
@@ -469,18 +473,14 @@
 
 		return $result;
 	}
-	
-	// }}}
-	// {{{ frsGetReleaseFiles
 
 	/**
-	 * Get files associated with a release
+	 * frsGetReleaseFiles() - Get files associated with a release
 	 *
-	 * @param $release_id int ID of the release
-	 * @returns Database result ID
+	 * @param	int		ID of the release
+	 * @return Database result ID
 	 */
-	function frsGetReleaseFiles($release_id)
-	{
+	function frsGetReleaseFiles($release_id) {
 		$sql="SELECT * FROM frs_file WHERE release_id='$release_id'";
 		$result=db_query($sql);
 
@@ -492,17 +492,13 @@
 		return $result;
 	}
 
-	// }}}
-	// {{{ frsVerifyFileOwnership
-
 	/**
-	 * Verify the ownership of a file
+	 * frsVerifyFileOwnership() - Verify the ownership of a file
 	 *
-	 * @param $file_id ID of the file to verify
-	 * @returns Database result ID
+	 * @param	int		ID of the file to verify
+	 * @return Database result ID
 	 */
-	function frsVerifyFileOwnership($file_id)
-	{
+	function frsVerifyFileOwnership($file_id) {
 		$res=db_query("SELECT 
 							frs_file.filename 
 					   FROM 
@@ -522,18 +518,14 @@
 		return $res;
 	}
 
-	// }}}
-	// {{{ frsVerifyRelease
-
 	/**
-	 * Verify whether a release belongs to a project
+	 * frsVerifyRelease() - Verify whether a release belongs to a project
 	 *
-	 * @param $release_id int ID of the release
-	 * @param $package_id int ID of the package
-	 * @returns True on success, False on error
+	 * @param	int		ID of the release
+	 * @param	int		ID of the package
+	 * @return True on success, False on error
 	 */
-	function frsVerifyRelease($release_id, $package_id)
-	{
+	function frsVerifyRelease($release_id, $package_id) {
 		$res=db_query("SELECT 
 							frs_package.package_id 
 					   FROM 
@@ -551,17 +543,13 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsVerifyPackage
-
 	/**
-	 * Verify whether a package belongs to a group
+	 * frsVerifyPackage() - Verify whether a package belongs to a group
 	 *
-	 * @param $package_id int ID of the package
-	 * @returns True on success, False on error
+	 * @param	int		ID of the package
+	 * @return True on success, False on error
 	 */
-	function frsVerifyPackage($package_id)
-	{
+	function frsVerifyPackage($package_id) {
 		$res=db_query("SELECT * FROM frs_package WHERE package_id='$package_id' AND group_id='$this->group_id'");
 		if (!$res || db_numrows($res) < 1) {
 			$this->setError(' FRS Verify Package Failed ');
@@ -571,17 +559,18 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsVerifyPackageName
-
 	/**
-	 * Verify whether a package name exists for a project
+	 * frsVerifyPackagename() - Verify whether a package name exists for a project
 	 *
-	 * @param $group_id
-	 * @param $package_name
+	 * @param	int		The group ID
+	 * @param	string	The name of the package
 	 */
-	function frsVerifyPackageName($group_id, $package_name)
-	{
+	function frsVerifyPackageName($group_id, $package_name) {
+//
+//
+//	Why is group_id passed in here?
+//
+//
 		$res=db_query("SELECT 
 							r.name 
 					   FROM 
@@ -600,18 +589,20 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsVerifyFile
-
 	/**
-	 * Verify whether a file belongs a release/project/package
+	 * frsVerifyFile() - Verify whether a file belongs a release/project/package
 	 *
-	 * @param $file_id int ID of the file to verify
-	 * @param $group_id int ID of the group to which the file belongs
-	 * @returns True on success, False on error
+	 * @param	int		ID of the file to verify
+	 * @param	int		ID of the group to which the file belongs
+	 * @return True on success, False on error
 	 */
-	function frsVerifyFile($file_id, $group_id)
-	{
+	function frsVerifyFile($file_id, $group_id) {
+//
+//
+//	Why is group_id passed in here?
+//	cache the result by setting a flag or something - don't re-fetch on each call
+//
+//
 		$res=db_query("SELECT 
 							frs_package.package_id 
 					   FROM 
@@ -629,18 +620,20 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsVerifyFileExist
-
 	/**
-	 * Verify that a file doesn't exist in the database
+	 * frsVerifyFielexist() - Verify that a file doesn't exist in the database
 	 *
-	 * @param $filename String Name of the file
-	 * @param $release_id Int ID of the release
-	 * @param $group_id Int ID of the group
+	 * @param	string	Name of the file
+	 * @param	int		ID of the release
+	 * @param	int		ID of the group
 	 */
-	function frsVerifyFileExist($filename, $release_id, $group_id)
-	{
+	function frsVerifyFileExist($filename, $release_id, $group_id) {
+//
+//
+//	why is group_id passed in here?
+//	cache the result by setting a flag or something - don't re-fetch on each call
+//
+//
 		$res=db_query("SELECT 
 							frs_package.package_id 
 					   FROM 
@@ -658,18 +651,20 @@
 		}
 	}
 
-	// }}}
-	// {{{ frsVerifyFileRelease
-
 	/**
-	 * Verify that a file belongs to a release
+	 * frsVerifyFileRelease() - Verify that a file belongs to a release
 	 *
-	 * @param $group_id int ID of the group
-	 * @param $release_id int ID of the release
-	 * @returns True on success, False on error
+	 * @param	int		ID of the group
+	 * @param	int		ID of the release
+	 * @return True on success, False on error
 	 */
-	function frsVerifyFileRelease($group_id, $release_id)
-	{
+	function frsVerifyFileRelease($group_id, $release_id) {
+//
+//
+//	why is group_id passed in here?
+//	cache the result by setting a flag or something - don't re-fetch on each call
+//
+//
 		$res=db_query("SELECT 
 							frs_package.package_id 
 					   FROM 
@@ -686,18 +681,19 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsVerifyProject
-
 	/**
-	 * Verify whether a package belongs to a project
+	 * frsVerifyProject() - Verify whether a package belongs to a project
 	 *
-	 * @param $package_id int ID of the package
-	 * @param $project_id int ID of the project
-	 * @returns True on success, False on error
+	 * @param	int		ID of the package
+	 * @param	int		ID of the project
+	 * @return True on success, False on error
 	 */
-	function frsVerifyProject($package_id, $project_id)
-	{
+	function frsVerifyProject($package_id, $project_id) {
+//
+//
+//	why is group_id passed in here?
+//
+//
 		$res1=db_query("SELECT * FROM frs_package WHERE package_id='$package_id' AND group_id='$this->group_id'");
 		if (!$res1 || db_numrows($res1) < 1) {
 			$this->setError(' FRS Verify Project Failed ');
@@ -707,17 +703,13 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsVerifyReleaseDate
-
 	/**
-	 * Verify the release date format
+	 * frsVerifyReleaseDate() - Verify the release date format
 	 * 
-	 * @param $release_date int Date ofthe release to verify
-	 * @returns True on success, False on error
+	 * @param	int		Date ofthe release to verify
+	 * @return True on success, False on error
 	 */
-	function frsVerifyReleaseDate($release_date)
-	{
+	function frsVerifyReleaseDate($release_date) {
 		if (!ereg("[0-9]{4}-[0-9]{2}-[0-9]{2}",$release_date)) {
 			$this->setError(' FRS Verify Release Date Failed: invalid date format ');
 			return false;
@@ -726,31 +718,36 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsCreatePackage
-
 	/**
-	 * Create a new package
-	 * 
-	 * @param $package_id Int ID of the package
-	 * @param $group_id Int ID of the group
-	 * @param $package_name string Name of the package to create
-	 * @param $status_id int ID of the status
-	 * @returns True on success, False on error
+	 * frsVerifyFileMoved() - Verify that a file has actually moved from the temp upload location 
+	 * to the projects dir.
+	 *
+	 * @param	string	Location of the file in question.
 	 */
-	function frsCreatePackage($package_id, $group_id, $package_name, $status_id)
-	{
-		if( !$this->frsVerifyPackage($package_id) ) {
-			$this->setError(' FRS Change Package Failed: ' . $this->getErrorMessage());
+	function frsVerifyFileMoved($file_location) {
+		if( !file_exists($file_location) ) {
+			$this->setError($this->getErrorMessage() . " | Move File Failed ");
 			return false;
 		}	
 
-		if( !$this->frsVerifyPackageName($group_id, $package_name) ) {
-			$this->setError(' FRS Change Package Failed: ' . $this->getErrorMessage());
+		return true;
+	}
+
+	/**
+	 * frsCreatePackage() - Create a new package
+	 * 
+	 * @param	string	Name of the package to create
+	 * @return True on success, False on error
+	 */
+	function frsCreatePackage($package_name) {
+		if( !$this->frsVerifyPackageName($this->group_id, $package_name) ) {
 			return false;
 		}
 		
-		$res=db_query("INSERT INTO frs_package VALUES('$package_id','$group_id','$package_name','$status_id')");
+		$res=db_query("
+			INSERT INTO frs_package (group_id,name,status_id)
+			VALUES('".$this->group_id."','$package_name',1)
+		");
 
 		if (!$res) {
 			$this->setError(' FRS Create Package Failed ');
@@ -760,46 +757,48 @@
 		return true;
 	}
 
-	// }}}
-	// {{{ frsDeleteFile
-
 	/**
-	 * Delete a file
+	 * frsDeleteFile() - Delete a file
 	 * 
-	 * @param $group_id int ID of the group
-	 * @param $file_id int ID of the file to delete
-	 * @returns True on success, False on error
+	 * @param	int		ID of the group
+	 * @param	int		ID of the file to delete
+	 * @return True on success, False on error
 	 */
-	function frsDeleteFile($file_id, $group_id)
-	{
+	function frsDeleteFile($file_id, $group_id) {
 		$result = db_query("DELETE FROM frs_file WHERE file_id='$file_id'");
 		//append the filename and project name to a temp file for the root perl job to grab
-		exec ("/bin/echo \"". db_result($result,0,'filename') ."::". group_getunixname($group_id) ."::xxx\" >> $FTPINCOMING_DIR/.delete_files");
+		exec ("/bin/echo \"". db_result($result,0,'filename') ."::"
+			  . group_getunixname($group_id) ."::xxx\" >> $FTPINCOMING_DIR/.delete_files");
 
 		return true;
 	}
 
-	// }}}
-	// {{{ frsSendNotice
-
 	/**
-	 * Send a release update notice
+	 * frsSendNotice() - Send a release update notice
 	 *
-	 * @param $group_id int ID of the group
-	 * @param $release_id int ID of the release
-	 * @param $package_id int ID of the package
-	 * @returns Database result ID
+	 * @param	int		ID of the group
+	 * @param	int		ID of the release
+	 * @param	int		ID of the package
+	 * @return Database result ID
 	 */
-	function frsSendNotice($group_id, $release_id, $package_id)
-	{	
+	function frsSendNotice($group_id, $release_id, $package_id) {	
+//
+//
+//	why is group_id passed in here?
+//
+//
 		$sql="SELECT 
 				users.email,
-				frs_package.name 
+				frs_package.name,
+				group_name,
+				unix_group_name
 			  FROM 
 			  	users,
 				filemodule_monitor,
-				frs_package 
+				frs_package,
+				groups 
 			  WHERE 
+				groups.group_id=frs_package.group_id AND
 			  	users.user_id=filemodule_monitor.user_id AND 
 				filemodule_monitor.filemodule_id=frs_package.package_id AND 
 				filemodule_monitor.filemodule_id='$package_id' AND 
@@ -810,21 +809,42 @@
 			//send the email
 			$array_emails=result_column_to_array($result);
 			$list=implode($array_emails,', ');
+			$package = db_result($result,0,'name');
+			$full_group = db_result($result,0,'group_name');
+			$unix_group = db_result($result,0,'unix_group_name');
+			$date = date('Y-m-d H:i',time());
+			
+			$subject = '[SourceForge Release] '
+			           .$unix_group.' : '.$package;
 		
-			$subject='SourceForge File Release Notice';
-		
-			$body = "To: noreply@$GLOBALS[HTTP_HOST]".
-				"\nBCC: $list".
-				"\nSubject: $subject".
-				"\n\nA new version of ". db_result($result,0,'name')." has been released. ".
-				"\nYou can download it from SourceForge by following this link: ".
-				"\n\n<http://".$GLOBALS['HTTP_HOST']."/project/showfiles.php?group_id=$group_id&release_id=$release_id> ".
-				"\n\nYou requested to be notified when new versions of this file ".
-				"\nwere released. If you don't wish to be notified in the ".
-				"\nfuture, please login to SourceForge and click this link: ".
-				"\n<http://$GLOBALS[HTTP_HOST]/project/filemodule_monitor.php?filemodule_id=$package_id> ";
+
+			$text = "Project: $full_group  ($unix_group)\n"
+				."Package: $package\n"
+				."Date   : $date"
+				."\n\nProject \"$full_group\" ('$unix_group') has "
+			        ."released the new version of package '"
+				.$package."'. "
+				."You can download it from SourceForge "
+				."by following this link:\n"
+				."<http://".$GLOBALS['HTTP_HOST']."/project/showfiles.php?group_id=$group_id&release_id=$release_id>\n"
+				."or browse Release Notes and ChangeLog by visiting this link:\n"
+				."<http://".$GLOBALS['HTTP_HOST']."/project/shownotes.php?release_id=$release_id> "
+				."\n\nYou receive this email because you "
+				."requested to be notified when new versions of this package "
+				."were released. If you don't wish to be notified in the "
+				."future, please login to SourceForge and click this link: "
+				."<http://$GLOBALS[HTTP_HOST]/project/filemodule_monitor.php?filemodule_id=$package_id> "
+				."\nIf you lost your SourceForge login name or password, refer to "
+				."this document: "
+				."<http://$GLOBALS[HTTP_HOST]/docman/display_doc.php?docid=760&group_id=1> "
+				."\n\nNote that you may receive this message indirectly via one of "
+				."your mailing list subscriptions. Please review message headers "
+				."before reporting unsolicited mailings."
+				;
+
+			$text = util_line_wrap($text);
 			
-			exec ("/bin/echo \"$body\" | /usr/sbin/sendmail -fnoreply@$GLOBALS[HTTP_HOST] -t");
+			util_send_mail("noreply@$GLOBALS[sys_default_domain]",$subject,$text,"noreply@$GLOBALS[sys_default_domain]",$list);			
 
 			return $result;
 		} else {
@@ -833,14 +853,42 @@
 		}
 	}
 
-	// }}}
-	//{{{ frsResolveRelease
+	/**
+	 * frsMoveFile() - Move a file from the FTP upload dir to a projects dir
+	 *
+	 * @param	string	The name of the file
+	 * @param	string	The name of the group
+	 * @param	int		The date/time of the move
+	 * @param	string	The FTP upload dir.  This is probably not needed.
+	 * @param	int		The ID of the release
+	 */
+	function frsMoveFile($file, $group_unix_name, $now, $FTPINCOMING_DIR, $release_id) {
+//
+//
+//	filename validation?
+//	permission checks??
+//
+//
+		clearstatcache();
+		if (is_file("$FTPINCOMING_DIR/$file") && file_exists("$FTPINCOMING_DIR/$file")) {
+			//move the file to a its project page using a setuid program
+			exec ("/usr/local/bin/fileforge $file $group_unix_name", $exec_res);
+			if ($exec_res[0]) {
+				$this->setError("FRS Move File Failed: $exec_res[0],$exec_res[1]");
+				return false;
+			}
+		} else {
+			$this->setError("| FRS Move File Failed: File Name Invalid Or Does Not Exist: $FTPINCOMING_DIR/$file ");
+			return false;
+		}
 
+		return true;
+	}
+
 	/**
-	 * Get a release name from the release ID
+	 * frsResolveRelease() - Get a release name from the release ID
 	 *
-	 * @param $type 
-	 * @param $release_id Int The ID of the release
+	 * @param	int		The ID of the release
 	 */
 	function frsResolveRelease($release_id)
 	{
@@ -853,8 +901,6 @@
 		$name = db_result($res,0,"release_name");
 		return $name;
 	}
-
-	//}}}
 }
 
 ?>

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/html.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/html.php	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/html.php	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,13 +1,19 @@
 <?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id$
+/**
+ * Misc HTML functions
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id$
+ */
 
-// require("exit.php");
-
+/**
+ * html_feedback_top() - Show the feedback output at the top of the page.
+ *
+ * @param		string	The feedback.
+ */
 function html_feedback_top($feedback) {
 	if (!$feedback) 
 		return '';
@@ -15,6 +21,24 @@
 		<H3><FONT COLOR="RED">'.$feedback.'</FONT></H3>';
 }
 
+/**
+ * make_user_link() - Make a username reference into a link to that users User page on SF.
+ *
+ * @param		string	The username of the user to link.
+ */
+function make_user_link($username) {
+	if (!strcasecmp($username,'Nobody') || !strcasecmp($username,'None')) {
+		return $username;
+	} else {
+		return '<a href="/users/'.$username.'">'.$username.'</a>' ;
+	}
+}
+
+/**
+ * html_feedback_top() - Show the feedback output at the bottom of the page.
+ *
+ * @param		string	The feedback.
+ */
 function html_feedback_bottom($feedback) {
 	if (!$feedback) 
 		return '';
@@ -22,19 +46,38 @@
 		<H3><FONT COLOR="RED">'.$feedback.'</FONT></H3>';
 }
 
+/**
+ * html_a_group() - Turn a group name into a link to that groups summary page.
+ *
+ * @param		string	The group name.
+ */
 function html_a_group($grp) {
 	print '<A /project/?group_id='.$grp.'>' . group_getname($grp) . '</A>';
 }
 
+/**
+ * html_blankimage() - Show the blank spacer image.
+ *
+ * @param		int		The height of the image
+ * @param		int		The width of the image
+ */
 function html_blankimage($height,$width) {
 	return '<img src="/images/blank.gif" width="' . $width . '" height="' . $height . '" alt="">';
 }
 
-function html_dbimage($id) {
+/**
+ * html_dbimage() - Show an image that is stored in the database
+ *
+ * @param		int		The id of the image to show
+ */
+function html_dbimage($id, $args=0) {
 	if (!$id) {
 		return '';
 	}
-	$sql="SELECT width,height ".
+	if (!$args) {
+		$args = array();
+	}
+	$sql="SELECT width,height,version ".
 		"FROM db_images WHERE id='$id'";
 	$result=db_query($sql);
 	$rows=db_numrows($result);
@@ -42,13 +85,23 @@
 	if (!$result || $rows < 1) {
 		return db_error();
 	} else {
-		return html_image('/dbimage.php?id='.$id,db_result($result,0,'width'),db_result($result,0,'height'),array());
+		return html_image('/dbimage.php?id='.$id.'&v='.db_result($result,0,'version'),db_result($result,0,'width'),db_result($result,0,'height'),$args);
 	}
 }
 
+/**
+ * html_image() - Build an image tag of an image contained in $src
+ *
+ * @param		string	The source location of the image
+ * @param		int		The width of the image
+ * @param		int		The height of the image
+ * @param		array	Any IMG tag parameters associated with this image (i.e. 'border', 'alt', etc...)
+ * @param		bool	DEPRECATED
+ */
 function html_image($src,$width,$height,$args,$display=1) {
 	global $sys_images_url;
-	$return = ('<IMG src="' . $sys_images_url . $src .'"');
+	$s = ((session_issecure()) ? 's' : '' );
+	$return = ('<IMG src="http'. $s .':' . $sys_images_url . $src .'"');
 	reset($args);
 	while(list($k,$v) = each($args)) {
 		$return .= ' '.$k.'="'.$v.'"';
@@ -65,39 +118,26 @@
 	return $return;
 }
 
-
-
-/*
-
-	Pop up box of supported languages
-
-	requires
-	BaseLanguage object
-	Title
-	Selected
-*/
-
+/**
+ * html_get_language_popup() - Pop up box of supported languages
+ *
+ * @param		object	BaseLanguage object
+ * @param		string	The title of the popup box
+ * @param		string	Which element of the box is to be selected
+ */
 function html_get_language_popup ($Language,$title='language_id',$selected='xzxzxz') {
 	$res=$Language->getLanguages();
 	return html_build_select_box ($res,$title,$selected,false);
 }
 
-
-
-/*
-
-	Pop up box of supported Timezones
-
-	Assumes you have included Timezones array file
-
-	requires
-
-	title,
-	selected
-
-*/
-
-function html_get_timezone_popup ($title='timezone',$selected='xzxzxzx') {
+/**
+ * html_get_timezone_popup() - Pop up box of supported Timezones
+ * Assumes you have included Timezones array file
+ *
+ * @param		string	The title of the popup box
+ * @param		string	Which element of the box is to be selected
+ */
+function html_get_timezone_popup ($title='timezone',$selected='xzxz') {
 	global $TZs;
 	if ($selected == 'xzxzxzx') {
 	  $r = file ('/etc/timezone');
@@ -106,13 +146,13 @@
 	return html_build_select_box_from_arrays ($TZs,$TZs,$title,$selected,false);
 }
 
+/**
+ * html_build_list_table_top() - Takes an array of titles and builds the first row of a new table.
+ *
+ * @param		array	The array of titles
+ * @param		array	The array of title links
+ */
 function html_build_list_table_top ($title_arr,$links_arr=false) {
-	/*
-		Takes an array of titles and builds
-		The first row of a new table
-
-		Optionally takes a second array of links for the titles
-	*/
 	GLOBAL $HTML;
 
 	$return = '
@@ -136,6 +176,11 @@
 	return $return.'</TR>';
 }
 
+/**
+ * html_get_alt_row_color() - Get an alternating row color for tables.
+ *
+ * @param		int		Row number
+ */
 function html_get_alt_row_color ($i) {
 	GLOBAL $HTML;
 	if ($i % 2 == 0) {
@@ -145,16 +190,14 @@
 	}
 }
 
+/**
+ * html_build_select_box_from_array() - Takes one array, with the first array being the "id"
+ * or value and the array being the text you want displayed.
+ *
+ * @param		string	The name you want assigned to this form element
+ * @param		string	The value of the item that should be checked
+ */
 function html_build_select_box_from_array ($vals,$select_name,$checked_val='xzxz',$samevals = 0) {
-	/*
-		Takes one array, with the first array being the "id" or value
-		and the array being the text you want displayed
-
-		The second parameter is the name you want assigned to this form element
-
-		The third parameter is optional. Pass the value of the item that should be checked
-	*/
-
 	$return .= '
 		<SELECT NAME="'.$select_name.'">';
 
@@ -180,30 +223,23 @@
 	return $return;
 }
 
+/**
+ * html_build_select_box_from_arrays() - Takes two arrays, with the first array being the "id" or value and the other
+ * array being the text you want displayed.
+ *
+ * The infamous '100 row' has to do with the SQL Table joins done throughout all this code.
+ * There must be a related row in users, categories, et	, and by default that
+ * row is 100, so almost every pop-up box has 100 as the default
+ * Most tables in the database should therefore have a row with an id of 100 in it so that joins are successful
+ *
+ * @param		array	The ID or value
+ * @param		array	Text to be displayed
+ * @param		string	Name to assign to this form element
+ * @param		string	The item that should be checked
+ * @param		bool	Whether or not to show the '100 row'
+ * @param		string	What to call the '100 row' defaults to none
+ */
 function html_build_select_box_from_arrays ($vals,$texts,$select_name,$checked_val='xzxz',$show_100=true,$text_100='None') {
-	/*
-
-		The infamous '100 row' has to do with the
-			SQL Table joins done throughout all this code.
-		There must be a related row in users, categories, et	, and by default that
-			row is 100, so almost every pop-up box has 100 as the default
-		Most tables in the database should therefore have a row with an id of 100 in it
-			so that joins are successful
-
-		Params:
-
-		Takes two arrays, with the first array being the "id" or value
-		and the other array being the text you want displayed
-
-		The third parameter is the name you want assigned to this form element
-
-		The fourth parameter is optional. Pass the value of the item that should be checked
-
-		The fifth parameter is an optional boolean - whether or not to show the '100 row'
-
-		The sixth parameter is optional - what to call the '100 row' defaults to none
-	*/
-
 	$return .= '
 		<SELECT NAME="'.$select_name.'">';
 
@@ -225,65 +261,70 @@
 			$return .= '
 				<OPTION VALUE="'.$vals[$i].'"';
 			if ($vals[$i] == $checked_val) {
+				$checked_found=true;
 				$return .= ' SELECTED';
 			}
 			$return .= '>'.$texts[$i].'</OPTION>';
 		}
 	}
+	//
+	//	If the passed in "checked value" was never "SELECTED"
+	//	we want to preserve that value UNLESS that value was 'xzxz', the default value
+	//
+	if (!$checked_found && $checked_val != 'xzxz' && $checked_val && $checked_val != 100) {
+		$return .= '
+		<OPTION VALUE="'.$checked_val.'" SELECTED>No Change</OPTION>';
+	}
 	$return .= '
 		</SELECT>';
 	return $return;
 }
 
+/**
+ * html_build_select_box() - Takes a result set, with the first column being the "id" or value and
+ * the second column being the text you want displayed.
+ *
+ * @param		int		The result set
+ * @param		string	Text to be displayed
+ * @param		string	The item that should be checked
+ * @param		bool	Whether or not to show the '100 row'
+ * @param		string	What to call the '100 row'.  Defaults to none.
+ */
 function html_build_select_box ($result, $name, $checked_val="xzxz",$show_100=true,$text_100='None') {
-	/*
-		Takes a result set, with the first column being the "id" or value
-		and the second column being the text you want displayed
-
-		The second parameter is the name you want assigned to this form element
-
-		The third parameter is optional. Pass the value of the item that should be checked
-
-		The fourth parameter is an optional boolean - whether or not to show the '100 row'
-
-		The fifth parameter is optional - what to call the '100 row' defaults to none
-	*/
-
 	return html_build_select_box_from_arrays (util_result_column_to_array($result,0),util_result_column_to_array($result,1),$name,$checked_val,$show_100,$text_100);
 }
-
-function html_build_multiple_select_box ($result,$name,$checked_array,$size='8') {
-	/*
-		Takes a result set, with the first column being the "id" or value
-		and the second column being the text you want displayed
-
-		The second parameter is the name you want assigned to this form element
-
-		The third parameter is an array of checked values;
-
-		The fourth parameter is optional. Pass the size of this box
-	*/
-
+/**
+ * html_build_multiple_select_box() - Takes a result set, with the first column being the "id" or value
+ * and the second column being the text you want displayed.
+ *
+ * @param		int		The result set
+ * @param		string	Text to be displayed
+ * @param		string	The item that should be checked
+ * @param		int		The size of this box
+ * @param		bool	Whether or not to show the '100 row'
+ */
+function html_build_multiple_select_box ($result,$name,$checked_array,$size='8',$show_100=true) {
 	$checked_count=count($checked_array);
-//      echo '-- '.$checked_count.' --';
 	$return .= '
 		<SELECT NAME="'.$name.'" MULTIPLE SIZE="'.$size.'">';
-	/*
-		Put in the default NONE box
-	*/
-	$return .= '
+	if ($show_100) {
+		/*
+			Put in the default NONE box
+		*/
+		$return .= '
 		<OPTION VALUE="100"';
-	for ($j=0; $j<$checked_count; $j++) {
-		if ($checked_array[$j] == '100') {
-			$return .= ' SELECTED';
+		for ($j=0; $j<$checked_count; $j++) {
+			if ($checked_array[$j] == '100') {
+				$return .= ' SELECTED';
+			}
 		}
+		$return .= '>None</OPTION>';
 	}
-	$return .= '>None</OPTION>';
 
 	$rows=db_numrows($result);
 
 	for ($i=0; $i<$rows; $i++) {
-		if (db_result($result,$i,0) != '100') {
+		if ((db_result($result,$i,0) != '100') || (db_result($result,$i,0) == '100' && !$show_100)) {
 			$return .= '
 				<OPTION VALUE="'.db_result($result,$i,0).'"';
 			/*
@@ -303,13 +344,71 @@
 	return $return;
 }
 
-function html_buildpriority_select_box ($name='priority', $checked_val='5') {
-	/*
-		Return a select box of standard priorities.
-		The name of this select box is optional and so is the default checked value
-	*/
-	?>
+/**
+ *	html_build_checkbox() - Render checkbox control
+ *
+ *	@param name - name of control
+ *	@param value - value of control
+ *	@param checked - true if control should be checked
+ *	@return html code for checkbox control
+ */
+function html_build_checkbox($name, $value, $checked) {
+	return '<input type="checkbox" name="'.$name.'"'
+		.' value="'.$value.'"'
+		.($checked ? 'checked' : '').'>';
+}
+
+/**
+ * get_priority_color() - Wrapper for html_get_priority_color().
+ * 
+ * @see	html_get_priority_color()
+ */
+function get_priority_color ($index) {
+	return html_get_priority_color ($index);
+}
+
+/**
+ * html_get_priority_color() - Return the color value for the index that was passed in
+ * (defined in $sys_urlroot/themes/<selected theme>/theme.php)
+ *
+ * @param		int		Index
+ */
+function html_get_priority_color ($index) {
+	global $bgpri;
+
+	/* make sure that index is of appropriate type and range */
+	$index = (int)$index;
+	if ($index<1) {
+		$index=1;
+	} else if ($index>9) {
+		$index=9;
+	}   
+	return $bgpri[$index];
+}
+
+/**
+ * build_priority_select_box() - Wrapper for html_build_priority_select_box()
+ *
+ * @see html_build_priority_select_box()
+ */
+function build_priority_select_box ($name='priority', $checked_val='5', $nochange=false) {
+	echo html_build_priority_select_box ($name, $checked_val, $nochange);
+}
+
+/**
+ * html_build_priority_select_box() - Return a select box of standard priorities.
+ * The name of this select box is optional and so is the default checked value.
+ *
+ * @param		string	Name of the select box
+ * @param		string	The value to be checked
+ * @param		bool	Whether to make 'No Change' selected.
+ */
+function html_build_priority_select_box ($name='priority', $checked_val='5', $nochange=false) {
+?>
 	<SELECT NAME="<?php echo $name; ?>">
+<?php if($nochange) { ?>
+	<OPTION VALUE="100"<?php if ($nochange) {echo " SELECTED";} ?>>No Change</OPTION>
+<?php }  ?>
 	<OPTION VALUE="1"<?php if ($checked_val=="1") {echo " SELECTED";} ?>>1 - Lowest</OPTION>
 	<OPTION VALUE="2"<?php if ($checked_val=="2") {echo " SELECTED";} ?>>2</OPTION>
 	<OPTION VALUE="3"<?php if ($checked_val=="3") {echo " SELECTED";} ?>>3</OPTION>
@@ -324,6 +423,13 @@
 
 }
 
+/**
+ * html_buildcheckboxarray() - Build an HTML checkbox array.
+ *
+ * @param		array	Options array
+ * @param		name	Checkbox name
+ * @param		array	Array of boxes to be pre-checked
+ */
 function html_buildcheckboxarray($options,$name,$checked_array) {
 	$option_count=count($options);
 	$checked_count=count($checked_array);
@@ -340,13 +446,13 @@
 	}
 }
 
-/*!     @function site_user_header
-	@abstract everything required to handle security and
-		add navigation for user pages like /my/ and /account/
-	@param params array() must contain $user_id
-	@result text - echos HTML to the screen directly
-*/
-function site_header($params) {							 GLOBAL $HTML;
+/** 
+ *	site_user_header() - everything required to handle security and
+ *	add navigation for user pages like /my/ and /account/
+ *
+ *	@param		array	Must contain $user_id
+ */
+function site_header($params) {
 	GLOBAL $HTML;
 	/*
 		Check to see if active user
@@ -356,16 +462,22 @@
 	echo html_feedback_top($GLOBALS['feedback']);
 }
 
+/**
+ * site_footer() - Show the HTML site footer.
+ *
+ * @param		array	Footer params array
+ */
 function site_footer($params) {
 	GLOBAL $HTML;
 	$HTML->footer($params);
 }
 
-/*! 	@function site_project_header
-	@abstract everything required to handle security and state checks for a project web page
-	@param params array() must contain $toptab and $group
-	@result text - echos HTML to the screen directly
-*/
+/**
+ *	site_project_header() - everything required to handle 
+ *	security and state checks for a project web page
+ *
+ *	@param params array() must contain $toptab and $group
+ */
 function site_project_header($params) {
 	GLOBAL $HTML;
 
@@ -378,9 +490,11 @@
 	$group_id=$params['group'];
 
 	//get the project object 
-	$project=&project_get_object($group_id);
+	$project =& group_get_object($group_id);
 
-	if (!$project || $project->isError()) {
+	if (!$project || !is_object($project)) {
+		exit_error("GROUP PROBLEM","PROBLEM CREATING GROUP OBJECT");
+	} else if ($project->isError()) {
 		exit_error("Group Problem",$project->getErrorMessage());
 	}
 
@@ -398,15 +512,16 @@
 
 	echo $HTML->header($params);
 	echo html_feedback_top($GLOBALS['feedback']);
-	echo $HTML->project_tabs($params['toptab'],$params['group']);
+	echo $HTML->project_tabs($params['toptab'],$params['group'],$params['tabtext']);
 }
 
-/*!     @function site_project_footer
-	@abstract currently a simple shim that should be on every project page, 
-		rather than a direct call to site_footer() or theme_footer()
-	@param params array() empty
-	@result text - echos HTML to the screen directly
-*/
+/**
+ *	site_project_footer() - currently a simple shim 
+ *	that should be on every project page,  rather than 
+ *	a direct call to site_footer() or theme_footer()
+ *
+ *	@param params array() empty
+ */
 function site_project_footer($params) {
 	GLOBAL $HTML;
 
@@ -414,12 +529,12 @@
 	echo $HTML->footer($params);
 }
 
-/*!     @function site_user_header
-	@abstract everything required to handle security and 
-		add navigation for user pages like /my/ and /account/
-	@param params array() must contain $user_id
-	@result text - echos HTML to the screen directly
-*/
+/**
+ *	site_user_header() - everything required to handle security and 
+ *	add navigation for user pages like /my/ and /account/
+ *
+ *	@param params array() must contain $user_id
+ */
 function site_user_header($params) {
 	GLOBAL $HTML;
 
@@ -436,17 +551,42 @@
 
 }
 
-/*!     @function site_user_footer
-	@abstract currently a simple shim that should be on every user page, 
-		rather than a direct call to site_footer() or theme_footer()
-	@param params array() empty
-	@result text - echos HTML to the screen directly
-*/
+/** 
+ *	site_user_footer() - currently a simple shim that should be on every user page, 
+ *	rather than a direct call to site_footer() or theme_footer()
+ *
+ *	@param params array() empty
+ */
 function site_user_footer($params) {
 	GLOBAL $HTML;
 
 	echo html_feedback_bottom($GLOBALS['feedback']);
 	echo $HTML->footer($params);
-}       
+}	   
 
+/** 
+ *	html_clean_hash_string() - Remove noise characters from hex hash string
+ *	
+ *	Thruout SourceForge, URLs with hexadecimal hash string parameters
+ *	are being sent via email to request confirmation of user actions. 
+ *	It was found that some mail clients distort this hash, so we take
+ *	special steps to encode it in the way which help to preserve its
+ *	recognition. This routine 
+ *
+ *	@param hashstr required hash parameter as received from browser
+ *	@return pure hex string
+ */
+function html_clean_hash_string($hashstr) {
+
+        if (substr($hashstr,0,1)=="_") {
+                $hashstr = substr($hashstr, 1);
+        }
+				
+        if (substr($hashstr, strlen($hashstr)-1, 1)==">") {
+                $hashstr = substr($hashstr, 0, strlen($hashstr)-1);
+        }
+	
+	return $hashstr;
+}
+
 ?>

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/menu.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/menu.php	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/menu.php	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,56 +1,115 @@
 <?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: menu.php,v 1.186 2000/11/30 05:33:42 tperdue Exp $
+/**
+ * menu.php
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id: menu.php,v 1.202 2001/06/27 00:14:30 jbyers Exp $
+ */
 
-/* The correct theme.php must be included by this point -- Geoffrey */
+require_once('www/tracker/include/ArtifactTypeHtml.class');
 
-function menu_show_search_box() {
-	global $words,$forum_id,$group_id,$is_bug_page,$exact,$type_of_search;
+/**
+ * menu_show_search_box() - Show search box
+ *
+ * @param		bool	Show box horizontally
+ * @param		bool	Show box in new window
+ */
+function menu_show_search_box($show_horizontally=false, $new_window=true) {
+	global $words,$forum_id,$group_id,$atid,$exact,$type_of_search;
 
-	  // if there is no search currently, set the default
+	if ($new_window) {
+		$new_window = ' target="_blank"';
+	}
+
+	// if there is no search currently, set the default
 	if ( ! isset($type_of_search) ) {
 		$exact = 1;
 	}
 
-	print "\t<CENTER>\n";
-	print "\t<FONT SIZE=\"2\">\n";
-	print "\t<FORM action=\"/search/\" method=\"post\">\n";
+	if ($show_horizontally) {
+		print '
+		<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>
+		<TR><TD>';
+	}
 
-	print "\t<SELECT name=\"type_of_search\">\n";
-	if ($is_bug_page && $group_id) {
-		print "\t<OPTION value=\"bugs\"".( $type_of_search == "bugs" ? " SELECTED" : "" ).">Bugs</OPTION>\n";
+	print '<CENTER>
+		<FONT SIZE="1">
+		<FORM action="/search/" method="POST"'.$new_window.'>
+
+		<SELECT name="type_of_search">';
+
+	if ($atid && $group_id) {
+		$group =& group_get_object($group_id);
+		if ($group && is_object($group)) {
+			$ath = new ArtifactTypeHtml($group,$atid);
+			if ($ath && is_object($ath)) {
+				print '
+					<OPTION value="artifact"'.( $type_of_search == 'artifact' ? ' SELECTED' : '' ).'>'. $ath->getName() .'</OPTION>';
+			}
+		}
 	} else if ($group_id && $forum_id) {
-		print "\t<OPTION value=\"forums\"".( $type_of_search == "forums" ? " SELECTED" : "" ).">This Forum</OPTION>\n";
+		print '
+			<OPTION value="forums"'.( $type_of_search == 'forums' ? ' SELECTED' : '' ).'>This Forum</OPTION>';
 	}
-	print "\t<OPTION value=\"soft\"".( $type_of_search == "soft" ? " SELECTED" : "" ).">Software/Group</OPTION>\n";
-	print "\t<OPTION value=\"people\"".( $type_of_search == "people" ? " SELECTED" : "" ).">People</OPTION>\n";
-	print "\t</SELECT>\n";
+	print '
+		<OPTION value="soft"'.( $type_of_search == 'soft' ? ' SELECTED' : '' ).'>Software/Group</OPTION>';
+	print '
+		<OPTION value="people"'.( $type_of_search == 'people' ? ' SELECTED' : '' ).'>People</OPTION>';
+	print '
+		<OPTION value="freshmeat"'.( $type_of_search == 'freshmeat' ? ' SELECTED' : '' ).'>Freshmeat.net</OPTION>';
+	print '
+		</SELECT>';
 
-	print "\t<BR>\n";
-	print "\t<INPUT TYPE=\"CHECKBOX\" NAME=\"exact\" VALUE=\"1\"".( $exact ? " CHECKED" : " UNCHECKED" )."> Require All Words \n";
+	print '<BR>';
+	print '
+		<INPUT TYPE="CHECKBOX" NAME="exact" VALUE="1"'.( $exact ? ' CHECKED' : ' UNCHECKED' ).'> Require All Words';
 
-	print "\t<BR>\n";
+	if ($show_horizontally) {
+		print '</TD>'; 
+	} else {
+		print '<BR>';
+	}
 	if ( isset($forum_id) ) {
-		print "\t<INPUT TYPE=\"HIDDEN\" VALUE=\"$forum_id\" NAME=\"forum_id\">\n";
+		print '
+		<INPUT TYPE="HIDDEN" VALUE="'.$forum_id.'" NAME="forum_id">';
 	} 
-	if ( isset($is_bug_page) ) {
-		print "\t<INPUT TYPE=\"HIDDEN\" VALUE=\"$is_bug_page\" NAME=\"is_bug_page\">\n";
-	}
 	if ( isset($group_id) ) {
-		print "\t<INPUT TYPE=\"HIDDEN\" VALUE=\"$group_id\" NAME=\"group_id\">\n";
+		print '
+		<INPUT TYPE="HIDDEN" VALUE="'.$group_id.'" NAME="group_id">';
 	}
+	if ( isset($atid) ) {
+		print '
+		<INPUT TYPE="HIDDEN" VALUE="'.$atid.'" NAME="atid">';
+	}
+	if ($show_horizontally) {
+		print '<TD>';
+	}
+	print '
+		<INPUT TYPE="text" SIZE="12" NAME="words" VALUE="'.$words.'">';
 
-	print "\t<INPUT TYPE=\"text\" SIZE=\"12\" NAME=\"words\" VALUE=\"$words\">\n";
-	print "\t<BR>\n";
-	print "\t<INPUT TYPE=\"submit\" NAME=\"Search\" VALUE=\"Search\">\n";
-	print "\t</FORM>\n";
+	if ($show_horizontally) {
+		print '</TD><TD>';
+	} else {
+		print '<BR>';
+	}
+	print '<INPUT TYPE="submit" NAME="Search" VALUE="Search">';
+
+	if ($show_horizontally) {
+		print '
+		</TD></TR></TABLE>';
+	}
+	print '</FORM></FONT>';
 }
 
-//depricated - theme wrapper
+/**
+ * menuhtml_top() - Theme wrapper
+ * DEPRECATED
+ *
+ * @deprecated
+ */
 function menuhtml_top($title) {
 	/*
 		Use only for the top most menu
@@ -58,63 +117,89 @@
 	theme_menuhtml_top($title);
 }
 
-//deprecated - theme wrapper
+/**
+ * menuhtml_bottom() - Theme wrapper
+ * DEPRECATED
+ * 
+ * @deprecated
+ */
 function menuhtml_bottom() {
 	theme_menuhtml_bottom();
 }
 
+/**
+ * menu_software() - Show the software menu.
+ */
 function menu_software() {
 	GLOBAL $HTML, $Language;
 	$HTML->menuhtml_top('Software'); 
-		$HTML->menu_entry('/softwaremap/',$Language->SOFTWARE_MAP);
-		$HTML->menu_entry('/new/',$Language->NEW_RELEASES);
-		// $HTML->menu_entry('/mirrors/',$Language->OTHER_SITE_MIRRORS);
-		$HTML->menu_entry('/snippet/',$Language->CODE_SNIPPET_LIBRARY);
+		$HTML->menu_entry('/softwaremap/',$Language->getText('menu','software_map'));
+		$HTML->menu_entry('/new/',$Language->getText('menu','new_releases'));
+		// $HTML->menu_entry('/mirrors/',$Language->getText('menu','other_site_mirrors'));
+		$HTML->menu_entry('/snippet/',$Language->getText('menu','code_snippet_library'));
 	$HTML->menuhtml_bottom();
 }
 
+/**
+ * menu_sourceforge() - Show the sourceforge menu.
+ */
 function menu_sourceforge() {
 	GLOBAL $HTML, $Language;
 	$HTML->menuhtml_top('SourceForge');
-		$HTML->menu_entry('/docman/?group_id=1','<b>'.$Language->DOCUMENTATION.'</b>');
-		$HTML->menu_entry('/forum/?group_id=1',$Language->DISCUSSION_FORUMS);
-		$HTML->menu_entry('/people/',$Language->PROJECT_HELP_WANTED);
-		$HTML->menu_entry('/top/',$Language->TOP_PROJECTS);
+		$HTML->menu_entry('/docman/?group_id=1','<b>'.$Language->getText('menu','documentation').'</b>');
+		$HTML->menu_entry('/forum/?group_id=1',$Language->getText('menu','discussion_forums'));
+		$HTML->menu_entry('/people/',$Language->getText('menu','project_help_wanted'));
+		$HTML->menu_entry('/top/',$Language->getText('menu','top_projects'));
+		$HTML->menu_entry('/docman/display_doc.php?docid=2352&group_id=1',$Language->getText('menu','site_status'));
 		print '<P>';
-		// $HTML->menu_entry('/compilefarm/',$Language->COMPILE_FARM);
+		$HTML->menu_entry('http://jobs.osdn.com', 'jobs.osdn.com');
+		print '<P>';
+		// $HTML->menu_entry('/compilefarm/',$Language->getText('menu','compile_farm'));
 		// print '<P>';
-		// $HTML->menu_entry('/contact.php',$Language->CONTACT_US);
-		// $HTML->menu_entry('/about.php',$Language->ABOUT_SOURCEFORGE);
+		// $HTML->menu_entry('/contact.php',$Language->getText('menu','contact_us'));
+		// $HTML->menu_entry('/about.php',$Language->getText('menu','about_sourceforge'));
 	$HTML->menuhtml_bottom();
 }
 
+/**
+ * menu_foundry_links() - Show links to the Foundries.
+ */
 function menu_foundry_links() {
 	GLOBAL $HTML, $Language;
 	$HTML->menuhtml_top('SourceForge Foundries');
-		$HTML->menu_entry('/about_foundries.php', $Language->ABOUT_FOUNDRIES);
-		echo '<P>
-';
-		$HTML->menu_entry('/foundry/3d/', '3D');
-		$HTML->menu_entry('/foundry/games/', 'Games');
-		$HTML->menu_entry('/foundry/java/', 'Java');
-		$HTML->menu_entry('/foundry/printing/', 'Printing');
-		$HTML->menu_entry('/foundry/storage/', 'Storage');
+	$HTML->menu_entry('/about_foundries.php', $Language->getText('menu','about_foundries'));
+	echo '<P>';
+	$HTML->menu_entry('/foundry/linuxkernel/', 'Linux Kernel');
+	$HTML->menu_entry('/foundry/linuxdrivers/', 'Linux Drivers');
+	$HTML->menu_entry('/foundry/3d/', '3D');
+	$HTML->menu_entry('/foundry/games/', 'Games');
+	$HTML->menu_entry('/foundry/java/', 'Java');
+	$HTML->menu_entry('/foundry/printing/', 'Printing');
+	$HTML->menu_entry('/foundry/storage/', 'Storage');
 	$HTML->menuhtml_bottom();
 }
 
+/**
+ * menu_search() - Show the search menu.
+ */
 function menu_search() {
 	GLOBAL $HTML, $Language;
-	$HTML->menuhtml_top($Language->SEARCH);
+	$HTML->menuhtml_top($Language->getText('menu','search'));
 	menu_show_search_box();
 	$HTML->menuhtml_bottom();
 }
 
+/**
+ * menu_project() - Show the project menu
+ *
+ * @param		string	The group name
+ */
 function menu_project($grp) {
 	GLOBAL $HTML, $Language;
 	$HTML->menuhtml_top('Project: ' . group_getname($grp));
-		$HTML->menu_entry('/projects/'. group_getunixname($grp) .'/',$Language->PROJECT_SUMMARY);
+		$HTML->menu_entry('/projects/'. group_getunixname($grp) .'/',$Language->getText('menu','project_summary'));
 		print '<P>';
-		$HTML->menu_entry('/project/admin/?group_id='.$grp,$Language->PROJECT_ADMIN);
+		$HTML->menu_entry('/project/admin/?group_id='.$grp,$Language->getText('menu','project_admin'));
 	$HTML->menuhtml_bottom();
 }
 
@@ -136,16 +221,26 @@
 	$HTML->menuhtml_bottom();
 }
 
+/**
+ * menu_foundry() - Show the foundry menu
+ *
+ * @param		string	The foundry name
+ */
 function menu_foundry($grp) {
 	GLOBAL $HTML, $Language;
 	$unix_name=strtolower(group_getunixname($grp));
 	$HTML->menuhtml_top('Foundry: ' . group_getname($grp));
-		$HTML->menu_entry('/foundry/'. $unix_name .'/',$Language->FOUNDRY_SUMMARY);
+		$HTML->menu_entry('/foundry/'. $unix_name .'/',$Language->getText('menu','foundry_summary'));
 		print '<P>';
-		$HTML->menu_entry('/foundry/'. $unix_name .'/admin/', $Language->FOUNDRY_ADMIN);
+		$HTML->menu_entry('/foundry/'. $unix_name .'/admin/', $Language->getText('menu','foundry_admin'));
 	$HTML->menuhtml_bottom();
 }
 
+/**
+ * menu_foundry_guides() - Show the foundry guides menu
+ *
+ * @param		string	The foundry name
+ */
 function menu_foundry_guides($grp) {
 	GLOBAL $HTML, $Language;
 	/*
@@ -180,23 +275,26 @@
 
 }
 
+/**
+ * menu_loggedin() - Show links appropriate for someone logged in, like account maintenance, etc
+ *
+ * @param		string	 The page title
+ */
 function menu_loggedin($page_title) {
 	GLOBAL $HTML, $Language;
-	/*
-		Show links appropriate for someone logged in, like account maintenance, etc
-	*/
+		
 	$HTML->menuhtml_top('Logged In: '.user_getname());
-		$HTML->menu_entry('/account/logout.php',$Language->LOGOUT);
-		$HTML->menu_entry('/register/',$Language->NEW_PROJECT);
-		$HTML->menu_entry('/account/',$Language->ACCOUNT_MAINTENANCE);
+		$HTML->menu_entry('/account/logout.php',$Language->getText('menu','logout'));
+		$HTML->menu_entry('/register/',$Language->getText('menu','new_project'));
+		$HTML->menu_entry('/account/',$Language->getText('menu','account_maintenance'));
 		print '<P>';
-		$HTML->menu_entry('/themes/',$Language->CHANGE_MY_THEME);
-		$HTML->menu_entry('/my/',$Language->MY_PERSONAL_PAGE);
+		$HTML->menu_entry('/themes/',$Language->getText('menu','change_my_theme'));
+		$HTML->menu_entry('/my/',$Language->getText('menu','my_personal_page'));
 
 		if (!$GLOBALS['HTTP_POST_VARS']) {
 			$bookmark_title = urlencode( str_replace('SourceForge: ', '', $page_title));
 			print '<P>';
-			$HTML->menu_entry('/my/bookmark_add.php?bookmark_url='.urlencode($GLOBALS['REQUEST_URI']).'&bookmark_title='.$bookmark_title,$Language->BOOKMARK_PAGE);
+			$HTML->menu_entry('/my/bookmark_add.php?bookmark_url='.urlencode($GLOBALS['REQUEST_URI']).'&bookmark_title='.$bookmark_title,$Language->getText('menu','bookmark_page'));
 		}
 	$HTML->menuhtml_bottom();
 
@@ -212,15 +310,13 @@
 	GLOBAL $HTML, $Language;
 	$HTML->menuhtml_top('Status:');
 		echo '<h4><FONT COLOR="#990000">NOT LOGGED IN</h4>';
-		$HTML->menu_entry('/account/login.php',$Language->LOGIN);
-		$HTML->menu_entry('/account/register.php',$Language->NEW_USER);
+		$HTML->menu_entry('/account/login.php',$Language->getText('menu','login'));
+		$HTML->menu_entry('/account/register.php',$Language->getText('menu','new_user'));
 	$HTML->menuhtml_bottom();
 }
 
 /**
- *
- *  Show a form with a language pop-up box
- *
+ * menu_language_box() - Show a form with a language pop-up box
  */
 function menu_language_box() {
 	GLOBAL $HTML, $Language,$cookie_language_id;
@@ -235,7 +331,7 @@
 	}
 
 	echo '
-	<!--    
+	<!--	
 
 		this document.write is necessary
 		to prevent the ads from screwing up

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/osdn.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/osdn.php	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/osdn.php	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,4 +1,13 @@
 <?php
+/**
+ * osdn.php
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id: osdn.php,v 1.121 2001/06/27 00:14:30 jbyers Exp $
+ */
 $osdn_sites[0] = array('Freshmeat' => 'http://www.freshmeat.net/');
 $osdn_sites[1] = array('Geocrawler' => 'http://www.geocrawler.com/');
 $osdn_sites[2] = array('Linux.Com' => 'http://www.linux.com/');
@@ -9,6 +18,9 @@
 $osdn_sites[7] = array('Themes.Org' => 'http://www.themes.org/');
 $osdn_sites[8] = array('Thinkgeek' => 'http://www.thinkgeek.com/');
 
+/**
+ * osdn_nav_dropdown() - Show the nav bar dropdown of all the OSDN sites.
+ */
 function osdn_nav_dropdown() {
 	GLOBAL $osdn_sites;
 ?>
@@ -43,13 +55,15 @@
 
 	<!-- end OSDN navdropdown -->
 
-
 <?php
 }
 
-/*
-	Picks random OSDN sites to display
-*/
+/**
+ * osdn_print_randpick() - Picks random OSDN sites to display
+ *
+ * @param		array	Array of sites
+ * @param		int		Number of sites to print
+ */
 function osdn_print_randpick($sitear, $num_sites = 1) {
 	shuffle($sitear);
 	reset($sitear);
@@ -61,6 +75,9 @@
 	print ' · ';
 }
 
+/**
+ * osdn_print_navbar() - Show the navbar
+ */
 function osdn_print_navbar() {
   // osdn_print_navbar_1 () ;
   osdn_print_navbar_2 () ;
@@ -73,7 +90,7 @@
 	<tr> 
 		<td valign="middle" align="left" bgcolor="#6C7198">
 		<SPAN class="osdn">
-			<font face="arial,geneva,helvetica,verdana,sans-serif" size="-2" color="#ffffff">   <b><a href="http://osdn.com/" style="text-decoration:none"><font color="#ffffff">O <font color="#9b9b9b">|</font> S <font color="#9b9b9b">|</font> D <font color="#9b9b9b">|</font> N</font></a> : 
+			<font face="arial,geneva,helvetica,verdana,sans-serif" size="-2" color="#ffffff">   <b><a href="http://osdn.com/" style="text-decoration:none"><font color="#ffffff">O <font color="#9b9b9b">|</font> S <font color="#9b9b9b">|</font> D <font color="#9b9b9b">|</font> N</font></a></b></font> : 
 ';
 	osdn_print_randpick($GLOBALS['osdn_sites'], 3);
 	print '
@@ -88,7 +105,8 @@
 */
 	print '
 		<a href="http://www.osdn.com/partner_programs.shtml" style="text-decoration:none"><font color="#ffffff">PARTNERS</font></a> ·  
-		<a href="http://www.osdn.com/gallery.pl?type=community" style="text-decoration:none"><font color="#ffffff">AFFILIATES</font></a> </b></font>
+		<a href="http://www.osdn.com/gallery.pl?type=community" style="text-decoration:none"><font color="#ffffff">AFFILIATES</font></a> ·  
+		<a href="http://jobs.osdn.com" style="text-decoration:none"><font color="#ffffff">JOBS</font></a> </b></font>
 		</SPAN>
 		</td>
 	</tr>
@@ -107,13 +125,8 @@
 	<tr>' ;
   print '<td bgcolor="'.$GLOBALS['COLOR_CONTENT_BACK'].'" WIDTH="20%">'.html_blankimage(1,100).'</td>';
 
-  // srand((double)microtime()*1000000);
-  // $random_num=rand(0,100000);
-  
   print '<td bgcolor="'.$GLOBALS['COLOR_CONTENT_BACK'].'" width="60%"><a href="/"><img src="/images/sf-for-debian.png" alt="Debian Sourceforge"></a></td>';
 
-  //	print '<td valign="center" align="left" bgcolor="#d5d7d9" background="/images/steel3.jpg" WIDTH="20%"><a href="http://www.osdn.com">' . html_image("/images/OSDN-lc.gif","100","40",array("hspace"=>"10","border"=>"0","alt"=>" OSDN - Open Source Development Network ")) . '</a></td>';
-
   print '<td bgcolor="'.$GLOBALS['COLOR_CONTENT_BACK'].'" WIDTH="20%">'.html_blankimage(1,100).'</td>';
 
 	print '</tr>

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/pre.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/pre.php	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/pre.php	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,10 +1,13 @@
 <?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id$
+/**
+ * pre.php - Automatically prepend to every page.
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id$
+ */
 
 /*
 	redirect to proper hostname to get around certificate problem on IE 5
@@ -27,7 +30,7 @@
 */
 
 if ($OVERRIDES_PATH) {
-	require ($OVERRIDES_PATH."overrides.inc");
+	require_once($OVERRIDES_PATH."overrides.inc");
 }
 
 if (($HTTP_HOST != $GLOBALS['sys_default_domain']) && ($HTTP_HOST != $GLOBALS['sys_fallback_domain']) && ($HTTP_HOST != 'localhost') && ($HTTP_HOST != $GLOBALS['sys_default_domain'].':80')) {
@@ -40,56 +43,59 @@
 }
 
 //library to determine browser settings
-require('browser.php');
+require_once('www/include/browser.php');
 
 //base error library for new objects
-require('Error.class');
+require_once('common/include/Error.class');
 
 // HTML layout class, may be overriden by the Theme class
-require('Layout.class');
+require_once('www/include/Layout.class');
 
 $HTML = new Layout();
 
 //various html utilities
-require('utils.php');
+require_once('common/include/utils.php');
 
 //database abstraction
-require('database.php');
+require_once('common/include/database.php');
 
 //security library
-require('session.php');
+require_once('common/include/session.php');
 
 // LDAP library
-require('ldap.php');
+require_once('common/include/ldap.php');
 
 //user functions like get_name, logged_in, etc
-require('User.class');
+require_once('common/include/User.class');
 
 //group functions like get_name, etc
-require('Group.class');
+require_once('common/include/Group.class');
 
+//permission functions
+require_once('common/include/Permission.class');
+
 //Project extends Group and includes preference accessors
-require('Project.class');
+require_once('common/include/Project.class');
 
 //Foundry extends Group and includes preference/data accessors
-require ('Foundry.class');
+require_once('common/include/Foundry.class');
 
 //library to set up context help
-require('help.php');
+require_once('www/include/help.php');
 
 //exit_error library
-require('exit.php');
+require_once('www/include/exit.php');
 
 //various html libs like button bar, themable
-require('html.php');
+require_once('www/include/html.php');
 
 //left-hand nav library, themable
-require('menu.php');
+require_once('www/include/menu.php');
 
 //theme functions like get_themename, etc
-require('theme.php');
+require_once('www/include/theme.php');
 
-$sys_datefmt = "Y-M-d H:i";
+$sys_datefmt = "Y-m-d H:i";
 
 // #### Connect to db
 
@@ -107,11 +113,20 @@
 theme_sysinit($sys_themeid);
 
 // OSDN functions and defs
-require('osdn.php');
+require_once('www/include/osdn.php');
 
 //insert this page view into the database
-require('logger.php');
+require_once('www/include/logger.php');
 
+//
+//	If logged in, set up a $LUSER var referencing
+//	the logged in user's object
+//
+if (user_isloggedin()) {
+	//set up the user's timezone if they are logged in
+	$LUSER =& session_get_user();
+}
+
 /*
 
 	Timezone must come after logger to prevent messups
@@ -121,7 +136,7 @@
 
 if (user_isloggedin()) {
 	//set up the user's timezone if they are logged in
-	putenv('TZ='.user_get_timezone());
+	putenv('TZ='. $LUSER->getTimeZone());
 } else {
 	//just user pacific time as always
 }
@@ -132,34 +147,41 @@
 
 */
 
-require ('BaseLanguage.class');
+require_once('www/include/BaseLanguage.class');
 
 if (user_isloggedin()) {
-	$user=&user_get_object(user_getid());
-	$res=$user->getData();
-	$classfile=db_result($res,0,'filename');
-	if ($classfile) {
-		include ("languages/$classfile");
+	$res=$LUSER->getData();
 		$classname=db_result($res,0,'classname');
-		$Language=new $classname();
+	if ($classname) {
+		$Language=new BaseLanguage();
+		$Language->loadLanguage($classname);
 	} else {
-		include ('languages/English.class');
-	        $Language=new English();
+		$Language=new BaseLanguage();
+		$Language->loadLanguage('English');
 	}
 } else {
 	//if you aren't logged in, check your browser settings 
 	//and see if we support that language
 	//if we don't support it, just use English as default
 	$res = language_code_to_result ($HTTP_ACCEPT_LANGUAGE);
-	$classfile=db_result($res,0,'filename');
-	if (!$classfile) $classfile="English.class";
-	include ("languages/$classfile");
 	$classname=db_result($res,0,'classname');
-	if (!$classname) $classname="English";
-	$Language=new $classname();
+	if (!$classname) {
+		$classname="English";
+	}
+	$Language=new BaseLanguage();
+	$Language->loadLanguage($classname);
 }
 
 
+//ob_start(ob_gzhandler);
+
+//
+//	For now, only cache English, non-logged-in pages, with no POST going on
+//
+if (!user_isloggedin() && ($Language->getLanguageId() == 1) && (count($HTTP_POST_VARS) < 1) && !session_issecure()) {
+	include_once('common/include/jpcache.php');
+}
+
 /*
 
 
@@ -168,11 +190,9 @@
 $conn
 $session_hash
 $Language
-$User
+$LUSER - Logged in user object
 $HTML
-$foundry
-$project
-$Group
+$sys_datefmt
 
 */
 

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/project_home.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/project_home.php	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/project_home.php	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,20 +1,29 @@
-<?php // // SourceForge: Breaking Down the Barriers to Open Source Development // Copyright 1999-2000 (c) The SourceForge Crew // http://sourceforge.net // // $Id$
+<?php 
+/**
+ * project_home.php
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id$
+ */
 
-require ('vote_function.php');
-require ('vars.php');
-require ($DOCUMENT_ROOT.'/news/news_utils.php');
-require ('trove.php');
-require ('project_summary.php');
+require_once('www/include/vote_function.php');
+require_once('common/include/vars.php');
+require_once('www/news/news_utils.php');
+require_once('www/include/trove.php');
+require_once('www/include/project_summary.php');
 
 //make sure this project is NOT a foundry
 if (!$project->isProject()) {
 	header ("Location: /foundry/". $project->getUnixName() ."/");
 	exit;
-}       
+}	   
 
 $title = 'Project Info - '. $project->getPublicName();
 
-site_project_header(array('title'=>$title,'group'=>$group_id,'toptab'=>'home'));
+site_project_header(array('title'=>$title,'group'=>$group_id,'toptab'=>'home','pagename'=>'projects','sectionvals'=>array(group_getname($group_id))));
 
 
 // ########################################### end top area
@@ -27,10 +36,14 @@
 <?php 
 
 // ########################################## top area, not in box 
-$res_admin = db_query("SELECT users.user_id AS user_id,users.user_name AS user_name "
-	. "FROM users,user_group "
-	. "WHERE user_group.user_id=users.user_id AND user_group.group_id=$group_id AND "
-	. "user_group.admin_flags = 'A'");
+$res_admin = db_query("
+	SELECT users.user_id AS user_id,users.user_name AS user_name 
+	FROM users,user_group 
+	WHERE user_group.user_id=users.user_id 
+	AND user_group.group_id=$group_id 
+	AND user_group.admin_flags = 'A'
+	AND users.status='A'
+");
 
 if ($project->getStatus() == 'H') {
 	print "<P>NOTE: This project entry is maintained by the SourceForge staff. We are not "
@@ -47,36 +60,37 @@
 // trove info
 print '<BR> <BR>';
 trove_getcatlisting($group_id,0,1);
-//print '<BR> ';
 
 // Get the activity percentile
 $actv = db_query("SELECT percentile FROM project_weekly_metric WHERE group_id='$group_id'");
 $actv_res = db_result($actv,0,"percentile");
-if (!$actv_res) $actv_res=0;
+if (!$actv_res) {
+	$actv_res=0;
+}
 
 print("Registered: " . date($sys_datefmt, $project->getStartDate()));
 print '<br>Activity Percentile: ' . $actv_res . '%';
 print '<br>View project activity <a href="/project/stats/?group_id='.$group_id.'">statistics</a>';
 
 $jobs_res = db_query("SELECT name ".
-                "FROM people_job,people_job_category ".
-                "WHERE people_job.category_id=people_job_category.category_id ".
-                "AND people_job.status_id=1 ".
-                "AND group_id='$group_id' ".
-                "GROUP BY name",2);
+				"FROM people_job,people_job_category ".
+				"WHERE people_job.category_id=people_job_category.category_id ".
+				"AND people_job.status_id=1 ".
+				"AND group_id='$group_id' ".
+				"GROUP BY name",2);
 if ($jobs_res) {
 	$num=db_numrows($jobs_res);
-        if ($num>0) {
-        	print '<br><br>HELP WANTED: This project is looking for ';
-                if ($num==1) {
-                	print '<a href="/people/?group_id='.$group_id.'">'.
-                              db_result($jobs_res,0,"name").'(s)</a>';
-                } else {
-                	print 'People to fill '.
-                        '<a href="/people/?group_id='.$group_id.'">several '.
-                        'different positions</a>';
-                }
-        }
+		if ($num>0) {
+			print '<br><br>HELP WANTED: This project is looking for ';
+				if ($num==1) {
+					print '<a href="/people/?group_id='.$group_id.'">'.
+							  db_result($jobs_res,0,"name").'(s)</a>';
+				} else {
+					print 'People to fill '.
+						'<a href="/people/?group_id='.$group_id.'">several '.
+						'different positions</a>';
+				}
+		}
 }
 
 
@@ -84,13 +98,12 @@
 
 // ########################### Developers on this project
 
-echo $HTML->box1_top($Language->DEVELOPER_INFO);
-?>
-<?php
+echo $HTML->box1_top($Language->getText('group','developer_info'));
+
 if (db_numrows($res_admin) > 0) {
 
 	?>
-	<SPAN CLASS="develtitle"><?php echo $Language->PROJECT_ADMINS; ?>:</SPAN><BR>
+	<SPAN CLASS="develtitle"><?php echo $Language->getText('group','project_admins'); ?>:</SPAN><BR>
 	<?php
 		while ($row_admin = db_fetch_array($res_admin)) {
 			print "<A href=\"/users/$row_admin[user_name]/\">$row_admin[user_name]</A><BR>";
@@ -102,7 +115,7 @@
 }
 
 ?>
-<SPAN CLASS="develtitle"><?php echo $Language->DEVELOPERS; ?>:</SPAN><BR>
+<SPAN CLASS="develtitle"><?php echo $Language->getText('group','developers'); ?>:</SPAN><BR>
 <?php
 //count of developers on this project
 $res_count = db_query("SELECT user_id FROM user_group WHERE group_id=$group_id");
@@ -115,35 +128,34 @@
 
 echo $HTML->box1_bottom();
 
-print '
+?>
 </TD></TR>
 </TABLE>
 <P>
-';
+<?php
 
-
 // ############################# File Releases
 
-echo $HTML->box1_top($Language->LATEST_FILE_RELEASES); 
+echo $HTML->box1_top($Language->getText('frs','latest_file_releases')); 
 	$unix_group_name = $project->getUnixName();
 
 	echo '
 	<TABLE cellspacing="1" cellpadding="5" width="100%" border="0">
-		<TR bgcolor="'.$GLOBALS['COLOR_LTBACK1'].'">
+		<TR bgcolor="'.$HTML->COLOR_LTBACK1.'">
 		<TD align="left"">
-			'.$Language->FILE_PACKAGE.'
+			'.$Language->getText('frs','file_package').'
 		</td>
 		<TD align="center">
-			'.$Language->FILE_VERSION.'
+			'.$Language->getText('frs','file_version').'
 		</td>
 		<td align="center">
-			'.$Language->FILE_REL_DATE.'
+			'.$Language->getText('frs','file_rel_date').'
 		</td>
 		<TD align="center">
-			'.$Language->FILE_NOTES.' / '.$Language->FILE_MONITOR.'
+			'.$Language->getText('frs','file_notes').' / '.$Language->getText('frs','file_monitor').'
 		</td>
 		<TD align="center">
-			'.$Language->FILE_DOWNLOAD.'
+			'.$Language->getText('frs','file_download').'
 		</td>
 		</TR>';
 
@@ -159,7 +171,7 @@
 		if (!$res_files || $rows_files < 1) {
 			echo db_error();
 			// No releases
-			echo '<TR BGCOLOR="'.$GLOBALS['COLOR_LTBACK1'].'"><TD COLSPAN="4"><B>This Project Has Not Released Any Files</B></TD></TR>';
+			echo '<TR BGCOLOR="'.$HTML->COLOR_LTBACK1.'"><TD COLSPAN="4"><B>This Project Has Not Released Any Files</B></TD></TR>';
 
 		} else {
 			/*
@@ -172,7 +184,7 @@
 				} else {
 					$rel_date = getdate(db_result($res_files,$f,'release_date'));
 					echo '
-					<TR BGCOLOR="'.$GLOBALS['COLOR_LTBACK1'].'" ALIGN="center">
+					<TR BGCOLOR="'.$HTML->COLOR_LTBACK1.'" ALIGN="center">
 					<TD ALIGN="left">
 					<B>' . db_result($res_files,$f,'package_name'). '</B></TD>';
 					// Releases to display
@@ -185,7 +197,7 @@
 					echo html_image("images/ic/mail16d.png",'15','15',array('alt'=>'Monitor This Package'));
 					echo '</A>
 					</TD>
-					<TD><A HREF="/project/showfiles.php?group_id=' . $group_id . '&release_id=' . db_result($res_files,$f,'release_id') . '">'.$Language->FILE_DOWNLOAD.'</A></TD></TR>';
+					<TD><A HREF="/project/showfiles.php?group_id=' . $group_id . '&release_id=' . db_result($res_files,$f,'release_id') . '">'.$Language->getText('frs','file_download').'</A></TD></TR>';
 				}
 			}
 
@@ -205,45 +217,50 @@
 <?php
 
 // ############################## PUBLIC AREAS
-echo $HTML->box1_top($Language->PUBLIC_AREA); 
+echo $HTML->box1_top($Language->getText('group','public_area')); 
 
 // ################# Homepage Link
 
 print "<A href=\"http://" . $project->getHomePage() . "\">";
-print html_image("images/ic/home16b.png",'20','20',array('alt'=>$Language->GROUP_SHORT_HOMEPAGE));
-print ' '.$Language->GROUP_LONG_HOMEPAGE.'</A>';
+print html_image("images/ic/home16b.png",'20','20',array('alt'=>$Language->getText('group','short_homepage')));
+print ' '.$Language->getText('group','long_homepage').'</A>';
 
-// ################## forums
+// ################## ArtifactTypes
 
-if ($project->usesForum()) {
-	print '<HR SIZE="1" NoShade><A href="/forum/?group_id='.$group_id.'">';
-	print html_image("images/ic/notes16.png",'20','20',array('alt'=>$Language->GROUP_SHORT_FORUM)); 
-	print ' '.$Language->GROUP_LONG_FORUM.'</A>';
-	print " ( <B>". project_get_public_forum_count($group_id) ."</B> messages in ";
+print '<HR SIZE="1" NoShade><A href="/tracker/?group_id='.$group_id.'">';
+print html_image("images/ic/taskman16b.png",'20','20',array('alt'=>$Language->getText('group','short_tracker')));
+print ' Tracker</A>';
 
-	print "<B>". project_get_public_forum_message_count($group_id) ."</B> forums )\n";
-}
+$result=db_query("SELECT agl.*,aca.count,aca.open_count
+FROM artifact_group_list agl
+LEFT JOIN artifact_counts_agg aca USING (group_artifact_id) 
+WHERE agl.group_id='$group_id'
+AND agl.is_public=1 
+ORDER BY group_artifact_id ASC");
 
-// ##################### Bug tracking
+$rows = db_numrows($result);
 
-if ($project->usesBugs()) {
-	print '<HR SIZE="1" NoShade><A href="/bugs/?group_id='.$group_id.'">';
-	print html_image("images/ic/bug16b.png",'20','20',array('alt'=>$Language->GROUP_SHORT_BUGS)); 
-	print ' '.$Language->GROUP_LONG_BUGS.'</A>';
-	print " ( <B>". project_get_open_bug_count($group_id) ."</B>";
-	print " open bugs, <B>". project_get_total_bug_count($group_id) ."</B> total )";
+if (!$result || $rows < 1) {
+	echo '<BR><I>There are no public trackers available</I>';
+} else {
+	for ($j = 0; $j < $rows; $j++) {
+		echo '<P>
+		 - <A HREF="/tracker/?atid='. db_result($result, $j, 'group_artifact_id') .
+		'&group_id='.$group_id.'&func=browse">'. db_result($result, $j, 'name') .'</A> 
+		( <B>'. db_result($result, $j, 'open_count') .' open / '. db_result($result, $j, 'count') .' total</B> )<BR>'.
+		db_result($result, $j, 'description');
+	}
 }
 
-// ##################### Support Manager
- 
-if ($project->usesSupport()) {
-	print '
-		<HR SIZE="1" NoShade>
-		<A href="/support/?group_id='.$group_id.'">';
-	print html_image("images/ic/support16b.jpg",'20','20',array('alt'=>$Language->GROUP_SHORT_SUPPORT));
-	print ' '.$Language->GROUP_LONG_SUPPORT.'</A>';
-	print " ( <B>". project_get_open_support_count($group_id) ."</B>";
-	print " open requests, <B>". project_get_total_support_count($group_id) ."</B> total )";
+// ################## forums
+
+if ($project->usesForum()) {
+	print '<HR SIZE="1" NoShade><A href="/forum/?group_id='.$group_id.'">';
+	print html_image("images/ic/notes16.png",'20','20',array('alt'=>$Language->getText('group','short_forum'))); 
+	print ' '.$Language->getText('group','long_forum').'</A>';
+	print " ( <B>". project_get_public_forum_message_count($group_id) ."</B> messages in ";
+
+	print "<B>". project_get_public_forum_count($group_id) ."</B> forums )\n";
 }
 
 // ##################### Doc Manager
@@ -252,28 +269,16 @@
 	print '
 	<HR SIZE="1" NoShade>
 	<A href="/docman/?group_id='.$group_id.'">';
-	print html_image("images/ic/docman16b.png",'20','20',array('alt'=>$Language->GROUP_SHORT_DOCMAN));
-	print ' '.$Language->GROUP_LONG_DOCMAN.'</A>';
+	print html_image("images/ic/docman16b.png",'20','20',array('alt'=>$Language->getText('group','short_docman')));
+	print ' '.$Language->getText('group','long_docman').'</A>';
 }
 
-// ##################### Patch Manager
-
-if ($project->usesPatch()) {
-	print '
-		<HR SIZE="1" NoShade>
-		<A href="/patch/?group_id='.$group_id.'">';
-	print html_image("images/ic/patch.png",'20','20',array('alt'=>$Language->GROUP_SHORT_PATCH));
-	print ' '.$Language->GROUP_LONG_PATCH.'</A>';
-	print " ( <B>". project_get_open_patch_count($group_id) ."</B>";
-	print " open patches, <B>". project_get_total_patch_count($group_id) ."</B> total )";
-}
-
 // ##################### Mailing lists
 
 if ($project->usesMail()) {
 	print '<HR SIZE="1" NoShade><A href="/mail/?group_id='.$group_id.'">';
-	print html_image("images/ic/mail16b.png",'20','20',array('alt'=>$Language->GROUP_SHORT_MAIL)); 
-	print ' '.$Language->GROUP_LONG_MAIL.'</A>';
+	print html_image("images/ic/mail16b.png",'20','20',array('alt'=>$Language->getText('group','short_mail'))); 
+	print ' '.$Language->getText('group','long_mail').'</A>';
 	print " ( <B>". project_get_mail_list_count($group_id) ."</B> public mailing lists )";
 }
 
@@ -281,8 +286,8 @@
 
 if ($project->usesPm()) {
 	print '<HR SIZE="1" NoShade><A href="/pm/?group_id='.$group_id.'">';
-	print html_image("images/ic/taskman16b.png",'20','20',array('alt'=>$Language->GROUP_SHORT_PM));
-	print ' '.$Language->GROUP_LONG_PM.'</A>';
+	print html_image("images/ic/taskman16b.png",'20','20',array('alt'=>$Language->getText('group','short_pm')));
+	print ' '.$Language->getText('group','long_pm').'</A>';
 	$sql="SELECT * FROM project_group_list WHERE group_id='$group_id' AND is_public=1";
 	$result = db_query ($sql);
 	$rows = db_numrows($result);
@@ -302,8 +307,8 @@
 
 if ($project->usesSurvey()) {
 	print '<HR SIZE="1" NoShade><A href="/survey/?group_id='.$group_id.'">';
-	print html_image("images/ic/survey16b.png",'20','20',array('alt'=>$Language->GROUP_SHORT_SURVEY));
-	print " ".$Language->GROUP_LONG_SURVEY."</A>";
+	print html_image("images/ic/survey16b.png",'20','20',array('alt'=>$Language->getText('group','short_survey')));
+	print " ".$Language->getText('group','long_survey')."</A>";
 	echo ' ( <B>'. project_get_survey_count($group_id) .'</B> surveys )';
 }
 
@@ -311,21 +316,29 @@
 
 if ($project->usesCVS()) {
 	print '<HR SIZE="1" NoShade><A href="/cvs/?group_id='.$group_id.'">';
-	print html_image("images/ic/cvs16b.png",'20','20',array('alt'=>$Language->GROUP_SHORT_CVS));
-	print " ".$Language->GROUP_LONG_CVS."</A>";
-	$sql = "SELECT SUM(cvs_commits) AS commits,SUM(cvs_adds) AS adds from stats_project where group_id='$group_id'";
-	$result = db_query($sql);
-        $cvs_commit_num=db_result($result,0,0);
-        $cvs_add_num=db_result($result,0,1);
-        if (!$cvs_commit_num) $cvs_commit_num=0;
-        if (!$cvs_add_num) $cvs_add_num=0;
-	echo ' ( <B>'.$cvs_commit_num.'</B> commits, <B>'.$cvs_add_num.'</B> adds )';
-        if ($cvs_commit_num || $cvs_add_num) {
-        	echo '<br>   - <a href="http://'.$sys_cvs_host
-                     .'/cgi-bin/cvsweb.cgi?cvsroot='.$project->getUnixName()
-                     .'">Browse CVS</a>';
-        }
+	print html_image("images/ic/cvs16b.png",'20','20',array('alt'=>$Language->getText('group','short_cvs')));
+	print " ".$Language->getText('group','long_cvs')."</A>";
 
+	$result = db_query("
+		SELECT cvs_commits AS commits,cvs_adds AS adds
+		FROM stats_project_all
+		WHERE group_id='$group_id'
+	", -1, 0, SYS_DB_STATS);
+	$cvs_commit_num = db_result($result,0,0);
+	$cvs_add_num    = db_result($result,0,1);
+	if (!$cvs_commit_num) {
+		$cvs_commit_num=0;
+	}
+	if (!$cvs_add_num) {
+		$cvs_add_num=0;
+	}
+	echo ' ( <B>' . number_format($cvs_commit_num, 0) . '</B> commits, <B>' . number_format($cvs_add_num, 0) . '</B> adds )';
+	if ($cvs_commit_num || $cvs_add_num) {
+		echo '<br>   - 
+			<a href="'.account_group_cvsweb_url($project->getUnixName()).'">
+			Browse CVS</a>';
+	}
+
 }
 
 // ######################## AnonFTP 
@@ -333,8 +346,8 @@
 if ($project->isActive()) {
 	print '<HR SIZE="1" NoShade>';
 	print "<A href=\"ftp://" . $project->getUnixName() . "." . $GLOBALS['sys_default_domain'] . "/pub/". $project->getUnixName() ."/\">";
-	print html_image("images/ic/ftp16b.png",'20','20',array('alt'=>$Language->GROUP_LONG_FTP));
-	print $Language->GROUP_LONG_FTP."</A>";
+	print html_image("images/ic/ftp16b.png",'20','20',array('alt'=>$Language->getText('group','long_ftp')));
+	print $Language->getText('group','long_ftp')."</A>";
 }
 
 $HTML->box1_bottom();
@@ -350,7 +363,7 @@
 	<?php
 	// ############################# Latest News
 
-	echo $HTML->box1_top($Language->GROUP_LONG_NEWS);
+	echo $HTML->box1_top($Language->getText('group','long_news'));
 
 	echo news_show_latest($group_id,10,false);
 

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/squal_pre.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/squal_pre.php	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/squal_pre.php	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,37 +1,34 @@
 <?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id$
+/**
+ * squal_pre.php
+ *
+ * Drastically simplified version of pre.php
+ * 
+ * Sets up database connection and session
+ * 
+ * NOTE:
+ *		You cannot call HTML, user, group or related functions
+ * 
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id$
+ */
 
+require_once('/etc/sourceforge/local.inc');
+require_once('common/include/database.php');
+require_once('common/include/session.php');
+require_once('common/include/Error.class');
+require_once('common/include/User.class');
+require_once('common/include/Permission.class');
+require_once('common/include/utils.php');
 
-/*
-
-
-	Drastically simplified version of pre.php
-
-	Sets up database connection and session
-
-	###
-	###  You cannot call HTML, user, group or related functions
-	###
-
-*/
-
-require ('/etc/sourceforge/local.inc');
-require('database.php');
-require('session.php');
-require('Error.class');
-require('User.class');
-require('utils.php');
-
 //plain text version of exit_error();
-require('squal_exit.php');
+require_once('squal_exit.php');
 
 //needed for logging / logo
-require('browser.php');
+require_once('browser.php');
 
 $sys_datefmt = "m/d/y H:i";
 
@@ -43,7 +40,7 @@
 	exit_error("Could Not Connect to Database",db_error());
 }
 
-//require('logger.php');
+//require_once('logger.php');
 
 // #### set session
 

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/theme.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/theme.php	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/theme.php	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,44 +1,55 @@
 <?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id: theme.php,v 1.16 2000/08/31 06:11:35 gherteg Exp $
+/**
+ * theme.php
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id: theme.php,v 1.20 2001/06/22 18:18:08 dbrogdon Exp $
+ */
 
-$theme_arcolor = array(White=>"#FFFFFF", Black=>"#000000", Blue=>"#0000FF", Green=>"#00FF00", Red=>"#FF0000");
-$theme_arfont = array(Helvetica=>"Helvetica", Times=>"Times", Courier=>"Courier", Lucida=>"Lucida");
+$theme_arcolor = array('White'=>'#FFFFFF', 'Black'=>'#000000', 'Blue'=>'#0000FF', 'Green'=>'#00FF00', 'Red'=>'#FF0000');
+$theme_arfont = array('Helvetica'=>'Helvetica', 'Times'=>'Times', 'Courier'=>'Courier', 'Lucida'=>'Lucida');
 $theme_arfontsize = array('small'=>'small', 'medium'=>'medium', 'large'=>'large', 'x-large'=>'x-large');
 
+/**
+ * user_getthemeid() - Get the default theme ID for a user.
+ *
+ * @param		int		The user ID
+ */
 function user_getthemeid($user_id = 0) {
-        global $USER_THEME;
-        // use current user if one is not passed in
-        if (!$user_id) {
-                return ($G_USER?$G_USER['user_theme']:$GLOBALS['sys_themeid']);
-        }
-        // else must lookup name
-        else {
-                if ($USER_THEME["user_$user_id"]) {
-                        //user theme was fetched previously
-                        return $USER_THEME["user_$user_id"];
-                } else {
-                        //fetch the user theme and store it for future reference
-                        $sql = "SELECT * FROM theme_prefs WHERE user_id=$user_id";
-			// echo "<b> $sql </b><br>" ;
-                        $result = db_query($sql) ;
-                        if ($result && db_numrows($result) > 0) {
-                                //valid theme - store and return
-                                $USER_THEME["user_$user_id"]=db_result($result,0,"user_theme");
-                                return $USER_THEME["user_$user_id"];
-                        } else {
-                                //invalid theme - store and return
-                                $USER_THEME["user_$user_id"]="<B>Invalid User ID</B>";
-                                return $GLOBALS['sys_themeid'];
-                        }
-                }
-        }
+	global $USER_THEME;
+	// use current user if one is not passed in
+	if (!$user_id) {
+		return ($G_USER?$G_USER['user_theme']:$GLOBALS['sys_themeid']);
+	}
+	// else must lookup name
+	else {
+		if ($USER_THEME["user_$user_id"]) {
+			//user theme was fetched previously
+			return $USER_THEME["user_$user_id"];
+		} else {
+			//fetch the user theme and store it for future reference
+			$result = db_query("SELECT * FROM theme_prefs WHERE user_id='$user_id'");
+			if ($result && db_numrows($result) > 0) {
+				//valid theme - store and return
+				$USER_THEME["user_$user_id"]=db_result($result,0,"user_theme");
+				return $USER_THEME["user_$user_id"];
+			} else {
+				//invalid theme - store and return
+				$USER_THEME["user_$user_id"]=$GLOBALS['sys_themeid'];
+				return $USER_THEME["user_$user_id"];
+			}
+		}
+	}
 }
 
+/**
+ * get_themedir() - Get the theme dir location for a particular theme.
+ *
+ * @param		int		The theme iD
+ */
 function get_themedir($theme_id = 0) {
         global $THEME_DIR;
         // use current theme if one is not passed in
@@ -68,6 +79,11 @@
         }
 }
 
+/**
+ * get_themename() - The the name of a theme
+ *
+ * @param		int		The theme ID
+ */
 function get_themename($theme_id = 0) {
         global $THEME_NAME;
         // use current theme if one is not passed in
@@ -97,6 +113,11 @@
         }
 }
 
+/**
+ * theme_get_userpref() - Get a users theme preference.
+ *
+ * @param		string	The preference name
+ */
 function theme_get_userpref($preference_name) {
         GLOBAL $theme_pref;
         if (user_isloggedin()) {
@@ -117,21 +138,25 @@
                         if (db_numrows($result) < 1) {
                                 return false;
                         } else {
+				$theme_pref = db_fetch_array($result);
 
-        			$theme_pref = db_fetch_array($result);
-
 				if($theme_pref["$preference_name"]){
 					return $theme_pref["$preference_name"];
 				} else {
 					return false;
 				}
-                        }
-                }
-        } else {
-                return false;
-        }
+			}
+		}
+	} else {
+		return false;
+	}
 }
 
+/**
+ * theme_set_usertheme() - Set a users theme preference
+ *
+ * @param		int		The theme ID
+ */
 function theme_set_usertheme($theme_id) {
         if (user_isloggedin()) {
                 $result=db_query("DELETE FROM theme_prefs WHERE user_id=".user_getid());
@@ -142,10 +167,15 @@
 	return true;
 }
 
+/**
+ * theme_sysinit() - Initialize a theme
+ *
+ * #param		int		The theme ID
+ */
 function theme_sysinit($theme_id = 0){
 	GLOBAL $HTML;
 
-        if (user_isloggedin() && !$theme_id){
+    if (user_isloggedin() && !$theme_id){
 		$GLOBALS['sys_themeid'] = user_getthemeid(user_getid());
 		$GLOBALS['sys_theme'] = get_themedir($GLOBALS['sys_themeid']);
 	} else {
@@ -158,43 +188,65 @@
 		$GLOBALS['sys_theme'] = 'forged';
 	} else {
 		//now include the actual chosen theme file
-		include($GLOBALS['sys_themeroot'].$GLOBALS['sys_theme'].'/Theme.class');
+		include_once($GLOBALS['sys_themeroot'].$GLOBALS['sys_theme'].'/Theme.class');
 		$HTML = new Theme();
 	}
 	
 }
 
-// returns full select output for a particular root
+/**
+ * theme_selectfull() - Returns full select output for a particular root
+ *
+ * @param		string	The theme to be pre-selected
+ * @param		string	The select box name
+ */
 function theme_selectfull($selected,$name) {
-        print "<BR><SELECT name=\"$name\">\n\t";
-        $res_theme = db_query('SELECT theme_id,fullname FROM themes ORDER BY fullname');
-        while ($row_theme = db_fetch_array($res_theme)) {
-                print '  <OPTION value="'.$row_theme['theme_id'].'"';
-                if ($selected == $row_theme['theme_id']) print (' selected');
-                print '>'.$row_theme['fullname']."\n\t";
-        }
-        print "</SELECT>\n";
+	print "<BR><SELECT name=\"$name\">\n\t";
+	$res_theme = db_query('SELECT theme_id,fullname FROM themes ORDER BY fullname');
+	while ($row_theme = db_fetch_array($res_theme)) {
+		print '  <OPTION value="'.$row_theme['theme_id'].'"';
+		if ($selected == $row_theme['theme_id']) {
+			print (' selected');
+		}
+		print '>'.$row_theme['fullname']."\n\t";
+	}
+	print "</SELECT>\n";
 }
 
-// returns full select output for a particular root
+/**
+ * theme_optionselectfull() - Returns full select output for a particular root
+ *
+ * @param		string	The select box name
+ * @param		array	The select box options array
+ * @param		string	The option to be pre-selected
+ */
 function theme_optionselectfull($name, $optionar, $selected) {
-        $other_sel = " selected";
-        print "<BR><SELECT name=\"$name\">\n\t";
-        reset ($optionar);
-        while (list ($key, $val) = each ($optionar)) {
-            print '  <OPTION value="'.$val.'"';
-            if ($selected == $val){ print (' selected'); $other_sel = ""; }
-            print '>'.$key."</OPTION>\n\t";
-        }
-        print "  <OPTION VALUE='changed'$other_sel>Other\n\t</SELECT>\n";
+	$other_sel = " selected";
+	print "<BR><SELECT name=\"$name\">\n\t";
+	reset ($optionar);
+	while (list ($key, $val) = each ($optionar)) {
+	    print '  <OPTION value="'.$val.'"';
+	    if ($selected == $val){ print (' selected'); $other_sel = ""; }
+	    print '>'.$key."</OPTION>\n\t";
+	}
+	print "  <OPTION VALUE='changed'$other_sel>Other\n\t</SELECT>\n";
 	if($other_sel){ $GLOBALS[$name.'_other'] = $GLOBALS[$name]; } else {$GLOBALS[$name.'_other'] = ''; }
-        print "  <INPUT TYPE='text' NAME='".$name."_other' SIZE='7' VALUE='".$GLOBALS[$name.'_other']."'>\n";
+	print "  <INPUT TYPE='text' NAME='".$name."_other' SIZE='7' VALUE='".$GLOBALS[$name.'_other']."'>\n";
 }
 
 
-// returns form for modifying the user theme preferences
+/**
+ * theme_usermodform() - Returns form for modifying the user theme preferences
+ *
+ * @param		string	???
+ * @param		string	The form action
+ * @param		name	The form name
+ * @param		unknown	unknown
+ */
 function theme_usermodform($selected,$action,$name,$component) {
-	if(!$component){ print "<FORM NAME='$name' ACTION='$action' METHOD='post'>\n"; }
+	if(!$component) { 
+		print "<FORM NAME='$name' ACTION='$action' METHOD='post'>\n"; 
+	}
 	print'
 		<FONT FACE="Helvetica" SIZE="2">
 ';
@@ -208,11 +260,19 @@
 	if(!$component){ print "</FORM>\n"; }
 }
 
-// returns form for modifying the user color preferences
+/** 
+ * theme_modcolorform() - Returns form for modifying the user color preferences
+ *
+ * @param		string	The form action
+ * @param		string	The form name
+ * @param		unknown	unknown
+ */
 function theme_modcolorform($action,$name,$component) {
-	if(!$component){ print "<FORM NAME='$name' ACTION='$action' METHOD='post'>\n"; }
-        print'
-                <FONT FACE="Helvetica" SIZE="2">
+	if(!$component) { 
+		print "<FORM NAME='$name' ACTION='$action' METHOD='post'>\n"; 
+	}
+	print'
+		<FONT FACE="Helvetica" SIZE="2">
 		Light Background (Tables)';
 		theme_optionselectfull("COLOR_LTBACK1", $GLOBALS['theme_arcolor'], $GLOBALS['COLOR_LTBACK1']);
 	print'  <BR>Alternate Row Background :';
@@ -224,36 +284,48 @@
 	print'  <BR>Main Content Background :';
 		theme_optionselectfull("COLOR_CONTENT_BACK", $GLOBALS['theme_arcolor'], $GLOBALS['COLOR_CONTENT_BACK']);
 	print'  <BR>
-                <INPUT TYPE="submit" NAME="color_action" VALUE="Preview Colors">
-                <INPUT TYPE="submit" NAME="color_action" VALUE="Apply Colors">
-                <INPUT TYPE="submit" NAME="color_action" VALUE="Cancel">
-                </FONT>
+		<INPUT TYPE="submit" NAME="color_action" VALUE="Preview Colors">
+		<INPUT TYPE="submit" NAME="color_action" VALUE="Apply Colors">
+		<INPUT TYPE="submit" NAME="color_action" VALUE="Cancel">
+		</FONT>
 ';
-	if(!$component){ print "</FORM>\n"; }
+	if(!$component) { 
+		print "</FORM>\n"; 
+	}
 }
 
-// returns form for modifying the user color preferences
+/**
+ * theme_modfontform() - Returns form for modifying the user color preferences
+ *
+ * @param		string	The form action
+ * @param		string	The form name
+ * @param		unknown	unknown
+ */
 function theme_modfontform($action,$name,$component) {
-        if(!$component){ print "<FORM NAME='$name' ACTION='$action' METHOD='post'>\n"; }
-        print'
-                <FONT FACE="Helvetica" SIZE="2">
-                Body Font:';
-                theme_optionselectfull("FONT_CONTENT", $GLOBALS['theme_arfont'], $GLOBALS['FONT_CONTENT']);
-                theme_optionselectfull("FONTSIZE_CONTENT", $GLOBALS['theme_arfontsize'], $GLOBALS['FONTSIZE_CONTENT']);
+	if(!$component) { 
+		print "<FORM NAME='$name' ACTION='$action' METHOD='post'>\n"; 
+	}
+	print'
+		<FONT FACE="Helvetica" SIZE="2">
+		Body Font:';
+		theme_optionselectfull("FONT_CONTENT", $GLOBALS['theme_arfont'], $GLOBALS['FONT_CONTENT']);
+		theme_optionselectfull("FONTSIZE_CONTENT", $GLOBALS['theme_arfontsize'], $GLOBALS['FONTSIZE_CONTENT']);
 		theme_optionselectfull("FONTCOLOR_CONTENT", $GLOBALS['theme_arcolor'], $GLOBALS['FONTCOLOR_CONTENT']);
 
-        print'  <BR>Box TitleBar Font:';
-                theme_optionselectfull("FONT_HTMLBOX_TITLE", $GLOBALS['theme_arfont'], $GLOBALS['FONT_HTMLBOX_TITLE']);
-                theme_optionselectfull("FONTSIZE_HTMLBOX_TITLE", $GLOBALS['theme_arfontsize'], $GLOBALS['FONTSIZE_HTMLBOX_TITLE']);
+	print'  <BR>Box TitleBar Font:';
+		theme_optionselectfull("FONT_HTMLBOX_TITLE", $GLOBALS['theme_arfont'], $GLOBALS['FONT_HTMLBOX_TITLE']);
+		theme_optionselectfull("FONTSIZE_HTMLBOX_TITLE", $GLOBALS['theme_arfontsize'], $GLOBALS['FONTSIZE_HTMLBOX_TITLE']);
 		theme_optionselectfull("FONTCOLOR_HTMLBOX_TITLE", $GLOBALS['theme_arcolor'], $GLOBALS['FONTCOLOR_HTMLBOX_TITLE']);
 
-        print'  <BR>
-                <INPUT TYPE="submit" NAME="font_action" VALUE="Preview Fonts">
-                <INPUT TYPE="submit" NAME="font_action" VALUE="Apply Fonts">
-                <INPUT TYPE="submit" NAME="font_action" VALUE="Cancel">
-                </FONT>
+	print'  <BR>
+		<INPUT TYPE="submit" NAME="font_action" VALUE="Preview Fonts">
+		<INPUT TYPE="submit" NAME="font_action" VALUE="Apply Fonts">
+		<INPUT TYPE="submit" NAME="font_action" VALUE="Cancel">
+		</FONT>
 ';
-        if(!$component){ print "</FORM>\n"; }
+	if(!$component){ 
+		print "</FORM>\n"; 
+	}
 }
 
 ?>

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/user_home.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/user_home.php	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/user_home.php	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,29 +1,23 @@
 <?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id$
+/**
+ * user_home.php
+ * Developer Info Page
+ * Assumes $user object for displayed user is present
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id: 
+ * @author		Drew Streib <dtype at valinux.com>
+ */
 
-/*
+require_once('vote_function.php');
 
-	Developer Info Page
-	Written by dtype Oct 1999
+$HTML->header(array('title'=>'Developer Profile','pagename'=>'users'));
 
-
-	Assumes $user object for displayed user is present
-
-
-*/
-
-require ('vote_function.php');
-
-$HTML->header(array('title'=>'Developer Profile'));
-
 ?>
 
-<H3>Developer Profile</H3>
 <P>
 <TABLE width=100% cellpadding=2 cellspacing=2 border=0><TR valign=top>
 <TD width=50%>
@@ -61,7 +55,11 @@
 
 	echo $HTML->box1_middle('Peer Rating',false,false);
 
-	echo vote_show_user_rating($user_id);
+	if ($user->usesRatings()) {
+		echo vote_show_user_rating($user_id);
+	} else {
+		echo 'User chose not to participate in peer rating';
+	}
 
 	echo $HTML->box1_middle('Diary And Notes');
  
@@ -75,9 +73,9 @@
 		"WHERE user_id='". $user_id ."' AND is_public=1");
 	echo 'Diary/Note Entries: '.db_result($res,0,0).'
 	<P>
-	<A HREF="/developer/diary.php?user_id='. $user_id .'">View Diary & Notes</A>
+	<A HREF="/developer/diary.php?diary_user='. $user_id .'">View Diary & Notes</A>
 	<P>
-	<A HREF="/developer/monitor.php?user_id='. $user_id .'">'. html_image("/images/ic/check.png",'15','13',array(),0) .'Monitor This Diary</A>';
+	<A HREF="/developer/monitor.php?diary_user='. $user_id .'">'. html_image("/images/ic/check.png",'15','13',array(),0) .'Monitor This Diary</A>';
 
 	?>
 </TD></TR>
@@ -112,7 +110,16 @@
 
 $HTML->box1_bottom(); ?>
 
-</TD><TD>
+</TD>
+
+
+<TD>
+
+<?php 
+$me = session_get_user(); 
+if ($user->usesRatings() && (!$me || $me->usesRatings())) { 
+?>
+
 If you are familiar with this user, please take a moment to rate him/her
 on the following criteria. Keep in mind, that your rating will be visible to
 the user and others.
@@ -120,7 +127,7 @@
 The SourceForge Peer Rating system is based on concepts from 
 <A HREF="http://www.advogato.com">Advogato.</A> The system has been re-implemented and expanded in a few ways.
 	<CENTER>
-        <?php echo vote_show_user_rate_box ($user_id); ?>
+        <?php echo vote_show_user_rate_box ($user_id, $me?$me->getID():0); ?>
 	</CENTER>
 <P>
 The Peer Rating box shows all rating averages
@@ -136,7 +143,29 @@
 other developers will be given (between 1 and 1.5) -- higher rated user's
 responses are given more weight.  
 </ul>
-</TD></TR>
+<p>
+<i>
+If you would like to opt-out from peer rating system (this will affect
+your ability to both rate and be rated), refer to <a href="/account/">your account
+maintenance page</a>. If you choose not to participate, your ratings of
+other users will be permanently deleted and the 'Peer Rating' box will
+disappear from your user page.
+</i>
+</p>
+<?php } else if ($me && !$me->usesRatings()) { ?>
+<p>
+<i>
+You opted-out from peer rating system, otherwise you would have
+a chance to rate the user. Refer to 
+<a href="/account/">your account maintenance page</a> for more
+information.
+</i>
+</p>
+<?php } ?>
+</TD>
+
+
+</TR>
 </TABLE>
 
 <TABLE width=100% cellpadding=2 cellspacing=2 border=0><TR valign=top>
@@ -146,6 +175,8 @@
 
 if (user_isloggedin()) {
 
+	$u =& session_get_user();
+
 	?>
 	 
 	<P>
@@ -155,16 +186,12 @@
 	<INPUT TYPE="HIDDEN" NAME="touser" VALUE="<?php echo $user_id; ?>">
 
 	<B>Your Email Address:</B><BR>
-	<B><?php echo user_getname().'@'.$GLOBALS['sys_users_host']; ?></B>
-	<INPUT TYPE="HIDDEN" NAME="email" VALUE="<?php echo user_getname().'@'.$GLOBALS['sys_users_host']; ?>">
+	<B><?php echo $u->getUnixName().'@'.$GLOBALS['sys_users_host']; ?></B>
+	<INPUT TYPE="HIDDEN" NAME="email" VALUE="<?php echo $u->getUnixName().'@'.$GLOBALS['sys_users_host']; ?>">
 	<P>
 	<B>Your Name:</B><BR>
-	<B><?php 
-
-	$my_name=user_getrealname(user_getid());
-
-	echo $my_name; ?></B>
-	<INPUT TYPE="HIDDEN" NAME="name" VALUE="<?php echo $my_name; ?>">
+	<B><?php echo $u->getRealName(); ?></B>
+	<INPUT TYPE="HIDDEN" NAME="name" VALUE="<?php echo $u->getRealName(); ?>">
 	<P>
 	<B>Subject:</B><BR>
 	<INPUT TYPE="TEXT" NAME="subject" SIZE="30" MAXLENGTH="40" VALUE="">

Modified: trunk/gforge_base/evolvisforge-5.1/gforge/www/include/vote_function.php
===================================================================
--- trunk/gforge_base/evolvisforge-5.1/gforge/www/include/vote_function.php	2011-02-24 14:40:40 UTC (rev 7410)
+++ trunk/gforge_base/evolvisforge-5.1/gforge/www/include/vote_function.php	2011-02-24 14:40:41 UTC (rev 7411)
@@ -1,11 +1,19 @@
 <?php
-//
-// SourceForge: Breaking Down the Barriers to Open Source Development
-// Copyright 1999-2000 (c) The SourceForge Crew
-// http://sourceforge.net
-//
-// $Id$
+/**
+ * vote_function.php
+ *
+ * SourceForge: Breaking Down the Barriers to Open Source Development
+ * Copyright 1999-2001 (c) VA Linux Systems
+ * http://sourceforge.net
+ *
+ * @version   $Id$
+ */
 
+/**
+ * vote_number_to_stars() - Turns vote results into *'s
+ *
+ * @param		int		Raw value
+ */
 function vote_number_to_stars($raw) {
 	$raw=intval($raw*2);
 	//	echo "\n\n<!-- $raw -->\n\n";
@@ -24,7 +32,13 @@
 	return $return;
 }
 
-function vote_show_thumbs ($id,$flag) {
+/**
+ * vote_show_thumbs() - Show vote stars
+ *
+ * @param		int		The survey ID
+ * @param		string	The rating type
+ */
+function vote_show_thumbs($id,$flag) {
 	/*
 		$flag
 		project - 1
@@ -40,6 +54,12 @@
 	}
 }
 
+/**
+ * vote_get_rating() - Get a vote rating
+ *
+ * @param		int		The survey ID
+ * @param		string	The rating type
+ */
 function vote_get_rating ($id,$flag) {
 	$sql="SELECT response FROM survey_rating_aggregate WHERE type='$flag' AND id='$id'";
 	$result=db_query($sql);
@@ -50,6 +70,12 @@
 	}
 }
 
+/**
+ * vote_show_release_radios() - Show release radio buttons
+ *
+ * @param		int		Survey ID
+ * @param		string	The rating type
+ */ 
 function vote_show_release_radios ($vote_on_id,$flag) {
 	/*
 		$flag
@@ -95,12 +121,12 @@
 
 }
 
-/*
-
-	Select and show a specific survey from the database
-
-*/
-
+/**
+ * show_survey() - Select and show a specific survey from the database
+ * 
+ * @param		int		The group ID
+ * @param		int		The survey ID
+ */
 function show_survey ($group_id,$survey_id) {
 
 ?>
@@ -171,7 +197,7 @@
 
 			if ($question_type != $last_question_type) {
 				echo '
-					<B>1                   5</B>';
+					<b>1</b> low             <b>5</b> high';
 				echo '<BR>';
 
 			}
@@ -229,6 +255,11 @@
 				<INPUT TYPE="TEXT" name="_'.$quest_array[$i].'" SIZE=20 MAXLENGTH=70>';
 
 		}
+		else {
+			// no answers, just show question
+			echo stripslashes(db_result($result, 0, 'question')).'<BR>';
+		}
+
 		echo '</TD></TR>';
 
 		$last_question_type=$question_type;
@@ -253,12 +284,13 @@
 
 }
 
+/**
+ * Show a single question for the new user rating system
+ *
+ * @param		string	The question to show
+ * @param		string	The array element
+ */
 function vote_show_a_question ($question,$element_name) {
-	/*
-		Show a single question for the new user rating
-		system
-	*/
-
 	echo '
 	<TR><TD COLSPAN="2" NOWRAP>
 	<INPUT TYPE="RADIO" NAME="Q_'. $element_name .'" VALUE="-3">
@@ -339,7 +371,27 @@
 $USER_RATING_VALUES[]='2';
 $USER_RATING_VALUES[]='3';
 
-function vote_show_user_rate_box ($user_id) {
+/**
+ * vote_show_user_rate_box() - Show user rating box
+ *
+ * @param		int		The user ID
+ * @param		int		The user ID of the user who is rating $user_id
+ */
+function vote_show_user_rate_box ($user_id, $by_id=0) {
+	if ($by_id) {
+		$res = db_query("
+			SELECT rate_field,rating FROM user_ratings 
+			WHERE rated_by='$by_id' 
+			AND user_id='$user_id'
+		");
+		$prev_vote = util_result_columns_to_assoc($res);
+		while (list($k,$v) = each($prev_vote)) {
+			if ($v == 0) {
+				$prev_vote[$k] = 0.1;
+			}
+		}
+	}
+	
 	global $USER_RATING_VALUES,$USER_RATING_QUESTIONS,$USER_RATING_POPUP1,$USER_RATING_POPUP2,$USER_RATING_POPUP3,$USER_RATING_POPUP4,$USER_RATING_POPUP5;
 	echo '
 	<TABLE BORDER=0>
@@ -348,7 +400,9 @@
 
 	for ($i=1; $i<=count($USER_RATING_QUESTIONS); $i++) {
 		$popup="USER_RATING_POPUP$i";
-		echo '<TR><TD COLSPAN=2><B>'. $USER_RATING_QUESTIONS[$i] .':</B><BR> '.html_build_select_box_from_arrays ($USER_RATING_VALUES,$$popup,"Q_$i",'xzxzx',true,'Unrated').'</TD></TR>';
+		echo '<TR>
+		<TD COLSPAN=2><B>'. $USER_RATING_QUESTIONS[$i] .':</B><BR> '
+		.html_build_select_box_from_arrays($USER_RATING_VALUES,$$popup,"Q_$i",$prev_vote[$i]/*'xzxz'*/,true,'Unrated').'</TD></TR>';
 	}
 
 	echo '
@@ -357,6 +411,11 @@
 	</FORM>';
 }
 
+/**
+ * vote_show_user_rating() - Show a user rating
+ *
+ * @param		int		The user ID
+ */
 function vote_show_user_rating($user_id) {
 	global $USER_RATING_QUESTIONS;
 	$sql="SELECT rate_field,(avg(rating)+3) AS avg_rating,count(*) as count ".
@@ -392,4 +451,16 @@
 	}
 }
 
+/**
+ * vote_remove_all_ratings_by() - Remove all ratings by a particular user
+ * 
+ * @param		int		The user ID
+ */
+function vote_remove_all_ratings_by($user_id) {
+	db_query("
+		DELETE FROM user_ratings 
+		WHERE rated_by='$user_id' 
+	");
+}
+
 ?>



More information about the evolvis-commits mailing list