diff options
| author | 2024-05-11 09:29:38 +0200 | |
|---|---|---|
| committer | 2024-05-11 09:29:38 +0200 | |
| commit | 1762e0f1459599524b54aabfd470e171e1d6e592 (patch) | |
| tree | 10d950904c5d559a9454d4b201b216de7b182798 | |
| parent | Added a search box. (diff) | |
| download | snac2-1762e0f1459599524b54aabfd470e171e1d6e592.tar.gz snac2-1762e0f1459599524b54aabfd470e171e1d6e592.tar.xz snac2-1762e0f1459599524b54aabfd470e171e1d6e592.zip | |
Added an incremental max seconds value to every content search page.
| -rw-r--r-- | html.c | 7 |
1 files changed, 4 insertions, 3 deletions
| @@ -2525,7 +2525,7 @@ int html_get_handler(const xs_dict *req, const char *q_path, | |||
| 2525 | 2525 | ||
| 2526 | int skip = 0; | 2526 | int skip = 0; |
| 2527 | int show = xs_number_get(xs_dict_get(srv_config, "max_timeline_entries")); | 2527 | int show = xs_number_get(xs_dict_get(srv_config, "max_timeline_entries")); |
| 2528 | char *q_vars = xs_dict_get(req, "q_vars"); | 2528 | xs_dict *q_vars = xs_dict_get(req, "q_vars"); |
| 2529 | if ((v = xs_dict_get(q_vars, "skip")) != NULL) | 2529 | if ((v = xs_dict_get(q_vars, "skip")) != NULL) |
| 2530 | skip = atoi(v), cache = 0, save = 0; | 2530 | skip = atoi(v), cache = 0, save = 0; |
| 2531 | if ((v = xs_dict_get(q_vars, "show")) != NULL) | 2531 | if ((v = xs_dict_get(q_vars, "show")) != NULL) |
| @@ -2575,9 +2575,10 @@ int html_get_handler(const xs_dict *req, const char *q_path, | |||
| 2575 | if (q && *q) { | 2575 | if (q && *q) { |
| 2576 | /** search by content **/ | 2576 | /** search by content **/ |
| 2577 | int to = 0; | 2577 | int to = 0; |
| 2578 | xs *tl = content_search(&snac, q, 1, skip, show, skip ? 10 : 0, &to); | 2578 | int msecs = atoi(xs_dict_get_def(q_vars, "msecs", "0")); |
| 2579 | xs *tl = content_search(&snac, q, 1, skip, show, msecs, &to); | ||
| 2579 | xs *title = NULL; | 2580 | xs *title = NULL; |
| 2580 | xs *page = xs_fmt("/admin?q=%s", q); | 2581 | xs *page = xs_fmt("/admin?q=%s&msecs=%d", q, msecs + 10); |
| 2581 | int tl_len = xs_list_len(tl); | 2582 | int tl_len = xs_list_len(tl); |
| 2582 | 2583 | ||
| 2583 | if (tl_len) | 2584 | if (tl_len) |