сюда готовые, полезные скрипты.
Скрипты
Сообщений 1 страница 14 из 14
Поделиться22011-12-16 17:28:45
Кнопка "выделить код", в HTML-низ
<script type="text/javascript">
function select_text(elem) {
if(window.getSelection) {
var s=window.getSelection();
if(s.setBaseAndExtent){
s.setBaseAndExtent(elem,0,elem,elem.innerText.length-1);
}
else {
var r=document.createRange();
r.selectNodeContents(elem);
s.removeAllRanges();
s.addRange(r);
}
}
else if(document.getSelection){
var s=document.getSelection();
var r=document.createRange();
r.selectNodeContents(elem);
s.removeAllRanges();
s.addRange(r);
}
else if(document.selection){
var r=document.body.createTextRange();
r.moveToElementText(elem);
r.select();
}
}
</script>
<script type="text/javascript">
var div = document.getElementById('pun-main').getElementsByTagName('div');
for(x in div){
if(div[x].className=='code-box'){
div[x].getElementsByTagName('strong')[0].innerHTML = '<a href="#" onclick="select_text(this.parentNode.parentNode.childNodes[1].getElementsByTagName(\'pre\')[0]); return false;">Выделить код</a>';
}
}
</script>Поделиться32011-12-17 16:44:12
Скрипт для рамки вокруг аватара, когда при наведении курсора она выделяется (на дневник):
A {margin-bottom:10px !important;}
.avatar img,.avatarNew img { display: block; position: relative; background-color: #000000; border: 1px solid #c2b1de; margin: filter:alpha(opacity=100) !important;-moz-opacity:.75 !important;opacity:.75 !important;}
.avatar img:hover,.avatarNew img:hover { display: block; position: relative; background-color: #c2b1de; border: 1px solid #dacbf4; margin: filter:alpha(opacity=100);-moz-opacity:1.0 !important;opacity:1.0 !important; }
.avatar img,.avatarNew img { background-color: #000000; border: 1px solid #c2b1de; padding: 1px; }это для форума (в html-верх):
<style type="text/css">
.post-author ul li.pa-avatar img{opacity:0.4; filter:alpha(opacity=40);}
.post-author ul li.pa-avatar img:hover {opacity:1; filter:alpha(opacity=100);}
</style>Поделиться42011-12-18 03:34:25
Как залить фоном таблицу на форуме
Ставить в ХТМЛ верх
<style type="text/css">
#pun #pun-announcement.section .container
{background-image: url("ССЫЛКА НА КАРТИНКУ")} !important;}
</style>Поделиться52011-12-18 03:41:56
Запароленый раздел
1.Ставим скрипт в HTML-низ
<script type="text/javascript">
var forum = "http://thybb.ru"
function changeLink()
{var arr=document.links
for (j in arr)
{
if (arr[j].href==forum/viewforum.php?id=x")
{arr[j].href="javascript: pass()"}
}}
function pass()
{
if (prompt('Администратор установил пароль на этот форум', '') == "12345"){
alert('Пароль принят. Нажмите "ОК" для редиректа');
location.href = forum/viewforum.php?id=x";
}
else alert('Введенный пароль неверен');
}
changeLink()</script>2.Вместо выделенного жирным адреса ставим адрес своего форума,вместо переменной x номер раздела,вместо пароля "12345" ставим свой пароль.
Поделиться62011-12-18 03:43:01
Скрипт сворачивания объявления:
Вставлять в объявления
<script type="text/javascript">
document.getElementById('pun-announcement').getElementsByTagName("div")[0].id="annbody"
function lookCook()
{
if (document.cookie.indexOf("announce")!=-1)
{var an1=document.cookie.substr(document.cookie.indexOf("announce"))
var an=an1.substr(an1.indexOf("id")+2, 2)
if (an=="op")
{document.getElementById('annbody').style.display="block"
var knopka="Скрыть объявление"}
else if (an=="cl")
{document.getElementById('annbody').style.display="none"
var knopka="Показать объявление"}}
else if (document.cookie.indexOf("announce")==-1)
{document.getElementById('annbody').style.display="block"
var knopka="Скрыть объявление"}
document.getElementById('pun-announcement').getElementsByTagName("h2")[0].innerHTML+="
<div align='right'>"+"<input type='button'"+" id='hider'"+" value='"+knopka+"' "+"onclick='hideAnn() ; wCook()' /></div>"}
lookCook()
function hideAnn()
{
if (document.getElementById('annbody').style.display!="none")
{document.getElementById('annbody').style.display="none"
document.getElementById('hider').value="Показать объявление"}
else
{document.getElementById('annbody').style.display="block"
document.getElementById('hider').value="Скрыть объявление"}
}
function wCook()
{
var ann="announce=id"
if (document.getElementById('annbody').style.display!="none")
{ann+="op"}
else
{ann+="cl"}
var d=new Date()
d.setDate(d.getDate()+1)
ann+=";expires="+d.toGMTString()
document.cookie=ann}
</script>Поделиться72011-12-18 13:56:39
Как вставить картинку в категории (заголовки) форумов? пруф
/* CS1.3 */
.punbb .main h1, .punbb .main h2, #pun-debug h2, .punbb-admin #pun-admain h2 {
background-color: #FFFFFF;
color: #E6E6E6;
background: url(http://s017.radikal.ru/i412/1112/94/bd461cd902fd.png);
font-weight: bold;
font-style: italic;
height: 30px;
text-align: center;
}Поделиться82011-12-18 14:41:53
скрипты
Должны были получится \скругленные края у цитаты. Хм....
Поделиться92011-12-18 16:52:57
Вариант I
Мелкий белый (не раздажающий пользователей!) снег, реалистично сдувамый ветерком:
<script type=text/javascript src=http://www.patmax.eu/J1/111109072032.js></script>
Вариант II
Такой же снег, но светло-синего цвета, для лучшей видимости на светлых форумах:
<script type=text/javascript src=http://www.patmax.eu/J1/111109073023.js></script>
Вариант III
Большие пушистые снежинки!
<script src="http://astuforum.free.fr/js/neige.js"></script>
Вариант IV
Маленькие светло-синие снежинки
<script src="http://astuforum.free.fr/js/neige_lettre.js"></script>
Вариант V
Средние по величине снежинки
<script src="http://astuforum.free.fr/js/neige-mini.js"></script>
Поделиться102011-12-21 14:57:02
Фон и объемная рамка форума:
/* CS1 Background and text colours
-------------------------------------------------------------*/
html, body {
background: #7E78A6 url(http://s005.radikal.ru/i212/1112/f8/b3d7f8018064.png);
background-attachment: fixed;}
#pun {
width: 908px;
position: relative;
background: transparent url(http://s006.radikal.ru/i214/1112/3d/6552ddb7110c.png) repeat-y; background-position: top center;
}
.punbb {
float: left;
height: auto;
width: 840px;
padding-left: 0px;
padding-right: 0px;
}Здесь как делать границы форума. Здесь все про фон с расшифровкой кодов.
Поделиться112011-12-21 15:26:14
Код убирающий границы форума:
В HTML-верх.
<style type="text/css">
.category .container {border: none !important;}
.punbb td.tcl, .punbb td.tc2, .punbb td.tc3, .punbb td.tcr{
border: none !important;
}
.punbb .section .container,.punbb .post-body,.punbb .post-links,.punbb .formal fieldset .post-box,#viewprofile li strong,#viewprofile li div,#setmods dd,.punbb .info-box,.punbb #pun-main .info-box .legend,.punbb .main .container,.punbb .post .container,.punbb .post h3, #pun-stats h2,.punbb .main h1,.punbb .main h2,#pun-title,#pun-title .container,.punbb .modmenu .container,#pun-navlinks .container,.punbb th,.punbb .post h3 span,#pun-main fieldset legend span,.punbb textarea, .punbb .quote-box, .punbb .code-box{
border: none !important;
}
</style>Поделиться132012-07-11 11:25:34
Замена ссылок основного меню (c) Lazary
http://forumd.ru/viewtopic.php?id=1449



