All pastes #943421 Raw Edit

Something

public text v1 · immutable
·published 2008-03-15 06:57 UTC
rendered paste body
<?php include 'header.php';
$id = $post->id;
$next_post = FALSE;
while($next_post == FALSE) {
	$id = $id + 1;
	$next_post = Posts::get(array('id' => $id, 'content_type' => $post->content_type));
	if(count($next_post) >= 1) {
		$next_post = $next_post[0];
		break;
	} else {
		$next_post = FALSE;
		break;
	}
}
$id = $post->id;
$prev_post = FALSE;
while($prev_post == FALSE) {
	$id = $id - 1;
	$prev_post = Posts::get(array('id' => $id, 'content_type' => $post->content_type));
	if(count($prev_post) >= 1) {
		$prev_post = $prev_post[0];
		break;
	} else {
		$prev_post = FALSE;
		break;
	}
}
?>
<!-- entry.single -->
  <div class="single singlecolumn">
	<?php if($next_post || $prev_post) { ?><div id="navLinks">
		<?php if($next_post) { ?><a href="<?php echo $next_post->permalink; ?>" title="Read the next post"><?php echo $next_post->title; ?></a><?php } ?>
		<?php if($prev_post) { ?><a href="<?php echo $prev_post->permalink; ?>" title="Read the previous post"><?php echo $prev_post->title; ?></a><?php } ?>
	</div><?php } ?>