From 5af96ff5769b604cd726b5e53610f2870063f456 Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Sun, 3 Nov 2024 00:52:31 +1100 Subject: post titles make post titles links to the direct page as it isn't obvious the number girls are a link --- pages.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'pages.c') diff --git a/pages.c b/pages.c index fc0c280..e6cdeb7 100644 --- a/pages.c +++ b/pages.c @@ -657,9 +657,37 @@ writeposts(const int *posts, size_t totalposts, const char *outfile, int current return 0; } char c; + int in_title = 1; while ((c = fgetc(postfile)) != EOF) { - fputc(c, tmp); + // first line has to be the title + // 1 = start + // 2 = writing + // 3 = end + // -1 = not in title + if (in_title == 1) + { + fprintf(tmp, "", post); + fputc(c, tmp); + in_title = 2; + } + else if (in_title == 3) + { + + fprintf(tmp, ""); + fputc(c, tmp); + in_title = -1; + } + else if (in_title == 2 && c == '\n') + { + // check if we are finished title (new line) + in_title = 3; + fputc(c, tmp); + } + else + { + fputc(c, tmp); + } } fprintf(tmp, "
\n"); fclose(postfile); -- cgit v1.2.3