include(config.m4)dnl #!__CMD_AWK__ -f # __CGIPATH__/sort # # Change search sort order include(src/config.awk) incl(src/cgi.awk) incl(src/util.awk) function main( i, lbl, opt, out, sel) { out = "" lbl[1] = "Default [^]" opt[1] = "nav_order asc" lbl[2] = "Default [v]" opt[2] = "nav_order desc" lbl[3] = "Weekly views [^]" opt[3] = "week asc" lbl[4] = "Weekly views [v]" opt[4] = "week desc" lbl[5] = "All-time views [^]" opt[5] = "downloads asc" lbl[6] = "All-time views [v]" opt[6] = "downloads desc" lbl[7] = "Title [^]" opt[7] = "title asc" lbl[8] = "Title [v]" opt[8] = "title desc" lbl[9] = "Date added [^]" opt[9] = "addeddate asc" lbl[10] = "Date added [v]" opt[10] = "addeddate desc" lbl[11] = "Date created [^]" opt[11] = "createddate asc" lbl[12] = "Date created [v]" opt[12] = "createddate desc" lbl[13] = "Date published [^]" opt[13] = "date asc" lbl[14] = "Date published [v]" opt[14] = "date desc" lbl[15] = "Creator [^]" opt[15] = "creator asc" lbl[16] = "Creator [v]" opt[16] = "creator desc" lbl[17] = "Random" opt[17] = "random asc" info(out, "# Sort by") info(out, "") for (i = 1; i < 18; i++) { sel = sprintf("%s/search?%s/sort%s", cgipath, search, opt[i]) item(out, "1", lbl[i], sel, server, port) } exit 0 } BEGIN { config_init() cgi_init() main() }