Fossil SCM
Make the maximum title length when creating a new forum post configurable using the new forum-max-title setting.
Commit
83613064b853e70bf6cb76fa5c1e2342f29b267f02c002dcf8d93ae6574cf6d8
Parent
852e7b61b6ca874…
1 file changed
+12
-1
+12
-1
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -1846,12 +1846,17 @@ | ||
| 1846 | 1846 | const char *zTitle, |
| 1847 | 1847 | const char *zMimetype, |
| 1848 | 1848 | const char *zContent |
| 1849 | 1849 | ){ |
| 1850 | 1850 | if( zTitle ){ |
| 1851 | + int mxTitle = db_get_int("forum-max-title", 125); | |
| 1851 | 1852 | @ Title: <input type="input" name="title" value="%h(zTitle)" size="50" |
| 1852 | - @ maxlength="125"><br> | |
| 1853 | + if( mxTitle>0 ){ | |
| 1854 | + @ maxlength="%d(mxTitle)"><br> | |
| 1855 | + }else{ | |
| 1856 | + @ ><br> | |
| 1857 | + } | |
| 1853 | 1858 | } |
| 1854 | 1859 | @ %z(href("%R/markup_help"))Markup style</a>: |
| 1855 | 1860 | mimetype_option_menu(zMimetype, "mimetype"); |
| 1856 | 1861 | @ <div class="forum-editor-widget"> |
| 1857 | 1862 | @ <textarea aria-label="Content:" name="content" class="wikiedit" \ |
| @@ -2305,10 +2310,15 @@ | ||
| 2305 | 2310 | ** This is the name or "title" of the Forum for this repository. The |
| 2306 | 2311 | ** default is just "Forum". But in some setups, admins might want to |
| 2307 | 2312 | ** change it to "Developer Forum" or "User Forum" or whatever other name |
| 2308 | 2313 | ** seems more appropriate for the particular usage. |
| 2309 | 2314 | ** |
| 2315 | +** SETTING: forum-max-title width=10 default=125 | |
| 2316 | +** The maximum number of characters allowed in the title of a new | |
| 2317 | +** forum thread, as enforced by the web browser on the post editor. | |
| 2318 | +** A value of zero or less means there is no limit. | |
| 2319 | +** | |
| 2310 | 2320 | ** SETTING: attachment-size-limit width=16 |
| 2311 | 2321 | ** The maximum number of bytes for an attachment to a wiki page, |
| 2312 | 2322 | ** ticket, tech note, or forum post. The default (or 0) is unlimited |
| 2313 | 2323 | ** but a limit may be imposed by the web server or a proxy. |
| 2314 | 2324 | ** |
| @@ -2332,10 +2342,11 @@ | ||
| 2332 | 2342 | void forum_setup(void){ |
| 2333 | 2343 | /* boolean config settings specific to the forum. */ |
| 2334 | 2344 | static const char *azForumSettings[] = { |
| 2335 | 2345 | "forum-close-policy", |
| 2336 | 2346 | "forum-title", |
| 2347 | + "forum-max-title", | |
| 2337 | 2348 | "forum-statuses", |
| 2338 | 2349 | }; |
| 2339 | 2350 | |
| 2340 | 2351 | login_check_credentials(); |
| 2341 | 2352 | if( !g.perm.Setup ){ |
| 2342 | 2353 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -1846,12 +1846,17 @@ | |
| 1846 | const char *zTitle, |
| 1847 | const char *zMimetype, |
| 1848 | const char *zContent |
| 1849 | ){ |
| 1850 | if( zTitle ){ |
| 1851 | @ Title: <input type="input" name="title" value="%h(zTitle)" size="50" |
| 1852 | @ maxlength="125"><br> |
| 1853 | } |
| 1854 | @ %z(href("%R/markup_help"))Markup style</a>: |
| 1855 | mimetype_option_menu(zMimetype, "mimetype"); |
| 1856 | @ <div class="forum-editor-widget"> |
| 1857 | @ <textarea aria-label="Content:" name="content" class="wikiedit" \ |
| @@ -2305,10 +2310,15 @@ | |
| 2305 | ** This is the name or "title" of the Forum for this repository. The |
| 2306 | ** default is just "Forum". But in some setups, admins might want to |
| 2307 | ** change it to "Developer Forum" or "User Forum" or whatever other name |
| 2308 | ** seems more appropriate for the particular usage. |
| 2309 | ** |
| 2310 | ** SETTING: attachment-size-limit width=16 |
| 2311 | ** The maximum number of bytes for an attachment to a wiki page, |
| 2312 | ** ticket, tech note, or forum post. The default (or 0) is unlimited |
| 2313 | ** but a limit may be imposed by the web server or a proxy. |
| 2314 | ** |
| @@ -2332,10 +2342,11 @@ | |
| 2332 | void forum_setup(void){ |
| 2333 | /* boolean config settings specific to the forum. */ |
| 2334 | static const char *azForumSettings[] = { |
| 2335 | "forum-close-policy", |
| 2336 | "forum-title", |
| 2337 | "forum-statuses", |
| 2338 | }; |
| 2339 | |
| 2340 | login_check_credentials(); |
| 2341 | if( !g.perm.Setup ){ |
| 2342 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -1846,12 +1846,17 @@ | |
| 1846 | const char *zTitle, |
| 1847 | const char *zMimetype, |
| 1848 | const char *zContent |
| 1849 | ){ |
| 1850 | if( zTitle ){ |
| 1851 | int mxTitle = db_get_int("forum-max-title", 125); |
| 1852 | @ Title: <input type="input" name="title" value="%h(zTitle)" size="50" |
| 1853 | if( mxTitle>0 ){ |
| 1854 | @ maxlength="%d(mxTitle)"><br> |
| 1855 | }else{ |
| 1856 | @ ><br> |
| 1857 | } |
| 1858 | } |
| 1859 | @ %z(href("%R/markup_help"))Markup style</a>: |
| 1860 | mimetype_option_menu(zMimetype, "mimetype"); |
| 1861 | @ <div class="forum-editor-widget"> |
| 1862 | @ <textarea aria-label="Content:" name="content" class="wikiedit" \ |
| @@ -2305,10 +2310,15 @@ | |
| 2310 | ** This is the name or "title" of the Forum for this repository. The |
| 2311 | ** default is just "Forum". But in some setups, admins might want to |
| 2312 | ** change it to "Developer Forum" or "User Forum" or whatever other name |
| 2313 | ** seems more appropriate for the particular usage. |
| 2314 | ** |
| 2315 | ** SETTING: forum-max-title width=10 default=125 |
| 2316 | ** The maximum number of characters allowed in the title of a new |
| 2317 | ** forum thread, as enforced by the web browser on the post editor. |
| 2318 | ** A value of zero or less means there is no limit. |
| 2319 | ** |
| 2320 | ** SETTING: attachment-size-limit width=16 |
| 2321 | ** The maximum number of bytes for an attachment to a wiki page, |
| 2322 | ** ticket, tech note, or forum post. The default (or 0) is unlimited |
| 2323 | ** but a limit may be imposed by the web server or a proxy. |
| 2324 | ** |
| @@ -2332,10 +2342,11 @@ | |
| 2342 | void forum_setup(void){ |
| 2343 | /* boolean config settings specific to the forum. */ |
| 2344 | static const char *azForumSettings[] = { |
| 2345 | "forum-close-policy", |
| 2346 | "forum-title", |
| 2347 | "forum-max-title", |
| 2348 | "forum-statuses", |
| 2349 | }; |
| 2350 | |
| 2351 | login_check_credentials(); |
| 2352 | if( !g.perm.Setup ){ |
| 2353 |