diff options
| -rw-r--r-- | BitBlogPost.php | 14 | ||||
| -rw-r--r-- | templates/center_list_blog_posts.php | 3 |
2 files changed, 13 insertions, 4 deletions
diff --git a/BitBlogPost.php b/BitBlogPost.php index 753f05c..4ece384 100644 --- a/BitBlogPost.php +++ b/BitBlogPost.php @@ -1,12 +1,12 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_blogs/BitBlogPost.php,v 1.63 2007/04/11 21:01:07 wjames5 Exp $ + * $Header: /cvsroot/bitweaver/_bit_blogs/BitBlogPost.php,v 1.64 2007/04/25 16:03:49 wjames5 Exp $ * * Copyright (c) 2004 bitweaver.org * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: BitBlogPost.php,v 1.63 2007/04/11 21:01:07 wjames5 Exp $ + * $Id: BitBlogPost.php,v 1.64 2007/04/25 16:03:49 wjames5 Exp $ * * Virtual base class (as much as one can have such things in PHP) for all * derived tikiwiki classes that require database access. @@ -16,7 +16,7 @@ * * @author drewslater <andrew@andrewslater.com>, spiderr <spider@steelsun.com> * - * @version $Revision: 1.63 $ $Date: 2007/04/11 21:01:07 $ $Author: wjames5 $ + * @version $Revision: 1.64 $ $Date: 2007/04/25 16:03:49 $ $Author: wjames5 $ */ /** @@ -668,6 +668,12 @@ class BitBlogPost extends LibertyAttachable { $whereSql .= ' AND lc.`user_id` = ? '; } + if( @$this->verifyId( $pListHash['group_id'] ) ) { + array_push( $bindVars, (int)$pListHash['group_id'] ); + $joinSql .= " INNER JOIN `".BIT_DB_PREFIX."users_groups_map` ugm ON (ugm.`user_id`=uu.`user_id`)"; + $whereSql .= ' AND ugm.`group_id` = ? '; + } + // map user to login in case we used one instead of the other if( !empty( $pListHash['user'] ) ) { $pListHash['login'] = $pListHash['user']; @@ -739,7 +745,7 @@ class BitBlogPost extends LibertyAttachable { $joinSql WHERE lc.`content_type_guid` = ? $whereSql ORDER BY $sort_mode"; - + $query_cant = " SELECT COUNT( * ) FROM `".BIT_DB_PREFIX."blog_posts` bp diff --git a/templates/center_list_blog_posts.php b/templates/center_list_blog_posts.php index e24725b..fbb7608 100644 --- a/templates/center_list_blog_posts.php +++ b/templates/center_list_blog_posts.php @@ -24,6 +24,9 @@ if( empty( $listHash['user_id'] )) { $listHash['user_id'] = $_REQUEST['user_id']; } } +if( @BitBase::verifyId( $_REQUEST['group_id'] ) ) { + $listHash['group_id'] = $_REQUEST['group_id']; +} $blogPosts = $blogPost->getList( $listHash ); $gBitSmarty->assign_by_ref( 'gQueryUserId', $listHash['user_id'] ); |
