FW: Is there a way to access recent package proposals?
| From: | Steph | Date: | Thu, 02 Sep 2004 19:27:02 +0000 |
| Subject: | FW: Is there a way to access recent package proposals? | ||
| Groups: | php.pear.webmaster | ||
| Request: | Send a blank email to pear-webmaster+get-3050@lists.php.net to get a copy of this message | ||
And the quotemark was in the wrong place (blame c&p).. should be ok now.
class proposal {
// {{{ * proto array proposal::getRecent([int]) API 1.0
/**
* Get list of recent PEAR package proposals
*
* @access public
* @param limit Number of proposals to return
* @return array
*/
function getRecent($limit = 5) {
global $dbh;
$sth = $dbh->limitQuery("SELECT id, ".
"pkg_category, ".
"pkg_name, ".
"pkg_license, ".
"pkg_describtion, ". /* typo is in db! don't
fix */
"pkg_deps, ".
"draft_date, ".
"proposal_date ".
"user_handle ".
"FROM package_proposals ".
"WHERE status = 'proposal' ".
"ORDER BY proposal_date DESC, 0, $limit");
$recent = array();
while ($sth->fetchInto($row, DB_FETCHMODE_ASSOC)) {
$recent[] = $row;
}
return $recent;
}
// }}}
}
-----Original Message-----
From: Steph [mailto:steph@zend.com]
Sent: 02 September 2004 20:24
To: PEAR Webmasters
Subject: FW: Is there a way to access recent package proposals?
I'll get around to learning to code one day <sigh />
class proposal {
// {{{ * proto array proposal::getRecent([int]) API 1.0
/**
* Get list of recent PEAR package proposals
*
* @access public
* @param limit Number of proposals to return
* @return array
*/
function getRecent($limit = 5) {
global $dbh;
$sth = $dbh->limitQuery("SELECT id, ".
"pkg_category, ".
"pkg_name, ".
"pkg_license, ".
"pkg_describtion, ". /* typo is in db! don't
fix */
"pkg_deps, ".
"draft_date, ".
"proposal_date ".
"user_handle ".
"FROM package_proposals ".
"WHERE status = 'proposal' ".
"ORDER BY proposal_date DESC, 0, $limit");
$recent = array();
while ($sth->fetchInto($row, DB_FETCHMODE_ASSOC)) {
$recent[] = $row;
}
return $recent;
}
// }}}
}
-----Original Message-----
From: Steph [mailto:steph@zend.com]
Sent: 02 September 2004 20:16
To: PEAR Webmasters
Subject: Is there a way to access recent package proposals?
Hi guys and gals,
I haven't found an existing function in CVS that will list recent PEAR
package proposals - is this correct?
If so, would it be possible to add the following (or something like it) to
peclweb/include/pear-database.php?
class proposal {
// {{{ * proto array proposal::getRecent([int]) API 1.0
/**
* Get list of recent PEAR package proposals
*
* @access public
* @param limit Number of proposals to return
* @return array
*/
function proposal::getRecent($limit = 5) {
global $dbh;
$sth = $dbh->limitQuery("SELECT id, ".
"pkg_category, ".
"pkg_name, ".
"pkg_license, ".
"pkg_describtion, ". /* typo is in db! don't
fix */
"pkg_deps, ".
"draft_date, ".
"proposal_date ".
"user_handle ".
"FROM package_proposals ".
"WHERE status = 'proposal' ".
"ORDER BY proposal_date DESC", 0, $limit);
$recent = array();
while ($sth->fetchInto($row, DB_FETCHMODE_ASSOC)) {
$recent[] = $row;
}
return $recent;
}
// }}}
}
Thanks all
- Steph
DevZone Editor
www.zend.com