![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 38 Pomógł: 0 Dołączył: 2.12.2004 Skąd: Tarnów Ostrzeżenie: (10%) ![]() ![]() |
Chciałem się zapytać w jaki sposób na mojej stronie www mogę zrobić kolorowanie składni kodu php ? Bo jak narazie mam zrobiony taki bbcode [code][/code] np. u mnie w temacie taki kod wygląda tak: http://www.history.is.net.pl/faq/1/4
W jaki sposób zrobić tak, żeby te kody mi kolorowało ? może ktoś mi pomóc w tym ? Ten post edytował Lwie_Serce_ 6.03.2013, 17:51:48 |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 38 Pomógł: 0 Dołączył: 2.12.2004 Skąd: Tarnów Ostrzeżenie: (10%) ![]() ![]() |
no wiem, bo to jest w css
ale w php tego nie moge znalesc, jedynie mam w js Kod var id='txt';
// ---------- Poniżej tej linii nie trzeba nic zmieniać ---------- var T={}, id='txt'; function $add(con, el, t){ el=$get(el||id); el.focus(); if((t=document.selection)&&t.createRange) t.createRange().text=con; else if(el.selectionStart!==undefined){ t = el.selectionStart; el.value=el.value.substring(0, t)+con+el.value.substr(el.selectionEnd); $select(el, t += con.length, t); } else el.value+=con; el.focus(); } function $sel(e,t){e=$get(e||id);e.focus();return (t=document.selection)&&t.createRange?t.createRange().text:e.value.substring(e.selectionEnd|0,e.selectionStart|0)} function $get(el){return el.tagName ? el : document.getElementById(el)} function $status(id, tag, val, r){r=T[id][tag];if(val!==undefined)T[id][tag]=val|0;return r} function $select(e, from, to){ e=$get(e);e.focus(); if(e.setSelectionRange) e.setSelectionRange(from, to); else if(e.createTextRange) { e = e.createTextRange(); e.collapse(true); e.moveEnd('character', to); e.moveStart('character', from); e.select(); } } function bbcode(tag, opt, s){ opt = opt || {}; var t = opt.name || id, attr = 'attr' in opt ? '' + opt.attr : ''; T[t] = T[t] || {}; if(s=$sel(t)) $add('['+tag+attr+']'+s+'[/'+tag+']',t); else { (s=T[t])[tag]|=0; $add('['+(s[tag]?'/':'')+tag+(s[tag]?'':attr)+']',t); s[tag]^=1; mark($get(t).form, tag, s[tag]); } } function mark(frm, name, opened, t){ frm = frm.getElementsByTagName('*'); for(var i=0;t=frm[i++];){ if(t.getAttribute('name')===name) t.value = opened ? '/'+t.value : t.value.substr(1); } } function emoticon(e){ $add(e,'message'); } function closeAllTags(name){ var t = name || id; for(var i in T[t]){ if(T[t][i]===0)continue; $add('[/'+i+']',t); T[t][i]=0; mark($get(t).form, i, 0); } } Ten post edytował Lwie_Serce_ 7.03.2013, 21:13:57 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 5.10.2025 - 11:07 |