summaryrefslogtreecommitdiff
path: root/Pigeonholes.php
diff options
context:
space:
mode:
authorwjames5 <will@tekimaki.com>2006-09-20 17:19:59 +0000
committerwjames5 <will@tekimaki.com>2006-09-20 17:19:59 +0000
commit9d88ee52dc217cb733acd70257c9b1845330b6a6 (patch)
tree21f6d2ea27921e758416b666633a1faeccb4fdce /Pigeonholes.php
parentb2a65cf06b643facbc13c8a09f446e5cc462ad7c (diff)
downloadpigeonholes-9d88ee52dc217cb733acd70257c9b1845330b6a6.tar.gz
pigeonholes-9d88ee52dc217cb733acd70257c9b1845330b6a6.tar.bz2
pigeonholes-9d88ee52dc217cb733acd70257c9b1845330b6a6.zip
adds support for universal category REQUEST key to content_list_sql
Diffstat (limited to 'Pigeonholes.php')
-rw-r--r--Pigeonholes.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/Pigeonholes.php b/Pigeonholes.php
index 80b1efd..e0468d9 100644
--- a/Pigeonholes.php
+++ b/Pigeonholes.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.70 2006/09/09 05:59:21 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_pigeonholes/Pigeonholes.php,v 1.71 2006/09/20 17:19:59 wjames5 Exp $
*
* +----------------------------------------------------------------------+
* | Copyright ( c ) 2004, bitweaver.org
@@ -17,7 +17,7 @@
* Pigeonholes class
*
* @author xing <xing@synapse.plus.com>
- * @version $Revision: 1.70 $
+ * @version $Revision: 1.71 $
* @package pigeonholes
*/
@@ -991,7 +991,7 @@ function pigeonholes_content_store( $pObject, $pParamHash ) {
/**
* filter the search with pigeonholes
- * @param $pParamHash['pigeonholes'] - a pigeonhole or an array of pigeonhole content_id
+ * @param $pParamHash['pigeonholes']['filter'] - a pigeonhole or an array of pigeonhole content_id
**/
function pigeonholes_content_list_sql( &$pObject, $pParamHash = NULL ) {
global $gBitSystem;
@@ -1007,6 +1007,16 @@ function pigeonholes_content_list_sql( &$pObject, $pParamHash = NULL ) {
$ret['bind_vars'][] = $pParamHash['pigeonholes']['filter'];
}
}
+ if( !empty( $pParamHash['liberty_categories'] ) ) {
+ $ret['join_sql'] = "LEFT JOIN `".BIT_DB_PREFIX."pigeonhole_members` pm ON (lc .`content_id`= pm.`content_id`)";
+ if ( is_array( $pParamHash['liberty_categories'] ) ) {
+ $ret['where_sql'] = ' AND pm.`parent_id` in ('.implode( ',', array_fill(0, count( $pParamHash['pigeonholes']['filter'] ), '?' ) ).')';
+ $ret['bind_vars'] = $pParamHash['liberty_categories'];
+ } else {
+ $ret['where_sql'] = " AND pm.`parent_id`=? ";
+ $ret['bind_vars'][] = $pParamHash['liberty_categories'];
+ }
+ }
return $ret;
}
?>