Recent Topics

1 Jan 26, 2006 22:08    

<div class="bSideItem"> 
   <h3><?php echo T_('Recent Posts') ?></h3> 
   <ul> 
   <?php   // Get the 10 last posts for each blog: 
   $BlogBList = & new ItemList( $blog,  '', '', '', '', '', array(), '', 'DESC', '', 10, '', '', '', '', '', '', '', 'posts' ); 
   while( $Item = $BlogBList->get_item() ) { ?> 
      <li lang="<?php $Item->lang() ?>"> 
      <a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', false ); ?></a> 
      </li> 
      <?php } ?> 
   <li><a href="<?php blog_list_iteminfo('blogurl', 'raw' ) ?>"><?php echo T_('More posts...') ?></a></li> 
   </ul> 
   </div>

I'm looking for a way to change this listing such that the 'recent posts' will show posts in a status other than published which is what this does now.

Thanks ahead for any attention to this request.

2 Jan 27, 2006 22:27

[url=http://doc.b2evolution.net/0.9.0/evocore/ItemList.html#ItemList]Here are the docs for ItemList[/url]. It looks like the second parameter is an array of post statuses. I would guess you would do something like this:

$BlogBList = & new ItemList( $blog,  array('draft', 'private', 'protected', 'published') , '', '', '', '', array(), '', 'DESC', '', 10, '', '', '', '', '', '', '', 'posts' );


But I have not tested this.

3 Jan 28, 2006 00:22

This did work. Appears that the default is to display only 'published' posts. I had seen the technical documentation but had not worked out the listing protocol for the array. There is a wealth of info in that area for sure, some how to's or examples of its use would be a killer addition to that base of knowledge.

Thanks again!

for those interested the recent comment listing has a similar setup information here: http://doc.b2evolution.net/0.9.0/evocore/CommentList.html#methodCommentList


Form is loading...