cvs: pearweb /include pear-config.php pear-format-html.php /include/Damblan/RSS PEPr.php /include/pepr pepr.php /public_html search.php
/public_html/feeds index.php /public_html/pepr pepr-overview.php

From: Date: Sun, 05 Sep 2004 21:47:09 +0000
Subject: cvs: pearweb /include pear-config.php pear-format-html.php /include/Damblan/RSS PEPr.php /include/pepr pepr.php /public_html search.php
/public_html/feeds index.php /public_html/pepr pepr-overview.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-23670@lists.php.net to get a copy of this message
toby Sun Sep 5 17:47:09 2004 EDT Modified files: /pearweb/include pear-config.php pear-format-html.php /pearweb/include/Damblan/RSS PEPr.php /pearweb/include/pepr pepr.php /pearweb/public_html search.php /pearweb/public_html/feeds index.php /pearweb/public_html/pepr pepr-overview.php Log: * Adding PEPr search facilities.

http://cvs.php.net/diff.php/pearweb/include/pear-config.php?r1=1.25&r2=1.26&ty=u Index: pearweb/include/pear-config.php diff -u pearweb/include/pear-config.php:1.25 pearweb/include/pear-config.php:1.26 --- pearweb/include/pear-config.php:1.25 Tue Aug 31 04:37:14 2004 +++ pearweb/include/pear-config.php Sun Sep 5 17:47:08 2004 @@ -14,7 +14,7 @@ * @category pearweb * @copyright Copyright (c) 1997-2004 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License - * @version $Id: pear-config.php,v 1.25 2004/08/31 08:37:14 mj Exp $ + * @version $Id: pear-config.php,v 1.26 2004/09/05 21:47:08 toby Exp $ */ if (isset($_SERVER['PEAR_TMPDIR'])) { @@ -256,5 +256,7 @@ * PEPr: the string put on the end of each email */ define('PROPOSAL_EMAIL_POSTFIX', "\n\n-- \nSent by PEPr, the automatic proposal system at http://pear.php.net"); + +define('PROPOSAL_OVERVIEW_FINISHED', 10); ?> http://cvs.php.net/diff.php/pearweb/include/pear-format-html.php?r1=1.148&r2=1.149&ty=u Index: pearweb/include/pear-format-html.php diff -u pearweb/include/pear-format-html.php:1.148 pearweb/include/pear-format-html.php:1.149 --- pearweb/include/pear-format-html.php:1.148 Thu Aug 26 13:31:54 2004 +++ pearweb/include/pear-format-html.php Sun Sep 5 17:47:08 2004 @@ -15,7 +15,7 @@ +----------------------------------------------------------------------+ | Authors: | +----------------------------------------------------------------------+ - $Id: pear-format-html.php,v 1.148 2004/08/26 17:31:54 danielc Exp $ + $Id: pear-format-html.php,v 1.149 2004/09/05 21:47:08 toby Exp $ */ PEAR::setErrorHandling(PEAR_ERROR_CALLBACK, 'error_handler'); @@ -214,6 +214,7 @@ <option value="pear-dev">Developer mailing list</option> <option value="pear-general">General mailing list</option> <option value="pear-cvs">CVS commits mailing list</option> + <option value="pepr">PEPr proposals</option> </select> <input type="image" src="/gifs/small_submit_white.gif" alt="search" style="vertical-align: middle;" /> </p> http://cvs.php.net/diff.php/pearweb/include/Damblan/RSS/PEPr.php?r1=1.1&r2=1.2&ty=u Index: pearweb/include/Damblan/RSS/PEPr.php diff -u pearweb/include/Damblan/RSS/PEPr.php:1.1 pearweb/include/Damblan/RSS/PEPr.php:1.2 --- pearweb/include/Damblan/RSS/PEPr.php:1.1 Sat Sep 4 21:36:21 2004 +++ pearweb/include/Damblan/RSS/PEPr.php Sun Sep 5 17:47:09 2004 @@ -15,7 +15,7 @@ +----------------------------------------------------------------------+ | Author: Martin Jansen <mj@php.net> | +----------------------------------------------------------------------+ - $Id: PEPr.php,v 1.1 2004/09/05 01:36:21 toby Exp $ + $Id: PEPr.php,v 1.2 2004/09/05 21:47:09 toby Exp $ */ require_once "pear-database.php"; @@ -28,7 +28,7 @@ * @author Martin Jansen <mj@php.net> * @package Damblan * @category RSS - * @version $Revision: 1.1 $ + * @version $Revision: 1.2 $ */ class Damblan_RSS_PEPr extends Damblan_RSS_Common { @@ -42,16 +42,26 @@ if (isset($proposalStatiMap[$value])) { $this->setTitle("PEPr: Latest proposals with status " . $proposalStatiMap[$value]); $this->setDescription("The latest PEPr proposals with status " . $proposalStatiMap[$value]); + $items = proposal::getAll($dbh, @$value, 10); + } else if(substr($value, 0, 6) == 'search') { + $searchString = substr($value, 7); + $this->setTitle("PEPr: Latest proposals containing " . $searchString); + $this->setDescription("The latest PEPr proposals containing " . $searchString); + $items = proposal::search($searchString); } else { $this->setTitle("PEPr: Latest proposals."); $this->setDescription("The latest PEPr proposals."); $value = null; + $items = proposal::getAll($dbh, @$value, 10); } + + - $items = proposal::getAll($dbh, @$value, 10); foreach ($items as $id => $item) { $item = $item->toRSSArray(); $this->addItem($this->newItem($item['title'], $item['link'], $item['desc'], $item['date'])); } } } + +?> http://cvs.php.net/diff.php/pearweb/include/pepr/pepr.php?r1=1.51&r2=1.52&ty=u Index: pearweb/include/pepr/pepr.php diff -u pearweb/include/pepr/pepr.php:1.51 pearweb/include/pepr/pepr.php:1.52 --- pearweb/include/pepr/pepr.php:1.51 Sun Sep 5 09:33:47 2004 +++ pearweb/include/pepr/pepr.php Sun Sep 5 17:47:09 2004 @@ -22,7 +22,7 @@ * @author Daniel Convissor <danielc@php.net> * @copyright Copyright (c) 1997-2004 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License - * @version $Id: pepr.php,v 1.51 2004/09/05 13:33:47 toby Exp $ + * @version $Id: pepr.php,v 1.52 2004/09/05 21:47:09 toby Exp $ */ /**#@+ @@ -275,6 +275,36 @@ } return $result; } + + function &search($searchString) { + global $dbh; + $replacers = array( + '/ /', '/%/', '/_/', '/\*/', '/\?/'); + $replacements = array( + '%', '\%', '\_', '%', '_'); + $searchString = "%".preg_replace($replacers, $replacements, $searchString)."%"; + + $sql = "SELECT *, UNIX_TIMESTAMP(draft_date) as draft_date, + UNIX_TIMESTAMP(proposal_date) as proposal_date, + UNIX_TIMESTAMP(vote_date) as vote_date, + UNIX_TIMESTAMP(longened_date) as longened_date + FROM package_proposals + WHERE pkg_describtion LIKE ".$dbh->quoteSmart($searchString)." + OR pkg_name LIKE ".$dbh->quoteSmart($searchString)." + OR pkg_category LIKE ".$dbh->quoteSmart($searchString); + + $res = $dbh->query($sql); + if (DB::isError($res)) { + return $res; + } + $result = array(); + while ($set = $res->fetchRow(DB_FETCHMODE_ASSOC)) { + $result[$set['id']] =& new proposal($set); + } + return $result; + } + + function getLinks(&$dbh) { http://cvs.php.net/diff.php/pearweb/public_html/search.php?r1=1.9&r2=1.10&ty=u Index: pearweb/public_html/search.php diff -u pearweb/public_html/search.php:1.9 pearweb/public_html/search.php:1.10 --- pearweb/public_html/search.php:1.9 Sat Jun 19 15:29:33 2004 +++ pearweb/public_html/search.php Sun Sep 5 17:47:09 2004 @@ -15,7 +15,7 @@ +----------------------------------------------------------------------+ | Authors: Martin Jansen <mj@php.net> | +----------------------------------------------------------------------+ - $Id: search.php,v 1.9 2004/06/19 19:29:33 danielc Exp $ + $Id: search.php,v 1.10 2004/09/05 21:47:09 toby Exp $ */ if (!isset($_POST['search_in']) || !isset($_POST['search_string'])) { @@ -46,6 +46,11 @@ case 'site': header('Location: http://google.com/search?as_sitesearch=pear.php.net' . '&as_q=' . urlencode($_POST['search_string'])); + break; + +case 'pepr': + header('Location: /pepr/pepr-overview.php?search=' + . urlencode($_POST['search_string'])); break; default: http://cvs.php.net/diff.php/pearweb/public_html/feeds/index.php?r1=1.6&r2=1.7&ty=u Index: pearweb/public_html/feeds/index.php diff -u pearweb/public_html/feeds/index.php:1.6 pearweb/public_html/feeds/index.php:1.7 --- pearweb/public_html/feeds/index.php:1.6 Sun Sep 5 10:09:32 2004 +++ pearweb/public_html/feeds/index.php Sun Sep 5 17:47:09 2004 @@ -15,7 +15,7 @@ +----------------------------------------------------------------------+ | Authors: Martin Jansen <mj@php.net> | +----------------------------------------------------------------------+ - $Id: index.php,v 1.6 2004/09/05 14:09:32 toby Exp $ + $Id: index.php,v 1.7 2004/09/05 21:47:09 toby Exp $ */ response_header('Syndication Feeds'); ?> @@ -57,6 +57,14 @@ <li><?php echo make_link('/feeds/pepr_proposal.rss'); ?>: Last recent proposals with status "Proposal"</li> <li><?php echo make_link('/feeds/pepr_vote.rss'); ?>: Last recent proposals with status "Vote"</li> <li><?php echo make_link('/feeds/pepr_finished.rss'); ?>: Last recent proposals with status "Finished"</li> + </ul> + </li> + <li>PEPr proposal search feeds: + <ul> + <li><?php echo make_link('/feeds/pepr_config.rss'); ?>: Receive all proposals containing "config"</li> + <li><?php echo make_link('/feeds/pepr_XML.rss'); ?>: Receive all proposals containing "XML"</li> + <li><?php echo make_link('/feeds/pepr_search_table+config.rss'); ?>: Receive proposals containing "table" and "config"</li> + <li>Model searches with URL encoded strings.</li> </ul> </li> </ul> http://cvs.php.net/diff.php/pearweb/public_html/pepr/pepr-overview.php?r1=1.11&r2=1.12&ty=u Index: pearweb/public_html/pepr/pepr-overview.php diff -u pearweb/public_html/pepr/pepr-overview.php:1.11 pearweb/public_html/pepr/pepr-overview.php:1.12 --- pearweb/public_html/pepr/pepr-overview.php:1.11 Sun Sep 5 10:00:52 2004 +++ pearweb/public_html/pepr/pepr-overview.php Sun Sep 5 17:47:09 2004 @@ -20,7 +20,7 @@ * @author Daniel Convissor <danielc@php.net> * @copyright Copyright (c) 1997-2004 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License - * @version $Id: pepr-overview.php,v 1.11 2004/09/05 14:00:52 toby Exp $ + * @version $Id: pepr-overview.php,v 1.12 2004/09/05 21:47:09 toby Exp $ */ /** @@ -38,14 +38,22 @@ $order = ' pkg_category ASC, pkg_name ASC'; } -$proposals =& proposal::getAll($dbh, @$selectStatus, null, @$order); +if (isset($_GET['search'])) { + $searchString = trim($_GET['search']); + $searchString = preg_replace('/;/', '', $searchString); + $proposals = proposal::search($searchString); + $searchPostfix = '_search_'.urlencode($searchString); +} else { + $proposals =& proposal::getAll($dbh, @$selectStatus, null, @$order); + $searchPostfix = ''; +} response_header('PEPr :: Package Proposals'); echo '<h1>Package Proposals</h1>' . "\n"; if ($selectStatus == '') { echo "<p>"; - echo "<a href='/feeds/pepr.rss'>Aggregate this.</a>"; + echo "<a href='/feeds/pepr$searchPostfix.rss'>Aggregate this.</a>"; echo "</p>"; } @@ -62,7 +70,7 @@ echo "</ul>"; if ($last_status !== false) { echo "<p>"; - echo "<a href='/feeds/pepr_".$proposal->getStatus().".rss'>Aggregate this.</a>"; + echo "<a href='/feeds/pepr_".$last_status.".rss'>Aggregate this.</a>"; echo "</p>"; } echo '<h2 name="' . $proposal->getStatus() . '" id="'; @@ -123,16 +131,17 @@ echo "</li>\n"; } -if ($selectStatus == '') { +if ($selectStatus == '' && isset($proposal) && $proposal->getStatus() == 'finished') { print_link('pepr-overview.php?filter=finished', 'All finished proposals'); } echo "</ul>"; -echo "<p>"; -echo "<a href='/feeds/pepr_".$proposal->getStatus().".rss'>Aggregate this.</a>"; -echo "</p>"; - +if (isset($proposal)) { + echo "<p>"; + echo "<a href='/feeds/pepr_".@$proposal->getStatus().".rss'>Aggregate this.</a>"; + echo "</p>"; +} response_footer(); ?>
« previous php.pear.cvs (#23670) next »