]> bicyclesonthemoon.info Git - ott/mirror/commitdiff
Auto refresh after post
authorb <rowerynaksiezycu@gmail.com>
Sun, 9 Oct 2022 13:48:40 +0000 (13:48 +0000)
committerb <rowerynaksiezycu@gmail.com>
Sun, 9 Oct 2022 13:48:40 +0000 (13:48 +0000)
post.1.c
view.1.awk
www/ott/info.htm

index 508ffb0fb9822740a7a9a7cdfd59ca10a2fd3f20..1feb22697283dedb9b1e8296021e62013452e3df 100644 (file)
--- a/post.1.c
+++ b/post.1.c
@@ -2,7 +2,7 @@
 // Copyright (C) 2014, 2022 Balthasar Szczepański
 // post.c automatically generated from post.1.c
 // write posts from the mirror.
-// 29.09.2022
+// 09.10.2022
 //
 // This file is part of OTT mirror.
 //
@@ -377,13 +377,14 @@ void submit()
        }
        else
                snprintf(arg1,N_STRBUF,"info=<p>This message has been posted successfully.<br /><br /><a href=\"/ott/mview?p=%s#m%s\">View your submitted message</a><br /><br /><a href=\"/ott/\">Return to the ЯOЯЯIM TTO</a></p>",timenumber,timenumber);
+               snprintf(arg2,N_STRBUF,"refresh=<meta http-equiv=\"refresh\" content=\"6; URL=/ott/mview?p=%s#m%s\" />",timenumber,timenumber);
        
        printf("Content-type: text/html\n\n");
        fflush(stdout);
        sub=fork();
        if(sub==0)
        {
-               r=execl(MAWK_PATH,MAWK_PATH,"-f",AWK_VIEW,"-v",arg1,INFO_PATH,(char *)0);
+               r=execl(MAWK_PATH,MAWK_PATH,"-f",AWK_VIEW,"-v",arg1,"-v",arg2,INFO_PATH,(char *)0);
                exit(r);
        }
        waitpid(sub,&r,0);
index 72b0448510f55183665c4a498e3dcacb5afc4ad6..e86cb5fd1cc9bc2ebc44b86ceb0780a934727dc2 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright (C) 2014, 2022 Balthasar Szczepański
 # view.awk automatically generated from view.1.awk
 # insert content into a viewed page.
-# 29.09.2022
+# 09.10.2022
 
 # This file is part of OTT mirror.
 #
@@ -49,6 +49,10 @@ BEGIN{
        {
                print info;
        }
+       else if ($0 ~ /^###refresh/)
+       {
+               print refresh;
+       }
        else if ($0 ~ /^###title/)
        {
                print title;
index 31f65812690f01684052415f3384d9139f5090ab..76e1bdd764d8cd8134e298a901fc0aa69db546ac 100644 (file)
@@ -1,6 +1,7 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-gb" xml:lang="en-gb">
 <head>
+###refresh
 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
 <meta http-equiv="content-style-type" content="text/css" />
 <meta http-equiv="content-language" content="en-gb" />