__section__
default
__description__
Print older stories for older stories box

* cur_time = current time()
* stories = arrayref of story hashrefs
* yesterday = the value to put in the "yesterday's edition" link
* week_ago = the date from a week ago 
* start = where to start counting from in search.pl return values
* first_date = date of first story returned from getStoriesEssential
* last_date = date of last story returned from getStoriesEssential

Each story has the keys sid, section, title, time, commentcount,
day (w, m, d, h, min, ampm), secs (since unix epoch) and
link (which is a linkStory() value)

XXXSECTIONTOPICS the above key list is wrong at least for 'section' :)

__title__

__page__
misc
__lang__
en_US
__name__
getOlderStories
__template__
[% this_today = '';
   c = 0;
   max_older_stories = gSkin.artcount_max / 2 || 15;
   %]
<ul>
	[%
	FOREACH story = stories;
   	day = "$story.day_of_week $story.month $story.day";
	IF this_today != day;
		this_today = day; %]
		[% IF story != stories.first %]
			</ul>
		</li>
		[% END %]
		<li>
			<br>
			<a href="[% gSkin.rootdir %]/index.pl?issue=[% story.issue | strip_paramattr %]">
		[%- IF cur_time && story.secs && cur_time-story.secs < 7*86400
		    # If the story is within the last week, show (and link) the day-of-week -%]
			[% story.day_of_week %]</a> [% story.month %] [% story.day %]
		[%- ELSE
		    # Otherwise, show the whole date, because just the day would confuse -%]
			[% story.month %] [% story.day %]</a>
		[%- END -%]
		<ul>
	[%- END %]
	<li>
		<a href="[% story.link.0 | strip_urlattr %]"[% IF story.link.2 %] title="[% story.link.2 | strip_attribute %]"[% END %]>[% story.link.1 %]</a>
		<em>([% story.commentcount %])</em>
	</li>
	[% start = start + 1; c = c + 1; LAST IF c >= max_older_stories %]
[% END %]
		</ul>
	</li>
</ul>
<br>
<div class="right">
[% # only do this if we want to have an "Older Articles" link
   # pointing back in time into search.pl
   # (why wouldn't we??) %]

<b><a href="[% gSkin.rootdir %]/search.pl?start=[% start %]
	[%- IF gSkin.skid != constants.mainpage_skid %]&amp;section=[% gSkin.name; END -%]
">Older Articles</a></b>

[% # only do this if we want to have a yesterday/today/"June 1"
   # style next/previous day issue link
   # (why wouldn't we??) %]

<br><b>[% PROCESS next_prev_issue older_stories = 1 %]</b>
</div>

__seclev__
10000
__version__
$Id: getOlderStories;misc;default,v 1.21 2005/09/28 02:31:44 tvroom Exp $
