Index: pcb-rnd-poll.cgi =================================================================== --- pcb-rnd-poll.cgi (revision 1660) +++ pcb-rnd-poll.cgi (revision 1661) @@ -256,6 +256,13 @@ echo "" } +render_navi1() +{ + echo "show all" + echo " | " + echo "top 5 stats" +} + render_html() { local l @@ -281,6 +288,7 @@ *@captcha*) render_captcha ;; *@userinfo*) render_userinfo;; *@vote_submit) render_vote_submit;; + *@navi1*) render_navi1;; *) echo "$l" ;; esac done @@ -482,6 +490,7 @@ { local old_ifs n not_found votes tmp + export subs_current="statistics" case "$QS_fmt" in html|pie) ;; @@ -629,6 +638,33 @@ } +cmd_top_stats() +{ + + local l score name list cnt + + if test -z "$QS_len" + then + export QS_len=5 + fi + + cnt=1 + export QS_features=`find_all | while read l + do + score=$(get_score $l) + echo "$score $l" + done | sort -n -r | while read score name + do + basename $name + cnt=$(($cnt+1)) + if test $cnt -gt $QS_len + then + break + fi + done | tr "\n" "+" | sed "s/[+]$//" ` + cmd_stats +} + ########## main ############ @@ -660,6 +696,7 @@ logout) cmd_logout ;; captcha) cmd_captcha_jpg;; stats) cmd_stats ;; + top_stats) cmd_top_stats ;; *) cmd_list ;; esac Index: src/head.html =================================================================== --- src/head.html (revision 1660) +++ src/head.html (revision 1661) @@ -1,5 +1,5 @@ -

pcb-rnd feature poll

+

pcb-rnd feature poll

Currently shown: @current @@ -10,5 +10,6 @@ Search: +@navi1