19.08.2010, 17:49 | |||||
Персональный опрос для материалаДанная версия предназначена для модуля "Блог". Активируем доп.поле #1 в блоге. В него мы будем вводить вопрос. Quote <?if($PAGE_ID$='add' || 'edit'=$PAGE_ID$)?> <script type="text/javascript">function funcS() {$('#blM61').toggle();} $('#blM61').hide(); $('#blM61').before('<tr id="blM6_"><td class="manTd" id="blM6_2">Создать мини-опрос:</td><td class="manTd" id="blM6"><input type="checkbox" id="4ekvote" size="35" style="align:left;" name="4ekvote" onchange="funcS();" /></td></tr>');</script> <?endif?> Далее редактируем страницу материалов и комментариев к нему в место где вы хотите видеть опрос устанавливаем этот код:
Code <?if($OTHER1$)?> <b>$OTHER1$?</b> <div id="vote12"> <input type="radio" name="voter" value="1"> да<Br> <input type="radio" name="voter" value="0"> нет<Br> <input type="submit" name="zapr" value="Ответить" /> </div>[<a href="javascript:" onclick="var AjCo=$('#AjCont').html();new _uWnd('ResOpros', 'Результаты опроса', 500, 140, {autosize:1,min:1,close:1,resize:0}, AjCo);" title="Результаты">Результаты</a>] <div id="AjCont" style="display:none;"> <?if((-~($RATED$*$RATING$))%($RATED$*$RATING$)=1 && -~($RATED$*$RATING$)!=($RATED$*$RATING$)+1)?> <?if((-~($RATED$*$RATING$))- ($RATED$*$RATING$)>0.5) ?> <table border="0" cellpadding="0"><tr><td width="80%" valign="top"><table border="0" width="100%" cellspacing="1" cellpadding="1" class="myWinPollT"><tr><td class="myWinPollTd"><table border="0" width="100%" cellspacing="0" cellpadding="3"><tr><td width="18" align="right">1.</td><td width="5%" align="center"><table border="0" bgcolor="#000000" cellspacing="1" cellpadding="0"><tr><td><div style="height:10px;width:10px;background:url('http://sensor.ucoz.com/icon/poll2.gif');"><img alt="" width="10" src="http://s27.ucoz.net/img/1px.gif" /></div></td></tr></table></td><td>Поддерживают</td></tr></table></td><td width="10%" class="myWinPollTd" align="center"><b><?$RATED$-($RATED$*2-(-~($RATED$*$RATING$)-1))?></b></td><td width="10%" class="myWinPollTd" align="center"><span class="procentext"><?($RATED$-($RATED$*2-(-~($RATED$*$RATING$)-1)))/$RATED$*100?></span>%</td></tr> <tr><td class="myWinPollTd"><table border="0" width="100%" cellspacing="0" cellpadding="3"><tr><td width="18" align="right">2.</td><td width="5%" align="center"><table border="0" bgcolor="#000000" cellspacing="1" cellpadding="0"><tr><td><div style="height:10px;width:10px;background:url('http://sensor.ucoz.com/icon/poll1.gif')"><img alt="" width="10" src="http://s27.ucoz.net/img/1px.gif" /></div></td></tr></table></td><td>Против</td></tr></table></td><td width="10%" class="myWinPollTd" align="center"><b><?$RATED$*2-(-~($RATED$*$RATING$)-1)?></b></td><td width="10%" class="myWinPollTd" align="center"><span class="procentext2"><?100-($RATED$-($RATED$*2-(-~($RATED$*$RATING$)-1)))/$RATED$*100?></span>%</td></tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td width="50%"> </td><td align="right"> <table border="0" cellspacing="1" cellpadding="3" class="myWinPollT"><tr><td class="myWinPollTd">Всего ответов: <b>$RATED$</b></td></tr></table> </td></tr></table> </td><td align="right" valign="top"><div class="myWinPollG"><table border="0" width="195" height="131" cellspacing="0" cellpadding="0"><tr><td width="50%" align="center" valign="bottom"><table border="0" width="80%" bgcolor="#000000" cellspacing="1" cellpadding="0"><tr><td style="font-size:0;background:#3a75c4"><img alt="" src="http://s27.ucoz.net/img/1px.gif" width="80" height="<?($RATED$-($RATED$*2-(-~($RATED$*$RATING$)-1)))/$RATED$*129?>" /></td></tr></table></td> <td width="50%" align="center" valign="bottom"><table border="0" width="80%" bgcolor="#000000" cellspacing="1" cellpadding="0"><tr><td style="font-size:0;background:#e32636"><img alt="" src="http://s27.ucoz.net/img/1px.gif" width="80" height="<?(100-($RATED$-($RATED$*2-(-~($RATED$*$RATING$)-1)))/$RATED$*100)*1.29?>" /></td></tr></table></td> </tr></table></div></td></tr></table> <?else?> <table border="0" cellpadding="0"><tr><td width="80%" valign="top"><table border="0" width="100%" cellspacing="1" cellpadding="1" class="myWinPollT"><tr><td class="myWinPollTd"><table border="0" width="100%" cellspacing="0" cellpadding="3"><tr><td width="18" align="right">1.</td><td width="5%" align="center"><table border="0" bgcolor="#000000" cellspacing="1" cellpadding="0"><tr><td><div style="height:10px;width:10px;background:url('http://sensor.ucoz.com/icon/poll2.gif');"><img alt="" width="10" src="http://s27.ucoz.net/img/1px.gif" /></div></td></tr></table></td><td>Поддерживают</td></tr></table></td><td width="10%" class="myWinPollTd" align="center"><b><?$RATED$-($RATED$*2-(-~($RATED$*$RATING$)))?></b></td><td width="10%" class="myWinPollTd" align="center"><span class="procentext"><?($RATED$-($RATED$*2-(-~($RATED$*$RATING$))))/$RATED$*100?></span>%</td></tr> <tr><td class="myWinPollTd"><table border="0" width="100%" cellspacing="0" cellpadding="3"><tr><td width="18" align="right">2.</td><td width="5%" align="center"><table border="0" bgcolor="#000000" cellspacing="1" cellpadding="0"><tr><td><div style="height:10px;width:10px;background:url('http://sensor.ucoz.com/icon/poll1.gif')"><img alt="" width="10" src="http://s27.ucoz.net/img/1px.gif" /></div></td></tr></table></td><td>Против</td></tr></table></td><td width="10%" class="myWinPollTd" align="center"><b><?$RATED$*2-(-~($RATED$*$RATING$))?></b></td><td width="10%" class="myWinPollTd" align="center"><span class="procentext2"><?100-($RATED$-($RATED$*2-(-~($RATED$*$RATING$))))/$RATED$*100?></span>%</td></tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td width="50%"> </td><td align="right"> <table border="0" cellspacing="1" cellpadding="3" class="myWinPollT"><tr><td class="myWinPollTd">Всего ответов: <b>$RATED$</b></td></tr></table> </td></tr></table> </td><td align="right" valign="top"><div class="myWinPollG"><table border="0" width="195" height="131" cellspacing="0" cellpadding="0"><tr><td width="50%" align="center" valign="bottom"><table border="0" width="80%" bgcolor="#000000" cellspacing="1" cellpadding="0"><tr><td style="font-size:0;background:#3a75c4"><img alt="" src="http://s27.ucoz.net/img/1px.gif" width="80" height="<?($RATED$-($RATED$*2-(-~($RATED$*$RATING$))))/$RATED$*129?>" /></td></tr></table></td> <td width="50%" align="center" valign="bottom"><table border="0" width="80%" bgcolor="#000000" cellspacing="1" cellpadding="0"><tr><td style="font-size:0;background:#e32636"><img alt="" src="http://s27.ucoz.net/img/1px.gif" width="80" height="<?(100-($RATED$-($RATED$*2-(-~($RATED$*$RATING$))))/$RATED$*100)*1.29?>" /></td></tr></table></td> </tr></table></div></td></tr></table> <?endif?> <?else?> <table border="0" cellpadding="0"><tr><td width="80%" valign="top"><table border="0" width="100%" cellspacing="1" cellpadding="1" class="myWinPollT"><tr><td class="myWinPollTd"><table border="0" width="100%" cellspacing="0" cellpadding="3"><tr><td width="18" align="right">1.</td><td width="5%" align="center"><table border="0" bgcolor="#000000" cellspacing="1" cellpadding="0"><tr><td><div style="height:10px;width:10px;background:url('http://sensor.ucoz.com/icon/poll2.gif');"><img alt="" width="10" src="http://s27.ucoz.net/img/1px.gif" /></div></td></tr></table></td><td>Поддерживают</td></tr></table></td><td width="10%" class="myWinPollTd" align="center"><b><?$RATED$-($RATED$*2-($RATED$*$RATING$))?></b></td><td width="10%" class="myWinPollTd" align="center"><span class="procentext"><?($RATED$-($RATED$*2-($RATED$*$RATING$)))/$RATED$*100?></span>%</td></tr> <tr><td class="myWinPollTd"><table border="0" width="100%" cellspacing="0" cellpadding="3"><tr><td width="18" align="right">2.</td><td width="5%" align="center"><table border="0" bgcolor="#000000" cellspacing="1" cellpadding="0"><tr><td><div style="height:10px;width:10px;background:url('http://sensor.ucoz.com/icon/poll1.gif')"><img alt="" width="10" src="http://s27.ucoz.net/img/1px.gif" /></div></td></tr></table></td><td>Против</td></tr></table></td><td width="10%" class="myWinPollTd" align="center"><b><?$RATED$*2-($RATED$*$RATING$)?></b></td><td width="10%" class="myWinPollTd" align="center"><span class="procentext2"><?100-($RATED$-($RATED$*2-($RATED$*$RATING$)))/$RATED$*100?></span>%</td></tr> </table> <table border="0" width="100%" cellspacing="0" cellpadding="0"><tr><td width="50%"> </td><td align="right"> <table border="0" cellspacing="1" cellpadding="3" class="myWinPollT"><tr><td class="myWinPollTd">Всего ответов: <b>$RATED$</b></td></tr></table> </td></tr></table> </td><td align="right" valign="top"><div class="myWinPollG"><table border="0" width="195" height="131" cellspacing="0" cellpadding="0"><tr><td width="50%" align="center" valign="bottom"><table border="0" width="80%" bgcolor="#000000" cellspacing="1" cellpadding="0"><tr><td style="font-size:0;background:#3a75c4"><img alt="" src="http://s27.ucoz.net/img/1px.gif" width="80" height="<?($RATED$-($RATED$*2-($RATED$*$RATING$)))/$RATED$*129?>" /></td></tr></table></td> <td width="50%" align="center" valign="bottom"><table border="0" width="80%" bgcolor="#000000" cellspacing="1" cellpadding="0"><tr><td style="font-size:0;background:#e32636"><img alt="" src="http://s27.ucoz.net/img/1px.gif" width="80" height="<?(100-($RATED$-($RATED$*2-($RATED$*$RATING$)))/$RATED$*100)*1.29?>" /></td></tr></table></td> </tr></table></div></td></tr></table> <?endif?></div> <script type="text/javascript"> // U.miniVote.v1.0 //© Powered by d1mS // Не затирать копирайт. var gg=Math.round(<?($RATING$*$RATED$)?>);wq=<?$RATED$*2?>-gg;qq=$RATED$-wq;procQ=qq /$RATED$*100;procW=100-procQ;if($('a.u-one-star').text() !=1){$('div#vote12').html('Поддерживают: <b>'+qq+'</b><br/><img title="Голосов: '+qq+' ('+procQ+'%)" src="http://sensOr.ucoz.com/icon/poll2.gif" border="1" height="10" width='+procQ+' /><br/>Против: <b>'+wq+'</b><br/><img title="Голосов: '+wq+' ('+procW+'%)" src="http://sensOr.ucoz.com/icon/poll1.gif" border="1" height="10" width='+procW+' />');}; $('input[name=zapr]').click(function(){var dis = $('div#vote12 input[type=radio]:checked').val(); if(dis==1){ustarrating('$ID$',2);qq=qq+1;procQ=qq/<?$RATED$+1?>*100;$('div#vote12').html('Поддерживают: <b>'+qq+'</b><br/><img title="Голосов: '+qq+' ('+procQ+'%)" src="http://sensOr.ucoz.com/icon/poll2.gif" border="1" height="10" width='+procQ+' /><br/>Против: <b>'+wq+'</b><br/><img title="Голосов: '+wq+' ('+procW+'%)" src="http://sensOr.ucoz.com/icon/poll1.gif" border="1" height="10" width='+procW+' />');} if(dis==0) {ustarrating('$ID$',1);wq=(<?$RATED$*2?>-gg)+1;procW=wq/<?$RATED$+1?>*100;$('div#vote12').html('Поддерживают: <b>'+qq+'</b><br/><img title="Голосов: '+qq+' ('+procQ+'%)" src="http://sensOr.ucoz.com/icon/poll2.gif" border="1" height="10" width='+procQ+' /><br/>Против: <b>'+wq+'</b><br/><img title="Голосов: '+wq+' ('+procW+'%)" src="http://sensOr.ucoz.com/icon/poll1.gif" border="1" height="10" width='+procW+' />');};});if($('.procentext, .procentext2').text()!='nannan'){$('.procentext').text($('.procentext').text().substr(0,4));$('.procentext2').text($('.procentext2').text().substr(0,4));}else{$('#AjCont').html($('#AjCont').html().replace(/nan/g, '0'));} </script><?endif?><style type="text/css">.u-current-rating, .u-star-rating{display:none;}</style> Внимание для правильной работы на странице должен находится рейтинг в виде звездочек (<?$RSTARS$('12','/.s/img/stars/3/12.png','1','float')?>) Материал взят с сайта infoscript.ru
| |||||
Категория: Скрипты uCoz | Просмотров: 2326 | Добавил: antisept | Рейтинг: 4.0/1 | | |||||
Теги: |
Пока комментариев нет. Ты можешь быть первым! | |
Кроме того, материал перепечатывали с сайта на сайт, ставили... файл можно найти на Вэбочке (название tables_tablichki_dli_foruma.js).