Fossil SCM

/forumnew?legacy forces use of the older static form, as a way of testing that the old form remains working through this upheaval.

stephan 2026-06-06 17:16 UTC forum-editor-2026
Commit 354e82947a76efbf55c40faaf7a4adbefdd898544db9d8812663dfeaa98d917c
1 file changed +15 -11
+15 -11
--- src/forum.c
+++ src/forum.c
@@ -1984,11 +1984,11 @@
19841984
*/
19851985
void forumnew_page(void){
19861986
const char *zTitle = PDT("title","");
19871987
const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE);
19881988
const char *zContent = PDT("content","");
1989
-
1989
+ const int bLegacy = PB("legacy"); /* True for legacy HTML form */
19901990
login_check_credentials();
19911991
if( !g.perm.WrForum ){
19921992
login_needed(g.anon.WrForum);
19931993
return;
19941994
}
@@ -2001,34 +2001,38 @@
20012001
forum_render(zTitle, zMimetype, zContent, "forumEdit", 1);
20022002
}
20032003
style_set_current_feature("forum");
20042004
style_header("New Forum Thread");
20052005
2006
- @ <noscript>
2006
+ if( !bLegacy ){
2007
+ @ <noscript>
2008
+ }
20072009
@ <form action="%R/forume1" method="POST">
20082010
@ <h1>New Thread:</h1>
20092011
forum_from_line();
20102012
forum_post_widget(zTitle, zMimetype, zContent);
20112013
@ <input type="submit" name="preview" value="Preview">
2014
+ @ <input type="hidden" name="legacy" value="1">
20122015
if( P("preview") && !whitespace_only(zContent) ){
20132016
@ <input type="submit" name="submit" value="Submit">
20142017
}else{
20152018
@ <input type="submit" name="submit" value="Submit" disabled>
20162019
}
20172020
forum_render_debug_options();
20182021
login_insert_csrf_secret();
20192022
@ </form>
20202023
forum_render_attachment_notice();
2021
- @ </noscript>
2022
- /* When JS is disabled the block above will work.
2023
- When it's enabled, the above won't do anything and
2024
- JS will render the editor form. */
2025
-
2026
- @ <div hidden id='forumnew-placeholder'>
2027
- @ <input type='hidden' name='title' value='%h(zTitle)'>
2028
- login_insert_csrf_secret() /* the 2026 form */;
2029
- @ </div>
2024
+ if( !bLegacy ){
2025
+ @ </noscript>
2026
+ /* When JS is disabled the block above will work.
2027
+ When it's enabled, the above won't do anything and
2028
+ JS will render the editor form in the next element. */
2029
+ @ <div hidden id='forumnew-placeholder'>
2030
+ @ <input type='hidden' name='title' value='%h(zTitle)'>
2031
+ login_insert_csrf_secret();
2032
+ @ </div>
2033
+ }
20302034
forum_emit_js();
20312035
style_finish_page();
20322036
}
20332037
20342038
/*
20352039
--- src/forum.c
+++ src/forum.c
@@ -1984,11 +1984,11 @@
1984 */
1985 void forumnew_page(void){
1986 const char *zTitle = PDT("title","");
1987 const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE);
1988 const char *zContent = PDT("content","");
1989
1990 login_check_credentials();
1991 if( !g.perm.WrForum ){
1992 login_needed(g.anon.WrForum);
1993 return;
1994 }
@@ -2001,34 +2001,38 @@
2001 forum_render(zTitle, zMimetype, zContent, "forumEdit", 1);
2002 }
2003 style_set_current_feature("forum");
2004 style_header("New Forum Thread");
2005
2006 @ <noscript>
 
 
2007 @ <form action="%R/forume1" method="POST">
2008 @ <h1>New Thread:</h1>
2009 forum_from_line();
2010 forum_post_widget(zTitle, zMimetype, zContent);
2011 @ <input type="submit" name="preview" value="Preview">
 
2012 if( P("preview") && !whitespace_only(zContent) ){
2013 @ <input type="submit" name="submit" value="Submit">
2014 }else{
2015 @ <input type="submit" name="submit" value="Submit" disabled>
2016 }
2017 forum_render_debug_options();
2018 login_insert_csrf_secret();
2019 @ </form>
2020 forum_render_attachment_notice();
2021 @ </noscript>
2022 /* When JS is disabled the block above will work.
2023 When it's enabled, the above won't do anything and
2024 JS will render the editor form. */
2025
2026 @ <div hidden id='forumnew-placeholder'>
2027 @ <input type='hidden' name='title' value='%h(zTitle)'>
2028 login_insert_csrf_secret() /* the 2026 form */;
2029 @ </div>
 
2030 forum_emit_js();
2031 style_finish_page();
2032 }
2033
2034 /*
2035
--- src/forum.c
+++ src/forum.c
@@ -1984,11 +1984,11 @@
1984 */
1985 void forumnew_page(void){
1986 const char *zTitle = PDT("title","");
1987 const char *zMimetype = PD("mimetype",DEFAULT_FORUM_MIMETYPE);
1988 const char *zContent = PDT("content","");
1989 const int bLegacy = PB("legacy"); /* True for legacy HTML form */
1990 login_check_credentials();
1991 if( !g.perm.WrForum ){
1992 login_needed(g.anon.WrForum);
1993 return;
1994 }
@@ -2001,34 +2001,38 @@
2001 forum_render(zTitle, zMimetype, zContent, "forumEdit", 1);
2002 }
2003 style_set_current_feature("forum");
2004 style_header("New Forum Thread");
2005
2006 if( !bLegacy ){
2007 @ <noscript>
2008 }
2009 @ <form action="%R/forume1" method="POST">
2010 @ <h1>New Thread:</h1>
2011 forum_from_line();
2012 forum_post_widget(zTitle, zMimetype, zContent);
2013 @ <input type="submit" name="preview" value="Preview">
2014 @ <input type="hidden" name="legacy" value="1">
2015 if( P("preview") && !whitespace_only(zContent) ){
2016 @ <input type="submit" name="submit" value="Submit">
2017 }else{
2018 @ <input type="submit" name="submit" value="Submit" disabled>
2019 }
2020 forum_render_debug_options();
2021 login_insert_csrf_secret();
2022 @ </form>
2023 forum_render_attachment_notice();
2024 if( !bLegacy ){
2025 @ </noscript>
2026 /* When JS is disabled the block above will work.
2027 When it's enabled, the above won't do anything and
2028 JS will render the editor form in the next element. */
2029 @ <div hidden id='forumnew-placeholder'>
2030 @ <input type='hidden' name='title' value='%h(zTitle)'>
2031 login_insert_csrf_secret();
2032 @ </div>
2033 }
2034 forum_emit_js();
2035 style_finish_page();
2036 }
2037
2038 /*
2039

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button