Here is MiguelGomes' Rotation Hack for Abywns Polls!!!
miguelgomes wrote: Hi Jack,
When you delete one poll, you are deleting the line of file polls.txt. Thus the randomic number does not find a valid id and produces one poll empty in the homepage. I created more one variable: $prefer_poll. When the number generated for srand not to find one valid id, it will substitute for this poll. I think it will correct the problem. I wait opinions.
code:
sub poll { ########## # this sub generates complete Table-ROWS it therefore has to be included in a boxheader and boxfooter
# if ($polls_are_loaded ne "YES") { load_polls(); }
if ($_ ne "" && $existpoll{$_}) { $thispollid = "$_"; } elsif ($info{'pollid'} ne "" && $info{'pollid'} !=~ /\W/) { $thispollid = $info{'pollid'} } else {
################################################################## # polls rotator hack for polls.pl (core code) and Abwin Polls ### # by miguelgomes # Configs: # 1= rotate 0 = fixes the last poll $rotatepoll="1"; # Put the id of poll to use this. Live this blank to use rotation $onlyonepoll=""; # put the id of poll defaut for use when encounter a invalid id $preferpoll="1"; ######################################## if ($rotatepoll="1") {
srand; $max=@polls; @quant=(0..$max); $next_poll = int(rand(@quant)); # number
} if ($onlyonepoll ne ""){$next_poll =$onlyonepoll;} $thispollid = $pollid; }
if ($thispollid eq ""){$thispollid="$preferpoll";}
just go at my site and see. if you dont undestend is becouse you`re stupid. try like this, vote 5 times on the poll, at the same questions, and you`ll see the point
This web site was made with WebAPP v0.9.9.3.3 , a web portal system written in Perl
All trademarks and copyrights on this page are owned by their
respective owners. Comments are owned by the Poster.