Скрипты, коды и т.д. для нашего любимого форума)
Делимся)
Скрипты, коды и т.д. для нашего любимого дома)
Сообщений 1 страница 8 из 8
Поделиться12010-12-28 21:01:19
Поделиться22010-12-28 21:42:47
Здесь находятся символы цветов. Просто нужно скопировать и вставить вместо стандартного:
[color=#"цвет"][/color]
(без кавычек)
Поделиться32010-12-29 10:00:15
Дополнительные цвета:
<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:indigo" onclick="bbcode('[color=indigo]', '[/color]'); return changeVisibility('mycolor', this)"></td> <td style="background-color:thistle" Height="15px" onclick="bbcode('[color=thistle]', '[/color]'); return changeVisibility('mycolor', this)"></td> <td style="background-color:tomato" onclick="bbcode('[color=tomato]', '[/color]'); return changeVisibility('mycolor', this)"></td> <td style="background-color:yellowgreen" onclick="bbcode('[color=yellowgreen]', '[/color]'); return changeVisibility('mycolor', this)"></td> <td style="background-color:lightslategray" onclick="bbcode('[color=lightslategray]', '[/color]'); return changeVisibility('mycolor', this)"></td> <td style="background-color:lightpink" onclick="bbcode('[color=lightpink]', '[/color]'); return changeVisibility('mycolor', this)"></td> <td style="background-color:goldenrod" onclick="bbcode('[color=goldenrod]', '[/color]'); return changeVisibility('mycolor', this)"></td> <td style="background-color:blue" onclick="bbcode('[color=blue]', '[/color]'); return changeVisibility('mycolor', this)"></td> <td style="background-color:silver" onclick="bbcode('[color=silver]', '[/color]'); return changeVisibility('mycolor', this)"></td> <td style="background-color:aquamarine" onclick="bbcode('[color=aquamarine]', '[/color]'); return changeVisibility('mycolor', this)"></td> </tr> </table> </div>
Поделиться42010-12-29 10:02:25
Смена слова Позитив на свое
<script type="text/javascript"> function changeLink() {var arr=document.links for (j in arr) { if (arr[j].innerHTML=="Позитив") {arr[j].innerHTML="Ваше слово"} }} changeLink() </script>
В HTML низ.
Изменение уважение на свое слово
<script type="text/javascript"> function changeLink() {var arr=document.links for (j in arr) { if (arr[j].innerHTML=="Уважение") {arr[j].innerHTML="Ваше слово"} }} changeLink() </script>
Поделиться52010-12-29 10:06:44
Последние 10 сообщений в статистику.
<script src="/export.php?type=js&max=10" type="text/javascript"></script> <script type="text/javascript"> var html=''; var ts = ''; var mo = ''; var hh = ''; var mm = ''; var i = 0; for(i=0;i<content.length;i++) { ts = new Date(); ts.setTime(1000*content[i][0]); mo = ts.getMonth()+1; if (mo<10) mo='0'+mo; hh = ts.getHours(); mm = ts.getMinutes()+''; if (mm<10) mm='0'+mm; ts = ts.getDate()+'.'+mo+' '+hh+':'+mm; html2="</tr></tbody></table></div>" html1="<h2>Последние 10 сообщений форума</h2><div class=\"container\"><table cellspacing=\"0\" width=100%><thead><tr><th scope=\"col\">Автор</th><th scope=\"col\">Время</th><th scope=\"col\">Последнее сообщение</th></tr></thead><tbody class=\"hasicon\">" html+='<tr><td>'+content[i][1]+'</td><td class=\"tc2\">'+ts+'<td class=\"tcr\"><a href=\"'+content[i][2]+'\" target=\"_blank\">'+content[i][3]+'</a><br /></td></tr>'; } var arr=document.getElementsByTagName("div") i=0 str=document.URL while(arr[i] ){ if((str.substring(str.lastIndexOf('/')+1)=="" || str.substring(str.lastIndexOf('/')+1)=="index.php") && arr[i].className=="statscon"){ name=arr[i].innerHTML name=name.substring(0) arr[i].innerHTML=""+html1+""+html+""+html2+"<br><h2>Общая статистика</h2>"+name+"" } i++ } </script>
Скрипт добавит в статистику оформленную табличку для 10 последних сообщзений, который форум сгенерирует сам(с помощью яваскрипта на экспорт файлов).
Что можно поменять в скрипте?
Первая строка - export.php?type=js&max=10, 10 можете поменять на свое, взависимости от того, сколько новых сообщений должно выводиться на главной.
Поделиться62010-12-29 10:09:52
Изменяем надписи в панеле ссылок.
в хтмл-низ
Выделеное жирным шрифтом меняем на свое
Для изменения слова "Форум"
<script> <!-- indexof="[b]Форумочек[/b]" str = document.getElementById("navindex").innerHTML pos = str.indexOf("Форум") document.getElementById("navindex").innerHTML=str.substring(0,pos)+indexof+str.substring(pos+5,str.length-1) --> </script>
Для изменения слова Участники
<script> <!-- userof="[b]Люди[/b]" str = document.getElementById("navuserlist").innerHTML if( (pos=str.indexOf("Участники")) != -1 ) document.getElementById("navuserlist").innerHTML=str.substring(0,pos)+userof+str.substring(pos+9,str.length-1) --> </script>
Для изменения слова Правила
<script> <!-- pravilof="[b]Законы[/b]" str = document.getElementById("navrules").innerHTML pos = str.indexOf("Правила") document.getElementById("navrules").innerHTML=str.substring(0,pos)+pravilof+str.substring(pos+14,str.length-1) --> </script>
Для изменения слова Поиск
<script> <!-- findof="[b]Найти[/b]" str = document.getElementById("navsearch").innerHTML pos = str.indexOf("Поиск") document.getElementById("navsearch").innerHTML=str.substring(0,pos)+findof+str.substring(pos+5,str.length-1) --> </script>
Для изменения слова Профиль
<script> <!-- faseof="[b]Профайл участника[/b]" str = document.getElementById("navprofile").innerHTML pos = str.indexOf("Профиль") document.getElementById("navprofile").innerHTML=str.substring(0,pos)+faseof+str.substring(pos+14,str.length-1) --> </script>
Для изменения слова Сообщения
<script> <!-- pismaof="[b]Мессаги[/b]" str = document.getElementById("navpm").innerHTML pos = str.indexOf("Сообщения") document.getElementById("navpm").innerHTML=str.substring(0,pos)+pismaof+str.substring(pos+9,str.length-1) --> </script>
Для изменения слова Администрирование
<script> <!-- godof="[b]Админ-панель[/b]" str = document.getElementById("navadmin").innerHTML pos = str.indexOf("Администрирование") document.getElementById("navadmin").innerHTML=str.substring(0,pos)+godof+str.substring(pos+17,str.length-1) --> </script>
Для изменения слова Выход
<script> <!-- valiof="[b]Уйти[/b]" str = document.getElementById("navlogout").innerHTML pos = str.indexOf("Выход") document.getElementById("navlogout").innerHTML=str.substring(0,pos)+valiof+str.substring(pos+5,str.length-1) --> </script>
Для изменения слова Вход
<script> <!-- vxodiof="[b]Зайти[/b]" str = document.getElementById("navlogin").innerHTML pos = str.indexOf("Войти") document.getElementById("navlogin").innerHTML=str.substring(0,pos)+vxodiof+str.substring(pos+5,str.length-1) --> </script>
Для изменения слова Регистрация
<script> <!-- regof="[b]Рега на форуме[/b]" str = document.getElementById("navregister").innerHTML pos = str.indexOf("Регистрация") document.getElementById("navregister").innerHTML=str.substring(0,pos)+regof+str.substring(pos+18,str.length-1) --> </script>
Поделиться72010-12-29 10:11:01
Запятая в форму ответа после клика на Ник автора поста.
<script type="text/javascript"> function to(username) {insert('[b]' + username + '[/b]' + ', ');} </script>
Вставлять в Низ.
Поделиться82010-12-29 10:12:47
Дополнение в статистику.
Добавит в статистику число разделов и категорий.
<script> var num_f = 0; var num_c = 0; var tr = document.getElementsByTagName("tr") for(i=0;i<tr.length;i++){ if(tr[i].id.indexOf("forum_f")!=-1){ num_f++ } } var div = document.getElementsByTagName("div") for(q=0;q<div.length;q++){ if(div[q].id.indexOf("pun-category")!=-1){ num_c++ } } var v = document.getElementById('onlinelist'); v = v.parentNode.firstChild; if (!v.innerHTML) v = v.nextSibling; v.innerHTML = '<span>Всего форумов: </span><b>'+num_f+'</b><br /><span>Всего категорий: </span><b>'+num_c+'</b><br />' + v.innerHTML; </script>
Если есть скрытые разделы, а на странице не соответствует число показанных разделов и кол-во разделов в статистике, поставьте num_f = -1, если вы хотите убавить цифру в статистике на один раздел. num_f = -3, если у вас 3 скрытых раздела. и так далее.