Recent Topics

1 Jun 05, 2012 12:50    

My b2evolution Version: 4.1.x

set up a test installation here http://tecexplore.com/three/index.php

I'm enjoying exploring B2 Evo before I go for the real install.

I've set things up to aggregate from 3 other blogs. It seems to aggregate all the pages from the other blogs too which is not what I want. I figured how to limit this but what I really want to do is show only a page created in the aggregate blog. Seems that I can't create a page in the blog once I make it the aggregate - only pages from other blogs - I'm confused.

Next question. In the aggregate blog rather than show the full posting I'd rather just show the title and a link back to the posting in the original blog it came from. How would I do this.

2 Jun 06, 2012 15:09

Then instead of aggregating other blogs you can do this. Edit the file index.main.php

replace this code

<?php
	// --------------------------------- START OF POSTS -------------------------------------
	// Display message if no post:
	display_if_empty();

	while( $Item = & mainlist_get_item() )
	{	// For each blog post:
		// ---------------------- ITEM BLOCK INCLUDED HERE ------------------------
		skin_include( '_item_block.inc.php', array(
				'content_mode' => 'auto',		// 'auto' will auto select depending on $disp-detail
				'image_size'	 =>	'fit-400x320',
			) );
		// ----------------------------END ITEM BLOCK  ----------------------------
	} // ---------------------------------- END OF POSTS ------------------------------------
?>

with this

<?php
	if( $blog == 1 ) // "Blog All" ID
	{
		$GLOBALS['MainList'] = NULL;

		$BlogCache = & get_BlogCache();
		$public_blogs = $BlogCache->load_public();

		$SQL = new SQL();
		$SQL->SELECT( 'T_items__item.*' );
		$SQL->FROM( 'T_categories
						INNER JOIN T_postcats ON cat_ID = postcat_cat_ID
						INNER JOIN T_items__item ON postcat_post_ID = post_ID' );
		$SQL->WHERE( 'cat_blog_ID IN ('.implode(',',$public_blogs).')' );
		$SQL->WHERE_and( 'cat_blog_ID != '.$DB->quote($blog) );
		$SQL->WHERE_and( 'post_status = "published"' );
		$SQL->WHERE_and( 'post_ptyp_ID = 1' );
		$SQL->WHERE_and( 'post_datestart <= "'.remove_seconds( time() ).'"' );
		$SQL->LIMIT( 50 );
		$SQL->GROUP_BY( 'post_ID' );
		$SQL->ORDER_BY(	gen_order_clause( 'datestart', 'DESC', 'post_', 'post_ID' ) );

		$ItemCache = & get_ItemCache();
		$LatestList = new DataObjectList2( $ItemCache );
		$LatestList->sql = $SQL->get();
		$LatestList->query( false, false, false, 'Fetching latest posts' );

		$list_items = array();
		while( $X = & $LatestList->get_next() )
		{
			$ItemLight = new Item( $LatestList->get_row_by_idx( $LatestList->current_idx - 1 ) );
			$list_items[] = '<li style="background: none"><h3 class="bTitle linked">'.$ItemLight->get_title().'</h3></li>';
		}

		if( !empty($list_items) )
		{
			echo '<ul style="margin-left: 0; padding-left: 0">'.implode( "\n", $list_items ).'</ul>';
		}
	}
	else
	{
		// --------------------------------- START OF POSTS -------------------------------------
		// Display message if no post:
		display_if_empty();

		while( $Item = & mainlist_get_item() )
		{	// For each blog post:
			// ---------------------- ITEM BLOCK INCLUDED HERE ------------------------
			skin_include( '_item_block.inc.php', array(
					'content_mode' => 'auto',		// 'auto' will auto select depending on $disp-detail
					'image_size'	 =>	'fit-400x320',
				) );
			// ----------------------------END ITEM BLOCK  ----------------------------
		} // ---------------------------------- END OF POSTS ------------------------------------
	}
?>

Replace "1" with your actual Blog All id

3 Jun 06, 2012 16:26

Thanks, that works but it's not the end result I'm looking for. It's on my production blog so I can give a URL but what I get is this:

Post in Ancient Years

Post in Mystique Blog

That links to two other blogs where there are posts. What I was looking for was not dissimilar to the ALL blog where it aggregates the posts (preferably just the titles rather than fullposts) but does not aggregate Pages

5 Jun 06, 2012 17:25

sure - that's what I considered but I wanted to have a page accompanying the ALL blog that aggregated the other blogs - a static page about the project

6 Jun 06, 2012 17:26

create a page and then add a custom menu link to that particular page


Form is loading...