Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Zetaboards Modifications
  • [ZB] Tabbed Categories
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
  • Pages:
  • 1
  • 2
[ZB] Tabbed Categories
Tweet Topic Started: Mar 29 2010, 09:37 PM (4,084 Views)
Agent Moose Mar 29 2010, 09:37 PM Post #1
Member Avatar
SMF for Free Moderator

Posts:
838
Group:
Former Staff
Member
#14
Joined:
Jul 9, 2008
Below the Baord:
Code:
 
<style>
.tabBorder{
border-left: 1px solid #3A5197;
padding: 5px;
margin-right: 1px;
};
</style>


<script type="text/javascript">
/*
Created by Agent Moose
-zbcode.com
-revolutionx.smfforfree3.com
You may not redistribute or edit without permission
*/
if(location.href == main_url + "index/"){
var Tabs = "";
var Forumz = "";
var FirstView = $("div.category:first").find("h2 a").parent().parent().parent().parent().parent().next().html();
$("div.category[id!='Tabby']").find("h2 a").each(function(){
var startID = this.href.split("/forum/")[1];
var forumID = startID.split("/")[0];
Tabs += "<a id='tab_" + forumID + "' href='javascript:void(0);' onclick='ShowCat(" + forumID + ");' class='tabBorder'>" + this.innerHTML + "</a>";
});
if(readCookie("ShowForum")){
var CurrentCookie = $("div.category").find("h2 a[href*='forum/" + readCookie("ShowForum") + "/']").parent().parent().parent().parent().parent().next().html();
$("div#main div.category:first").before("<div class='category' id='Tabby'><table class='cat_head'><tr><td><h2><span style='float: right;'><a href='javascript:void(0);' onclick='ShowAll(this);' id='ShoeMe'>(Show all Forums)</a></span>Tabs: " + Tabs + "<span class='tabBorder'> </span></h2></td></tr></table><table id='TheTable'>" + CurrentCookie + "</table></div>");
}else{
$("div#main div.category:first").before("<div class='category' id='Tabby'><table class='cat_head'><tr><td><h2><span style='float: right;'><a href='javascript:void(0);' onclick='ShowAll(this);' id='ShoeMe'>(Show all Forums)</a></span>Tabs: " + Tabs + "<span class='tabBorder'> </span></h2></td></tr></table><table id='TheTable'>" + FirstView + "</table></div>");
};
$("div.category[id*='cat-']").hide();
};
function ShowCat(forum){
$("div.category").find("h2 a").each(function(){
if(this.href.match("/forum/" + forum + "/")){
createCookie("ShowForum",forum,365);
Forumz = $(this).parent().parent().parent().parent().parent().next().html();
$("#TheTable").html(Forumz);
};});
};
function ShowAll(){
$("#Tabby").slideToggle();
$("div.category[id*='cat-']").show("normal");
};
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

function eraseCookie(name) {
createCookie(name,"",-1);
}
</script>


I saw that someone wanted this code to be made right here:
http://zbcode.com/single/?p=155828&t=1537803

So, I decided to make it.

It gathers all the Categories you have on your forum, and puts them into tabs, then when you click on a tab, it will show the forums under that category.

Also, it remembers what category you were last in when you leave the page ^_^

Enjoy :)
You could call me Troy :P | The World of Moosey | Newest Blog: SMF for Free Spam Code

Current Project: Zetaboard Javascript Tester (click on the link in the Submenu)

ZetaBoard Javascript Tester Features:
- Code Test box
- Counts how many open brackets/parentheses and closed brackets/parentheses you have in your code to make sure that your code will work.
- New: Inspect Element
Offline Profile Goto Top
 
screamscream Mar 30 2010, 04:13 PM Post #2


Posts:
72
Group:
Member
Member
#3,674
Joined:
Feb 4, 2010
Coding language
HTML/CSS
Preview? :D Hello I am enjoying the preview box above this ahahaha i can type faster than it can load asfdgfgdfg dfbgjfgfnhknmmgkmgkjhkhjk
Posted Image
Offline Profile Goto Top
 
Agent Moose Mar 30 2010, 07:30 PM Post #3
Member Avatar
SMF for Free Moderator

Posts:
838
Group:
Former Staff
Member
#14
Joined:
Jul 9, 2008
http://s1.zetaboards.com/Superstar_Test/index/ :)
You could call me Troy :P | The World of Moosey | Newest Blog: SMF for Free Spam Code

Current Project: Zetaboard Javascript Tester (click on the link in the Submenu)

ZetaBoard Javascript Tester Features:
- Code Test box
- Counts how many open brackets/parentheses and closed brackets/parentheses you have in your code to make sure that your code will work.
- New: Inspect Element
Offline Profile Goto Top
 
tangbangnho Mar 31 2010, 03:56 AM Post #4
Member Avatar


Posts:
24
Group:
Member
Member
#3,752
Joined:
Mar 27, 2010
wow wow , it's really wonderful code . Thanks for sharing :)

I wanna to replace the text (Tabs: prefix categories ) with the other , as a small gif img :Posted Image . How should i do ? <3
Edited by tangbangnho, Mar 31 2010, 04:30 AM.
Two shall be as one , always protects , always trusts , always love Posted Image
Offline Profile Goto Top
 
Brandon2KO Apr 2 2010, 11:53 PM Post #5


Posts:
17
Group:
Member
Member
#3,640
Joined:
Jan 6, 2010
Coding language
Everything
Hmm it shows the Catagoreys as Tabs but when I click the Tab it dosnt load the Catagorey here is a link to my board to show you http://s1.zetaboards.com/Visual_Studios/index/ It also shows "null" below the H2 instead of the starting catagorey.

EDIT: choose the Zeta Default skin please
Edited by Brandon2KO, Apr 3 2010, 10:29 AM.
Offline Profile Goto Top
 
Angel Pie Apr 4 2010, 04:32 PM Post #6
Member Avatar


Posts:
41
Group:
Member
Member
#1,893
Joined:
Dec 30, 2008
Works fine for me but this blue separator does not match my theme. Is there any way to get rid of these blue lines?
Offline Profile Goto Top
 
Gorgor Apr 4 2010, 06:07 PM Post #7
Hello

Posts:
1,187
Group:
Former Staff
Member
#2,728
Joined:
Apr 2, 2009
Coding language
PHP
Angel Pie
Apr 4 2010, 04:32 PM
Works fine for me but this blue separator does not match my theme. Is there any way to get rid of these blue lines?
Code:
 
<style>
.tabBorder{
border-left: 1px solid #3A5197;
padding: 5px;
margin-right: 1px;
};
</style>
Remove that or change it.
Offline Profile Goto Top
 
Angel Pie Apr 4 2010, 07:17 PM Post #8
Member Avatar


Posts:
41
Group:
Member
Member
#1,893
Joined:
Dec 30, 2008
Thanks!
Offline Profile Goto Top
 
Anicho Apr 5 2010, 07:44 AM Post #9


Posts:
30
Group:
Member
Member
#3,585
Joined:
Nov 25, 2009
Coding language
HTML/CSS
I'd like this if it were made out of AJAX, and more like the vBulletin mod, but who's complaining?
Offline Profile Goto Top
 
Gorgor Apr 5 2010, 09:12 PM Post #10
Hello

Posts:
1,187
Group:
Former Staff
Member
#2,728
Joined:
Apr 2, 2009
Coding language
PHP
Anicho
Apr 5 2010, 07:44 AM
I'd like this if it were made out of AJAX, and more like the vBulletin mod, but who's complaining?
What would be the benefits if it were made in AJAX? If anything that would just be much worse, take longer, and use up those nasty ad credits! xD
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Zetaboards Modifications · Next Topic »
Locked Topic
  • Pages:
  • 1
  • 2

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