Техническая поддержка SpyBB

Объявление

Ответы на часто задаваемые вопросы  |  FAQ по администрированию форума  |  FAQ по дизайну форума в CSS  |  Абсолютный помощник по дизайну  |  Навигатор по форуму

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

● 24 марта 2012г. - Закрепление первого сообщения
● 23 марта 2012г.: Изменения в форме ответа - Добавлен стандартный спойлер. Доработан функционал кнопок

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

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


Вы здесь » Техническая поддержка SpyBB » Архив » Цветовыделение тем,спойлер


Цветовыделение тем,спойлер

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

1

Новый скрипт :

Код:
<script type="text/javascript">
if(document.URL.indexOf("viewforum.php")!=-1){
var a = document.getElementsByTagName("a");
var ins, col;
for( i=0; i<a.length; i++ ){
	if(a[i].href.indexOf("viewtopic.php")!=-1 && a[i].innerHTML.indexOf(";;")!=-1){
ins = a[i].innerHTML;
col = ins.substring(0, ins.indexOf(";;"))
txt = ins.substring(ins.indexOf(";;")+2)
a[i].innerHTML = "<span style=\"color: "+col+"\">"+txt+"</span>";
	}
}
} else if(document.URL.indexOf("viewtopic.php")!=-1){
var p = document.getElementsByTagName("p");
if(document.title.indexOf(";;")!=-1){
	document.title = document.title.substring(0, document.title.indexOf(" - ")+3)+document.title.substring(document.title.indexOf(";;")+2)
}
for( q=0; q<p.length; q++ ){
	if(p[q].className=="container crumbs" && p[q].innerHTML.indexOf(";;")!=-1){
p[q].innerHTML = p[q].innerHTML.substring(0, p[q].innerHTML.lastIndexOf("»")+1)+" "+p[q].innerHTML.substring(p[q].innerHTML.indexOf(";;")+2)
	}
}
} else if(document.URL.indexOf("post.php?fid=")!=-1 && GroupID<=2){
var colors = new Array();
colors.push(new Array('Красный', 'red'));
colors.push(new Array('Черный', 'black'));
colors.push(new Array('Жерный', 'yellow'));
colors.push(new Array('Оранжевый', 'orange'));
colors.push(new Array('Синий', 'blue'));
colors.push(new Array('Зеленый', 'green'));
colors.push(new Array('Серый', 'gray'));
var mmass = ""
for(x=0;x<colors.length;x++){
	mmass+="<option style=\"color: "+colors[x][1]+"\" value=\""+colors[x][1]+"\">"+colors[x][0]+"</option>"
}
var p1 = document.getElementsByName("req_subject")[0]
p1.style.visibility = 'hidden'
p1.parentNode.innerHTML+="<input onkeydown=\"st(document.getElementsByName('changer')[0].options[document.getElementsByName('changer')[0].selectedIndex].value)\" onkeyup=\"st(document.getElementsByName('changer')[0].options[document.getElementsByName('changer')[0].selectedIndex].value)\"   id=\"qwe_pole\" type=\"text\" name=\"qwe_pole\" value=\"\" size=\"80\" maxlength=\"70\" /> <select name=\"changer\" onchange=\"st(this.options[this.selectedIndex].value)\"><option value=\"default\">По-умолчанию</option>"+mmass+"</select>"
function st(value){
	if(document.getElementsByName("qwe_pole")[0].value!=""){
	t = document.getElementsByName("req_subject")[0];
	if(value!="default"){
if(t.value.indexOf(";;")!=-1){
	t.value=value+";;"+document.getElementsByName("qwe_pole")[0].value
} else {
	t.value=value+";;"+document.getElementsByName("qwe_pole")[0].value
}
	} else {
t.value=document.getElementsByName("qwe_pole")[0].value
	}
	}
}
}
</script>

Поставила и вот что получилось:

http://s55.radikal.ru/i147/0903/c0/968e18087377.jpg

как убрать слово green ?

Отредактировано Pravda (7 Апр 2009 05:40:35)

0

2

Pravda
Ссылку на форум в студию.

0

3

Скрипт кривой.

0

4

Kitti
форум

0

5

Pravda

Айрин написал(а):

Скрипт кривой.

Вы в нём ничего не меняли?

0

6

Нет

0

7

Kitti
Я имела ввиду, что скрипт изначально был кривой.

0

8

Как сделать чтоб спойлер не был длинной на всю форму ответа, а по середине (ну или поменьше)
http://i077.radikal.ru/0904/a5/3c9dae99872d.jpg

И ещё кнопка спойлера не отображается ... вот  форум

Как поменять слово Спойлер и слова Показать и Скрыть.

Использую:

Код:
<script>
function addSpoiler(str,from,internal){
var pos=0,pos2=0,newpos=0
if((pos=str.indexOf("[spoiler]",from))==-1) return str;
if((pos2=str.indexOf("[/spoiler]"),pos+9)==-1) return str;
newpos=str.indexOf("[spoiler]",pos+9)
if(newpos<pos2 && newpos!=-1) str=addSpoiler(str,pos+9,true)
if((pos2=str.indexOf("[/spoiler]",pos+9))==-1) return str;
str=str.substring(0,pos)+makeSpoiler(str.substring(pos+9,pos2))+str.substring(pos2+10,str.length)
if( str.indexOf("[spoiler]")!=-1 && internal==false) str=addSpoiler(str,0,false)
return str}

function makeSpoiler(txt){
txt="<div class=quote-box style='padding:1px'><cite style='width:100%'>Спойлер <input style='width:60px;margin-left:70%;font-size:10px;' type='button' value='Показать' onclick='hideSpoiler(this)'></cite><blockquote style='display:none'>"+txt+"</blockquote></div>"
return txt}

function hideSpoiler(sp){
spoiler=sp.parentNode.parentNode.getElementsByTagName("blockquote")[0]
if(spoiler.style.display=='none'){
spoiler.style.display='inline'
sp.value='Скрыть'}
else{
spoiler.style.display='none'
sp.value='Показать'}}

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=addSpoiler(post.innerHTML,0,false)}}
if(form=document.getElementById("form-buttons"))
form.getElementsByTagName("tr")[0].insertCell(19).innerHTML="<img  id=\"button-spoiler\" title=\"Спойлер\" onclick=\"bbcode('[spoiler]','[/spoiler]')\" src=\"/i/blank.gif\" />"
</script>

0

9

Pravda

Pravda написал(а):

Как поменять слово Спойлер и слова Показать и Скрыть.

Вот скрипт с выделенными надписями, которые хочешь изменить...

<script>
function addSpoiler(str,from,internal){
var pos=0,pos2=0,newpos=0
if((pos=str.indexOf("

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

",from))==-1) return str;
if((pos2=str.indexOf("

"),pos+9)==-1) return str;
newpos=str.indexOf("

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

",pos+9)
if(newpos<pos2 && newpos!=-1) str=addSpoiler(str,pos+9,true)
if((pos2=str.indexOf("

",pos+9))==-1) return str;
str=str.substring(0,pos)+makeSpoiler(str.substring(pos+9,pos2))+str.substring(pos2+10,str.length)
if( str.indexOf("

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

")!=-1 && internal==false) str=addSpoiler(str,0,false)
return str}

function makeSpoiler(txt){
txt="<div class=quote-box style='padding:1px'><cite style='width:100%'>Спойлер <input style='width:60px;margin-left:70%;font-size:10px;' type='button' value='Показать' onclick='hideSpoiler(this)'></cite><blockquote style='display:none'>"+txt+"</blockquote></div>"
return txt}

function hideSpoiler(sp){
spoiler=sp.parentNode.parentNode.getElementsByTagName("blockquote")[0]
if(spoiler.style.display=='none'){
spoiler.style.display='inline'
sp.value='Скрыть'}
else{
spoiler.style.display='none'
sp.value='Показать'}}

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=addSpoiler(post.innerHTML,0,false)}}
if(form=document.getElementById("form-buttons"))
form.getElementsByTagName("tr")[0].insertCell(19).innerHTML="<img  id=\"button-spoiler\" title=\"Спойлер\" onclick=\"bbcode('[spoiler]','

')\" src=\"/i/blank.gif\" />"
</script>

Слово спойлер меняешь на свое
Слово скрыть меняешь на свое
Слово показать меняешь на свое

Отредактировано Vista923 (8 Апр 2009 18:06:48)

+1


Вы здесь » Техническая поддержка SpyBB » Архив » Цветовыделение тем,спойлер