Monday, November 08, 2010 at 12:05 AM.
system.verbs.builtins.radio.macros.nextDayLink
on nextDayLink (linetext="Next") {
<<Changes
<<8/7/02; 2:05:00 PM by LL
<<Created. Generate a link to the next day's archive page, if any.
local (adrblog = radio.weblog.init (), adrPost, catname="");
local (d, year, month, day, minute, second, maxdate);
if flArchivePage {
year = string.nthField (archiveDate, "/", 1);
month = string.nthField (archiveDate, "/", 2);
day = string.nthField (archiveDate, "/", 3);
maxdate = date.set (day, month, year, 23, 59, 59)}
else { //home page
date.get (d, @day, @month, @year, @hour, @minute, @second);
maxdate = date.set (day, month, year, 23, 59, 59)};
if defined (categoryName) {
catname = categoryName};
if catname == nil { //check that the post is included on the home page
loop {
radio.weblog.getNextPostAfterDate (adrblog, maxdate, adrAdrPost:@adrpost);
if (adrpost == nil) or (adrpost^.flNotOnHomePage == false) {
break}
else {
local (theDay, theMonth, theYear, theHour, theMinute, theSecond);
date.get (adrpost^.when, @theDay, @theMonth, @theYear, @theHour, @theMinute, @theSecond);
maxdate = date.set (theDay, theMonth, theYear, 23, 59, 59)}}}
else {
radio.weblog.getNextPostAfterDate (adrblog, maxdate, adrAdrPost:@adrpost, catname:catname)};
if adrpost != nil {
local (url);
if radio.weblog.getUrlForPost (adrpost, @url, catname) {
url = string.nthField (url, "#", 1);
return ("<a href=\"" + url + "\" title=\"Click to view the next archive page.\">" + linetext + "</a>")}};
return (linetext)}
This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.