[ABD] Forum Categories in Tabs

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
darocker077
Registered User
Posts: 512
Joined: Thu Sep 16, 2010 5:53 pm
Location: ..:: Index.php ::..
Name: darocker 077
Contact:

Re: [BETA] Forum Categories in Tabs

Post by darocker077 »

I also have a suggestion for the tabs since those are little tricky enough to identify at the first look.. may be hard for the new forum users (newbies)...

suggestion: if tabs can change color depend on the board style + tab height & width can be altered.. that would be great :)
..:: RoCkInG dUdE ::..
:: MBCS | MCP | MCTS | MCSA
:: GeekLK - Tech in Simplified English

User avatar
Boardtalk.net
Registered User
Posts: 1217
Joined: Fri Jun 05, 2009 8:12 pm
Location: Ireland
Name: Colette
Contact:

Re: [BETA] Forum Categories in Tabs

Post by Boardtalk.net »

darocker077 wrote:I also have a suggestion for the tabs since those are little tricky enough to identify at the first look.. may be hard for the new forum users (newbies)...

suggestion: if tabs can change color depend on the board style + tab height & width can be altered.. that would be great :)
Yep, this is worth looking into but only after we get the mod working as it should. ;)

darocker077
Registered User
Posts: 512
Joined: Thu Sep 16, 2010 5:53 pm
Location: ..:: Index.php ::..
Name: darocker 077
Contact:

Re: [BETA] Forum Categories in Tabs

Post by darocker077 »

I really love the way this MOD works.. well, I should thank Boardtalk.net for providing us such a nice mod.. I've tried this within my board and it works perfectly. But the only thing needed is a cookie to remember which tab that user was in.. coz, when he/she hit the back button it goes to the main index, and then user needs to select the tab again.

If anyone can come up with what Boardtalk.net mention on this topic here. It will be a great support. :)
..:: RoCkInG dUdE ::..
:: MBCS | MCP | MCTS | MCSA
:: GeekLK - Tech in Simplified English

darocker077
Registered User
Posts: 512
Joined: Thu Sep 16, 2010 5:53 pm
Location: ..:: Index.php ::..
Name: darocker 077
Contact:

Re: [BETA] Forum Categories in Tabs

Post by darocker077 »

This is what a user gave me & advised me to replace within theme/js/tab-view.js with whatever the current code... but unfortunately it did not work with the cookies script in it.. any one please have a look and advise if possible.. :(

Code: Select all

    /************************************************************************************************************
    (C) www.dhtmlgoodies.com, October 2005

    This is a script from www.dhtmlgoodies.com. You will find this and a lot of other scripts at our website.   

    Terms of use:
    You are free to use this script as long as the copyright message is kept intact. However, you may not
    redistribute, sell or repost it without our permission.

    Updated:
       
       March, 14th, 2006 - Create new tabs dynamically
       March, 15th, 2006 - Dynamically delete a tab
       
    Thank you!

    www.dhtmlgoodies.com
    Alf Magne Kalleland

    ************************************************************************************************************/      
    var textPadding = 3; // Padding at the left of tab text - bigger value gives you wider tabs
    var strictDocType = true;
    var tabView_maxNumberOfTabs = 8;   // Maximum number of tabs

    /* Don't change anything below here */
    var dhtmlgoodies_tabObj;
    var activeTabIndex = -1;
    var MSIE = navigator.userAgent.indexOf('MSIE')>=0?true:false;
    var navigatorVersion = navigator.appVersion.replace(/.*?MSIE (\d\.\d).*/g,'$1')/1;
    var ajaxObjects = new Array();
    var tabView_countTabs = 0;
    var tabViewHeight;

    function setPadding(obj,padding){
       var span = obj.getElementsByTagName('SPAN')[0];
       span.style.paddingLeft = padding + 'px';   
       span.style.paddingRight = padding + 'px';   
    }

    function showTab(tabIndex)
    {
       if(!document.getElementById('tabView' + tabIndex))return;
       if(activeTabIndex>=0){
          if(activeTabIndex==tabIndex)return;
          var obj = document.getElementById('tabTab'+activeTabIndex);
          obj.className='tabInactive';
          var img = obj.getElementsByTagName('IMG')[0];
          img.src = img_url + '/tabimages/tab_right_inactive.gif';
          document.getElementById('tabView' + activeTabIndex).style.display='none';
       }
       
       var thisObj = document.getElementById('tabTab'+tabIndex);      
       thisObj.className='tabActive';
       var img = thisObj.getElementsByTagName('IMG')[0];
       img.src = img_url + '/tabimages/tab_right_active.gif';
       
       document.getElementById('tabView' + tabIndex).style.display='block';
       activeTabIndex = tabIndex;
       

       var parentObj = thisObj.parentNode;
       var aTab = parentObj.getElementsByTagName('DIV')[0];
       countObjects = 0;
       var startPos = 2;
       var previousObjectActive = false;
       while(aTab){
          if(aTab.tagName=='DIV'){
             if(previousObjectActive){
                previousObjectActive = false;
                startPos-=2;
             }
             if(aTab==thisObj){
                startPos-=2;
                previousObjectActive=true;
                setPadding(aTab,textPadding+1);
             }else{
                setPadding(aTab,textPadding);
             }
             
             aTab.style.left = startPos + 'px';
             countObjects++;
             startPos+=2;
          }         
          aTab = aTab.nextSibling;
       }
       
       return;
    }

    function tabClick()
    {
       var tab = this.id.replace(/[^\d]/g,'');
       setCookie("tab", tab);
       showTab(tab);
    }

    function rolloverTab()
    {
       if(this.className.indexOf('tabInactive')>=0){
          this.className='inactiveTabOver';
          var img = this.getElementsByTagName('IMG')[0];
          img.src = img_url + '/tabimages/tab_right_over.gif';
       }
       
    }
    function rolloutTab()
    {
       if(this.className ==  'inactiveTabOver'){
          this.className='tabInactive';
          var img = this.getElementsByTagName('IMG')[0];
          img.src = img_url + '/tabimages/tab_right_inactive.gif';
       }
       
    }

    function initTabs(tabTitles,activeTab,width,height,additionalTab)
    {
       if(!additionalTab || additionalTab=='undefined'){         
          dhtmlgoodies_tabObj = document.getElementById('dhtmlgoodies_tabView');
          width = width + '';
          if(width.indexOf('%')<0)width= width + 'px';
          dhtmlgoodies_tabObj.style.width = width;
                   
          height = height + '';
          if(height.length>0){
             if(height.indexOf('%')<0)height= height + 'px';
             dhtmlgoodies_tabObj.style.height = height;
          }
          

          tabViewHeight = height;
          
          var tabDiv = document.createElement('DIV');      
          var firstDiv = dhtmlgoodies_tabObj.getElementsByTagName('DIV')[0];   
          
          dhtmlgoodies_tabObj.insertBefore(tabDiv,firstDiv);   
          tabDiv.className = 'dhtmlgoodies_tabPane';
          
          tabView_countTabs = 0;
       }else{
          var tabDiv = dhtmlgoodies_tabObj.getElementsByTagName('DIV')[0];
          var firstDiv = dhtmlgoodies_tabObj.getElementsByTagName('DIV')[1];
          height = tabViewHeight;
          activeTab = tabView_countTabs;         
       }
       
       
       
       for(var no=0;no<tabTitles.length;no++){
          var aTab = document.createElement('DIV');
          aTab.id = 'tabTab' + (no + tabView_countTabs);
          aTab.onmouseover = rolloverTab;
          aTab.onmouseout = rolloutTab;
          aTab.onclick = tabClick;
          aTab.className='tabInactive';
          tabDiv.appendChild(aTab);
          var span = document.createElement('SPAN');
          span.innerHTML = tabTitles[no];
          aTab.appendChild(span);
          
          var img = document.createElement('IMG');
          img.valign = 'bottom';
          img.src = img_url + '/tabimages/tab_right_inactive.gif';
          // IE5.X FIX
          if((navigatorVersion && navigatorVersion<6) || (MSIE && !strictDocType)){
             img.style.styleFloat = 'none';
             img.style.position = 'relative';   
             img.style.top = '4px'
             span.style.paddingTop = '4px';
             aTab.style.cursor = 'hand';
          }   // End IE5.x FIX
          aTab.appendChild(img);
       }

       var tabs = dhtmlgoodies_tabObj.getElementsByTagName('DIV');
       var divCounter = 0;
       for(var no=0;no<tabs.length;no++){
          if(tabs[no].className=='dhtmlgoodies_aTab'){
             if(height.length>0)tabs[no].style.height = height;
             tabs[no].style.display='none';
             tabs[no].id = 'tabView' + divCounter;
             divCounter++;
          }         
       }   
       tabView_countTabs = tabView_countTabs + tabTitles.length;   
       showTab(activeTab);
       
       return activeTab;
    }   

    function setCookie(name, value, expires, path, domain, secure) {
        document.cookie= name + "=" + escape(value) +
       ((expires) ? "; expires=" + expires.toGMTString() : "") +
       ((path) ? "; path=" + path : "") +
       ((domain) ? "; domain=" + domain : "") +
       ((secure) ? "; secure" : "");
    }

    function getCookie(name) {
        var dc = document.cookie;
        var prefix = name + "=";
        var begin = dc.indexOf("; " + prefix);
        if (begin == -1) {
       begin = dc.indexOf(prefix);
       if (begin != 0) return null;
        } else {
       begin += 2;
        }
        var end = document.cookie.indexOf(";", begin);
        if (end == -1) {
       end = dc.length;
        }
        return unescape(dc.substring(begin + prefix.length, end));
    }
..:: RoCkInG dUdE ::..
:: MBCS | MCP | MCTS | MCSA
:: GeekLK - Tech in Simplified English

Peter77sx
Registered User
Posts: 3259
Joined: Wed Nov 09, 2005 2:51 pm

Re: [BETA] Forum Categories in Tabs

Post by Peter77sx »

Love it. thanks for taking up. hm yeah let's make the tabs match prosilver at the least. I would be happy styling it with custom css.. bit tricky.

User avatar
Boardtalk.net
Registered User
Posts: 1217
Joined: Fri Jun 05, 2009 8:12 pm
Location: Ireland
Name: Colette
Contact:

Re: [BETA] Forum Categories in Tabs

Post by Boardtalk.net »

@darocker077
Yep, I had already tried that piece of javascript but its specific to where it was found.

@Peter77sx
Yes that would be great if you wanted to.

Mod Info Update;
I've been looking at using jQuery for this mod instead of the script that came from dhtmlgoodies.com as its licence is not suitable for submission to the Mod DB.

I have the jQuery version working but now I've to figure out the 'stay on tab page refresh' issue.

Will keep you updated as I go.
;)

puabase-2
Registered User
Posts: 34
Joined: Sat Oct 29, 2011 8:54 am

Re: [BETA] Forum Categories in Tabs

Post by puabase-2 »

Love it!

You cant give up. Keep goin please :D

darocker077
Registered User
Posts: 512
Joined: Thu Sep 16, 2010 5:53 pm
Location: ..:: Index.php ::..
Name: darocker 077
Contact:

Re: [BETA] Forum Categories in Tabs

Post by darocker077 »

puabase-2 wrote:Love it!

You cant give up. Keep goin please :D
Of course yes.. even I'm trying to find out a solution to create a cookie by calling all my friends.. hope, this will be fixed soon :)
..:: RoCkInG dUdE ::..
:: MBCS | MCP | MCTS | MCSA
:: GeekLK - Tech in Simplified English

puabase-2
Registered User
Posts: 34
Joined: Sat Oct 29, 2011 8:54 am

Re: [BETA] Forum Categories in Tabs

Post by puabase-2 »

I found a bug.

For exemple:

if you have four categories.

Cat 1 - cat 2 - cat 3 and cat 4

And normal users can only see the categorie 1,3 and 4

The category 3 name instead of be cat 3 gonna be category 2.

Javascript cant assume which category name belongs to . Only can be if are in order.

User avatar
Boardtalk.net
Registered User
Posts: 1217
Joined: Fri Jun 05, 2009 8:12 pm
Location: Ireland
Name: Colette
Contact:

Re: [BETA] Forum Categories in Tabs

Post by Boardtalk.net »

@ puabase-2
Thanks, will look into this

User avatar
Kamahl19
Registered User
Posts: 1598
Joined: Tue Nov 06, 2007 3:33 pm
Location: Slovakia
Name: Martin
Contact:

Re: [BETA] Forum Categories in Tabs

Post by Kamahl19 »

It is a good idea, you just should change the style of forums and buttons :) It is ugly now

User avatar
Boardtalk.net
Registered User
Posts: 1217
Joined: Fri Jun 05, 2009 8:12 pm
Location: Ireland
Name: Colette
Contact:

Re: [BETA] Forum Categories in Tabs

Post by Boardtalk.net »

Kamahl19 wrote:It is a good idea, you just should change the style of forums and buttons :) It is ugly now
:lol: it sure is ugly ;)
am trying to figure it out and get it working right first but its not easy, am open to ideas.

KarGoManiA
Registered User
Posts: 39
Joined: Thu Nov 06, 2008 9:30 pm

Re: [BETA] Forum Categories in Tabs

Post by KarGoManiA »

Thank you for this mod ;)

puabase-2
Registered User
Posts: 34
Joined: Sat Oct 29, 2011 8:54 am

Re: [BETA] Forum Categories in Tabs

Post by puabase-2 »

Any update?

User avatar
Boardtalk.net
Registered User
Posts: 1217
Joined: Fri Jun 05, 2009 8:12 pm
Location: Ireland
Name: Colette
Contact:

Re: [BETA] Forum Categories in Tabs

Post by Boardtalk.net »

sorry no, it needs someone good with AJAX/Javascript and PHP and that's beyond me at the moment.
:(

Locked

Return to “[3.0.x] Abandoned MODs”