mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 06:25:04 +00:00
The /admin page now accepts ?q=regex for a content search.
This commit is contained in:
parent
7b0e9285af
commit
a5766a6c83
1 changed files with 37 additions and 24 deletions
13
html.c
13
html.c
|
@ -2559,6 +2559,18 @@ int html_get_handler(const xs_dict *req, const char *q_path,
|
|||
*body = xs_dup(uid);
|
||||
status = 401;
|
||||
}
|
||||
else {
|
||||
char *q = xs_dict_get(q_vars, "q");
|
||||
|
||||
if (q && *q) {
|
||||
/* search by content */
|
||||
int to = 0;
|
||||
xs *tl = content_search(&snac, q, 1, 0, show, &to);
|
||||
|
||||
*body = html_timeline(&snac, tl, 0, 0, show, 0, NULL, "/admin", 1);
|
||||
*b_size = strlen(*body);
|
||||
status = 200;
|
||||
}
|
||||
else {
|
||||
double t = history_mtime(&snac, "timeline.html_");
|
||||
|
||||
|
@ -2592,6 +2604,7 @@ int html_get_handler(const xs_dict *req, const char *q_path,
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if (xs_startswith(p_path, "admin/p/")) { /** unique post by md5 **/
|
||||
if (!login(&snac, req)) {
|
||||
|
|
Loading…
Reference in a new issue