2
Ok, so im new at this... I realise it uses the below code to store the info to a cookie, so i guess i could store this info to the cookie aswell somehow...
Not sure, will keep looking.
foreach($categories as $onecat){
$forums = array();
$catid=$cats.$onecat->getVar('cat_id');
$catshow = true;
if (isset($_COOKIE['newbb2_toggle']))
{
$cookiearr = split(',',$_COOKIE['newbb2_toggle']);
$catshow = (in_array($catid, $cookiearr)) ? false : true;
}
$display = ($catshow) ? 'block;' : 'none;';
$display_icon = ($catshow) ? 'images/minus.png' : 'images/plus.png';
if (isset($forumsByCat[$onecat->getVar('cat_id')])) {
$forums = $forumsByCat[$onecat->getVar('cat_id')];
}
But on the upside i realised that all i have to do is replace 'block' to 'none' to have it default to be closed, which is cool by me for now, but it would be good to have it default to what is written in a cookie.
Regards,
Ivan