diff --git a/src/elogd.c b/src/elogd.c index 0238b44b..1cf89414 100755 --- a/src/elogd.c +++ b/src/elogd.c @@ -6,6 +6,9 @@ Contents: Web server program for Electronic Logbook ELOG $Log$ + Revision 1.732 2005/07/29 09:06:33 ritt + Moved 'filter menu text' left of 'show only new entries' + Revision 1.731 2005/07/29 08:37:06 ritt Added 'filter menu text' @@ -16113,6 +16116,37 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands, rsprintf("\n"); + /*---- filter menu text ----*/ + + if (getcfg(lbs->name, "filter menu text", str, sizeof(str))) { + FILE *f; + char file_name[256], *buf; + + /* check if file starts with an absolute directory */ + if (str[0] == DIR_SEPARATOR || str[1] == ':') + strcpy(file_name, str); + else { + strlcpy(file_name, resource_dir, sizeof(file_name)); + strlcat(file_name, str, sizeof(file_name)); + } + + f = fopen(file_name, "rb"); + if (f != NULL) { + fseek(f, 0, SEEK_END); + size = TELL(fileno(f)); + fseek(f, 0, SEEK_SET); + + buf = xmalloc(size + 1); + fread(buf, 1, size, f); + buf[size] = 0; + fclose(f); + + rsputs(buf); + + } else + rsprintf("
Error: file \"%s\" not found
", file_name); + } + ref[0] = 0; if (!isparam("new_entries") || atoi(getparam("new_entries")) == 0) { build_ref(ref, sizeof(ref), "", "", "1"); @@ -16236,37 +16270,6 @@ void show_page_filters(LOGBOOK * lbs, int n_msg, int page_n, BOOL mode_commands, } } - /*---- filter menu text ----*/ - - if (getcfg(lbs->name, "filter menu text", str, sizeof(str))) { - FILE *f; - char file_name[256], *buf; - - /* check if file starts with an absolute directory */ - if (str[0] == DIR_SEPARATOR || str[1] == ':') - strcpy(file_name, str); - else { - strlcpy(file_name, resource_dir, sizeof(file_name)); - strlcat(file_name, str, sizeof(file_name)); - } - - f = fopen(file_name, "rb"); - if (f != NULL) { - fseek(f, 0, SEEK_END); - size = TELL(fileno(f)); - fseek(f, 0, SEEK_SET); - - buf = xmalloc(size + 1); - fread(buf, 1, size, f); - buf[size] = 0; - fclose(f); - - rsputs(buf); - - } else - rsprintf("
Error: file \"%s\" not found
", file_name); - } - rsprintf(" %d %s ", n_msg, loc("Entries")); rsprintf("\n\n");