cvs: pearweb /public_html pkginfo.php

From: Date: Wed, 26 Dec 2001 03:37:56 +0000
Subject: cvs: pearweb /public_html pkginfo.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-1692@lists.php.net to get a copy of this message
ssb Tue Dec 25 22:37:56 2001 EDT Modified files: /pearweb/public_html pkginfo.php Log: * display releases and files Index: pearweb/public_html/pkginfo.php diff -u pearweb/public_html/pkginfo.php:1.9 pearweb/public_html/pkginfo.php:1.10 --- pearweb/public_html/pkginfo.php:1.9 Fri Nov 16 04:21:07 2001 +++ pearweb/public_html/pkginfo.php Tue Dec 25 22:37:56 2001 @@ -19,15 +19,10 @@ if (!$row) { die ('No package selected (db)'); } -$name = $row['name']; -$summary = $row['summary']; -$license = $row['license']; - -// Releases Data -$maturity = 'stable'; -$release = '1.3'; -$release_date = '2000-01-34'; -$release_notes = 'Bug fix release'; +$name = $row['name']; +$summary = $row['summary']; +$license = $row['license']; +$description = $row['description']; // Accounts data $sth = $dbh->query("SELECT u.handle, u.name, u.email, u.showemail, m.role @@ -44,21 +39,44 @@ $accounts .= "</td></tr>\n"; } +$releases = $dbh->getAll( + "SELECT id, version, state, releasedate, releasenotes + FROM releases + WHERE package = $pacid + ORDER BY releasedate"); +/* +$sth = $dbh->query("SELECT * FROM files WHERE package = $pacid"); +*/ +$sth = $dbh->query("SELECT f.id AS id, f.release AS release, + f.platform AS platform, f.format AS format, + f.md5sum AS md5sum, f.basename AS basename, + f.fullpath AS fullpath, r.version AS version + FROM files f, releases r + WHERE f.package = $pacid AND f.release = r.id"); +while ($sth->fetchInto($row)) { + $downloads[$row['version']][] = $row; +} +print "<pre>";var_dump($downloads);print "</pre>"; + response_header("Package :: $name"); + ?> <!-- PKGINFO start --> -<center><h2><?php echo "$name $release ($maturity)";?></h2></center> -<table border="1" cellspacing="3" cellpadding="3" height="48" width="100%"> +<h2 align="center"><?php echo "$name";?></h2> + +<?php border_box_start("Package Information"); ?> + +<table border="0" cellspacing="2" cellpadding="2" height="48" width="100%"> <tr> <th class="pack" bgcolor="#009933" width="20%">Summary</th> <td><?php echo $summary;?></td> </tr> <tr> - <th class="pack" bgcolor="#009933" width="20%">Accounts</th> + <th class="pack" bgcolor="#009933" width="20%">Maintainers</th> <td> - <!-- Accounts --> + <!-- Maintainers --> <table border="0" cellspacing="1" cellpadding="1" width="100%"> <?php echo $accounts;?> </table> @@ -69,24 +87,56 @@ <td><?php echo $license;?></td> </tr> <tr> - <th class="pack" bgcolor="#009933" width="20%">Release Date</th> - <td><?php echo $release_date;?></td> -</tr> -<tr> - <th class="pack" bgcolor="#009933" width="20%">Release Notes</th> - <td><?php echo $release_notes;?></td> + <th class="pack" bgcolor="#009933" width="20%">Description</th> + <td><?php echo $description;?>&nbsp;</td> </tr> </table> + +<?php border_box_end(); ?> + <br> <table border="0" cellspacing="3" cellpadding="3" height="48" width="100%" align="center"> <tr> - <td width="33%" align="center">| View Source Code &amp;<br> Doc On-line |</td> + <td width="33%" align="center">| View Source Code &amp; Docs |</td> <td width="33%" align="center">| View ChangeLog |</td> <td width="33%" align="center">| Download Now |</td> </tr> </table> + +<br> + +<?php border_box_start("Available Releases"); ?> + +<table border="0" cellspacing="0" cellpadding="3" width="100%"> + <th align="left">Version</th> + <th align="left">State</th> + <th align="left">Release Date</th> + <th align="left">Downloads</th> + </tr> +<?php + +foreach ($releases as $rel) { + print " <tr>\n"; + if (empty($rel['state'])) { + $rel['state'] = 'devel'; + } + $rel['releasedate'] = substr($rel['releasedate'], 0, 10); + $downloads_html = ''; + foreach ($downloads[$rel['version']] as $dl) { + $downloads_html .= "<a href=\"download.php?fileid={$dl['id']}\">". + "{$dl['basename']}</a><br />"; + } + printf(" <td>%s</td><td>%s</td><td>%s</td><td>%s</td>\n", + $rel['version'], $rel['state'], $rel['releasedate'], + $downloads_html); + print " </tr>\n"; +} + +?></table> +<?php border_box_end(); ?> + +<!-- Package Dependencies <br> -<!-- Package Dependencies --> <table border="0" cellspacing="3" cellpadding="3" width="100%"> <tr> <th class="others" colspan="3" bgcolor="#DDDDDD">Net_Ping dependencies:</th> @@ -103,8 +153,9 @@ <td colspan="3" align="center">&nbsp;<br>| Download All Packages |</td> </tr> </table> +--> +<!-- Related Links <br> -<!-- Related Links --> <table border="0" cellspacing="3" cellpadding="3" width="100%"> <tr> <th class="others" colspan="3" bgcolor="#DDDDDD">Related Links:</th> @@ -114,8 +165,9 @@ <td>Description</td> </tr> </table> +--> +<!-- Other releases download <br> -<!-- Other releases download --> <table border="0" cellspacing="3" cellpadding="3" width="100%"> <tr> <th class="others" colspan="3" bgcolor="#DDDDDD">Other releases download:</th> @@ -125,6 +177,7 @@ </tr> </table> <br> +--> <!-- PKGINFO end -->

« previous php.pear.cvs (#1692) next »