The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

New Tab?

2 posters

Go down

New Tab? Empty New Tab?

Post by Beyonder December 14th 2014, 7:09 pm

How do I create a new tab for profiles?
My use would be for awards is there any codes?
Beyonder
Beyonder
Forumember

Male Posts : 721
Reputation : 29
Language : English
Location : Beyond Realm

http://fictionalomniverse.forumotion.com/

Back to top Go down

New Tab? Empty Re: New Tab?

Post by JScript December 15th 2014, 4:26 pm

Hello!
It's simple, but first I need to know some details:
1- The version of your forum;
2- If you use third-party skins nonstandard Forumotion;

See an example for punBB version:
Code:

 // New tab info on advanced perfil (PUNBB)! - By JScript
jQuery(function () {
    if (location.pathname.indexOf('/u') == 0) {
        jQuery('#tabs ul').append('<li id="new_tab" ><a href="javascript:void(0);"><span>New tab</span></a></li>');

        jQuery('#new_tab').click(function () {
         var oldSel = {
               tab: jQuery('#tabs .activetab'),
               html: document.getElementById('profile-advanced-details').innerHTML
            };
            oldSel.tab.removeClass('activetab');
            jQuery('#new_tab').addClass('activetab');
         JS_NewTab();

         oldSel.tab.click(function (event) {
            event.preventDefault();
            jQuery('#new_tab').removeClass('activetab');
            oldSel.tab.addClass('activetab');
            document.getElementById('profile-advanced-details').innerHTML = oldSel.html;
            oldSel.tab.unbind('click');
         });
        });
    }
});

function JS_NewTab() {
    document.getElementById('profile-advanced-details').innerHTML =
        '<div class="main-head">' +
        '    <div class="subtitle">New tab info:</span>' +
        '    </div>' +
        '</div>' +
        '<div class="main-content clearfix">' +
        '    <div class="middleline">' +
        '        <dl id=""><dt>Label 01:</dt>' +
        '            <dd>' +
        '                <span>Description 01...</span>' +
        '            </dd>' +
        '        </dl>' +
        '        <div class="separator">&nbsp;</div>' +
        '        <dl id=""><dt>Label 02:</dt>' +
        '            <dd>' +
        '                <span>Description 02...</span>' +
        '            <dd>' +
        '        </dl>' +
        '        <div class="separator">&nbsp;</div>' +
        '    </div>' +
        '</div>';
};

Result:
New Tab? Jgod68u

Edit:
But it can also be done by editing templates if you wish!

JS


Last edited by JScript on December 15th 2014, 4:48 pm; edited 1 time in total (Reason for editing : More info...)
JScript
JScript
Forumember

Male Posts : 741
Reputation : 175
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum