Fossil SCM
Omit the Forum Search at the top of the /forum page if search is disabled.
Commit
d4281bbc03f1b02493331a89c823612786e5ae7671e0872531b48e591a8bb31b
Parent
96fbcd1311c57e8…
1 file changed
+8
-4
+8
-4
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -928,11 +928,13 @@ | ||
| 928 | 928 | ** x=X Skip the first X threads |
| 929 | 929 | */ |
| 930 | 930 | void forum_main_page(void){ |
| 931 | 931 | Stmt q; |
| 932 | 932 | int iLimit, iOfst, iCnt; |
| 933 | + int srchFlags; | |
| 933 | 934 | login_check_credentials(); |
| 935 | + srchFlags = search_restrict(SRCH_FORUM); | |
| 934 | 936 | if( !g.perm.RdForum ){ |
| 935 | 937 | login_needed(g.anon.RdForum); |
| 936 | 938 | return; |
| 937 | 939 | } |
| 938 | 940 | style_header("Forum"); |
| @@ -940,14 +942,16 @@ | ||
| 940 | 942 | style_submenu_element("New Message","%R/forumnew"); |
| 941 | 943 | } |
| 942 | 944 | if( g.perm.ModForum && moderation_needed() ){ |
| 943 | 945 | style_submenu_element("Moderation Requests", "%R/modreq"); |
| 944 | 946 | } |
| 945 | - if( search_screen(SRCH_FORUM, 0) ){ | |
| 946 | - style_submenu_element("Recent Threads","%R/forum"); | |
| 947 | - style_footer(); | |
| 948 | - return; | |
| 947 | + if( (srchFlags & SRCH_FORUM)!=0 ){ | |
| 948 | + if( search_screen(SRCH_FORUM, 0) ){ | |
| 949 | + style_submenu_element("Recent Threads","%R/forum"); | |
| 950 | + style_footer(); | |
| 951 | + return; | |
| 952 | + } | |
| 949 | 953 | } |
| 950 | 954 | iLimit = atoi(PD("n","25")); |
| 951 | 955 | iOfst = atoi(PD("x","0")); |
| 952 | 956 | iCnt = 0; |
| 953 | 957 | if( db_table_exists("repository","forumpost") ){ |
| 954 | 958 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -928,11 +928,13 @@ | |
| 928 | ** x=X Skip the first X threads |
| 929 | */ |
| 930 | void forum_main_page(void){ |
| 931 | Stmt q; |
| 932 | int iLimit, iOfst, iCnt; |
| 933 | login_check_credentials(); |
| 934 | if( !g.perm.RdForum ){ |
| 935 | login_needed(g.anon.RdForum); |
| 936 | return; |
| 937 | } |
| 938 | style_header("Forum"); |
| @@ -940,14 +942,16 @@ | |
| 940 | style_submenu_element("New Message","%R/forumnew"); |
| 941 | } |
| 942 | if( g.perm.ModForum && moderation_needed() ){ |
| 943 | style_submenu_element("Moderation Requests", "%R/modreq"); |
| 944 | } |
| 945 | if( search_screen(SRCH_FORUM, 0) ){ |
| 946 | style_submenu_element("Recent Threads","%R/forum"); |
| 947 | style_footer(); |
| 948 | return; |
| 949 | } |
| 950 | iLimit = atoi(PD("n","25")); |
| 951 | iOfst = atoi(PD("x","0")); |
| 952 | iCnt = 0; |
| 953 | if( db_table_exists("repository","forumpost") ){ |
| 954 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -928,11 +928,13 @@ | |
| 928 | ** x=X Skip the first X threads |
| 929 | */ |
| 930 | void forum_main_page(void){ |
| 931 | Stmt q; |
| 932 | int iLimit, iOfst, iCnt; |
| 933 | int srchFlags; |
| 934 | login_check_credentials(); |
| 935 | srchFlags = search_restrict(SRCH_FORUM); |
| 936 | if( !g.perm.RdForum ){ |
| 937 | login_needed(g.anon.RdForum); |
| 938 | return; |
| 939 | } |
| 940 | style_header("Forum"); |
| @@ -940,14 +942,16 @@ | |
| 942 | style_submenu_element("New Message","%R/forumnew"); |
| 943 | } |
| 944 | if( g.perm.ModForum && moderation_needed() ){ |
| 945 | style_submenu_element("Moderation Requests", "%R/modreq"); |
| 946 | } |
| 947 | if( (srchFlags & SRCH_FORUM)!=0 ){ |
| 948 | if( search_screen(SRCH_FORUM, 0) ){ |
| 949 | style_submenu_element("Recent Threads","%R/forum"); |
| 950 | style_footer(); |
| 951 | return; |
| 952 | } |
| 953 | } |
| 954 | iLimit = atoi(PD("n","25")); |
| 955 | iOfst = atoi(PD("x","0")); |
| 956 | iCnt = 0; |
| 957 | if( db_table_exists("repository","forumpost") ){ |
| 958 |