From 8b4bc4431f50a5442344b3159e12329c3ebb36a9 Mon Sep 17 00:00:00 2001 From: Tekimaki Date: Thu, 2 Apr 2009 16:53:27 +0000 Subject: add option to mod list results by excluding by content_type_guid -- move out of group to liberty --- LibertyContent.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/LibertyContent.php b/LibertyContent.php index 2e25ff1..790b99f 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.397 2009/03/31 06:35:40 lsces Exp $ +* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.398 2009/04/02 16:53:27 tekimaki_admin Exp $ * @author spider */ @@ -2287,6 +2287,7 @@ class LibertyContent extends LibertyBase { } } + // join on specific content_type_guids if( !empty( $pListHash['content_type_guid'] ) && is_string( $pListHash['content_type_guid'] ) ) { $whereSql .= ' AND lc.`content_type_guid`=? '; $bindVars[] = $pListHash['content_type_guid']; @@ -2295,6 +2296,15 @@ class LibertyContent extends LibertyBase { $bindVars = array_merge( $bindVars, $pListHash['content_type_guid'] ); } + // exclude by content_type_guids + if( !empty( $pListHash['exclude_content_type_guid'] ) && is_string( $pListHash['exclude_content_type_guid'] ) ) { + $whereSql .= " AND lc.`content_type_guid` != ?"; + $bindVars[] = $pListHash['exclude_content_type_guid']; + } elseif( !empty( $pListHash['exclude_content_type_guid'] ) && is_array( $pListHash['exclude_content_type_guid'] ) ) { + $whereSql .= " AND lc.`content_type_guid` NOT IN ( ".implode( ',',array_fill ( 0, count( $pListHash['exclude_content_type_guid'] ),'?' ) )." )"; + $bindVars = array_merge( $bindVars, $pListHash['exclude_content_type_guid'] ); + } + // only display content modified more recently than this (UTC timestamp) if( !empty( $pListHash['from_date'] ) ) { $whereSql .= ' AND lc.`last_modified` >= ?'; -- cgit v1.3