ForumD.ru - Дизайн, графика, скрипты, техническая поддержка для форумов и сайтов

Объявление

🎲 Майский ваншот

Ленивая сезонная майская акция
Сыграем в настольную игру в дискорде?
Пишите, присоединяйтесь к обсуждению!

Подробности

GEMcross

Кроссовер, ориентированный на активную игру и уютный флуд.
Собираем у себя драгоценных игроков уже почти три года.

Посетить

🔥 Новинка в портфолио: ДИЗАЙН И ГРАФИКА В СТИЛЕ GENSHIN IMPACT

Платформа: MyBB.ru (RusFF)
Стоимость: 6500 рублей;
Авторы: Moju & wasurenagusa

Посмотреть

💰 Теперь у нас можно приобрести "Мгновенные уведомления от Алекса"

Скрипт оповещает пользователей о событиях на форуме в реальном времени, придавая динамики общению.
Автор: Alex_63 | Платформа: MyBB.ru.

У нас: структурированная документация, возможность платить иностранными картами, перевыпустить подписку или купить бессрочно.

Купить скрипт

🌟 ОПЛАТА ЗАКАЗА НАГРАДНЫМИ БАЛЛАМИ И СКИДКИ

Заказы можно оплачивать наградными баллами (НБ). Полностью или частично.
Бартер за НБ осуществляется на условиях платного заказа, в качестве оплаты - НБ.
А если у вас есть любой платный заказ, вы можете обменять НБ на скидочные купоны.

узнать подробности

❤️ Поддержать проект

Если у вас есть желание помочь нам сделать наш проект лучше:
Реклама на сайтеПредложения
Стать модераторомОтзывы

Подробнее

SPECIAL OFFER: We distribute designs for free

Finalizing the layout for your project;
Developing a style code;
Mobile version included if you wish.

Details

Support the project

If you want to help us:
Become a moderator
SuggestionsReviews

Details
❗ ❗ ❗ Technical work is underway. We'll fix it soon. :) If you're english-speaker and want to use our forum, switch to the russian language. This is temporary, until the works with multi-language option will be done. Sorry for the inconvenience.

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.



Срипты и коды для Формы ответа

Сообщений 1 страница 10 из 19

1

Дополнительные цвета для форума в форму ответа

Код:
<table><tr>
<td onclick="return changeVisibility('mycolor', this)"><img src="http://forum.mybb.ru/i/color_swatch.png" alt="Мои цвета" /></td></tr></table>
<div class="container" id="mycolor" style="display:none; width:200px">
	<table cellspacing="0">
<tr>
<td style="background-color:#00FF00" height="15px" width="15px" onclick="bbcode('[color=#00FF00]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#00FF66" height="15px" width="15px" onclick="bbcode('[color=#00FF66]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#00FFFF" height="15px" width="15px" onclick="bbcode('[color=#00FFFF]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#66FF66" height="15px" width="15px" onclick="bbcode('[color=#66FF66]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#99FF99" height="15px" width="15px" onclick="bbcode('[color=#99FF99]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#CCFF00" height="15px" width="15px" onclick="bbcode('[color=#CCFF00]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#CCFF66" height="15px" width="15px" onclick="bbcode('[color=#CCFF66]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#CCFFCC" height="15px" width="15px" onclick="bbcode('[color=#CCFFCC]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#FFFF00" height="15px" width="15px" onclick="bbcode('[color=#FFFF00]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#FFFF99" height="15px" width="15px" onclick="bbcode('[color=#FFFF99]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#00CC66" height="15px" width="15px" onclick="bbcode('[color=#00CC66]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#339966" height="15px" width="15px" onclick="bbcode('[color=#339966]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#6699CC" height="15px" width="15px" onclick="bbcode('[color=#6699CC]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#CCCC66" height="15px" width="15px" onclick="bbcode('[color=#CCCC66]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#009966" height="15px" width="15px" onclick="bbcode('[color=#009966]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#9999FF" height="15px" width="15px" onclick="bbcode('[color=#9999FF]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#CC9933" height="15px" width="15px" onclick="bbcode('[color=#CC9933]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#CC66CC" height="15px" width="15px" onclick="bbcode('[color=#CC66CC]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#FF6600" height="15px" width="15px" onclick="bbcode('[color=#FF6600]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#FF6666" height="15px" width="15px" onclick="bbcode('[color=#FF6666]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#003333" height="15px" width="15px" onclick="bbcode('[color=#003333]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#003366" height="15px" width="15px" onclick="bbcode('[color=#003366]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#0033FF" height="15px" width="15px" onclick="bbcode('[color=#0033FF]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#333300" height="15px" width="15px" onclick="bbcode('[color=#333300]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#663399" height="15px" width="15px" onclick="bbcode('[color=#663399]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#993300" height="15px" width="15px" onclick="bbcode('[color=#993300]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#CC3333" height="15px" width="15px" onclick="bbcode('[color=#CC3333]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#FF3300" height="15px" width="15px" onclick="bbcode('[color=#FF3300]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#FF66FF" height="15px" width="15px" onclick="bbcode('[color=#FF66FF]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#003366" height="15px" width="15px" onclick="bbcode('[color=#003366]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#FF3366" height="15px" width="15px" onclick="bbcode('[color=#FF3366]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#0000FF" height="15px" width="15px" onclick="bbcode('[color=#0000FF]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#660033" height="15px" width="15px" onclick="bbcode('[color=#660033]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#990000" height="15px" width="15px" onclick="bbcode('[color=#990000]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#FF0000" height="15px" width="15px" onclick="bbcode('[color=#FF0000]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#FF0066" height="15px" width="15px" onclick="bbcode('[color=#FF0066]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#FFCCCC" height="15px" width="15px" onclick="bbcode('[color=#FFCCCC]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#ffcc66" height="15px" width="15px" onclick="bbcode('[color=#ffcc66]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#666633" height="15px" width="15px" onclick="bbcode('[color=#666633]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#cc6633" height="15px" width="15px" onclick="bbcode('[color=#cc6633]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#993300" height="15px" width="15px" onclick="bbcode('[color=#993300]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#99ff00" height="15px" width="15px" onclick="bbcode('[color=#99ff00]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#cccccc" height="15px" width="15px" onclick="bbcode('[color=#cccccc]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#ffcccc" height="15px" width="15px" onclick="bbcode('[color=#ffcccc]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#336666" height="15px" width="15px" onclick="bbcode('[color=#336666]', '[/color]'); return changeVisibility('mycolor', this)"></td>
	<td style="background-color:#ff9999" height="15px" width="15px" onclick="bbcode('[color=#ff9999]', '[/color]'); return changeVisibility('mycolor', this)"></td>
</tr>
	</table>
	</div>

+1

2

Исправленный скрипт на цвета в форму ответа (39шт)

Код:
<table><tr>
<td onclick="return changeVisibility('mycolor', this)"><img src="http://forum.mybb.ru/i/color_swatch.png" alt="Мои цвета" /></td></tr></table>
<div class="container" id="mycolor" style="display:none;width:400px">
<table cellspacing="0">
<tr>
    <td style="background-color:#00FF00" height="1px" width="1px" onclick="bbcode('[color=#00FF00]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#00FFFF" height="1px" width="1px" onclick="bbcode('[color=#00FFFF]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#66FF66" height="1px" width="1px" onclick="bbcode('[color=#66FF66]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#CCFF00" height="1px" width="1px" onclick="bbcode('[color=#CCFF00]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#CCFFCC" height="1px" width="1px" onclick="bbcode('[color=#CCFFCC]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#FFFF00" height="1px" width="1px" onclick="bbcode('[color=#FFFF00]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#FFFF99" height="1px" width="1px" onclick="bbcode('[color=#FFFF99]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#00CC66" height="1px" width="1px" onclick="bbcode('[color=#00CC66]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#339966" height="1px" width="1px" onclick="bbcode('[color=#339966]', '[/color]'); return changeVisibility('mycolor', this)"></td>
    <td style="background-color:#6699CC" height="1px" width="1px" onclick="bbcode('[color=#6699CC]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#CCCC66" height="1px" width="1px" onclick="bbcode('[color=#CCCC66]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#9999FF" height="1px" width="1px" onclick="bbcode('[color=#9999FF]', '[/color]'); return changeVisibility('mycolor', this)"></td>
    <td style="background-color:#cc6633" height="1px" width="1px" onclick="bbcode('[color=#CC9933]', '[/color]'); return changeVisibility('mycolor', this)"></td>
</tr>
<tr><td style="background-color:#CC66CC" height="1px" width="1px" onclick="bbcode('[color=#CC66CC]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#FF6600" height="1px" width="1px" onclick="bbcode('[color=#FF6600]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#FF6666" height="1px" width="1px" onclick="bbcode('[color=#FF6666]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#003333" height="1px" width="1px" onclick="bbcode('[color=#003333]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#003366" height="1px" width="1px" onclick="bbcode('[color=#003366]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#0033FF" height="1px" width="1px" onclick="bbcode('[color=#0033FF]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#333300" height="1px" width="1px" onclick="bbcode('[color=#333300]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#663399" height="1px" width="1px" onclick="bbcode('[color=#663399]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#CC3333" height="1px" width="1px" onclick="bbcode('[color=#CC3333]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#FF3300" height="1px" width="1px" onclick="bbcode('[color=#FF3300]', '[/color]'); return changeVisibility('mycolor', this)"></td>
    <td style="background-color:#FF66FF" height="1px" width="1px" onclick="bbcode('[color=#FF66FF]', '[/color]'); return changeVisibility('mycolor', this)"></td>
    <td style="background-color:#003366" height="1px" width="1px" onclick="bbcode('[color=#003366]', '[/color]'); return changeVisibility('mycolor', this)"></td>
    <td style="background-color:#FF3366" height="1px" width="1px" onclick="bbcode('[color=#FF3366]', '[/color]'); return changeVisibility('mycolor', this)"></td>
</tr>
<tr><td style="background-color:#660033" height="1px" width="1px" onclick="bbcode('[color=#660033]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#990000" height="1px" width="1px" onclick="bbcode('[color=#990000]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#FF0000" height="1px" width="1px" onclick="bbcode('[color=#FF0000]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#FF0066" height="1px" width="1px" onclick="bbcode('[color=#FF0066]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#9966FF" height="1px" width="1px" onclick="bbcode('[color=#FFCCCC]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#ffcc66" height="1px" width="1px" onclick="bbcode('[color=#ffcc66]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#666633" height="1px" width="1px" onclick="bbcode('[color=#666633]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#cc6633" height="1px" width="1px" onclick="bbcode('[color=#cc6633]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#99ff00" height="1px" width="1px" onclick="bbcode('[color=#99ff00]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#cccccc" height="1px" width="1px" onclick="bbcode('[color=#cccccc]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#66B3FF" height="1px" width="1px" onclick="bbcode('[color=#66B3FF]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#336666" height="1px" width="1px" onclick="bbcode('[color=#336666]', '[/color]'); return changeVisibility('mycolor', this)"></td>
     <td style="background-color:#ff9999" height="1px" width="1px" onclick="bbcode('[color=#ff9999]', '[/color]'); return changeVisibility('mycolor', this)"></td>
</tr>
     </table>
     </div>

Вставлять в форму ответа

+1

3

Генератор таблиц (BB-таблицы). Duka

• Идея: Diesel
• Разработка: Duka
• Описание
    Скрипт поставит в форму ответа ссылку, при нажатии которой открывается сразу под ней меню для создания таблиц из BB-кодов [table*], [tr*], [td*] (без звездочек). Вам предложат ввести кол-во необходимых строк и ячеек, после этого жми "Создать" и вы увидете сгенерированую таблицу. Выделите все теги (для этого есть кнопка Выделить) и скопируйте их, нажмите "Назад" и в тело сообщения поставьте данный код, изменив описание ячеек.
• Установка
    Скрипт ставить строго в HTML в форме ответа.
• Скрипт

Код:
<script language="JavaScript1.2">
<!--
var ns6=document.getElementById&&!document.all?1:0

var head="display:''"
var folder=''

function expandit(curobj){
folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style
if (folder.display=="none")
folder.display=""
else
folder.display="none"
}

//-->
</script>
<SCRIPT language=JavaScript>
<!--
function MM_openBrWindow(theURL,winName,features) { 
  window.open(theURL,winName,features);
}
  function InsSM()
   {
   var table = '[table'+document.all.Bgcolor.value+document.all.Dkcolor.value+document.all.Ltcolor.value+']';

  for (var x=0; x<document.all.rows.value; x++) {
    table += "[tr]";
    for (var y=0; y<document.all.cols.value; y++) {
      table += "[td]Ячейка[/td]";
    }
    table += "[/tr]";
  }
  table += "[/table]\n";
    document.all.theCode.value=(table);
document.write('<b><font size=2 color=#555555 face=Arial, Helvetica, sans-serif>Скопируйте эти теги в ваше сообщение</font></b><br><textarea name=theCode cols=50 rows=6>'+table+'</textarea><br><input type=button name=Button value=Выделить onClick=document.all.theCode.select();document.all.theCode.focus()><br><br><br>');
document.write('<p><input type=button name=button value=Назад onClick=history.back()></p><Br><br>Скрипт написан компанией <a href=http://rusff.ru target=_blank>RusFF</a>.');


}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_showHideLayers() { 
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}
//-->
</SCRIPT>
<h4 style='cursor:hand' onClick='expandit(this)'>Сделать таблицу</h3>
<TABLE width=300 style='display:none' style=&{head};>
  <TR>
    <TD>Строк: <INPUT maxLength=3 size=3 value=1 name=rows></TD>
    <TD>Ячеек: <INPUT maxLength=4 size=3 value=1 name=cols></TD>
    <td><INPUT type=hidden name=Bgcolor><INPUT type=hidden name=Dkcolor><INPUT type=hidden name=Ltcolor></td>
    <TD colSpan=4><A href="http://rusff.ru/" target=_blank><B>RusFF ©</B></A><BR><INPUT type=hidden name=theCode> <INPUT onclick=InsSM() type=button value="Создать" name=Button2></TD>
</TR>
</TABLE>

взято с http://forums.0pk.ru/viewtopic.php?id=1847

+1

4

Новые кнопки для формы ответа

<style>
#form-buttons table, .punbb .formal textarea {width:99%}
#form-buttons td {padding:0; line-height:0; background-position:center; background-repeat:no-repeat}
#form-buttons td img {height:26px; width:100%}
#button-font {background-image:url('картинка шрифт')}
#button-size {background-image:url('картинка размер')}
#button-bold {background-image:url('картинка жирность')}
#button-italic {background-image:url('картинка курсив')}
#button-underline {background-image:url('картинка подчеркивание')}
#button-strike {background-image:url('картинка зачеркивание')}
#button-left {background-image:url('картинка влево)}
#button-center {background-image:url('картинка центр')}
#button-right {background-image:url('картинка вправо')}
#button-link {background-image:url('картинка ссылок')}
#button-email {background-image:url('картинка мыла')}
#button-image {background-image:url('картинка картинок')}
#button-youtube {background-image:url('картинка картинок')}
#button-hide {background-image:url('картинка скрытого текста')}
#button-quote {background-image:url('картинка цитаты')}
#button-code {background-image:url('картинка кода')}
#button-color {background-image:url('картинка цветов')}
#button-smile {background-image:url('картинка смайлов')}
#button-keyboard {background-image:url('картинка клавиатуры')}
#button-imageup {background-image:url('картинка загрузки изображений')}
</style>

0

5

Кубики (Дайсы)

Скрипт позволит "кидать" кубики прямо на форуме.
Полезно для ролевых форумов.

Свернутый текст
Код:
<input type="button" onclick="dice()" value="Кинуть кубики" />
<script type="text/javascript">
function dice()
{
	var FoundErrors = '';
	var diceRes=""
	var CountCube = prompt("Количество кубиков", "3");
	var SideCube = prompt("Сколько граней у кубика?", "6");
	if(CountCube>9){
	alert("Нельзя бросать столько кубиков"); 
	return false;}
	if(SideCube>9){
	alert("Не бывает таких кубиков"); 
	return false;}
	if (!CountCube)
	{return false;}
	if (!SideCube)
	{return false;}
	for(i=0; i<CountCube;i++){
	var dice = (Math.round(Math.random()*SideCube))
	if(dice==0) dice=1;
	diceRes += dice*1936+"-"
	}
	smile('[dice='+diceRes+CountCube+SideCube+']')
}
</script>
<script>
function addDice(str,from,internal){
var pos=0,pos2=0,newpos=0
if((pos=str.indexOf("[dice=",from))==-1) return str;
if((pos2=str.indexOf("]"),pos+6)==-1) return str;
newpos=str.indexOf("]",pos+6)
if(newpos<pos2 && newpos!=-1) str=addDice(str,pos+6,true)
if((pos2=str.indexOf("]",pos+6))==-1) return str;
str=str.substring(0,pos)+makeDice(str.substring(pos+6,pos2))+str.substring(pos2+1,str.length)
if( str.indexOf("[dice=")!=-1 && internal==false) str=addDice(str,0,false)
return str}

function makeDice(dice){
diceMass = dice.split("-")
diceC = dice.substring(dice.length-2, dice.length-1)
diceS = dice.substring(dice.length-1, dice.length)
var diceR=0, diceRu="";
for(i=0;i<diceMass.length-1;i++){diceR+=diceMass[i]/1936;}
for(i=0;i<diceMass.length-1;i++){if(diceMass[i]==diceMass[diceMass.length-2]){diceRu+=diceMass[i]/1936;}else{diceRu+=parseInt(diceMass[i]/1936)+"+";}}
txt="<div class=\"quote-box\"><blockquote><p><b>Количество кубиков</b>: "+diceC+"<br /><b>Граней в кубике</b>: "+diceS+"<br /><br /><b>Результаты броска</b>: ("+diceRu+")="+diceR+"</p></blockquote></div>"
return txt}

if(document.URL.indexOf("viewtopic.php")!=-1){
elm=document.getElementById("pun-main").getElementsByTagName("div")
for(x in elm) if(elm[x].className=="post-content"){
var post=elm[x]
post.innerHTML=addDice(post.innerHTML,0,false)}}
</script>

второй вариант:

Свернутый текст
Код:
<input type="button" onclick="dice()" value="Кинуть кубики" />
<script type="text/javascript">
function dice()
{
	var FoundErrors = '';
	var diceRes=""
	var CountCube = prompt("Количество кубиков", "3");
	var SideCube = prompt("Сколько граней у кубика?", "6");
	if(CountCube>9){
	alert("Нельзя бросать столько кубиков"); 
	return false;}
	if(SideCube>9){
	alert("Не бывает таких кубиков"); 
	return false;}
	if (!CountCube)
	{return false;}
	if (!SideCube)
	{return false;}
	for(i=0; i<CountCube;i++){
	var dice = (Math.round(Math.random()*SideCube))
	if(dice==0) dice=1;
	diceRes += dice*1936+"-"
	}
	smile('[dice='+diceRes+CountCube+SideCube+']')
}
</script>
<script>
function addDice(str,from,internal){
var pos=0,pos2=0,newpos=0
if((pos=str.indexOf("[dice=",from))==-1) return str;
if((pos2=str.indexOf("]"),pos+6)==-1) return str;
newpos=str.indexOf("]",pos+6)
if(newpos<pos2 && newpos!=-1) str=addDice(str,pos+6,true)
if((pos2=str.indexOf("]",pos+6))==-1) return str;
str=str.substring(0,pos)+makeDice(str.substring(pos+6,pos2))+str.substring(pos2+1,str.length)
if( str.indexOf("[dice=")!=-1 && internal==false) str=addDice(str,0,false)
return str}

function makeDice(dice){
diceMass = dice.split("-")
diceC = dice.substring(dice.length-2, dice.length-1)
diceS = dice.substring(dice.length-1, dice.length)
var diceR=0, diceRu="";
for(i=0;i<diceMass.length-1;i++){diceR+=diceMass[i]/1936;}
for(i=0;i<diceMass.length-1;i++){if(diceMass[i]==diceMass[diceMass.length-2]){diceRu+=diceMass[i]/1936;}else{diceRu+=parseInt(diceMass[i]/1936)+"+";}}
txt="<div class=\"quote-box\"><blockquote><p><b>Исходный бросок</b>: "+diceC+"d"+diceS+"<br /><br /><b>Результаты броска</b>: ("+diceRu+")="+diceR+"</p></blockquote></div>"
return txt}

if(document.URL.indexOf("viewtopic.php")!=-1){
elm=document.getElementById("pun-main").getElementsByTagName("div")
for(x in elm) if(elm[x].className=="post-content"){
var post=elm[x]
post.innerHTML=addDice(post.innerHTML,0,false)}}
</script>

Пользователь вводит сколько надо бросить кубиков и сколько в нем граней.
Далее получает уникальный код, который может произвольно перемещать в сообщении
Вставлять в форму ответа!

_______________

Для эстетов, которые хотят поместить кубики в виде иконки на панели инструментов в форме ответа, я чуть подкорректировала скриптег Duka (первый вариант).

Типа так:
http://s59.radikal.ru/i166/1006/1f/001fb8fdb6ac.jpg

Скриптег:

Свернутый текст

<!--Кубики-->
<script type="text/javascript">
if(form=document.getElementById("form-buttons"))
{
   var buttonCell = form.getElementsByTagName("tr")[0].insertCell(20);
   buttonCell.id = "button-dice";
   buttonCell.title = "Кубики";
   buttonCell.innerHTML='<img onclick="dice();" src="/i/blank.gif">';
}
</script>

<script type="text/javascript">
function dice()
{
var FoundErrors = '';
var diceRes=""
var CountCube = prompt("Количество кубиков", "3");
var SideCube = prompt("Сколько граней у кубика?", "6");
if(CountCube>9){
alert("Нельзя бросать столько кубиков");
return false;}
if(SideCube>9){
alert("Не бывает таких кубиков");
return false;}
if (!CountCube)
{return false;}
if (!SideCube)
{return false;}
for(i=0; i<CountCube;i++){
var dice = (Math.round(Math.random()*SideCube))
if(dice==0) dice=1;
diceRes += dice*1936+"-"
}
smile('[dice='+diceRes+CountCube+SideCube+']')
}
</script>
<script>
function addDice(str,from,internal){
var pos=0,pos2=0,newpos=0
if((pos=str.indexOf("[dice=",from))==-1) return str;
if((pos2=str.indexOf("]"),pos+6)==-1) return str;
newpos=str.indexOf("]",pos+6)
if(newpos<pos2 && newpos!=-1) str=addDice(str,pos+6,true)
if((pos2=str.indexOf("]",pos+6))==-1) return str;
str=str.substring(0,pos)+makeDice(str.substring(pos+6,pos2))+str.substring(pos2+1,str.length)
if( str.indexOf("[dice=")!=-1 && internal==false) str=addDice(str,0,false)
return str}

function makeDice(dice){
diceMass = dice.split("-")
diceC = dice.substring(dice.length-2, dice.length-1)
diceS = dice.substring(dice.length-1, dice.length)
var diceR=0, diceRu="";
for(i=0;i<diceMass.length-1;i++){diceR+=diceMass[i]/1936;}
for(i=0;i<diceMass.length-1;i++){if(diceMass[i]==diceMass[diceMass.length-2]){diceRu+=diceMass[i]/1936;}else{diceRu+=parseInt(diceMass[i]/1936)+"+";}}
txt="<div class=\"quote-box\"><blockquote><p><b>Исходный бросок</b>: "+diceC+"d"+diceS+"<br /><br /><b>Результаты броска</b>: ("+diceRu+")="+diceR+"</p></blockquote></div>"
return txt}

if(document.URL.indexOf("viewtopic.php")!=-1){
elm=document.getElementById("pun-main").getElementsByTagName("div")
for(x in elm) if(elm[x].className=="post-content"){
var post=elm[x]
post.innerHTML=addDice(post.innerHTML,0,false)}}
</script>
<!--Конец кубиков-->

Вставляется по-прежнему в форму ответа.

Красным выделена позиция иконки на панели инструментов. В примере она на 20 позиции - это значит, что она будет в самом конце у вас. Можете ставить любое другое число.

Зеленым выделена надпись, которая появляется при наведеннии курсором на иконку.

Но это еще не все. В стили style_cs.css в самый конец нужно добавить вот это:

#button-dice {
background-image:url(http://forumupload.ru/uploads/0005/6e/de/20529-1.gif);
}

Просто себе припишите в самом конце стилей.
Выделенное синим - адрес иконки. Можете вместо него вставить свою картинку. Размер 16 на 16 пикселей. :)

0

6

Герда написал(а):

Кубики (Дайсы)

Здравствуйте..
А можете ли помочь сделать кубик не просто с цифрами а с процентным соотношением от 0 до 100%?

0

7

KaIn616

такого скрипта, насколько я знаю нет.
спрошу.

зы. в личку мне писать НЕЛЬЗЯ

0

8

KaIn616

Код:
if(SideCube>9)

меняем на

Код:
if(SideCube>100)

и кидаем 100гранный кубик
Вроде это единственное ограничение на количество граней у кубика...

0

9

Гердаvuvko
Спс за ответы..
Герда извени не буду больше)
У меня еше вопрос есть про пароли..

0

10

Счетчик оставшихся вводимых знаков

http://freemanager.ucoz.com/_ph/5/2/817815857.png

1. Если у вас уже имеется код подключения JQuery, то по второму разу его ставить не рекомендуется, если же нет, то в html-верх:

Код:
<script type="text/javascript" src="http://freemanager.ucoz.com/js/jquery.js"></script>

2. Далее ставим код в форму ответа, но гостям его видно не будет:

<span id="charsLeft"></span>&nbsp;знаков осталось.
<script type="text/javascript">
$(document).ready(function(){       
$('textarea').limit('1000','#charsLeft');
});
</script>

красное меняете на свое максимальное число знаков или оставляете как есть...

0