Recent Topics

1 Jun 16, 2007 04:55    

My b2evolution Version: Not Entered

I'm trying to get a list of posts between two and three years old, ordered by number of views. I have this code:

<h3 class="sideItemTitle">Old Favourites</h3>
<?php
	$search_date = date("Ymd", strtotime("-24 month"));
	$search_date2 = date("Ymd", strtotime("-36 month"));
	$TOPART = new ItemList($blog, array(), '', '', '', '', array(), '', 'DESC', 'views', 3,'','','','','','','','',$search_date2,$search_date);
	echo "<ul>";
	while ($TOPART_ITEM = $TOPART->get_item()) {
		echo "<li><a href=\"", $TOPART_ITEM->get_permanent_url();
		echo "\">", $TOPART_ITEM->title('','',false), "</a></li>";
	}
	echo "</ul>";
?>

I get no posts returned, even though I have blog posts going back to 2003. I assume I've messed up the arguments to the ItemList constructor somewhere, but simple munging like swapping the two dates around makes no difference to the output. Can anyone help?

Rob


Form is loading...