Deeman
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Xnom Цитата: подумал ну я же надеюсь эти остальные не такие уж и тупые ---------- еще кто хочет может поменять дизайн вывода голосования.. ---------- всё что между: Код: #-------Polls #-------End Polls | надо заменить на это: Код: $pollfileexist = "1"; $filetoopen = "$ikondir" . "forum$inforum/$topicid.poll"; open(FILE1,"$filetoopen") or ($pollfileexist = "0"); @pollfile = <FILE1>; close(FILE1); if ($pollfileexist eq "1") { ($poll1,$poll1v,$poll2,$poll2v,$poll3,$poll3v,$poll4,$poll4v,$poll5,$poll5v,$poll6,$poll6v,$poll7,$poll7v,$poll8,$poll8v,$poll9,$poll9v,$poll10,$poll10v) = split(/\|/,$pollfile[0]); $totalvotes = ($poll1v + $poll2v + $poll3v + $poll4v + $poll5v + $poll6v + $poll7v + $poll8v + $poll9v + $poll10v); $pollvoters = "1"; $filetoopen = "$ikondir" . "forum$inforum/$intopic.vote"; $filetoopen = &stripMETA($filetoopen); open(FILE, "$filetoopen") or ($pollvoters = "0"); @allvoters = <FILE>; close(FILE); $votesubmitbutton = qq~<input style="BACKGROUND-COLOR: #FFFFFF; BORDER: 1px solid #000000" type=Submit value="Голосовать" name="Submit" onClick="return clckcntr();">~; if ($pollvoters eq "1") { foreach $voters (@allvoters) { chomp $voters; if ($inmembername eq $voters) { $votesubmitbutton = "Вы больше не можете голосовать в этой теме."; } } } if ($inmembername eq "Guest") { $votesubmitbutton = "Гости гне могут голосовать пожалуйста <a href=register.cgi>зарегистрируйтесь</a>."; } if ($membercode eq "banned") { $votesubmitbutton = "Забаненые участники не могут голосовать."; } if ($threadstate eq "closed") { $votesubmitbutton = "Тема закрыта."; } if ($poll1 ne "") { $polloption = $poll1; $pollvotes = $poll1v; if ($pollvotes ne "0") { $pollpercent = int(($pollvotes / $totalvotes) * 100); $pollwidth = int($pollpercent * 3); } else { $pollpercent = 0; } if ($pollpercent eq "0") { $pollb = "" } else { $pollb = qq~<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD BGCOLOR="$pollbar"><IMG SRC="$imagesurl/images/spacer.gif" HEIGHT="10" WIDTH="$pollwidth"></TD></TR></TABLE>~; } $poll = qq( <tr> <td class=dats bgcolor=#ffffff align=center><font color=#000000><b><input name="vote" type="radio" value="1"></b></td> <td class=dats bgcolor=#ffffff><font color=#000000>$polloption</font></td> <td class=dats bgcolor=#ffffff nowrap align="center"><font color=#000000>$pollvotes</font></td> <td class=dats bgcolor=#ffffff nowrap><font color=#000000>$pollb $pollpercent%</font></td></tr>) } if ($poll2 ne "") { $polloption = $poll2; $pollvotes = $poll2v; if ($pollvotes ne "0") { $pollpercent = int(($pollvotes / $totalvotes) * 100); $pollwidth = int($pollpercent * 3); } else { $pollpercent = 0; } if ($pollpercent eq "0") { $pollb = "" } else { $pollb = qq~<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD BGCOLOR="$pollbar"><IMG SRC="$imagesurl/images/spacer.gif" HEIGHT="10" WIDTH="$pollwidth"></TD></TR></TABLE>~; } $poll = qq( $poll <tr> <td bgcolor=#ffffff align=center><font face="$font" color=$pollfont size=1><b><input name="vote" type="radio" value="2"></b></td> <td class=dats bgcolor=#ffffff><font color=#000000>$polloption</font></td> <td class=dats bgcolor=#ffffff nowrap align="center"><font color=#000000>$pollvotes</font></td> <td class=dats bgcolor=#ffffff nowrap><font color=#000000>$pollb $pollpercent%</font></td></tr>) } if ($poll3 ne "") { $polloption = $poll3; $pollvotes = $poll3v; if ($pollvotes ne "0") { $pollpercent = int(($pollvotes / $totalvotes) * 100); $pollwidth = int($pollpercent * 3); } else { $pollpercent = 0; } if ($pollpercent eq "0") { $pollb = "" } else { $pollb = qq~<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD BGCOLOR="$pollbar"><IMG SRC="$imagesurl/images/spacer.gif" HEIGHT="10" WIDTH="$pollwidth"></TD></TR></TABLE>~; } $poll = qq( $poll <tr> <td bgcolor=#ffffff align=center><font face="$font" color=$pollfont size=1><b><input name="vote" type="radio" value="3"></b></td> <td class=dats bgcolor=#ffffff><font color=#000000>$polloption</font></td> <td class=dats bgcolor=#ffffff nowrap align="center"><font color=#000000>$pollvotes</font></td> <td class=dats bgcolor=#ffffff nowrap><font color=#000000>$pollb $pollpercent%</font></td></tr>) } if ($poll4 ne "") { $polloption = $poll4; $pollvotes = $poll4v; if ($pollvotes ne "0") { $pollpercent = int(($pollvotes / $totalvotes) * 100); $pollwidth = int($pollpercent * 3); } else { $pollpercent = 0; } if ($pollpercent eq "0") { $pollb = "" } else { $pollb = qq~<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD BGCOLOR="$pollbar"><IMG SRC="$imagesurl/images/spacer.gif" HEIGHT="10" WIDTH="$pollwidth"></TD></TR></TABLE>~; } $poll = qq( $poll <tr> <td bgcolor=#ffffff align=center><font face="$font" color=$pollfont size=1><b><input name="vote" type="radio" value="4"></b></td> <td class=dats bgcolor=#ffffff><font color=#000000>$polloption</font></td> <td class=dats bgcolor=#ffffff nowrap align="center"><font color=#000000>$pollvotes</font></td> <td class=dats bgcolor=#ffffff nowrap><font color=#000000>$pollb $pollpercent%</font></td></tr>) } if ($poll5 ne "") { $polloption = $poll5; $pollvotes = $poll5v; if ($pollvotes ne "0") { $pollpercent = int(($pollvotes / $totalvotes) * 100); $pollwidth = int($pollpercent * 3); } else { $pollpercent = 0; } if ($pollpercent eq "0") { $pollb = "" } else { $pollb = qq~<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD BGCOLOR="$pollbar"><IMG SRC="$imagesurl/images/spacer.gif" HEIGHT="10" WIDTH="$pollwidth"></TD></TR></TABLE>~; } $poll = qq( $poll <tr> <td bgcolor=#ffffff align=center><font face="$font" color=$pollfont size=1><b><input name="vote" type="radio" value="5"></b></td> <td class=dats bgcolor=#ffffff><font color=#000000>$polloption</font></td> <td class=dats bgcolor=#ffffff nowrap align="center"><font color=#000000>$pollvotes</font></td> <td class=dats bgcolor=#ffffff nowrap><font color=#000000>$pollb $pollpercent%</font></td></tr>) } if ($poll6 ne "") { $polloption = $poll6; $pollvotes = $poll6v; if ($pollvotes ne "0") { $pollpercent = int(($pollvotes / $totalvotes) * 100); $pollwidth = int($pollpercent * 3); } else { $pollpercent = 0; } if ($pollpercent eq "0") { $pollb = "" } else { $pollb = qq~<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD BGCOLOR="$pollbar"><IMG SRC="$imagesurl/images/spacer.gif" HEIGHT="10" WIDTH="$pollwidth"></TD></TR></TABLE>~; } $poll = qq( $poll <tr> <td bgcolor=#ffffff align=center><font face="$font" color=$pollfont size=1><b><input name="vote" type="radio" value="6"></b></td> <td class=dats bgcolor=#ffffff><font color=#000000>$polloption</font></td> <td class=dats bgcolor=#ffffff nowrap align="center"><font color=#000000>$pollvotes</font></td> <td class=dats bgcolor=#ffffff nowrap><font color=#000000>$pollb $pollpercent%</font></td></tr>) } if ($poll7 ne "") { $polloption = $poll7; $pollvotes = $poll7v; if ($pollvotes ne "0") { $pollpercent = int(($pollvotes / $totalvotes) * 100); $pollwidth = int($pollpercent * 3); } else { $pollpercent = 0; } if ($pollpercent eq "0") { $pollb = "" } else { $pollb = qq~<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD BGCOLOR="$pollbar"><IMG SRC="$imagesurl/images/spacer.gif" HEIGHT="10" WIDTH="$pollwidth"></TD></TR></TABLE>~; } $poll = qq( $poll <tr> <td bgcolor=#ffffff align=center><font face="$font" color=$pollfont size=1><b><input name="vote" type="radio" value="7"></b></td> <td class=dats bgcolor=#ffffff><font color=#000000>$polloption</font></td> <td class=dats bgcolor=#ffffff nowrap align="center"><font color=#000000>$pollvotes</font></td> <td class=dats bgcolor=#ffffff nowrap><font color=#000000>$pollb $pollpercent%</font></td></tr>) } if ($poll8 ne "") { $polloption = $poll8; $pollvotes = $poll8v; if ($pollvotes ne "0") { $pollpercent = int(($pollvotes / $totalvotes) * 100); $pollwidth = int($pollpercent * 3); } else { $pollpercent = 0; } if ($pollpercent eq "0") { $pollb = "" } else { $pollb = qq~<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD BGCOLOR="$pollbar"><IMG SRC="$imagesurl/images/spacer.gif" HEIGHT="10" WIDTH="$pollwidth"></TD></TR></TABLE>~; } $poll = qq( $poll <tr> <td bgcolor=#ffffff align=center><font face="$font" color=$pollfont size=1><b><input name="vote" type="radio" value="8"></b></td> <td class=dats bgcolor=#ffffff><font color=#000000>$polloption</font></td> <td class=dats bgcolor=#ffffff nowrap align="center"><font color=#000000>$pollvotes</font></td> <td class=dats bgcolor=#ffffff nowrap><font color=#000000>$pollb $pollpercent%</font></td></tr>) } if ($poll9 ne "") { $polloption = $poll9; $pollvotes = $poll9v; if ($pollvotes ne "0") { $pollpercent = int(($pollvotes / $totalvotes) * 100); $pollwidth = int($pollpercent * 3); } else { $pollpercent = 0; } if ($pollpercent eq "0") { $pollb = "" } else { $pollb = qq~<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD BGCOLOR="$pollbar"><IMG SRC="$imagesurl/images/spacer.gif" HEIGHT="10" WIDTH="$pollwidth"></TD></TR></TABLE>~; } $poll = qq( $poll <tr> <td bgcolor=#ffffff align=center><font face="$font" color=$pollfont size=1><b><input name="vote" type="radio" value="9"></b></td> <td class=dats bgcolor=#ffffff><font color=#000000>$polloption</font></td> <td class=dats bgcolor=#ffffff nowrap align="center"><font color=#000000>$pollvotes</font></td> <td class=dats bgcolor=#ffffff nowrap><font color=#000000>$pollb $pollpercent%</font></td></tr>) } if ($poll10 ne "") { $polloption = $poll10; $pollvotes = $poll10v; if ($pollvotes ne "0") { $pollpercent = int(($pollvotes / $totalvotes) * 100); $pollwidth = int($pollpercent * 3); } else { $pollpercent = 0; } if ($pollpercent eq "0") { $pollb = "" } else { $pollb = qq~<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0"><TR><TD BGCOLOR="$pollbar"><IMG SRC="$imagesurl/images/spacer.gif" HEIGHT="10" WIDTH="$pollwidth"></TD></TR></TABLE>~; } $poll = qq( $poll <tr> <td bgcolor=#ffffff align=center><b><input name="vote" type="radio" value="10"></b></td> <td class=dats bgcolor=#ffffff><font color=#000000>$polloption</font></td> <td class=dats bgcolor=#ffffff nowrap align="center"><font color=#000000>$pollvotes</font></td> <td class=dats bgcolor=#ffffff nowrap><font color=#000000>$pollb $pollpercent%</font></td></tr>) } $output .= qq~ <tr> <td bgcolor=#ffffff> <TABLE cellSpacing=1 cellPadding=3 width="95%" align=center bgColor=#999999 border=0> <TR align=middle> <TD class=tit bgColor=#dddddd colSpan=4><B>$topictitle</B></TD></TR> <tr><form action="$postprog" method=post> <input type=hidden name="action" value="updatepoll"> <input type=hidden name="forum" value="$inforum"> <input type=hidden name="topic" value="$intopic"> <input type=hidden name="topictitle" value="$topictitle"> <input type=hidden name="forumname" value="$forumname"> <TD bgcolor=#eeeeee width="5%"> </TD> <TD bgcolor=#eeeeee align=center class=dats width="70%"><B>Ответ</B></TD> <TD bgcolor=#eeeeee align=center class=dats noWrap width="5%"><B>Голосов</B></TD> <TD bgcolor=#eeeeee align=center class=dats noWrap width=300><B>Проценты</B></TD> </tr> $poll <TR bgColor=#ffffff> <TD bgcolor=#dddddd class=dats colSpan=3 height=25><B>$votesubmitbutton</B></TD> <TD bgcolor=#dddddd class=dats align=right heigth=25>Всего голосов: <B>$totalvotes</B></TD></TR> </table> </form> ~; ;} | не знаю у вас может из-за этого получится полная фигня. потому что у меня дизайн топиков очень сильно изменён.
---------- Мой дом, мой затхлый склеп. В обрывках чьих-то писем. От слёз почти ослеп. Боюсь прихода дня. Лишь тени всё поймут, и выслушают тихо, ведь я один из них - тень самого себя. (с) Arcanar |
| Всего записей: 699 | Зарегистр. 10-10-2002 | Отправлено: 03:35 03-01-2003 | Исправлено: Deeman, 09:18 03-01-2003 |
|