diff options
| author | Christian Fowler <spider@viovio.com> | 2009-08-04 01:13:09 +0000 |
|---|---|---|
| committer | Christian Fowler <spider@viovio.com> | 2009-08-04 01:13:09 +0000 |
| commit | 15168eac198dea3c942fa2299a2760aa27e56dbe (patch) | |
| tree | 922b902bd1f24b4e55deb3031616886e7df2b2c5 | |
| parent | 7ee4df2267d935b90bbbd8f02a7420d21521cf09 (diff) | |
| download | liberty-15168eac198dea3c942fa2299a2760aa27e56dbe.tar.gz liberty-15168eac198dea3c942fa2299a2760aa27e56dbe.tar.bz2 liberty-15168eac198dea3c942fa2299a2760aa27e56dbe.zip | |
add hashKey option to getList to specify hashed return array, allow content_id_list in ::getList to allow getting of an arbitrary array of content
| -rw-r--r-- | LibertyContent.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/LibertyContent.php b/LibertyContent.php index da97121..f4f4ffa 100644 --- a/LibertyContent.php +++ b/LibertyContent.php @@ -3,7 +3,7 @@ * Management of Liberty content * * @package liberty -* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.404 2009/05/22 21:00:48 tekimaki_admin Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.405 2009/08/04 01:13:09 spiderr Exp $ * @author spider <spider@steelsun.com> */ @@ -2241,6 +2241,11 @@ class LibertyContent extends LibertyBase { $bindVars[] = ( '%' . strtoupper( $pListHash['find'] ) . '%' ); } + if( !empty( $pListHash['content_id_list'] ) ) { // you can use an array of titles + $whereSql .= " AND lc.`content_id` IN ( ".implode( ',',array_fill( 0,count( $pListHash['content_id_list'] ),'?' ) ).") "; + $bindVars = array_merge( $bindVars, $pListHash['content_id_list'] ); + } + // this is necessary to display useful information in the liberty RSS feed if( !empty( $pListHash['include_data'] ) ) { $selectSql .= ", lc.`data`, lc.`format_guid`"; @@ -2324,6 +2329,12 @@ class LibertyContent extends LibertyBase { $bindVars[] = $pListHash['until_date']; } + // Should results be hashed or sequential indexed + $hashKeySql = ''; + if( !empty( $pListHash['hash_key'] ) ) { + $hashKeySql = $pListHash['hash_key'].' AS `hash_key`, '; + } + if( $gBitSystem->isPackageActive( 'gatekeeper' ) ) { if( $gBitSystem->isPackageActive( 'fisheye' ) ) { // This is really ugly to have in here, and really would be better off somewhere else. @@ -2378,6 +2389,7 @@ class LibertyContent extends LibertyBase { // If sort mode is backlinks then offset is 0, max_records is -1 (again) and sort_mode is nil $query = " SELECT + $hashKeySql uue.`login` AS `modifier_user`, uue.`real_name` AS `modifier_real_name`, uue.`user_id` AS `modifier_user_id`, @@ -2485,7 +2497,11 @@ class LibertyContent extends LibertyBase { $aux['thumbnail_urls'] = liberty_fetch_thumbnails( array( "storage_path" => $aux['image_attachment_path'] ) ); } - $ret[] = $aux; + if( isset( $aux['hash_key'] ) ) { + $ret[$aux['hash_key']] = $aux; + } else { + $ret[] = $aux; + } } } |
