Index: pcb-rnd-poll.cgi =================================================================== --- pcb-rnd-poll.cgi (revision 1659) +++ pcb-rnd-poll.cgi (revision 1660) @@ -522,7 +522,7 @@ echo "";; esac - echo "$votes" | awk -F "[|]" -v "choices=$choices" -v "choices_short=$choices_short" -v "qs_features=$QS_features" -v "cgi=$CGI" -v "fmt=$QS_fmt" ' + echo "$votes" | awk -F "[|]" -v "choices=$choices" -v "choices_short=$choices_short" -v "qs_features=$QS_features" -v "cgi=$CGI" -v "fmt=$QS_fmt" -v "root=$root" -v "srcdir=$srcdir" ' BEGIN { HTML=1 PIE=2 @@ -545,6 +545,15 @@ function html_tbl(TBL, divisor, feat ,n,img) { print "" + print "
" feature "" + print "
" load(feature, "short") "" + print "
" + if (feature != "") + print "" + else + print " " + + img=cgi "?cmd=stats&features=" feat "&fmt=pie" for(n=0; n < levels; n++) { print "
" CHOICES_SHORT[n+1] "
" CHOICES[n+1] "

 " @@ -553,6 +562,7 @@ print "
" } print "
" + print "
" } function pie_append(key, val) @@ -573,6 +583,15 @@ print pie | "(animpie; echo screenshot \\\"/dev/stdout\\\") | animator -H -x 300 -y 200" } + function load(fn, sect, tmp,l) + { + fn = root "/" fn "/" sect + close(fn) + while((getline l < fn) == 1) + tmp = tmp l "\n" + close(fn) + return tmp + } function out( u) { @@ -586,7 +605,6 @@ delete USER if (fmt == HTML) { - print "

" feature "

" html_tbl(VLOCAL, 1, feature) } features++ @@ -594,6 +612,7 @@ function out_end() { + feature="" if ((fmt == HTML) && (features > 1)) { print "

Average of " features " features

" html_tbl(VGLOBAL, features, qs_features)