Project Steve Guttenberg

Headlines Hack

Posted by Gavin on Tuesday, October 14, 2003 (Link)
I just implemented this neat PSG hack on my website. It basically produces a simple list of headlines. You will need a bit of PHP knowledge to get this to work on your own site.
<?php
	// duplicate your $conf here:
	$conf = array();

	// how many headlines?
	$limit = 10;

	require('psg.php');

	$articles = getArticles();
										
	$ids = array_keys($articles);
	rsort($ids, SORT_NUMERIC);

	$path = '/journal/';

	print '<ul>';										
	foreach (array_slice($ids, 0, $limit) as $id) {
		printf(
			'<li><a href="%s/index.php/article/%d">%s</a></li>',
			$journal,
			$id,
			stripslashes($articles[$id][subject])
		);
	}
	print '</ul>';
?>

<< Previous: PSG 1.8.1Next: PSG 1.8.2 >>

[ Archives | Search | Syndicate ]
© 2008 ProjectSteveGuttenberg.org.