--- make_poll.pl 2003/09/24 19:55:43 1.8 +++ make_poll.pl 2003/10/21 15:15:08 1.13 @@ -53,6 +53,19 @@ # this is usename in database my $db_user="dpavlin"; +# This option allows users to fill poll without using invitation URL. +# That also means it's unpossible for them to return to exiting poll +# because they don't have thair own unique ID. Howver, it enables simple +# polls to be conducted by just publishing URL to them. +my $without_invitation=0; + +# This will remove numbers before answers. That enables you to have +# answers written like: +# 1.1 red +# 1.2 black +# and users will see just "red" and "black" +my $remove_nrs_in_answers=0; + #------------------------------------------------------------------ sub suck_file { @@ -212,6 +225,7 @@ $common_php =~ s/##PREFIX##/$prefix/g; my $members_db = $prefix."members"; $common_php =~ s/##MEMBERS_DB##/$members_db/g; +$common_php =~ s/##WITHOUT_INVITATION##/$without_invitation/g; print PHP $common_php; close(PHP); @@ -590,13 +604,16 @@ my @dropdown_data; + my $default_value = x($attref->{default_value}) || 'null'; + my $default_text = x($attref->{default_text}) || '-'; + $$ncref = sub { my ($xp, $text) = @_; if (defined $text) { chomp $text; $text=~s/^\s*//g; - $text=~s/^[\d\.\s]+//g; + $text=~s/^[\d\.\s]+//g if ($remove_nrs_in_answers); $text=~s/\s*$//g; push @dropdown_data,x($text) if ($text ne ""); } else { @@ -604,7 +621,7 @@ my $id=1; my $p=new_pit(); $body.="