1 metacortex Aug 31, 2006 10:06
3 topanga Sep 01, 2006 12:49
have you had a look at the files summary.php and multiblog.php...
Those can help you I supposee...
Because in both you find pieces of the puzzle
4 metacortex Sep 02, 2006 02:59
Topanga, from this moment you're my personal hero. Thanks very much, i saw that files and i obtained a good result doing this:
<div class="frontpage">
<?php
$BlogBList = & new ItemList( 2, '', '', '', '', '', array(), '', 'DESC', '', 1, '', '', '', '', '', '', '', '3', 'posts' );
while( $Item = $BlogBList->get_item() )
{
?>
<h2 class="bTitle"><a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', false ); ?></a>
</h2>
<br />
<?php
$Item->content();
link_pages();
?>
<?php
}
?>
</div>
Wow, i almost make a party for this!! :D... Thank you again Topanga. The only problem i have are duplicated posts. When i publish an article in blogs 2 and 3 (asigned to new section), this also appear between the rest of posts in main area. How i can exclude these blogs to not appearing twice?.
5 metacortex Sep 02, 2006 12:30
Solved! http://img375.imageshack.us/img375/584/awesome6tr.gif
Just in case, i leave the solution here. In your skin _main.php find:
if( isset($MainList) ) while( $Item = $MainList->get_item() )
Add after
if ($Item->get('main_cat_ID') != '27' )
Where "27" is the category number.
The same thing is perfectly explained [url=http://forums.b2evolution.net/viewtopic.php?p=17386#17386][u]here[/u][/url] by clang2.
A last doubt: The following way works fine if i can exclude several categories:
if ($Item->get('main_cat_ID') != '27' )
if ($Item->get('main_cat_ID') != '29' )
if ($Item->get('main_cat_ID') != '5' )
Etc...
Are there a simplified way to do this?
6 yabba Sep 02, 2006 12:42
you could do :-
if( !in_array( $Item->Blog->ID, array( 2,3 ) ) )
¥
7 metacortex Sep 02, 2006 13:42
Thanks ¥åßßå. Go this code in same place? It don't works there.
8 urbandev_ Sep 15, 2007 02:18
is there a way to exclude posts in summary.php based on the catagory ID?
9 afwas Sep 15, 2007 03:16
Hi UrbanDEV™,
Welcome to the forum.
Let's pretend you are not a user with the 0.9 version you are referring to (the post you reply to is from 2002. It's 2007 now and the main version is 1.10).
In summary.php on lines 101-103 you find what is described in the post:
{ // Loop through all public blogs:
# by uncommenting the following lines you can hide some blogs
// if( $blog == 2 ) continue; // Hide blog 2...
but you want something different: excluding some categories. In the docs you find reference to [url=http://manual.b2evolution.net/Stub_file]stub files[/url]. In it is a nice collection of variables you can play with:
$blog = 2; // Select which blog you want to display here.
$skin = 'custom'; // Force the skin you want to display for this blog on this URL.
$show_statuses = array(); // This is the way to show published posts to everybody, protected posts to members
// and private posts to yourself
$blogroll_blog = 4; // This is the blog to be used as a blogroll (set to 0 if you don't want to use this feature)
$blogroll_cat = ''; // This is the list of categories to restrict the blogroll to (cats will be displayed recursively)
// Example: $blogroll_cat = '4,6,7';
$blogroll_catsel = array( ); // This is the array if categories to restrict the blogroll to (non recursive)
// Example: $blogroll_catsel = array( 4, 6, 7 );
$timestamp_min = ''; // Here you can set a limit before which posts will be ignored
$timestamp_max = 'now'; // Here you can set a limit after which posts will be ignored
Now I haven't tested this in summary.php, but you should try this: where in line 101-103 there is a variable $blog, try the variable $blogroll_catsel or $blogrol_cat. I think it will work.
Good luck
10 urbandev_ Sep 15, 2007 09:21
Thank you for the quick reply!
Yes, i do have 1.10, I hadn't realized the post i was replying to was that old...
I will try this and post the results.
=====================================
Nope, that doesn't work...
strange thing is that I can't get that to restrict anything in the stub file either.
I tried creating another blog and including its first post in _main.php between div tags. I can't do this. I reviewed the b2e wiki and forum's posts many times. A single $%&# example don't appears. Six hours triyng in different ways and i have nothing.