Hello,
I have made a simple modification to this code to make it remember the last tab you clicked on and use that as the default instead of default that is stored in the database (basically if you click on a home link after browsing to a tab it brings you back to the same tab).
Open the PHP file 'tabindex.php' in your root folder and add the following code a line or two after 'error_reporting(E_ALL & ~E_NOTICE);' at the top of the script:
PHP Code:
#request ID of tab clicked
$tabID = $_REQUEST['tID'];
#save it in cookie
if (isset($tabID))
{
setcookie("LinkClickedID", $tabID);
}
Now go to your ADMINCP, Plugin Manager, edit 'Create Tabs'.
There are two instances of this piece of code:
PHP Code:
if($tab['default_tab'] == "1" AND empty($vbulletin->GPC['varname']))
{
$active = 'true';
}
Replace the above piece of code in both cases with this:
PHP Code:
if(isset($_COOKIE["LinkClickedID"]))
{
if($tab['tabid'] == $_COOKIE["LinkClickedID"] AND empty($vbulletin->GPC['varname']))
{
$active = 'true';
}
}
elseif($tab['default_tab'] == "1" AND empty($vbulletin->GPC['varname']))
{
$active = 'true';
}
and there you have it - your last clicked on tab is now stored as the default (and it should use the database default if cookies are not allowed on the browser).