Код:
<style> #button-mod {background-image:url('http://png-5.findicons.com/files/icons/998/airicons/16/error.png'); padding:0; line-height:0; background-position:center; background-repeat:no-repeat; height:26px; width:100%} </style> <script> function addMod(str,from,internal){ var pos=0,pos2=0,newpos=0 if((pos=str.indexOf("[mod]",from))==-1) return str; if((pos2=str.indexOf("[/mod]"),pos+5)==-1) return str; newpos=str.indexOf("[mod]",pos+5) if(newpos<pos2 && newpos!=-1) str=addMod(str,pos+5,true) if((pos2=str.indexOf("[/mod]",pos+5))==-1) return str; str=str.substring(0,pos)+makeMod(str.substring(pos+5,pos2))+str.substring(pos2+6,str.length) if( str.indexOf("[mod]")!=-1 && internal==false) str=addMod(str,0,false) return str} function makeMod(txt){ txt="<br><div style='width:100%;'><div style='line-height: 40px; padding-left:10px; background:#8eb5c7; text-align:center; vertical-align:middle; font-weight:bold; color:#ffffff; font-size:10pt; border-top-right-radius: 15px;border-top-left-radius: 15px; '>СООБЩЕНИЕ ОТ АДМИНИСТРАЦИИ:</div><div style='background: #8eb5c7 url(http://s1.uploads.ru/1THLV.png) no-repeat right top; border-bottom-right-radius: 15px;border-bottom-left-radius: 15px;font-variant:small-caps; color: #ffffff; padding: 30px;'>"+txt+"</div></div><br>" 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=addMod(post.innerHTML,0,false)}} </script>
Код:
<style> #button-ex {background-image:url('http://png-4.findicons.com/files/icons/1014/ivista/16/error.png'); padding:0; line-height:0; background-position:center; background-repeat:no-repeat; height:26px; width:100%} </style> <script> function addEx(str,from,internal){ var pos=0,pos2=0,newpos=0 if((pos=str.indexOf("[ex]",from))==-1) return str; if((pos2=str.indexOf("[/ex]"),pos+4)==-1) return str; newpos=str.indexOf("[ex]",pos+4) if(newpos<pos2 && newpos!=-1) str=addEx(str,pos+4,true) if((pos2=str.indexOf("[/ex]",pos+4))==-1) return str; str=str.substring(0,pos)+makeEx(str.substring(pos+4,pos2))+str.substring(pos2+5,str.length) if( str.indexOf("[ex]")!=-1 && internal==false) str=addEx(str,0,false) return str} function makeEx(txt){ txt="<br><br><div style='width:100%;'><div style='line-height: 40px; padding-left:10px; background:#d14c4c; text-align:center; vertical-align:middle; font-weight:bold; color:#ffffff; font-size:10pt; border-top-right-radius: 15px;border-top-left-radius: 15px; '>ГРУБОЕ НАРУШЕНИЕ:</div><div style='background: #d14c4c url(http://s1.uploads.ru/1THLV.png) no-repeat right top; border-bottom-right-radius: 15px;border-bottom-left-radius: 15px;font-variant:small-caps; color: #ffffff; padding: 30px;'>"+txt+"</div></div><br><br>" 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=addEx(post.innerHTML,0,false)}} </script>