+w_advsearch(){
+ local n lbid tag category tn filter f
+ filter="${FILTER}^"
+
+ printf '[form #advsearch action=?a=advsearch method=POST
+ [a href="#" Hide]
+ [p .help Select multiple tags from each category by holding down the [strong Ctrl] key on your keyboard.[br]
+ Refine the search further by setting additional search tags using the [strong "+and"] button.]
+ [hidden "ref" "%s"]
+ ' "$w_refuri"
+
+ for n in 1 2 3 4 5 6 7 8 9 10; do
+ f="${filter%%^*}"; filter="${filter#*^}"
+
+ lbid="$(HTML "cat_${n}_(none)")"
+ printf '[input .and type=checkbox name=and id="and_%i" %s][label for="and_%i" +and
+ ][fieldset .select
+ [input .pol type="radio" name=pol_%i %s id="pol_pos_%i"][label for=pol_pos_%i Any]
+ [input .pol type="radio" name=pol_%i %s id="pol_neg_%i"][label for=pol_neg_%i None]
+ [label .head Category:]' \
+ $n "$([ "$f" ] && printf 'checked="checked"')" $n \
+ $n "$([ "$f" -a ! "${f%%~*}" ] || printf 'checked="checked"')" $n $n \
+ $n "$([ "$f" -a ! "${f%%~*}" ] && printf 'checked="checked"')" $n $n
+ f="|${f#~}|"
+
+ printf '*\n%s\n' "$w_tagcategories" \
+ | while read -r category; do
+ lbid="$(HTML "cat_${n}_${category}")"
+ printf '[input .cat type=radio %s name="cat_%i" id="%s"][label for="%s" %s]
+ [select name=tag_%s size=10 multiple="multiple"' \
+ "$([ ! "${f%%*|${category}:*}" -o ! "${category%\*}" ] && printf 'checked="checked"')" \
+ $n "$lbid" "$lbid" "$(HTML "$category")" $n