openmamba-website/wwwroot/cgi-bin/randombanner.cgi

15 lines
464 B
Plaintext
Raw Permalink Normal View History

2011-04-29 19:11:08 +02:00
#!/bin/bash
echo $header
[ "$1" ] && SHOW_BANNERS="$1"
[ "$SHOW_BANNERS" ] || SHOW_BANNERS=6
. ../banners/auto/settings.inc
[ "$HORIZONTAL_BANNERS" ] && echo "<table style=\"border:0\"><tr>"
for i in `seq 1 $SHOW_BANNERS`; do
number=$RANDOM
let number="$number % $banner_count"
[ "$HORIZONTAL_BANNERS" ] && echo "<td>"
cat ../banners/auto/$number.html
[ "$HORIZONTAL_BANNERS" ] && echo "</td>"
done
[ "$HORIZONTAL_BANNERS" ] && echo "</tr></table>"