Home | Add News | Edit News | Options | Help/About | Logout


Enable Hack Manually - Date Headers v1.0

Installation notes:

This will add date headers (aka. grouping) ability to the news. So you get something like this:
Jan, 1st:
news1
news2

Jan. 2nd:
news3
news4
news5

etc

Add block in "./inc/shows.inc.php":

Automatically Generated, be sure to be very precise on tabs and spaces.

Add this:

// Date Headers v1.0 - addblock
if ($show_dateheaders) {
	$config_dateheaderformat = 'D, d F'; // see http://php.net/date for more info about this format
	if ($dateHeader != date($config_dateheaderformat, $news_arr[0])) {
		$dateHeader = date($config_dateheaderformat, $news_arr[0]);
		// The following lines should be changed to format the news
?>

<p><?=$dateHeader?><br><br>

<?php
		// End of formatting
	}
	unset($show_dateheaders);
}
// Date Headers v1.0 - End addblock

Between:

		$output = str_replace("[/com-link]","</a>", $output);

And:

		echo $output;

End installation notes:

This addon will be enabled when you include
$show_dateheaders = true;
in your include code. If you want to change the format in which the date header is outputted. Change one of the following:
  • the $config_dateheaderformat, for the date format which should be shown.
  • The template. It is
    <p><?=$dateHeader?><br><br>
    by default, should be changed to fit your needs. In the template, <?=$dateHeader?> is the actual date header text.

Powered by CuteNews v1.3.1 © 2003 CutePHP.