Fix master html index
This commit is contained in:
parent
8fc6b50abf
commit
429b98994a
@ -589,8 +589,9 @@ void HtmlIndex(char *Lang)
|
||||
|
||||
/*
|
||||
* Setup the correct table to produce file listings for the www.
|
||||
* This make ANSI grafics look a bit nicer with browsers.
|
||||
*/
|
||||
charset_set_in_out((char *)"x-ibmpc", (char *)"iso-8859-1");
|
||||
charset_set_in_out((char *)"cp437", (char *)"iso-8859-1");
|
||||
|
||||
for (i = 1; i <= iAreas; i++) {
|
||||
|
||||
@ -615,12 +616,13 @@ void HtmlIndex(char *Lang)
|
||||
sprintf(temp, "%s/index.html", area.Path);
|
||||
obj_time = (int) file_time(temp);
|
||||
|
||||
if (strncmp(CFG.ftp_base, area.Path, strlen(CFG.ftp_base)) == 0)
|
||||
Syslog('f', "Area %d index.html is %s", i, (obj_time < db_time) ? "outdated" : "up todate");
|
||||
|
||||
/*
|
||||
* Create index.html pages in each available download area when not up to date.
|
||||
*/
|
||||
if (fm && (obj_time < db_time) && (strncmp(CFG.ftp_base, area.Path, strlen(CFG.ftp_base)) == 0)) {
|
||||
if (fm && (strncmp(CFG.ftp_base, area.Path, strlen(CFG.ftp_base)) == 0)) {
|
||||
|
||||
fseek(fdb_area->fp, fdbhdr.hdrsize, SEEK_SET);
|
||||
AreasHtml++;
|
||||
@ -633,6 +635,11 @@ void HtmlIndex(char *Lang)
|
||||
aSize = 0L;
|
||||
aTotal = 0;
|
||||
last = 0L;
|
||||
|
||||
if (obj_time < db_time) {
|
||||
/*
|
||||
* If not up todate
|
||||
*/
|
||||
if ((fb = OpenMacro("html.areas", 'E', TRUE)) == NULL) {
|
||||
fa = NULL;
|
||||
} else {
|
||||
@ -745,6 +752,21 @@ void HtmlIndex(char *Lang)
|
||||
break;
|
||||
Syslog('+', "Removed obsolete %s", linebuf);
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* Area was up todate, but we need some data for the main index page.
|
||||
*/
|
||||
while (fread(&fdb, fdbhdr.recsize, 1, fdb_area->fp) == 1) {
|
||||
if (!fdb.Deleted) {
|
||||
TotalHtml++;
|
||||
aTotal++;
|
||||
aSize += fdb.Size;
|
||||
if (fdb.FileDate > last)
|
||||
last = fdb.FileDate;
|
||||
}
|
||||
}
|
||||
KSize += aSize / 1024;
|
||||
}
|
||||
|
||||
strcpy(linebuf, area.Name);
|
||||
html_massage(linebuf, namebuf);
|
||||
|
Reference in New Issue
Block a user