Make file html index more SEO friendly

This commit is contained in:
Michiel Broek 2011-06-28 13:13:47 +02:00
parent d8e1372502
commit 784f95776a
2 changed files with 25 additions and 36 deletions

View File

@ -4,6 +4,9 @@
Added some IPv6 configurations to the manual.
Changed META description lines in the manual.
mbfile:
Each html file index page now has an unique name to help
search engines.
v0.95.12 22-May-2011

View File

@ -1,10 +1,9 @@
/*****************************************************************************
*
* $Id: mbfindex.c,v 1.50 2007/02/26 21:02:31 mbse Exp $
* Purpose: File Database Maintenance - Build index for request processor
*
*****************************************************************************
* Copyright (C) 1997-2007
* Copyright (C) 1997-2011
*
* Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10
@ -64,22 +63,6 @@ static char *months[]= {(char *)"Jan",(char *)"Feb",(char *)"Mar",
/*
* Translate a string from ANSI to safe HTML characters
*/
/*
char *To_Html(char *);
char *To_Html(char *inp)
{
static char temp[1024];
memset(&temp, 0, sizeof(temp));
strncpy(temp, chartran(inp), sizeof(temp) -1);
return temp;
}
*/
void tidy_index(Findex **);
void tidy_index(Findex **fap)
@ -248,25 +231,28 @@ void pagelink(FILE *fa, char *Path, int inArea, int Current)
FILE *newpage(char *, char *, time_t, int, int, FILE *);
FILE *newpage(char *Path, char *Name, time_t later, int inArea, int Current, FILE *fi)
{
char linebuf[1024], outbuf[1024];
static FILE* fa;
char linebuf[1024], outbuf[1024];
static FILE* fa;
lastfile = Current;
if (Current)
snprintf(linebuf, 1024, "%s/index%d.temp", Path, Current / CFG.www_files_page);
else
snprintf(linebuf, 1024, "%s/index.temp", Path);
if ((fa = fopen(linebuf, "w")) == NULL) {
WriteError("$Can't create %s", linebuf);
} else {
snprintf(linebuf, 1024, "%s", Name);
html_massage(linebuf, outbuf, 1024);
MacroVars("ab", "ss", rfcdate(later), outbuf);
pagelink(fa, Path, inArea, Current);
MacroRead(fi, fa);
return fa;
}
return NULL;
lastfile = Current;
if (Current)
snprintf(linebuf, 1024, "%s/index%d.temp", Path, Current / CFG.www_files_page);
else
snprintf(linebuf, 1024, "%s/index.temp", Path);
if ((fa = fopen(linebuf, "w")) == NULL) {
WriteError("$Can't create %s", linebuf);
} else {
if (Current)
snprintf(linebuf, 1024, "%s page %d", Name, (Current / CFG.www_files_page) + 1);
else
snprintf(linebuf, 1024, "%s", Name);
html_massage(linebuf, outbuf, 1024);
MacroVars("ab", "ss", rfcdate(later), outbuf);
pagelink(fa, Path, inArea, Current);
MacroRead(fi, fa);
return fa;
}
return NULL;
}