Fossil SCM

/forum page now changes its title to 'Forum Search Results' when showing search results, per request in [forum:291f9af918 | forum post 291f9af918].

stephan 2021-08-11 18:54 trunk
Commit b0862611cc3574c4109f55f463e1f0a6635d9b12157458ce268a706a7406b614
1 file changed +3 -1
+3 -1
--- src/forum.c
+++ src/forum.c
@@ -1353,23 +1353,25 @@
13531353
**
13541354
** Query parameters:
13551355
**
13561356
** n=N The number of threads to show on each page
13571357
** x=X Skip the first X threads
1358
+** s=Y Search for term Y.
13581359
*/
13591360
void forum_main_page(void){
13601361
Stmt q;
13611362
int iLimit, iOfst, iCnt;
13621363
int srchFlags;
1364
+ const int isSearch = P("s")!=0;
13631365
login_check_credentials();
13641366
srchFlags = search_restrict(SRCH_FORUM);
13651367
if( !g.perm.RdForum ){
13661368
login_needed(g.anon.RdForum);
13671369
return;
13681370
}
13691371
style_set_current_feature("forum");
1370
- style_header("Forum");
1372
+ style_header( "%s", isSearch ? "Forum Search Results" : "Forum" );
13711373
if( g.perm.WrForum ){
13721374
style_submenu_element("New Thread","%R/forumnew");
13731375
}else{
13741376
/* Can't combine this with previous case using the ternary operator
13751377
* because that causes an error yelling about "non-constant format"
13761378
--- 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

Keyboard Shortcuts

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