| ︙ | | |
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
|
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
|
-
+
|
** f -> forum
** all -> everything
*/
void search_page(void){
login_check_credentials();
style_header("Search");
search_screen(SRCH_ALL, 1);
style_body_and_footer("search");
style_finish_page("search");
}
/*
** This is a helper function for search_stext(). Writing into pOut
** the search text obtained from pIn according to zMimetype.
**
|
| ︙ | | |
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
|
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
|
-
+
|
const char *zIdxed = P("ixed");
int id;
int cnt1 = 0, cnt2 = 0, cnt3 = 0;
login_check_credentials();
if( !g.perm.Admin ){ login_needed(0); return; }
if( !search_index_exists() ){
@ <p>Indexed search is disabled
style_body_and_footer("report");
style_finish_page("report");
return;
}
search_sql_setup(g.db);
style_submenu_element("Setup","%R/srchsetup");
if( zId!=0 && (id = atoi(zId))>0 ){
/* Show information about a single ftsdocs entry */
style_header("Information about ftsdoc entry %d", id);
|
| ︙ | | |
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
|
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
|
-
+
|
@ </table>
zName = mprintf("Indexed '%c' docs",zDocId[0]);
style_submenu_element(zName,"%R/test-ftsdocs?y=%c&ixed=1",zDocId[0]);
zName = mprintf("Unindexed '%c' docs",zDocId[0]);
style_submenu_element(zName,"%R/test-ftsdocs?y=%c&ixed=0",zDocId[0]);
}
db_finalize(&q);
style_body_and_footer("test");
style_finish_page("test");
return;
}
if( zType!=0 && zType[0]!=0 && zType[1]==0 &&
zIdxed!=0 && (zIdxed[0]=='1' || zIdxed[0]=='0') && zIdxed[1]==0
){
int ixed = zIdxed[0]=='1';
char *zName;
|
| ︙ | | |
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
|
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
|
-
+
|
@ <ul>
while( db_step(&q)==SQLITE_ROW ){
@ <li> <a href='test-ftsdocs?id=%d(db_column_int(&q,0))'>
@ %h(db_column_text(&q,1))</a>
}
@ </ul>
db_finalize(&q);
style_body_and_footer("test");
style_finish_page("test");
return;
}
style_header("Summary of ftsdocs");
db_prepare(&q,
"SELECT type, sum(idxed IS TRUE), sum(idxed IS FALSE), count(*)"
" FROM ftsdocs"
" GROUP BY 1 ORDER BY 4 DESC"
|
| ︙ | | |
2097
2098
2099
2100
2101
2102
2103
2104
2105
|
2097
2098
2099
2100
2101
2102
2103
2104
2105
|
-
+
|
}
db_finalize(&q);
@ </tbody><tfooter>
@ <tr><th>Total<th align="right">%d(cnt1)<th align="right">%d(cnt2)
@ <th align="right">%d(cnt3)
@ </tfooter>
@ </table>
style_body_and_footer("test");
style_finish_page("test");
}
|