Simple Machine Codes
April 19, 2024, 10:30:24 pm
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to SMC, the best place for your SMF For Free Codes
 
  Home Help Search Arcade Gallery Affiliates Code Index Staff List Calendar Members Login Register  

Tabbed Categories

Pages: [1]   Go Down
  Print  
Author Topic: Tabbed Categories  (Read 413 times)
0 Members and 1 Guest are viewing this topic.
Agent Moose
Administrator

Offline Offline

Gender: Male
Posts: 2,672



View Profile WWW
« on: March 26, 2010, 12:17:50 am »

Well, you may realize that I haven't created a code in awhile (I should say haven't released a code in awhile).  After looking at some of the codes I had released only for the exclusive members on my old forum, Revolution X, I decided to give this code out to the public Smiley



Footers:
Code:
<style type="text/css">
.tabBorder{
border-left: 1px solid #3A5197;
padding: 5px 5px 5px 5px;
margin-right: 1px;
};
</style>

<script type="text/javascript">
if(document.getElementById("upshrinkHeaderIC") !== null){
//Created by Agent Moose
var Tabs = "", Forumz = "", FirstView = $("div#bodyarea").find("div[class*='catbg']:first a").parent().next().html();
$("div[class*='catbg'] a").each(function(){
var forumID = this.name;
this.parentNode.parentNode.id = "notTabby";
Tabs += "<a id='tab_" + forumID + "' href='javascript:void(0);' onclick='ShowCat(" + forumID + ");' class='tabBorder smalltext'>" + this.innerHTML + "</a>";
});
if(readCookie("ShowForum")){
var CurrentCookie = $("div#bodyarea").find("div[class*='catbg'] a[name='" + readCookie("ShowForum") + "']").parent().next().html();
$("div#bodyarea div.tborder:first").before("<div id='Tabby' class='tborder' style='margin-top: 0pt;'><div class='catbg' style='padding: 5px 5px 5px 10px;'><span style='float: right' class='smalltext'><a href='javascript:void(0);' onclick='ShowAll(this);'>(Show all Forums)</a></span>Tabs: " + Tabs + "<span class='tabBorder'> </span></div><table width='100%' cellspacing='1' cellpadding='5' border='0' style='margin-top: 1px;' class='bordercolor' id='TheTable'>" + CurrentCookie + "</table></div>");
}else{
$("div#bodyarea div.tborder:first").before("<div id='Tabby' class='tborder' style='margin-top: 0pt;'><div class='catbg' style='padding: 5px 5px 5px 10px;'><span style='float: right' class='smalltext'><a href='javascript:void(0);' onclick='ShowAll(this);'>(Show all Forums)</a></span>Tabs: " + Tabs + "<span class='tabBorder'> </span></div><table width='100%' cellspacing='1' cellpadding='5' border='0' style='margin-top: 1px;' class='bordercolor' id='TheTable'>" + FirstView + "</table></div>");
};
$("#bodyarea").find("div.tborder[id!='Tabby']:not(:contains(Info Center))").hide();
};

function ShowCat(forum){
$("#bodyarea").find("div[class*='catbg'] a").each(function(){
if(this.name == forum){
createCookie("ShowForum",forum,365);
Forumz = $(this).parent().next().html();
$("#TheTable").html(Forumz);
};});
};

function ShowAll(){
$("#Tabby").slideToggle();
$("#bodyarea").find("div.tborder[id!='Tabby']:not(:contains(Info Center))").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>

Here is a code that I created awhile back for Zetaboards, and I decided to make it for SMF for Free Smiley

All it does is make it so all the category names are made into tabs, and when you click on the tab, it will show all the boards under that category Smiley

Preview: http://tabbedcategory.smfforfree3.com/index.php

Enjoy Smiley
Report Spam   Logged

Share on Facebook Share on Twitter



Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy