Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 77503 Details for
Bug 201946
[patch] Update Projects landing page to use the ProjectInfo table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to projects/index.php to update to ProjectInfo
projects-index.php.patch (text/plain), 7.31 KB, created by
Karl Matthias
on 2007-08-31 15:28:04 EDT
(
hide
)
Description:
Patch to projects/index.php to update to ProjectInfo
Filename:
MIME Type:
Creator:
Karl Matthias
Created:
2007-08-31 15:28:04 EDT
Size:
7.31 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P www-projects >Index: index.php >=================================================================== >RCS file: /home/data/cvs/org.eclipse/www/projects/index.php,v >retrieving revision 1.62 >diff -u -r1.62 index.php >--- index.php 9 Aug 2007 17:36:07 -0000 1.62 >+++ index.php 31 Aug 2007 19:28:19 -0000 >@@ -14,7 +14,7 @@ > <style> > a.info{ > position:relative; /*this is the key*/ >- z-index:24; >+ z-index:24; > text-decoration:none} > > a.info:hover{z-index:25; background-color:#ccc} >@@ -34,7 +34,7 @@ > > <?php /* ------------------ R E V I E W S -------------------- */ ?> > <div class="homeitem3col"> >-<h3><a href="/projects/reviews-rss.php"><img src="images/rss.gif" align="right" >+<h3><a href="/projects/reviews-rss.php"><img src="images/rss.gif" align="right" > border="0"></a>Project Reviews</h3> > <div align="center" style="margin-top: 10px;"> > <?php include("fragments/processes-page-table.php") ?> >@@ -45,7 +45,7 @@ > </tr> > </table> > <p>Reviews are held on a conference call. Members and committers are directed to the >- <a href="http://portal.eclipse.org/"> MyFoundation portal </a>for the call-in information. If you do not have access to the >+ <a href="http://portal.eclipse.org/"> MyFoundation portal </a>for the call-in information. If you do not have access to the > portal, send <a href="mailto:emo@eclipse.org?Subject=Review Call Information">email to EMO</a> to request the call information.</p> > </div><!-- homeitem3col --> > >@@ -74,7 +74,7 @@ > while( $row = mysql_fetch_assoc($result) ) { > // ---- Exclude internal and archived projects ---- > if( !$row['IsActive'] ) continue; >- if( $row['ProjectID'] == "foundation-internal" >+ if( $row['ProjectID'] == "foundation-internal" > || $row['ParentProjectID'] == 'foundation-internal' ) continue; > if( $row['ProjectPhase'] == 'Archive' > || strpos( $row['Name'], "[archived]") >@@ -82,13 +82,13 @@ > if( $row['Level'] == 0 ) continue; > $border = ''; > if( $row['Level'] == 1 ) $border = ' style="border-top: 2px solid #444;"'; >- >+ > // ---- Project name and Home page ---- > $spacer = ''; > if( $row['Level'] == 2 ) $spacer = ' '; > ?><tr><td <?= $border ?>><?= $spacer ?> <a href="<?= $row['UrlIndex'] ?>"><?= $row['Name'] ?></a><?php > ?></td><?php >- >+ > // ---- Phase ---- > if( $row['ProjectPhase'] == 'Regular' ) { > ?><td <?= $border ?>><a href="explain/projects-table-phase.php"><img src="/projects/images/ok.gif" align="middle" border="0"></a></td><?php >@@ -99,105 +99,60 @@ > } else { > ?><td <?= $border ?>> </td><?php > } >- >- $xml = null; >- if( $row['UrlIndex'] ) { >- $url = $row['UrlIndex'] . "/project-info/project-info.xml"; >- /* if on eclipse */ >- if(eregi("eclipse.org", $_SERVER['SERVER_NAME'])) >- { >- if(eregi("eclipse.org", $url)) >- { >- $sites = array("http://eclipse.org", "http://www.eclipse.org"); >- $oldurl = $url; >- $url = str_replace($sites, $_SERVER['DOCUMENT_ROOT'], $url); >- } >- } >- $buffer = @file_get_contents( $url ); >- if( $buffer ) { >- try { >- $xml = @new SimpleXMLElement($buffer); >- } catch( Exception $x ) { >- $xml = null; >- } >- } >- } >- >+ >+ // ---- CONNECT TO ProjectInfo ---- >+ require_once("/home/data/httpd/eclipse-php-classes/system/dbconnection_projectinfo_ro.class.php"); >+ $_dbcpi = new DBConnectionProjectInfo(); >+ $_dbhpi = $_dbcpi->connect(); >+ > // ---- Newsgroup ---- >- $newsurl = ''; >- if( $xml ) { >- $t1 = 'newsgroups'; >- $t2 = $xml->$t1; >- if( $t2 ) { >- $newsurl = $t2['url']; >- } >- if( !$newsurl ) { >- $t3 = $t2->newsgroup[0]; >- if( $t3 ) { >- # $newsurl = 'http://dev.eclipse.org/newslists/news.' . $t3['name'] . '/maillist.html'; >- $newsurl = 'http://www.eclipse.org/newsportal/thread.php?group=' . $t3['name']; >- } >+ $newsurl = getProjInfValue($row['ProjectID'], 'newsgroup', 'name', $_dbhpi); >+ if($newsurl !== NULL) { >+ if(!preg_match('/www.eclipse.org/', $mailurl)) { >+ $newsurl = 'http://www.eclipse.org/newsportal/thread.php?group=' . $newsurl; > } >- } >- if( $newsurl && $newsurl != '' ) { > ?><td <?= $border ?>><a href="<?= $newsurl ?>"><img src="/home/categories/images/newsgroups.gif" border="0"></a></td><?php > } else { > ?><td <?= $border ?>> </td><?php > } > >+ > // ---- Mailing List ---- >- $mailurl = ''; >- if( $xml ) { >- $t1 = 'mailing-lists'; >- $t2 = $xml->$t1; >- if( $t2 ) { >- $mailurl = $t2['url']; >+ $mailurl = getProjInfValue($row['ProjectID'], 'mailinglist', 'name', $_dbhpi); >+ if($mailurl !== NULL) { >+ if(!preg_match('/dev.eclipse.org/', $mailurl)) { >+ $mailurl = 'https://dev.eclipse.org/mailman/listinfo/' . $mailurl; > } >- if( !$mailurl ) { >- $t3 = $t2->list[0]; >- if( $t3 ) { >- $mailurl = 'https://dev.eclipse.org/mailman/listinfo/' . $t3['name']; >- } >- } >- } >- if( $mailurl && $mailurl != '' ) { > ?><td <?= $border ?>><a href="<?= $mailurl ?>"><img src="/home/categories/images/mailinglist.gif" border="0"></a></td><?php > } else { > ?><td <?= $border ?>> </td><?php > } > >+ > // ---- Wiki ---- >- $wikiurl = ''; >- if( $xml ) { >- $t2 = $xml->wiki; >- if( $t2 ) { >- $wikiurl = $t2['url']; >+ $wikiurl = getProjInfValue($row['ProjectID'], 'wikiurl', NULL, $_dbhpi); >+ if($wikiurl !== NULL) { >+ if(!preg_match('/wiki.eclipse.org/', $wikiurl)) { >+ $wikiurl = "http://wiki.eclipse.org/$wikiurl"; > } >- } >- if( $wikiurl && $wikiurl != '' ) { > ?><td <?= $border ?>><a href="<?= $wikiurl ?>"><img src="/home/categories/images/wiki.gif" border="0"></a></td><?php > } else { > ?><td <?= $border ?>> </td><?php > } > >+ > // ---- IP Log ---- >- $logurl = ''; >- if( $xml ) { >- $t1 = 'ip-log'; >- $t2 = $xml->$t1; >- if( $t2 ) { >- $logurl = $t2['url']; >- } >- } >- if( $logurl && $logurl != '' ) { >+ $logurl = getProjInfValue($row['ProjectID'], 'iplogurl', NULL, $_dbhpi); >+ if($logurl !== NULL) { > ?><td <?= $border ?>><a href="<?= $logurl ?>"><img src="/home/categories/images/docs.gif" border="0"></a></td><?php > } else { > ?><td <?= $border ?>> </td><?php > } > > // ---- Downloads ---- >- if( $row['UrlDownload'] ) { >- ?><td <?= $border ?>><a href="<?= $row['UrlDownload'] ?>"><img border="0" src="/home/categories/images/download.gif"></a></td><?php >+ $downloadsurl = getProjInfValue($row['ProjectID'], 'downloadsurl', NULL, $_dbhpi); >+ if($downloadsurl !== NULL) { >+ ?><td <?= $border ?>><a href="<?= $downloadsurl ?>"><img border="0" src="/home/categories/images/download.gif"></a></td><?php > } else { > ?><td <?= $border ?>> </td><?php > } >@@ -244,10 +199,25 @@ > > </div><!-- maincontent --> > <?php >- # Paste your HTML content between the EOHTML markers! >+ # Paste your HTML content between the EOHTML markers! > $html = ob_get_contents(); > ob_end_clean(); > > # Generate the web page > $App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); >+ >+# Return the requested ProjectInfoValue >+function getProjInfValue($ProjectID, $MainKey, $SubKey, $dbh) { >+ if($SubKey != NULL) { >+ $SubKey = "AND SubKey = '$SubKey'"; >+ } >+ $query = "SELECT Value FROM ProjectInfo as PI, ProjectInfoValues as PIV " . >+ "WHERE PI.ProjectInfoID = PIV.ProjectInfoID " . >+ "AND MainKey = '$MainKey' $SubKey " . >+ "AND ProjectID = '$ProjectID'"; >+ $result = mysql_query($query, $dbh); >+ $row = mysql_fetch_assoc($result); >+ >+ return $row['Value']; >+} > ?>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 201946
: 77503