Subversion Repositories IRC-Archiver

Rev

Rev 11 | Rev 13 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 11 Rev 12
Line 1... Line 1...
1
/* $Id: html.c 11 2024-08-30 05:20:32Z nishi $ */
1
/* $Id: html.c 12 2024-08-30 05:23:43Z nishi $ */
2
 
2
 
3
#include "web_html.h"
3
#include "web_html.h"
4
 
4
 
5
#include "ia_util.h"
5
#include "ia_util.h"
6
 
6
 
Line 45... Line 45...
45
	char* path = ia_strcat4(webroot, "/", name, ".html");
45
	char* path = ia_strcat4(webroot, "/", name, ".html");
46
	FILE* f = fopen(path, "w");
46
	FILE* f = fopen(path, "w");
47
	if(f != NULL) {
47
	if(f != NULL) {
48
		char* htmlesc = web_html_escape(name);
48
		char* htmlesc = web_html_escape(name);
49
		char* title = ia_strcat("Archive: ", htmlesc);
49
		char* title = ia_strcat("Archive: ", htmlesc);
50
		fprintf(f, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n");
50
		fprintf(f, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n");
51
		fprintf(f, "<html>\n");
51
		fprintf(f, "<html>\n");
52
		fprintf(f, "	<head>\n");
52
		fprintf(f, "	<head>\n");
53
		fprintf(f, "		<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">\n");
53
		fprintf(f, "		<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">\n");
54
		fprintf(f, "		<title>%s</title>\n", title);
54
		fprintf(f, "		<title>%s</title>\n", title);
55
		fprintf(f, "	</head>\n");
55
		fprintf(f, "	</head>\n");
56
		fprintf(f, "	<body>\n");
56
		fprintf(f, "	<body>\n");
-
 
57
		fprintf(f, "		<div style=\"text-align: center; background-color: #0000e0;\">\n");
-
 
58
		fprintf(f, "			<h1>%s</h1>\n", title);
-
 
59
		fprintf(f, "		</div>\n");
57
		fprintf(f, "	</body>\n");
60
		fprintf(f, "	</body>\n");
58
		fprintf(f, "</html>\n");
61
		fprintf(f, "</html>\n");
59
		fclose(f);
62
		fclose(f);
60
		free(title);
63
		free(title);
61
		free(htmlesc);
64
		free(htmlesc);