Index: openacs-4/packages/lars-blogger/www/blog-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/blog-postgresql.xql,v
diff -u -N -r1.9 -r1.10
--- openacs-4/packages/lars-blogger/www/blog-postgresql.xql 28 Jan 2004 15:44:55 -0000 1.9
+++ openacs-4/packages/lars-blogger/www/blog-postgresql.xql 20 Feb 2004 05:43:02 -0000 1.10
@@ -13,64 +13,62 @@
entry_date > current_timestamp - interval '$num_days days'
+
+
+
+
+ and o.creation_user = :blog_user_id
+
-
-
- select entry_id,
- to_char(entry_date, 'YYYY-MM-DD HH24:MI:SS') as entry_date_ansi,
- title,
- title_url,
- category_id,
- content,
- content_format,
- draft_p,
- p.first_names as poster_first_names,
- p.last_name as poster_last_name,
- o.creation_user as user_id,
- (select count(gc.comment_id)
- from general_comments gc, cr_revisions cr
- where gc.object_id = entry_id
- and content_item__get_live_revision(gc.comment_id) = cr.revision_id) as num_comments
- from pinds_blog_entries e join
- acs_objects o on (o.object_id = e.entry_id) join
- persons p on (p.person_id = o.creation_user)
- where package_id = :package_id
- [ad_decode $date_clause "" "" "and $date_clause"]
- and draft_p = 'f'
- and deleted_p = 'f'
- order by entry_date desc
- [ad_decode $limit "" "" "limit $limit"]
-
-
+
+
+ and filt_com.category_id = :blog_sw_category_id
+
+
+
+
+ join category_object_map filt_com
+ on (filt_com.object_id = e.entry_id)
+
+
+
- select entry_id,
- to_char(entry_date, 'YYYY-MM-DD HH24:MI:SS') as entry_date_ansi,
- title,
- title_url,
- category_id,
- content,
- content_format,
- draft_p,
- p.first_names as poster_first_names,
- p.last_name as poster_last_name,
- o.creation_user as user_id,
- (select count(gc.comment_id)
- from general_comments gc, cr_revisions cr
- where gc.object_id = entry_id
- and content_item__get_live_revision(gc.comment_id) = cr.revision_id) as num_comments
- from pinds_blog_entries e join
- acs_objects o on (o.object_id = e.entry_id) join
- persons p on (p.person_id = o.creation_user)
- where package_id = :package_id
- and o.creation_user = :blog_user_id
- [ad_decode $date_clause "" "" "and $date_clause"]
- and draft_p = 'f'
- and deleted_p = 'f'
- order by entry_date desc
- [ad_decode $limit "" "" "limit $limit"]
+ select entry_id,
+ entry_date,
+ to_char(entry_date, 'YYYY-MM-DD HH24:MI:SS')
+ as entry_date_ansi,
+ title,
+ title_url,
+ e.category_id,
+ com.category_id as sw_category_id,
+ content,
+ content_format,
+ draft_p,
+ p.first_names as poster_first_names,
+ p.last_name as poster_last_name,
+ o.creation_user as user_id,
+ (select count(gc.comment_id)
+ from general_comments gc,
+ cr_revisions cr
+ where gc.object_id = entry_id
+ and content_item__get_live_revision(gc.comment_id) =
+ cr.revision_id) as num_comments
+ from pinds_blog_entries e
+ join acs_objects o on (o.object_id = e.entry_id)
+ join persons p on (p.person_id = o.creation_user)
+ left outer join category_object_map com
+ on (com.object_id = e.entry_id)
+ $sw_category_filter_join_clause
+ where package_id = :package_id
+ [ad_decode $date_clause "" "" "and $date_clause"]
+ and draft_p = 'f'
+ and deleted_p = 'f'
+ $user_filter_where_clause
+ $sw_category_filter_where_clause
+ order by entry_date desc, entry_id, com.category_id