|
Hide Tag !; Mod cực hiếm và cực cool...
|
|
Topic Started: May 26 2006, 05:08 PM (986 Views)
|
|
Jimmy
|
May 26 2006, 05:08 PM
Post #1
|
__Love__
- Posts:
- 3,228
- Group:
- L'@mour ™ Admin
- Member
- #1
- Joined:
- May 6, 2006
|
...Cũng giống như thẻ "HIDE" của IPB2.x, thành viên phải có ít nhất 1 bài trả lời mới có thể xem phần được làm ẩn đi. Mă chạy ổn định và không có những ảnh hưởng đáng kể khi load page.
Mẫu here:
http://z4.invisionfree.com/OLL/index.php?showtopic=5
...Cách gài vào th́ nhanh lắm, t́m Board Wrappers > Footer, đặt mă này:
- Quote:
-
<style> .hidetag { display:none; } </style> <script> function Request() { if (window.XMLHttpRequest ) { return new XMLHttpRequest(); } else if (window.ActiveXObject) { try { return new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { return new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { return false; } } } } function ShowHides(tid) { tid=tid; ulnk=document.all?document.all.userlinks:document.getElementById("userlinks"); if (ulnk.innerHTML.match(/showuser=([0-9]+)/ig)!=null) { unum=RegExp.$1; req=Request(); main=document.location.href.split("/index.php")[0]; req.open("GET",main+"/index.php?s=&act=Stats&CODE=who&t="+tid); req.onreadystatechange=function() { if (req.readyState==4) { txt=req.responseText; okay=txt.match(new RegExp("showuser="+unum,"ig")); if (okay) { divs=document.getElementsByTagName("div"); for (p=0; p<divs.length; p++) { if (divs[p].className=="hidetag") { divs[p].className=""; divs[p].style.display="inline"; } } } } } req.send(null); } } function ReplaceHides(tid) { tid=tid; ulnk=document.all?document.all.userlinks:document.getElementById("userlinks"); if (ulnk.innerHTML.match(/showuser=([0-9]+)/ig)!=null) { unum=RegExp.$1; divs=document.getElementsByTagName("div"); for (p=0; p<divs.length; p++) { if (divs[p].className=="pformstrip" && divs[p].innerHTML.match(/Last 10 Posts/ig)!=null) { divs[p].parentNode.innerHTML=divs[p].parentNode.innerHTML.replace(/\[hide\]([\s\S]*?)\[\/hide\]/ig,"<div class='hidetag'>$1</div>"); } } document.REPLIER.Post.value=document.REPLIER.Post.value.replace(/\[hide\].*?\[\/hide\]/ig,""); document.REPLIER.QPost.value=document.REPLIER.QPost.value.replace(/\[hide\].*?\[\/hide\]/ig,""); req=Request(); main=document.location.href.split("/index.php")[0]; req.open("GET",main+"/index.php?s=&act=Stats&CODE=who&t="+tid); req.onreadystatechange=function() { if (req.readyState==4) { txt=req.responseText; okay=txt.match(new RegExp("showuser="+unum,"ig")); if (okay) { divs=document.getElementsByTagName("div"); for (p=0; p<divs.length; p++) { if (divs[p].className=="hidetag") { divs[p].className=""; divs[p].style.display="inline"; } } } } } req.send(null); } } tds=document.getElementsByTagName("td"); for (p=0; p<tds.length; p++) { spans=tds[p].getElementsByTagName("span"); as=tds[p].getElementsByTagName("a"); if (as.length>0 && spans.length>0 && spans[0].className=="normalname" && as[0].href.match(/showuser=[0-9]+/ig)!=null) { p+=3; tds[p].innerHTML=tds[p].innerHTML.replace(/\[hide\]([\s\S]*?)\[\/hide\]/ig,"<div class='hidetag'>$1</div>"); } } if (document.location.href.match(/showtopic=([0-9]+)/ig)!=null) { ShowHides(RegExp.$1); } if (document.location.href.match(/act=Post.*?&CODE=0[826]/ig)!=null && document.location.href.match(/t=([0-9]+)/ig)!=null) { ReplaceHides(RegExp.$1); } </script>
...Không cần sửa đổi ǵ cả, bạn làm ngay được rồi và dùng tag này để ẩn đi một mục tùy ư khi viết bài:
- Quote:
-
[HIDE] CHỮ VÀ H̀NH ẢNH [/HIDE]
Enjoy!
|
|
| |
|
yuta
|
May 30 2006, 10:14 AM
Post #2
|
- Posts:
- 68
- Group:
- Member ™
- Member
- #76
- Joined:
- May 27, 2006
|
Công nhận là cái mă này của kenshin rất hay!!
|
|
|
| |
|
bigbangs
|
May 30 2006, 11:14 AM
Post #3
|
- Posts:
- 60
- Group:
- Member ™
- Member
- #66
- Joined:
- May 26, 2006
|
ḿnh vẫn ko hiểu lắm bạn ạ
|
|
|
| |
|
Jimmy
|
May 30 2006, 11:18 AM
Post #4
|
__Love__
- Posts:
- 3,228
- Group:
- L'@mour ™ Admin
- Member
- #1
- Joined:
- May 6, 2006
|
...Đơn giản thui, bigbangs, hăy đăng kí một nick trong demo trên, rùi reply cho Topic post của Nekon, sẽ hỉu ngay, rất tuyệt !
|
|
| |
|
ghost_boy1412
|
Dec 8 2006, 07:46 PM
Post #5
|
- Posts:
- 2
- Group:
- Member ™
- Member
- #628
- Joined:
- December 6, 2006
|
- Quote:
-
thành viên phải có ít nhất 1 bài trả lời mới có thể xem phần được làm ẩn đi
Vậy th́ muốn phải post ít nhất 10 bài th́ làm sao!
|
|
|
| |
| 1 user reading this topic (1 Guest and 0 Anonymous)
|