pearweb_index
[ class tree: pearweb_index ] [ index: pearweb_index ] [ all elements ]

Source for file index.php

Documentation is available at index.php

  1. <?php
  2. /*
  3.    +----------------------------------------------------------------------+
  4.    | PEAR Web site version 1.0                                            |
  5.    +----------------------------------------------------------------------+
  6.    | Copyright (c) 2001-2005 The PHP Group                                |
  7.    +----------------------------------------------------------------------+
  8.    | This source file is subject to version 2.02 of the PHP license,      |
  9.    | that is bundled with this package in the file LICENSE, and is        |
  10.    | available at through the world-wide-web at                           |
  11.    | http://www.php.net/license/2_02.txt.                                 |
  12.    | If you did not receive a copy of the PHP license and are unable to   |
  13.    | obtain it through the world-wide-web, please send a note to          |
  14.    | license@php.net so we can mail you a copy immediately.               |
  15.    +----------------------------------------------------------------------+
  16.    | Authors: Martin Jansen <mj@php.net>                                  |
  17.    +----------------------------------------------------------------------+
  18.    $Id$
  19. */
  20.  
  21. require_once 'pear-database-release.php';
  22. require_once 'pepr/pepr.php';
  23. require_once 'pear-database-user.php';
  24.  
  25. $recent = release::getRecent(5);
  26.  
  27. $RSIDEBAR_DATA '';
  28. if (!empty($recent> 0{
  29.     $RSIDEBAR_DATA "<strong>Recent Releases:</strong>\n";
  30.     $RSIDEBAR_DATA .= '<table class="sidebar-releases">' "\n";
  31.     $today date("D, jS M y");
  32.     foreach ($recent as $release{
  33.         $releasedate = format_date(strtotime($release['releasedate'])"D, jS M y");
  34.         if ($releasedate == $today{
  35.             $releasedate "today";
  36.         }
  37.         $RSIDEBAR_DATA .= "<tr><td>";
  38.         $RSIDEBAR_DATA .= "<a href=\"/package/" $release['name'"/\">";
  39.         $RSIDEBAR_DATA .= wordwrap($release['name'],25,"\n",1' ' .
  40.                           $release['version''</a><br /> <small>(' .
  41.                           $releasedate ')</small></td></tr>';
  42.     }
  43.     $feed_link '<a href="/feeds/" title="Information about XML feeds for the PEAR website"><img src="/gifs/feed.png" width="16" height="16" alt="" /></a>';
  44.     $RSIDEBAR_DATA .= "<tr><td>&nbsp;</td></tr>\n";
  45.     $RSIDEBAR_DATA .= '<tr><td style="text-align: right">' $feed_link "</td></tr>\n";
  46.     $RSIDEBAR_DATA .= "</table>\n";
  47. }
  48.  
  49. $popular = release::getPopular(5);
  50. if (!empty($popular)) {
  51.     $RSIDEBAR_DATA .= "<strong>Popular Packages*:</strong>\n";
  52.     $RSIDEBAR_DATA .= '<table class="sidebar-releases">' "\n";
  53.     foreach ($popular as $package{
  54.         $RSIDEBAR_DATA .= "<tr><td>";
  55.         $RSIDEBAR_DATA .= "<a href=\"/package/" $package['name'"/\">";
  56.         $RSIDEBAR_DATA .= wordwrap($package['name'],25,"\n",1' ' $package['version''</a><br /> <small>(' .
  57.                           number_format($package['d'],2')</small></td></tr>';
  58.     }
  59.     $feed_link '<a href="/feeds/" title="Information about XML feeds for the PEAR website"><img src="/gifs/feed.png" width="16" height="16" alt="" /></a>';
  60.     $RSIDEBAR_DATA .= "<tr><td><small>* downloads per day</small></td></tr>\n";
  61.     $RSIDEBAR_DATA .= '<tr><td style="text-align: right">' $feed_link "</td></tr>\n";
  62.     $RSIDEBAR_DATA .= "</table>\n";
  63. }
  64.  
  65. $proposals = proposal::getRecent($dbh5);
  66. if (!empty($proposals)) {
  67.     $RSIDEBAR_DATA .= "<strong>Recently Proposed:</strong>\n";
  68.     $RSIDEBAR_DATA .= '<table class="sidebar-releases">' "\n";
  69.     foreach ($proposals as $proposal{
  70.         $RSIDEBAR_DATA .= "<tr><td>";
  71.         $RSIDEBAR_DATA .= make_link('/pepr/pepr-proposal-show.php?id=' $proposal->idwordwrap($proposal->pkg_category . '::' $proposal->pkg_name,25,"\n",1));
  72.         $RSIDEBAR_DATA .= '<br />by ' . make_link('/user/' htmlspecialchars($proposal->user_handle)$proposal->user_handle);
  73.  
  74.         $RSIDEBAR_DATA .= '</td></tr>';
  75.     }
  76.     $feed_link '<a href="/pepr/" title="PEPR Proposals">See all</a>';
  77.     $RSIDEBAR_DATA .= '<tr><td style="text-align: right">' $feed_link "</td></tr>\n";
  78.     $RSIDEBAR_DATA .= "</table>\n";
  79. }
  80.  
  81. $developers = user::listRecentUsersByKarma('pear.dev'3);
  82.  
  83. if (!empty($developers)) {
  84.  
  85.     $RSIDEBAR_DATA .= "<strong>New Developers:</strong>\n";
  86.     $RSIDEBAR_DATA .= '<table class="sidebar-releases">' "\n";
  87.     foreach ($developers as $developer{
  88.         $RSIDEBAR_DATA .= "<tr><td>";
  89.         $RSIDEBAR_DATA .= make_link('/user/' htmlspecialchars($developer['handle'])$developer['name']'<br />' $developer['handle'];
  90.  
  91.         $RSIDEBAR_DATA .= '</td></tr>';
  92.     }
  93.     $feed_link '<a href="/user/" title="Developers">See all</a>';
  94.     $RSIDEBAR_DATA .= '<tr><td style="text-align: right">' $feed_link "</td></tr>\n";
  95.     $RSIDEBAR_DATA .= "</table>\n";
  96. }
  97.  
  98. $rss_feed = DAMBLAN_RSS_CACHE_DIR . '/pear-news.xml';
  99. if (file_exists($rss_feed)) {
  100.     $blog simplexml_load_file($rss_feed);
  101. }
  102.  
  103. $self strip_tags(htmlspecialchars($_SERVER['PHP_SELF']ENT_QUOTES'iso-8859-1'));
  104.  
  105. $extraHeaders '<link rel="alternate" href="http://blog.pear.php.net/feed/" type="application/rss+xml" title="PEAR News" />';
  106.  
  107. response_header("PEAR - PHP Extension and Application Repository"false$extraHeaders);
  108. ?>
  109.  
  110. <h1>PEAR - PHP Extension and Application Repository</h1>
  111.  
  112. <h2>&raquo; What is it?</h2>
  113.  
  114. <p><abbr title="PHP Extension and Application Repository">PEAR</abbr> is a framework and distribution system for reusable PHP components.</p>
  115.  
  116. <p>Sounds good? Perhaps you might want to know about <strong><a href="/manual/en/installation.php">installing PEAR on your system</a></strong> or <a href="/manual/en/guide.users.commandline.cli.php">installing pear packages</a>.</p>
  117.  
  118. <p>You can find help using PEAR packages in the <a href="/manual/en/">online manual</a> and the <a href="/manual/en/faq.php">FAQ</a>.</p>
  119.  
  120. <?php
  121. if (!$auth_user{
  122. ?>
  123. <p>If you have been told by other PEAR developers to sign up for a PEAR website account, you can use <a href="/account-request.php"> this interface</a>.</p>
  124. <?php
  125. }
  126. ?>
  127. <?php $n = 0; ?>
  128. <h2>&raquo; Hot off the Press</h2>
  129. <div id="news">
  130. <?php if (!empty($blog)) ?>
  131.     <?php foreach ($blog->xpath('//item'as $node?>
  132.         <?php if ($n++ >= 3continue; ?>
  133.         <div class="news-entry">
  134.             <h4><?php print make_link((string)$node->link(string)$node->title)?></h4>
  135.             <?php foreach ($node->children('content'trueas $description?>
  136.                 <?php print $description?>
  137.             <?php ?>
  138.             <p class="news-footer"><?php print $node->creator; ?> <?php print date("jS M Y h:ia"strtotime($node->pubDate))?>. Read <?php print make_link((string)$node->link'more')?> or see <?php print make_link((string)$node->comments'comments')?></p>
  139.         </div>
  140.     <?php ?>
  141. <?php else ?>
  142.     <p>Looks like we don't have an RSS feed. Try adding a cron job to fetch <a href="http://blog.pear.php.net/feed/">http://blog.pear.php.net/feed/</a> and put it in <?php print $rss_feed?></p>
  143.     <pre>wget --output-document=/var/tmp/pear/rss_cache/pear-news.xml http://blog.pear.php.net/feed/</pre>
  144. <?php ?>
  145. </div>
  146. <h2>PEAR Community</h2>
  147. <div style="float: left">
  148. <script type="text/javascript" src="https://www.openhub.net/p/3322/widgets/project_basic_stats.js"></script>
  149. </div>
  150. <h3>Need help?</h3>
  151. <p>
  152.  You can find help and <a href="/support/">support</a> on our
  153.  <a href="http://pear.php.net/support/lists.php">mailing lists</a>
  154.  and <a href="irc://irc.efnet.org/pear">IRC channel</a>.
  155. </p>
  156. <p>
  157.  Our developers are also on
  158.  <a href="http://www.linkedin.com/groups?gid=36298">LinkedIn</a>,
  159.  <a href="https://www.openhub.net/p/pear">OpenHub</a>,
  160.  <a href="https://twitter.com/pear">Twitter</a>
  161.  as well as the <a href="http://wiki.php.net/pear/">wiki</a>.
  162. </p>
  163. <?php
  164. response_footer();

Documentation generated on Mon, 11 Mar 2019 16:01:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.