%
local(htmltext = "\r", indentlevel = 0);
on add (s) {
htmltext = htmltext + string.filledstring ("\t", indentlevel) + s + "\r\n";
};
local (pta = html.getpagetableaddress ());
pta^.title = radio.string.getlocalizedstring ("viewStories.title");
if not pta^.radioResponder.flStaticRendering {
add (radio.string.getlocalizedstring ("viewStories.description") + " " + radio.userInterface.helpLink ("The Stories page"))};
if defined (pta^.radioResponder.getArgs.command) {
if pta^.radioResponder.getArgs.command == "newStory" {
add (radio.userinterface.editorbox ("", 15));
return (htmltext)}};
local (f, s = "", pc = file.getPathChar ());
local (folder = user.radio.prefs.wwwFolder + radio.data.folderNames.wwwStoriesSubFolderName + pc);
local (fileList = {});
// Gather up list of elgible files
fileloop (f in folder, infinity) {
if file.fileFromPath (f) beginsWith "index." {continue};
// Skip images, non-indexed docs - 1/28/02; 9:50:32 AM by MW
if string.lower(f) contains pc + "images" + pc {continue};
local (adratts);
radio.file.getFileAttributes (f, @adratts);
if defined(adrAtts^.flindex) {
if adratts^.flindex == false {continue};
};
// Nothing from stories!
if file.folderFromPath (f) == folder {continue};
fileList = fileList + {f};
};
// Take all of the matching files and their creation dates and
// plop them into a table for easy sorting.local(i);
new(tableType, @sortList);
for i = 1 to sizeOf(fileList) {
new(tableType, @entry);
f = fileList[i];
local (adrfile = @user.radio.settings.files.[f]);
if defined (adrfile^) and (adrfile^.upstream.url != "") {
entry.title = adrfile^.title;
entry.url = adrfile^.upstream.url;
entry.created = adrfile^.created;
// sortList.[entry.created] = entry;
local (created, dd, mm, yy, hh, min, ss);
date.get(entry.created, @dd, @mm, @yy, @hh, @min, @ss);
created = string.padWithZeros(yy, 4) +
string.padWithZeros(mm, 2) +
string.padWithZeros(dd, 2) +
string.padWithZeros(hh, 2) +
string.padWithZeros(min, 2) +
string.padWithZeros(ss, 2);
sortList.[created] = entry;
};
};
add ("
| " + radio.string.getlocalizedstring ("viewStories.dateHeader") + " | " + radio.string.getlocalizedstring ("viewStories.titleHeader") + " |
| " + date.shortstring (sortList[i].created) + " | "); add ("" + sortList[i].title + " | "); add ("