Recent Topics

1 Jun 17, 2009 21:00    

My b2evolution Version: 2.x

Summary all blog to a blog. I use Blog settings > Advanced > Aggregation [Admin] > Blogs to aggregate: > insert number all blog. But it has limite insert. How to edit code?

- I would like to edit code for unlimite insert number all blog to Blogs to aggregate:.
- Thank you for support.

3 Jun 18, 2009 06:27

Thank you, EdB.
When i use Aggregate "All" blogs into one code. First, i have more blog and some blog no Include in public blog list:. So when i use Blogs to aggregate: "All" it show only blog select public blog list, no show other. How to edit code?

Blogs to aggregate: can unlimite? I would like to show all blog in a blog ex. Blog1, Blog2, (Blog3 no show), > show in Blog4. From example if i select "All" from EdB code it show all but i would like don't show some blog. How to edit code?

- Now i turn back to use insert number id to show all blog again but it has limite and await tactic from every friend.

Thank again.

4 Jun 18, 2009 17:07

Blogs to aggregate: When insert "All" it can show all post from every blog? After test, it can show post only public blogs. How to edit code?

5 Jun 18, 2009 17:32

I didn't know it did that, but it makes sense. The thing is you are aggregating posts that can be seen. I've no idea how to make it show posts that you decided shouldn't be shown (by not including the blog in the public list) even if the posts can be seen by knowing the blog URL. I would have to look into the improvement files and see if I can figure out how to make it show everything, but then it might try to show protected or private posts. That would be bad!

6 Jun 18, 2009 17:55

Thank you EdB

Summary Blog. My website www.blogtika.com open member can register a blog. When member register finish and start post story. I would like to show new post to http://www.blogtika.com/summary.php so

- Blogtika Community < post by admin
- Blogtika Labs < post by admin
- The Story of Blogtika < post by admin
and
- Members Blogtika < post by members

Members Blogtika. This's point important for show all post of every members when it update. So i use (Blogs to aggregate:) and insert number of all blog but it have limite character. After find topic in forum EdB help me about (Aggregate "All" blogs into one) but it can not to show all post from every blog.

- I can? edit code at http://www.blogtika.com/summary.php for show all post. For end this problem.

7 Jun 18, 2009 18:02

The short answer is "yes" ... the long answer will require me to get enough free time, whilst also having a working brain, to code it up but :

in summary.php, build a list of public blogs, members blogs and owner blogs, then loop through them to get your single $MainList items

Snippet from one of our plugins may help you :

		// fetch public blogs if required
		$public_blogs = ( $params[ 'public_blogs' ] ? $BlogCache->load_public() : array() );
		// fetch same owner blogs if required
		$owner_blogs = ( $params[ 'owner_blogs' ] ? $BlogCache->load_owner_blogs( $Blog->get( 'owner_user_ID' ) ) : array() );
		// fetch members blogs if required
		$members_blogs = ( is_logged_in() && $params[ 'members_blogs' ] ? $BlogCache->load_user_blogs() : array() );
		// reduce to unique blog ID's
		$all_blogs = array_unique( array_merge( $public_blogs, $owner_blogs, $members_blogs ) );

Then you'd just loop through $all_blogs ;)

¥

8 Jun 18, 2009 18:32

Thank you ¥åßßå.

Confuse Code. I think your code can help me but i don't sure, how to edit? In php code for show post in summary.php so i post my code. Please, help suggest.

This is my code in summary.php.

<?php // --------------------------- BLOG LIST -----------------------------

	load_class('items/model/_itemlist.class.php');

	$BlogCache = & get_Cache( 'BlogCache' );

	$blog_array = $BlogCache->load_public( 'ID' );

	foreach( $blog_array as $blog )
	{	// Loop through all public blogs:
		# by uncommenting the following lines you can hide some blogs
		// if( $blog == 2 ) continue; // Hide blog 2...

    /**
		 * @var Blog
		 */
		$l_Blog = & $BlogCache->get_by_ID( $blog );

		?>
    <a href="<?php echo $l_Blog->gen_blogurl(); ?>" title="<?php $l_Blog->disp( 'shortdesc', 'htmlattr' ); ?>">
    <?php $l_Blog->disp( 'name', 'htmlattr' ); ?>
    </a>
  </p>
  <ul>
<?php	// Get the 3 last posts for each blog:

			$BlogBList = & new ItemList2( $l_Blog, NULL, 'now', 20 );

			$BlogBList->set_filters( array(
					'order' => 'DESC',
					'unit' => 'posts',
				) );

			// Run the query:
			$BlogBList->query();

			while( $Item = & $BlogBList->get_item() )
			{
				?>
<li lang="<?php $Item->lang() ?>">
<?php
						$Item->issue_date( array(
								'before'      => ' ',
								'after'       => ' ',
								'date_format' => '#',
							) );

						$Item->title( array(
								'link_type' => 'permalink',
							) );
					?>
<span class="small">[<?php $Item->lang() ?>]</span>
	</li>
				<?php
			}
			?>
<li><a href="<?php echo $l_Blog->gen_blogurl(); ?>"><?php echo T_('More posts...') ?></a></li>
</ul>
<?php
	}
	// ---------------------------------- END OF BLOG LIST --------------------------------- ?>

- I don't skillfully PHP so :D Please, suggest "How to" insert your code to my code.
- I'm trying test this code. at summary.php but i can't.

9 Jun 19, 2009 08:46

 <?php // --------------------------- BLOG LIST -----------------------------

    load_class('items/model/_itemlist.class.php');

    $BlogCache = & get_Cache( 'BlogCache' );

        // fetch public blogs
        $public_blogs = $BlogCache->load_public();
        // fetch same owner blogs
//        $owner_blogs = $BlogCache->load_owner_blogs( $Blog->get( 'owner_user_ID' ) );
        // fetch members blogs
        $members_blogs = ( is_logged_in() ? $BlogCache->load_user_blogs() : array() );
        // reduce to unique blog ID's
        $blog_array = array_unique( array_merge( $public_blogs, $members_blogs ) ); 
    foreach( $blog_array as $blog )
    {    // Loop through all public blogs:

Something like that should do it

¥

10 Jun 19, 2009 10:29

I change summary.php to your code
This's my code now.

<?php // --------------------------- BLOG LIST ----------------------------- 

    load_class('items/model/_itemlist.class.php'); 

    $BlogCache = & get_Cache( 'BlogCache' ); 

        // fetch public blogs 
        $public_blogs = $BlogCache->load_public(); 
        // fetch same owner blogs 
//        $owner_blogs = $BlogCache->load_owner_blogs( $Blog->get( 'owner_user_ID' ) ); 
        // fetch members blogs 
        $members_blogs = ( is_logged_in() ? $BlogCache->load_user_blogs() : array() ); 
        // reduce to unique blog ID's 
        $blog_array = array_unique( array_merge( $public_blogs, $members_blogs ) );  
    foreach( $blog_array as $blog ) 
    {    // Loop through all public blogs: 	
		# by uncommenting the following lines you can hide some blogs
		// if( $blog == 2 ) continue; // Hide blog 2...

    /**
		 * @var Blog
		 */
		$l_Blog = & $BlogCache->get_by_ID( $blog );

		?>
    <a href="<?php echo $l_Blog->gen_blogurl(); ?>" title="<?php $l_Blog->disp( 'shortdesc', 'htmlattr' ); ?>">
    <?php $l_Blog->disp( 'name', 'htmlattr' ); ?>
    </a>
  </p>
  <ul>
<?php	// Get the 3 last posts for each blog:

			$BlogBList = & new ItemList2( $l_Blog, NULL, 'now', 20 );

			$BlogBList->set_filters( array(
					'order' => 'DESC',
					'unit' => 'posts',
				) );

			// Run the query:
			$BlogBList->query();

			while( $Item = & $BlogBList->get_item() )
			{
				?>
<li lang="<?php $Item->lang() ?>">
<?php
						$Item->issue_date( array(
								'before'      => ' ',
								'after'       => ' ',
								'date_format' => '#',
							) );

						$Item->title( array(
								'link_type' => 'permalink',
							) );
					?>
<span class="small">[<?php $Item->lang() ?>]</span>
	</li>
				<?php
			}
			?>
<li><a href="<?php echo $l_Blog->gen_blogurl(); ?>"><?php echo T_('More posts...') ?></a></li>
</ul>
<?php
	}
	// ---------------------------------- END OF BLOG LIST --------------------------------- ?>

This code very good thank you ¥åßßå again. After after upload this code, it show all blog (public and no public) + all post from members (link immensely) that bad for seo.

So i have idea as follow. I would like to show 4 blog public.
referable from http://www.blogtika.com/summary.php

1. Blogtika Community (public blog)
1.01 post
1.02 post
1.03 post
...
1.20 post (show 20 post only)

2. Blogtika Labs (public blog)
2.01 post
2.02 post
2.03 post
...
2.20 post (show 20 post only)

3. The Story of Blogtika (public blog)
3.01 post
3.02 post
3.03 post
...
3.20 post (show 20 post only)

4. Members Blogtika (from members blog only, by i use "All" Blogs to aggregate for summary all blog post to here.)
4.01 post
4.02 post
4.03 post
...
4.20 post (show 20 post only)

First. I know ¥åßßå maybe have a headache with my problem :D so don't hurry for me. Above all, Thank every body for help.

- Please, suggest code for my summary.php

11 Jun 19, 2009 12:18

It should only show you "members" posts if you're a member of the blog that it was posted in, search engines will never be logged in so they won't see them.

Try logging out and going back to your summary.php, all your member blogs should disappear

¥

12 Jun 19, 2009 17:31

Thank you, ¥åßßå. It finish

14 Jul 28, 2009 16:13

- Again for my problem about blogs to aggregate.
- Help me at Blog Settings > Advanced > Blogs to aggregate [List blog IDs].
- Now, I add ids 1-100 (not use "All" because i would like to show only insert my id)
- My problem is i would like to show 1-unlimite ids, please suggestion.
- I try edit code at blogs/inc/collections/views/_coll_advanced.form.php
Original is

$Form->begin_fieldset( T_('Aggregation').' ['.T_('Admin').']' );
		$Form->text( 'aggregate_coll_IDs', $edited_Blog->get_setting( 'aggregate_coll_IDs' ), 30, T_('Blogs to aggregate'), T_('List blog IDs separated by ,').' or "All"', 255 );
	$Form->end_fieldset();

Edit to

$Form->begin_fieldset( T_('Aggregation').' ['.T_('Admin').']' );
		$Form->text( 'aggregate_coll_IDs', $edited_Blog->get_setting( 'aggregate_coll_IDs' ), 30, T_('Blogs to aggregate'), T_('List blog IDs separated by ,').' or "All"', 1000000 );
	$Form->end_fieldset();


- I think that maybe miss something about "1000000" because when i type more > 255 text can save only 255 text. please, suggestion.
- Goal is i can add ids more than 100 How to?

* Add a question.
- I test and edit code about "load_public" that have idea if chage from "load_public" to "load_user_blogs" that maybe good for me. But how to :D

16 Mar 30, 2010 18:48

Use star (*) to aggregate all blogs


Form is loading...