Fossil SCM

Omit the Forum Search at the top of the /forum page if search is disabled.

drh 2018-08-31 11:32 trunk
Commit d4281bbc03f1b02493331a89c823612786e5ae7671e0872531b48e591a8bb31b
1 file changed +8 -4
+8 -4
--- src/forum.c
+++ src/forum.c
@@ -928,11 +928,13 @@
928928
** x=X Skip the first X threads
929929
*/
930930
void forum_main_page(void){
931931
Stmt q;
932932
int iLimit, iOfst, iCnt;
933
+ int srchFlags;
933934
login_check_credentials();
935
+ srchFlags = search_restrict(SRCH_FORUM);
934936
if( !g.perm.RdForum ){
935937
login_needed(g.anon.RdForum);
936938
return;
937939
}
938940
style_header("Forum");
@@ -940,14 +942,16 @@
940942
style_submenu_element("New Message","%R/forumnew");
941943
}
942944
if( g.perm.ModForum && moderation_needed() ){
943945
style_submenu_element("Moderation Requests", "%R/modreq");
944946
}
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
+ }
949953
}
950954
iLimit = atoi(PD("n","25"));
951955
iOfst = atoi(PD("x","0"));
952956
iCnt = 0;
953957
if( db_table_exists("repository","forumpost") ){
954958
--- 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

Keyboard Shortcuts

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