write_formatted(fd,"[<a href=\"/index/?%s\">Back to the Main Index</a>]\n",sorttype[mode][0]);
else if(protocol && host)
write_formatted(fd,"[<a href=\"/index/%s/?%s\">Back to the Hosts Index</a>]\n",proto,sorttype[mode][0]);
else
write_string(fd,"[<a href=\"/\">Back to the Welcome Page</a>]\n");
write_string(fd,"</p>\n");
write_string(fd,tail);
}
free(newpath);
}
/*++++++++++++++++++++++++++++++++++++++
Index the root of the cache.
int fd The file descriptor to write to.
++++++++++++++++++++++++++++++++++++++*/
static void IndexRoot(int fd)
{
char *page=
"<h2>Main Index</h2>\n"
"This is the main index page for all of the files in the wwwoffle cache."
"<h3>New Format Index</h3>\n"
"The index of the files in the cache has changed in version 2.0 of wwwoffle compared to earlier versions."
"This is for a number of reasons:\n"
"<ul>\n"
"<li>So that the new protocol types can be introduced.\n"
"<li>To present a consistent interface for all of the index pages (the new buttons bars).\n"
"<li>To improve the formatting and layout.\n"
"</ul>\n"
"It is hoped that this new format is easier to use and makes more sense than the previous version.\n"
"<h3>First Level Index</h3>\n"
"This page is the first level index, it is available on the first of the three button bars.\n"
"<h3>Second Level Indexes</h3>\n"
"Below the main index there are several second level indexes as shown on the second of the button bars.\n"
"<br>These indexes are:\n"
"<dl compact>\n"
"<dt>Outgoing\n"
"<dd>The index of the requests that have been made while offline and are waiting to be fetched.\n"
"<dt>Monitored\n"
"<dd>The index of the pages that are automatically monitored at fixed intervals.\n"
"<dt>Last Time\n"
"<dd>All of the pages from all protocols that were fetched the last time that wwwoffle was online.\n"
"<dt>Latest\n"
"<dd>All of the latest pages (from the last %d days) from all protocols.\n"
"<dt>Protocols (http,ftp etc.)\n"
"<dd>Each of the protocols that wwwoffle supports has an index showing the hosts that have pages stored.\n"
"</dl>\n"
"<h3>Third Level Indexes</h3>\n"
"Below the protocol indexes there are third level indexes (not shown on the button bars).\n"
"<br>These indexes are the list of pages from a particular host using a particular protocol.\n"
"<h3>Sorting</h3>\n"
"All of the second and third level indexes can be sorted in several ways using the third button bar.\n"
"<br>These methods are:\n"
"<dl compact>\n"
"<dt>Unsorted\n"
"<dd>No sorting applied, this uses the default directory order.\n"
"<dt>Modification Time\n"
"<dd>The time that the page was last modified (most recent first), this could be when it was fetched or refreshed.\n"
"<dt>Access Time\n"
"<dd>The time that the page was last accessed (most recent first), this is the time that the page was last viewed (if later than modification time).\n"
"<dt>Date Changed\n"
"<dd>The same as for \"Modification Time\", but with separators for every day and a blank line for gaps of an hour or more.\n"
"<dt>Alphabetical\n"
"<dd>The pages are sorted into alphabetical order.\n"
"<dt>File Type\n"
"<dd>The pages are sorted alphabetically according to the file extension.\n"