Page Index Toggle Pages: 1 [2]  Send TopicPrint
Hot Topic (More than 10 Replies) installing Polls (Read 6430 times)
Spam
Full Member
***
Offline


I love Spam's HTTP

Posts: 159
Joined: Sep 18th, 2001
Re: installing Polls
Reply #15 - Feb 16th, 2002 at 10:47am
Print Post  
No problem... else you could mail me your display.pl and i'll do the change for you...

Cheers
Spam Wink
  

I do not spam you... even when i'm Spam Wink

[glow=yellow,2,300]Spam's HTTP [/glow]
Back to top
WWW  
IP Logged
 
Brookmans
New Member
*
Offline


I love YaBB 1G - SP1!

Posts: 43
Joined: Feb 14th, 2002
Re: installing Polls
Reply #16 - Feb 16th, 2002 at 3:34pm
Print Post  
Hope you had a good kip spam.

Everything is now the correct font EXCEPT for the poll options I type in - they come out too big.

Can you see where I have messed up?

[code] <tr valign="top">
    <td width="65"><font size=2><b>$polltxt{'16'}:</b></font></td>
    <td><font size=2>$pollquestion    $endedtext<br><br></font>
    </td>
  </tr>
  <tr>
    <td> </td>
       <td>
    <table width="90%" border="0" cellspacing="0" cellpadding="0"><font size=2>~;
    $nums = 0;
   
    my $Key;
     my $Total;
     foreach $Key (@votes) {
     $Total += $Key;
     }

  $totalvotes = $Total;
  pop (@options);
    foreach (@options) {
             # Censor the options.
           foreach (@censored) {
                 ($tmpa,$tmpb) = @{$_};
                 $options[$nums] =~ s~\Q$tmpa\E~$tmpb~gi;
           }
         $yymain .= qq~
  <tr valign="top">
     <td><font size=2><b>$options[$nums]  </b></font></td>
    <td><font size=2>~;
    unless ($votes[$nums] eq 0) {
   
$votepercent = ( $votes[$nums] / $totalvotes );                        
$pollbarpercent = ($votepercent * 100);
$votepercent = ($votepercent * 100);

# Now lets calculate how many devisions by the total number of votes are needed to make the bar graphs stay nicely sized in the browser window:

if ($totalvotes <= "10000" && $totalvotes => "5001") {
$pollbar = ($pollbarpercent / 1000);
}
if ($totalvotes <= "5000" && $totalvotes => "1001") {
$pollbar = ($pollbarpercent / 100);
}
if ($totalvotes <= "1000" && $totalvotes => "501") {
$pollbar = ($pollbarpercent / 50);
}
if ($totalvotes <= "500" && $totalvotes => "101") {
$pollbar = ($pollbarpercent / 15);
}
if ($totalvotes <= "100" && $totalvotes => "51") {
$pollbar = ($pollbarpercent / 8);
}
if ($totalvotes <= "50" && $totalvotes => "11") {
$pollbar = ($pollbarpercent *2);
}
if ($totalvotes <= "10" && $totalvotes => "1" && $votes[$nums] => "1") {      
$pollbar = ($pollbarpercent *4);
}
}
else { $pollbar = 0; }
unless ($totalvotes eq 0) {
$pollpercent = ( $votes[$nums] * 100 / $totalvotes);
}
my($roundedpercent) = shift;
$pollpercent = int($pollpercent + .5);

   
    $yymain .= qq~  <IMG SRC="$imagesdir/poll_left.gif"><IMG SRC="$imagesdir/poll_middle.gif" height="12" width="$pollbar"><IMG SRC="$imagesdir/poll_right.gif"> $votes[$nums] ($pollpercent%)</td>
</tr>~;
  $nums++;
  }

     $yymain .= qq~ </font></table>
     <br><font size=2><b>$polltxt{'17'}: $totalvotes</b>   $lockpoll<br><br>
    </font></td>
  </tr>
</table>
           </td>
           </tr>
           </table>~;
     }
     else {
           $board = $INFO{'board'};
                           # Censor the question.
           foreach (@censored) {
                 ($tmpa,$tmpb) = @{$_};
                 $pollquestion =~ s~\Q$tmpa\E~$tmpb~gi;
           }
           $yymain.= qq~<table border="0" width="100%" cellspacing="1" cellpadding="0" bgcolor="$color{'bordercolor'}" class="bordercolor">
           <tr>
           <td height="22" valign="middle" class="titlebg" color="$color{'titlebg'}">
           <font size=2 class="text1" color="$color{'titletext'}"> $img{'pollicon'} $polltxt{'15'}</font>
           </td>
           </tr>
           <tr>
           <td valign="top" align="middle" bgcolor="$color{'windowbg'}"><font size=2>
           <form name="poll" method="post" action="$cgi;action=vote;board=$board;num=$viewnum">
           <table border="0" width="100%" cellspacing="0" cellpadding="5" bgcolor="$color{'windowbg'}" class="windowbg">
  </font><tr valign="top">
    <td width="65"><font size=2><b>$polltxt{'16'}:</b></font></td>
    <td><font size=2>$pollquestion<br><br></font>
    </td>
  </tr>
  <tr>
    <td> </td>
       <td>
    <table width="90%" border="0" cellspacing="0" cellpadding="0"><font size=2>~;
    $nums = 0;
    pop (@options);
    foreach (@options) {
             # Censor the options.
           foreach (@censored) {
                 ($tmpa,$tmpb) = @{$_};
                 $options[$nums] =~ s~\Q$tmpa\E~$tmpb~gi;
           }      
         $yymain .= qq~
  </font><tr valign="top">
     <td width="5%"><font size=2><INPUT type="radio" name="option" value="$nums|$options[$nums]"></td>
    <td width="95%" valign="middle"><b>$options[$nums]</b></font></td>
  </tr>~;
  $nums++;
  }
     $yymain .= qq~
     </td>
  </tr>
</table>
<table>
<tr>
           <td width="5%"><font size=2><INPUT type="submit" value="$polltxt{'18'}"></font></td>
    <td width="95%"><b><font size=2><a $lockpoll</td>
    </font></tr>
    </table>
    </form>
           </td>
           </tr>
           </table>
           </td>
           </tr>
           </table>~;      
     }
}
$yymain .= qq~
<table cellpadding="0" cellspacing="0" border="0" width="100%" bgcolor="$color{'bordercolor'}" class="bordercolor" align="center">
  <tr>
    <td>
    <table cellpadding="3" cellspacing="1" border="0" width="100%">
     <tr><font size=2>
       <td valign="middle" align="left" width="20%" bgcolor="$color{'titlebg'}" class="titlebg">
       <font size=2 class="text1" color="$color{'titletext'}"> <img src="$imagesdir/$threadclass.gif" alt="">
        <b>$txt{'29'}</b></font></td>
       <td valign="middle" align="left" bgcolor="$color{'titlebg'}" class="titlebg" width="80%">
       <font size=2 class="text1" color="$color{'titletext'}"><b> $txt{'118'}: $msubthread</b>  ($txt{'641'} $views $txt{'642'})</font></td>
     </tr>
    </table>
    </td>
  </tr>
</table>[/code]
  
Back to top
 
IP Logged
 
Spam
Full Member
***
Offline


I love Spam's HTTP

Posts: 159
Joined: Sep 18th, 2001
Re: installing Polls
Reply #17 - Feb 16th, 2002 at 4:25pm
Print Post  
Yupp... you forgot one <font size=2> tag here:

Code
Select All
    <td width="95%" valign="middle"><b>$options[$nums]</b></font></td>
 



Cheers
Spam Wink
  

I do not spam you... even when i'm Spam Wink

[glow=yellow,2,300]Spam's HTTP [/glow]
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1 [2] 
Send TopicPrint