Recent Topics

1 Sep 20, 2005 20:29    

I've got my blogs installed in /public_html/blogs and will be offering members of my site free blogs.

How do I add an area of my site's front page (/public_html/index.php) so that it shows the last 10 or 15 posts from all of the blogs?

Thanks!

Kootch

2 Sep 20, 2005 21:10

There's a file in the blogs folder called summary.php. You could strip out the parts you don't want, customize it to look the way you want, then do an include on it from your front page.

3 Sep 20, 2005 22:29

personman wrote:

There's a file in the blogs folder called summary.php. You could strip out the parts you don't want, customize it to look the way you want, then do an include on it from your front page.

Hmm. Quickly tried that but doesn't seem to do quite what I want from my abilities.

Say I have 6 different blogs, with different users each posting on their own blogs only, but I want to be able to list the latest 10 posts from all of those blogs together in one spot on the main page of my site, that's what I want to do. The summary.php looks to almost do that, but either it doesn't do exactly what I wanted or I haven't quite got the php skill to edit it enough. The suggestion to do an include of the summary.php is a good one, I just need to pare the summary.php page down a little more I guess...

Essentially, on this summary page that I stripped down, I just want the top three links showing, not the other sets down below and I can't seem to strip the rest away:
http://www.tmlfans.ca/blogs/summary.php

<?php
require(dirname(__FILE__).'/b2evocore/_main.php');
?>

</head><body>

<div class="main"><!-- InstanceBeginEditable name="Main" -->

<!-- =================================== START OF MAIN AREA =================================== -->

<?php // --------------------------- BLOG LIST -----------------------------
for( $blog=blog_list_start('stub');
$blog!=false;
$blog=blog_list_next('stub') )
{ # by uncommenting the following lines you can hide some blogs
// if( $blog == 1 ) continue; // Hide blog 1...
?>

<ul>
<?php // Get the 3 last posts for each blog:
$BlogBList = & new ItemList( $blog, '', '', '', '', '', array(), '', 'DESC', '', '', '', '', '', '', '', '', '', '3', 'posts' );

while( $Item = $BlogBList->get_item() )
{
?>
<li lang="<?php $Item->lang() ?>">
<?php $Item->issue_date() ?>:
<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', false ); ?></a>
<span class="small">[<?php $Item->lang() ?>]</span>
</li>
<?php
}
?>
<li><a href="<?php blog_list_iteminfo('blogurl', 'raw' ) ?>"><?php echo T_('MORE posts...') ?></a></li>
</ul>
<?php
}
// ---------------------------------- END OF BLOG LIST --------------------------------- ?>
<!-- InstanceEndEditable --></div>

</body></html>

4 Sep 20, 2005 22:37

Take a look at this line:

 // if( $blog == 1 ) continue; // Hide blog 1... 


You can use that to hide blogs that you don't want displayed. The linkblog is probably 3.

5 Sep 20, 2005 23:52

personman wrote:

Take a look at this line:

 // if( $blog == 1 ) continue; // Hide blog 1... 


You can use that to hide blogs that you don't want displayed. The linkblog is probably 3.

Okay, I went and editted out the one blog, but it looks like I'd have to do it for each blog I add - problem is I plan to have a couple dozen blogs (or more) hosted on the site over the next few weeks. I don't want to have to remember to go in and alter that summary.php file each time I add one.

Is there any other workarounds to just show the first set of posts compiled from all of the blogs together? Anyone?

http://www.tmlfans.ca/clip.jpg

6 Sep 21, 2005 00:16

Ok, I see, just turn that line inside out like so:

if( $blog != 1 ) continue; // Only show blog 1 (blog all)

Does that work?

7 Sep 21, 2005 00:38

personman wrote:

Ok, I see, just turn that line inside out like so:

if( $blog != 1 ) continue; // Only show blog 1 (blog all)

Does that work?

No, gives me the error:
Parse error: parse error, unexpected '!' in /home/penaltyb/public_html/blogs/summary.php on line 25

Here's the summary.php:

<?php

require(dirname(__FILE__).'/b2evocore/_main.php');
?>

</head>
<body>

<div class="main"><!-- InstanceBeginEditable name="Main" -->

<!-- =================================== START OF MAIN AREA =================================== -->

<?php // --------------------------- BLOG LIST -----------------------------
for( $blog=blog_list_start('stub');
$blog!=false;
$blog=blog_list_next('stub') )
{ # by uncommenting the following lines you can hide some blogs
if( $blog ! = 1 ) continue; // Only Show blog 1...
?>

<ul>
<?php // Get the 3 last posts for each blog:
$BlogBList = & new ItemList( $blog, '', '', '', '', '', array(), '', 'DESC', '', '', '', '', '', '', '', '', '', '5', 'posts' );

while( $Item = $BlogBList->get_item() )
{
?>
<li lang="<?php $Item->lang() ?>">
<?php $Item->issue_date() ?>
<a href="<?php $Item->permalink() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php $Item->title( '', '', false ); ?></a>

</li>
<?php
}
?>

</ul>
<?php
}
// ---------------------------------- END OF BLOG LIST --------------------------------- ?>
<!-- InstanceEndEditable --></div>

</body>

</html>

8 Sep 21, 2005 01:09

get rid of the space between ! and =.

9 Sep 21, 2005 01:31

Much thanks personman, it works like a charm now!


Form is loading...