Recent Topics

1 Apr 29, 2004 00:11    

This is nothing more than a piece of the summary.php file moved to the sidebar, but it allows for showing all your post titles at the same time. I originally put it under the "includes for last comments etc" using spaces before and after each item instead of an unorder list. It takes up less space that way, but for some reason I think it 'works' better as a sidebar item.

<div class="bSideItem">
	<h3><?php echo T_('In this section') ?></h3>
	<ul>
	<?php
	$BlogBList = new ItemList( $blog,  '', '', '', '', '', array(), '', 'DESC', '', '', '', '', '', '', '', '', '', '99', 'posts' );
	while( $BlogBList->get_item() )
	{
	?>
	<li lang="<?php the_lang() ?>">
	<a href="<?php permalink_link() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php the_title( '', '', false ); ?></a>
	</li>
	<?php
	}
	?>
	</ul>
	</div>


I'm using even numbers for visible blogs and odd numbers for the blogroll blogs, so I set my blog_as_blogroll on the odd ones to 0 in order to not duplicate the list of posts. I should do an if statement to exclude the blogroll section if it's set to 0, but that's for another day.

The site I've done this to is not accessible by the world in general, so here ya go: http://whitesandshanggliding.com/main.php

2 Apr 29, 2004 05:05

Yeah, that works for me; in fact, I'd like to know how to take clean install and make it look like your site.

How do I do that?

ric

3 Apr 29, 2004 06:36

It's basically the custom skin with a few changes to the CSS for the background colors on the page and in the various text divs. I may have changed some fonts and size declarations too - I'm not sure. If you want I'll save it as a TXT and upload it for ya since I'm not sure where all my tweaks are relative to the original document.

As for the _main file: I moved the <h1 id="pageTitle"> bit above the blog list deal, then started stripping out what I didn't like. The posts section looks like this, with the includes part as per default configuration:

<?php  // ------------------------------------ START OF POSTS ------------------------------------
if( isset($MainList) ) while( $MainList->get_item() )
{
	// the_date( '', '<h2>', '</h2>' );
?>

<div class="bPost" lang="<?php the_lang() ?>">
	<?php permalink_anchor(); ?>
	<h3 class="bTitle"><?php the_title(); ?></h3>

	<div class="bText">
		<?php the_content(); ?>
		<?php link_pages("<br />Pages: ","<br />","number") ?>
		</div>

	<div class="bSmallPrint">
		<a href="<?php permalink_link() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><img src="img/icon_minipost.gif" alt="Permalink" width="12" height="9" class="middle" /></a>
		<?php 
		echo 'posted in: ';
		the_categories();
		echo ', ';
		?>
		 - <a href="<?php permalink_link() ?>#comments" title="<?php echo T_('Display comments / Leave a comment') ?>"><?php comments_number() ?></a>

		<?php if( $debug==1 ) printf( T_('- %d queries so far'), $querycount); ?>
		</div>


There are some setting in the back office (or one of the /config/ files in older version) that leave out the pingback and trackback portions on permalink pages. The changes to the side bar should be pretty obvious - I just deleted sections I didn't want, then made up the 'list all the posts' hack because I thought it would help people navigate easier.

What else? There's the hack to make only "blog as blogroll" entries with text get the permalink icon but not show the text on the blogroll - that's in the forums somewhere, and I think it did a lot for the 'clean' look. Another one from the forums is the 'get rid of checkboxes' hack - do a search and use the one with {solved} in the name, plus remove the form and button lines from the _main file.

Hey I'm glad you like the layout! My whole idea with this install was to be like a 'regular' web but use as much of the blog app as I could without getting carried away. For example: no archive access. My personal blog is intentionally a bit difficult to navigate through - I don't bother linking my flightblog anywhere other than indirectly as a cross-posted category. When I get this install published again I'm going to go back to my personal one and start going crazy on it. The install I want my club to adopt uses the multiblogs page to let three key guys post stuff without me having to do it for them, or use the b-board...or attaching a word doc to an email.

4 Apr 29, 2004 20:55

Are you talking about a "Recent Posts" type of thing?

I've done this for a few of my skins, and I'm thinking more and more lately that I oughta just make a script kinda like the defaults in the skins directory to make it easier to use and share.

There's an example of what i'm talking about at http://isaacschlueter.com/index.php?skin=autumn and http://isaacschlueter.com/index.php?skin=ala and http://isaacschlueter.com/index.php?skin=moonrise

Look in the sidebar on all three, under "recent posts". If you'd like, I will share the script that does this. I made it really customizable, perhaps too much so, because when I was making it I wasn't sure how I'd want it to look. It uses the same principle as the summary.php template, but most of the time I just grab from blog #1 so that it sorts them by date instead of by blog and then date.

LMKWYT.

5 Apr 29, 2004 22:04

"Recent Posts Across Blogs" excluding your blogroll blog - that's pretty trick! I'd love to see the code so I can implement it on my third install after the guys figure out blogging is better. I see where your list is sorted by time, but is it limited by time or by quantity?

What I wanted to do was to list all the posts in the specific blog you happen to be viewing so I could leave my posts paged at 3 but still show people everything in the blog, so I should have called this thread "All Posts in a Blog on the Blog". The code from summary.php is strictly chronological so editing my post dates allows me to structure this section as I see fit.

Not much of a hack eh? Just moving bits around, but it works for me.

6 Apr 30, 2004 01:23

At this point, I've got three different versions of the "Recent posts" thing, used on three different skins. (Four, if you count http://www.objectivisttheatre.com.) The one on my ALA skin is the earliest and has some problems that I've since fixed in moonrise and autumn. The one on the autumn skin is the most up to date. I've been meaning to standardize them, which is part of the reason why I plan on packaging it up nice and spiffy tonite. Also, there seems to be popular demand for the feature. Of course, I might not get to it tonite, as happens too often with my lofty aspirations, but we'll see :)

EdB wrote:

I see where your list is sorted by time, but is it limited by time or by quantity?

Both, actually. It's 10 posts, or 1 month, whichever is less. (Since I write about 20-30 posts per month, of course, it's pretty much always limited to 10 posts.) You could easily set that to 99999 and 50 years to include everything, or, in the latest version, you could even make it show all the posts from a certain date range very simply. (I had fun playing with date functions in php.)

What I really gotta figure out is how to make my "Archives" sideitem pick up where my "Recent Posts" leaves off. I'm sure there's a way to do it, there's just been too many things to do to figure it out. Maybe if I publish it for ya'll, someone'll do it for me, so that's even more incentive ;)

7 Apr 30, 2004 07:36

Anyone who wants this, it's on my site now.

Go to http://isaac.beigetower.org/recent.zip

You can use it on your site in two ways:
1. Unpack the _recent.php file in your $blogurl/skins/skinname folder. Include it in your _main.php file for the skin.

2. Unpack the file into your skins folder. Create another file in the $blogurl/skins/skinname called _recent.php, and put just the top section in there where you set all the variables, and then include the main _recent.php file from your skins folder.

Either way, you should really read the comments in the file, especially if you want to customize the "recent posts" section of your page.

EdB: If you set the number of posts to '', and the date range to something huge, then you'll have all the posts shown.

If you only want to include the current blog, then set:
$recent_blogs = $blog;

8 Apr 30, 2004 08:07

Thanks! Got it, and saved the forum thread in my "cool hacks" folder for future reference.

9 May 15, 2004 05:45

EdB,

What file is it you inserst that code into the list the last entries. I like what you did and want to implement it on my site.

Thanks,

T

10 May 15, 2004 06:44

Oops. _main.php in whatever skin you're using following the start of sidebar comment.

12 May 15, 2004 19:42

Hmmm?

I keep getting an error message:

Parse error: parse error in /home/beacon4/public_html/skins/custom/_main.php on line 168

I don't know what that is.

13 May 15, 2004 20:07

What version are you using? I did the mod on version .8.9 so that might be part of it. I noticed recently that one of my simple hacks didn't survive from version 862 to version 89 so that might be part of it. Also you can compare the code to the original version of the summary.php file in the root directory (of your version) to see if there is anything that makes you go 'hmmm'.

Also, what's on line 168? Is there any other valuable looking stuff in the error message?

14 May 15, 2004 20:25

I'm using the latest version and the line seems to be related to the calendar.

15 Jul 10, 2004 08:05

Wow Isaac! Thanks for making that Recent Posts script available. Nice work. Since badbadbruin seems to have had trouble with the install, I thought I'd lay out step by step what I did to get it working.

1. Download and unzip the _recent.php file linked above. ( http://isaac.beigetower.org/recent.zip )
2. Save _recent.php in your skins folder, for me it was .../blogs/skins/custom/_recent.php
3. Edit _main.php to include the recent posts script. A good place for it seemed to me to be after the calendar and before recent comments, so it got inserted into my _main.php like this:

			// -------------------------------- END OF CALENDAR ---------------------------------- ?>
<br />		
		<?php // -------------------------- RECENT POSTS INCLUDED HERE -------------------------
			require( dirname(__FILE__).'/_recent.php' );
			// -------------------------------- END OF RECENT POSTS ------------------------------ ?>


4. Edit the _recent.php file to your liking. In particular, allow me to suggest:
4a. Make the text 'Recent Posts' match other sidebar items with:

//text to show at the beginning of the recent posts list
if(!isset($recent_before_all)) $recent_before_all = '<h3>'.T_('Recent Posts').'</h3><ul>';


The original line had a list-item tag before 'Recent Posts' that I think was a bug. (It's never closed.) At least in my sidebar it made the text end up over too far to the left.
4b. Choose the right blog that you want recent posts from, for me it was 2:

//blogs to show in "recent posts"
if(!isset($recent_blogs)) $recent_blogs = '2';


4c. Set the number of months to go back to a higher figure because so long as you keep the max posts per blog at 10, it's not going to matter if you go way back, but if you have fewer than 10 posts per month, the original setting will leave you with fewer recent posts listed. I picked 3 months:

if(!isset($recent_daterange) ) $recent_daterange = '-3 months';

I think that's it! Once again, thanks Isaac. I think this should become part of the default installation!

Brian

16 Jul 10, 2004 12:07

As far as I know, the version on Isaacs site is an old version. The latest version is on the forums somewhere. Search for recent hack.

17 Jul 11, 2004 21:15

You're absolutely right. I removed the zip to avoid confusion.

18 Jul 12, 2004 04:03

So, is the latest version one of the ones posted in the topic linked below?:

http://forums.b2evolution.net/viewtopic.php?t=1422&highlight=posts

That topic ends with someone not being able to get it to work, so it's not very encouraging! Maybe Isaac could put the latest version back on his site at .../recent.zip and then people who follow this thread or the other thread would still get to the latest version...

Brian

19 Jul 12, 2004 07:36

I have no idea what is wrong with that person's site. It is exactly the code I use for my site, and as you can see at http://tin-men.net it works perfectly. (well, there is one problem with the code that I've just noticed, but it's just a case of reporting the wrong number of comments, nothing life threatening)

20 Nov 09, 2005 02:10

personman, brianwc,

the docu that personman linked is actually Phoenix as of April this year. It is not 0.9.1 really.

Please stick to the 0.9.0 docu from http://doc.b2evolution.net/

I've just asked Fran├žois to update it.

21 Nov 11, 2005 04:25

EdB wrote:

This is nothing more than a piece of the summary.php file moved to the sidebar, but it allows for showing all your post titles at the same time. I originally put it under the "includes for last comments etc" using spaces before and after each item instead of an unorder list. It takes up less space that way, but for some reason I think it 'works' better as a sidebar item.

<div class="bSideItem">
	<h3><?php echo T_('In this section') ?></h3>
	<ul>
	<?php
	$BlogBList = new ItemList( $blog,  '', '', '', '', '', array(), '', 'DESC', '', '', '', '', '', '', '', '', '', '99', 'posts' );
	while( $BlogBList->get_item() )
	{
	?>
	<li lang="<?php the_lang() ?>">
	<a href="<?php permalink_link() ?>" title="<?php echo T_('Permanent link to full entry') ?>"><?php the_title( '', '', false ); ?></a>
	</li>
	<?php
	}
	?>
	</ul>
	</div>


I'm using even numbers for visible blogs and odd numbers for the blogroll blogs, so I set my blog_as_blogroll on the odd ones to 0 in order to not duplicate the list of posts. I should do an if statement to exclude the blogroll section if it's set to 0, but that's for another day.

The site I've done this to is not accessible by the world in general, so here ya go: http://whitesandshanggliding.com/main.php

EdB, may you please teach me

how to modify this so that i can only display a specified category's posts?

22 Nov 12, 2005 02:23

Evidently, Isaac's recent.zip file is no longer there. Is it anywhere accessible to folks. I would like to add that capacity to my blog.

Thanks.


Form is loading...