// New Posts SSI // Copyright (c) 2002 by Paul Guyot. // All rights reserved worldwide. // // This script will put a list of the 3 (this can be customized) last posts // sent to the server. func(inUndocumentedRequestFrame) begin // Array of the soup entries. local array theEntries := []; // Cursor on the soups, representing a query on the posts. local frame theCursor := GetUnionSoup("Notes"):query({tagspec: {equal: ['|NPDS.Board|]}, indexPath: 'timestamp}); // Entry to iterate on this cursor. local frame someEntry := theCursor:entry(); // Let's add all entries to the array. while( someEntry ) do begin AddArraySlot(theEntries, someEntry); someEntry := theCursor:next(); end; // We'll get most recent first. theEntries:= sort(theEntries, '|>|, 'timestamp); // Result with the list of posts. local string theResult := "

No post present.

\n"; // How many entries do we have? local int theLength := length( theEntries ); if (theLength > 0) then begin // We have at least one entry. Put the header. theResult := "

Most recent posts:

\n"; end; return theResult; end