From ec5c72f06c45c563edecd2f7ec7eb6c1c268eb24 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 2 Jul 2024 20:01:00 +0200 Subject: [PATCH] Minor search tweaks. --- html.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/html.c b/html.c index b9946e6..2d1acd8 100644 --- a/html.c +++ b/html.c @@ -2634,7 +2634,9 @@ int html_get_handler(const xs_dict *req, const char *q_path, cache = 0; int skip = 0; - int show = xs_number_get(xs_dict_get(srv_config, "max_timeline_entries")); + int def_show = xs_number_get(xs_dict_get(srv_config, "max_timeline_entries")); + int show = def_show; + const xs_dict *q_vars = xs_dict_get(req, "q_vars"); if ((v = xs_dict_get(q_vars, "skip")) != NULL) skip = atoi(v), cache = 0, save = 0; @@ -2651,6 +2653,10 @@ int html_get_handler(const xs_dict *req, const char *q_path, } } + /* a show of 0 has no sense */ + if (show == 0) + show = def_show; + if (p_path == NULL) { /** public timeline **/ xs *h = xs_str_localtime(0, "%Y-%m.html"); @@ -2720,6 +2726,9 @@ int html_get_handler(const xs_dict *req, const char *q_path, xs *page = xs_fmt("/admin?q=%s&msecs=%d", q, msecs + 10); int tl_len = xs_list_len(tl); + if (to) + title = xs_fmt(L("Search results for '%s' (may be more)"), q); + else if (tl_len) title = xs_fmt(L("Search results for '%s'"), q); else