Fossil SCM
/forum page now changes its title to 'Forum Search Results' when showing search results, per request in [forum:291f9af918 | forum post 291f9af918].
Commit
b0862611cc3574c4109f55f463e1f0a6635d9b12157458ce268a706a7406b614
Parent
1e919d601f774fd…
1 file changed
+3
-1
+3
-1
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -1353,23 +1353,25 @@ | ||
| 1353 | 1353 | ** |
| 1354 | 1354 | ** Query parameters: |
| 1355 | 1355 | ** |
| 1356 | 1356 | ** n=N The number of threads to show on each page |
| 1357 | 1357 | ** x=X Skip the first X threads |
| 1358 | +** s=Y Search for term Y. | |
| 1358 | 1359 | */ |
| 1359 | 1360 | void forum_main_page(void){ |
| 1360 | 1361 | Stmt q; |
| 1361 | 1362 | int iLimit, iOfst, iCnt; |
| 1362 | 1363 | int srchFlags; |
| 1364 | + const int isSearch = P("s")!=0; | |
| 1363 | 1365 | login_check_credentials(); |
| 1364 | 1366 | srchFlags = search_restrict(SRCH_FORUM); |
| 1365 | 1367 | if( !g.perm.RdForum ){ |
| 1366 | 1368 | login_needed(g.anon.RdForum); |
| 1367 | 1369 | return; |
| 1368 | 1370 | } |
| 1369 | 1371 | style_set_current_feature("forum"); |
| 1370 | - style_header("Forum"); | |
| 1372 | + style_header( "%s", isSearch ? "Forum Search Results" : "Forum" ); | |
| 1371 | 1373 | if( g.perm.WrForum ){ |
| 1372 | 1374 | style_submenu_element("New Thread","%R/forumnew"); |
| 1373 | 1375 | }else{ |
| 1374 | 1376 | /* Can't combine this with previous case using the ternary operator |
| 1375 | 1377 | * because that causes an error yelling about "non-constant format" |
| 1376 | 1378 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -1353,23 +1353,25 @@ | |
| 1353 | ** |
| 1354 | ** Query parameters: |
| 1355 | ** |
| 1356 | ** n=N The number of threads to show on each page |
| 1357 | ** x=X Skip the first X threads |
| 1358 | */ |
| 1359 | void forum_main_page(void){ |
| 1360 | Stmt q; |
| 1361 | int iLimit, iOfst, iCnt; |
| 1362 | int srchFlags; |
| 1363 | login_check_credentials(); |
| 1364 | srchFlags = search_restrict(SRCH_FORUM); |
| 1365 | if( !g.perm.RdForum ){ |
| 1366 | login_needed(g.anon.RdForum); |
| 1367 | return; |
| 1368 | } |
| 1369 | style_set_current_feature("forum"); |
| 1370 | style_header("Forum"); |
| 1371 | if( g.perm.WrForum ){ |
| 1372 | style_submenu_element("New Thread","%R/forumnew"); |
| 1373 | }else{ |
| 1374 | /* Can't combine this with previous case using the ternary operator |
| 1375 | * because that causes an error yelling about "non-constant format" |
| 1376 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -1353,23 +1353,25 @@ | |
| 1353 | ** |
| 1354 | ** Query parameters: |
| 1355 | ** |
| 1356 | ** n=N The number of threads to show on each page |
| 1357 | ** x=X Skip the first X threads |
| 1358 | ** s=Y Search for term Y. |
| 1359 | */ |
| 1360 | void forum_main_page(void){ |
| 1361 | Stmt q; |
| 1362 | int iLimit, iOfst, iCnt; |
| 1363 | int srchFlags; |
| 1364 | const int isSearch = P("s")!=0; |
| 1365 | login_check_credentials(); |
| 1366 | srchFlags = search_restrict(SRCH_FORUM); |
| 1367 | if( !g.perm.RdForum ){ |
| 1368 | login_needed(g.anon.RdForum); |
| 1369 | return; |
| 1370 | } |
| 1371 | style_set_current_feature("forum"); |
| 1372 | style_header( "%s", isSearch ? "Forum Search Results" : "Forum" ); |
| 1373 | if( g.perm.WrForum ){ |
| 1374 | style_submenu_element("New Thread","%R/forumnew"); |
| 1375 | }else{ |
| 1376 | /* Can't combine this with previous case using the ternary operator |
| 1377 | * because that causes an error yelling about "non-constant format" |
| 1378 |