+ <p class="help">Up to <strong>10</strong> filter boxes will appear as you start selecting tags. You can select <strong>multiple</strong> tags in each box by holding down the <strong>Ctrl</strong>-key. Click the "<strong>Filter!</strong>" button when you are ready.</p>
+
+ $(for n in {0..9}; do
+ hideall="$(echo "$taglist" |sed -rn "s;^([^:]+):.*$;hide('${n}_\\1')\\;;p" |sort -u)hide('${n}_none');"
+ echo "
+ <p class="filter" id=\"filter$n\" $([ $n -gt 0 ] && echo 'style="display:none;"')>
+ <span class=\"help conjunction\">and</span>
+ <label class=\"conjunction\"><input type=\"radio\" name=\"type$n\" value=\"pos\" checked>Any</label>
+ <label class=\"conjunction\"><input type=\"radio\" name=\"type$n\" value=\"neg\">None</label>
+ <span class=\"help\">of the tags selected here:</span>
+ <label for=\"category$n\" class=\"category\">Category:</label>
+ <select class=\"input category\" name=\"category$n\" size=\"1\" id=\"category$n\"
+ onchange=\"${hideall}show_block('${n}_'+this.options[this.options.selectedIndex].value)\">
+ <option>none</option>
+ $(echo "$taglist" |sed -rn 's;^([^:]+):.*$;<option>\1</option>;p' |sort -u)
+ </select>
+ <select class=\"input tagfilter\" name=\"cfilter${n}_\" size=\"12\" multiple id=\"${n}_none\"
+ onchange=\"show_iblock('filter$((1+$n))')\">
+ $(echo "$taglist" |sed -rn 's;^([^:]+)$;<option>\1</option>;p')
+ </select>
+ $(echo "$taglist" |sed -rn 's;^([^:]+):.*$;\1;p' |sort -u |while read cat; do echo "
+ <select class=\"input tagfilter\" name=\"cfilter${n}_\" size=\"12\" multiple id=\"${n}_$cat\" style=\"display:none;\"
+ onchange=\"show_iblock('filter$((1+$n))')\">
+ $(echo "$taglist" |sed -rn 's;^'"$cat"':(.*)$;<option>\1</option>;p')
+ </select>"
+ done)
+ </p>"
+ done)
+
+ <p class="filter final">
+ <label for="o3" class="order">Order by:</label>
+ <select class="edit order" size="1" name="o" id="o3">
+ <option>Name</option>
+ <option>Date</option>
+ <option>Length</option>
+ </select>
+ <input type="submit" value="Filter!">
+ </p>
+
+ <p class="quicklinks">
+ <label class="quicklinks">Most recent</label>
+ $(output=''
+ tac ${_DATA}/meta/recent |while [ "$(echo "$output" |wc -l)" -lt 10 ] && read line; do
+ line="<a href="$line">$line</a>"
+ echo "$output" |grep -qF "$line" || output="$output$line\n"
+ done
+ echo $output
+ )
+ </p>
+ </form>