Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Support
  • Code University
  • subforums?
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
subforums?
Tweet Topic Started: Jan 18 2009, 02:31 PM (136 Views)
VampDuzell Jan 18 2009, 02:31 PM Post #1


Posts:
1
Group:
Member
Member
#2,061
Joined:
Jan 18, 2009
Coding language
HTML/CSS
So, im currently using this code by Choco:

Quote:
 
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.pack.js"></script>
<script type="text/javascript">
//////////////////////////////////
// Auto-List Subforums Code //
//By Choco of the IFSZ & Ifusion//
// Do Not Redistribute //
//////////////////////////////////
// Edit This //
start = "Subforums: "; //Starting text. What should it say before the list?
text = " [{f}] "; //How should the subforum links be formatted?

// Don't Edit This //
var x=document.getElementsByTagName("a");
for(var i in x) {
if(x.href&&x.href.match(/showforum/i)&&x.parentNode.parentNode&&x.parentNode.parentNode.className=="row4") {
x.id=(x.href).substring(((x.href).indexOf("showforum=")+10),(x.href).length);
$.get(x.href,function(_d) {
cF=_d.split(/\<div id=.navstrip. align=.left.\>/i)[1].split(/\<\/div\>/i)[0];
/showforum=(\d+)/i.test(cF);
fin=RegExp.$1;
_t=document.getElementById(fin);
if(_d.match(/Forum\<\/th\>/i)) {
_c_t=_d.split(/Forum\<\/th\>/i)[1].split(/\<td class=.darkrow2./i)[0];
_n_e=document.createElement("div");
_n_e.id="_n"+fin;
_n_e.innerHTML=_c_t;
document.body.appendChild(_n_e);
_c_l=_n_e.getElementsByTagName("a");
_f_l_c=[];
for(var _li in _c_l) {
if(_c_l[_li].href&&_c_l[_li].href.match(/showforum=(\d+)/i)) {
_f_l_c[_f_l_c.length]=[_c_l[_li].href,_c_l[_li].innerHTML];
}
}
if(_f_l_c.length>0) {
_p_n_u=document.getElementById(fin).parentNode.parentNode;
_p_n_u.innerHTML+="<br />"+start;
for(var _in in _f_l_c) {
if(_f_l_c[_in][0]!=undefined)
_p_n_u.innerHTML+=text.replace(/\{f\}/i,"<a href='"+_f_l_c[_in][0]+"'>"+_f_l_c[_in][1]+"</a>");
}
}
}
});
}
}
</script>

It works and i like it, but if you scroll all the way to the bottom it shows a list of all the subforums and their new topics. Is there a way to make this go away?

You can see it in the preview Choco made here
Offline Profile Goto Top
 
HolySavior Jan 18 2009, 07:55 PM Post #2
Member Avatar
Modifying The World Around You

Posts:
2,488
Group:
Distinguished Coder
Member
#7
Joined:
Jul 2, 2008
Coding language
Everything
looks like you have an error the coding somewhere. since its showing JS too. so possibly a premature </script> tag
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Code University · Next Topic »
Locked Topic

Track Topic · E-mail Topic Time: 7:43 PM Jul 10
Hosted for free by ZetaBoards · Privacy Policy