Сделал с куками
в board.js дописываем
CODE:
function my_getcookie(name)
{
cname = name + '=';
cpos = document.cookie.indexOf( cname );
if ( cpos != -1 )
{
cstart = cpos + cname.length;
cend = document.cookie.indexOf(";", cstart);
if (cend == -1)
{
cend = document.cookie.length;
}
return unescape( document.cookie.substring(cstart, cend) );
}
return null;
}
/*-------------------------------------------------------------------------*/
// Get element by id
/*-------------------------------------------------------------------------*/
function my_getbyid(id)
{
itm = null;
if (document.getElementById)
{
itm = document.getElementById(id);
}
else if (document.all)
{
itm = document.all[id];
}
else if (document.layers)
{
itm = document.layers[id];
}
return itm;
}
/*-------------------------------------------------------------------------*/
// Set DIV ID to hide
/*-------------------------------------------------------------------------*/
function my_hide_div(itm)
{
if ( ! itm ) return;
itm.style.display = "none";
}
/*-------------------------------------------------------------------------*/
// Set DIV ID to show
/*-------------------------------------------------------------------------*/
function my_show_div(itm)
{
if ( ! itm ) return;
itm.style.display = "";
}
/*-------------------------------------------------------------------------*/
// Toggle category
/*-------------------------------------------------------------------------*/
function togglecategory( fid, add )
{
saved = new Array();
clean = new Array();
//-----------------------------------
// Get any saved info
//-----------------------------------
if ( tmp = my_getcookie('coll') )
{
saved = tmp.split(",");
}
//-----------------------------------
// Remove bit if exists
//-----------------------------------
for( i = 0 ; i < saved.length; i++ )
{
if ( saved[i] != fid && saved[i] != "" )
{
clean[clean.length] = saved[i];
}
}
//-----------------------------------
// Add?
//-----------------------------------
if ( add )
{
clean[ clean.length ] = fid;
my_show_div( my_getbyid( 'fc_'+fid ) );
my_hide_div( my_getbyid( 'fo_'+fid ) );
}
else
{
my_show_div( my_getbyid( 'fo_'+fid ) );
my_hide_div( my_getbyid( 'fc_'+fid ) );
}
my_setcookie( 'coll', clean.join(',') );
}
function my_setcookie( name, value )
{
var expire = "";
var domain = "";
var path = "/";
var expire = "; expires=Wed, 1 Jan 2020 00:00:00 GMT";
document.cookie = name + "=" + value + "; path=" + path + expire + domain + ';';
}
в index.php перед строчкой
CODE:
include ('./templates/'.$exbb['default_style'].'board_data.tpl');
вставить
CODE:
$ex_hide = explode(",",$_COOKIE['coll']);
if(in_array($in_cat,$ex_hide))
{
$flag2 = "none";
$flag1 = "show";
}else{
$flag1 = "none";
$flag2 = "show";
}
файл board_data.tpl
CODE:<?
$board_data .= ($catrow) ? '
<div align="left" id="fc_'.$in_cat.'" style="display:'.$flag1.';">
<br><table class="tableborder" width="100%" border="0" cellspacing="1" cellpadding="4">
<tr><th border="0" colspan="5" class="maintitle" align="right">
<div style="display: block; float: left;"><img src="./templates/InvisionExBB/im/nav_m.gif" border="0" alt=">" width="8" height="8" /> <a href="index.php?c='.$in_cat.'">'.$category.'</a></div>
<a href="javascript:togglecategory('.$in_cat.', 0);">
<img src="./templates/InvisionExBB/im/show_f.gif" border="0" alt="+/-" width="12" height="12" name="fimg'.$in_cat.'">
</a>
</th></tr> </table>
</div>
<div align="left" id="fo_'.$in_cat.'" style="display:'.$flag2.';">
<br><table class="tableborder" width="100%" border="0" cellspacing="1" cellpadding="4">
<tr><th border="0" colspan="5" class="maintitle" align="right">
<div style="display: block; float: left;"><img src="./templates/InvisionExBB/im/nav_m.gif" border="0" alt=">" width="8" height="8" /> <a href="index.php?c='.$in_cat.'">'.$category.'</a></div>
<a href="javascript:togglecategory('.$in_cat.', 1);">
<img src="./templates/InvisionExBB_Winter/im/hide_f.gif" border="0" alt="+/-" width="12" height="12" name="fimg'.$in_cat.'">
</a>
</th></tr> <tr>
<th align="center" width="2%" class="titlemedium"><img src="./templates/InvisionExBB/im/spacer.gif" alt="" width="28" height="1" /></th>
<th align="left" width="59%" class="titlemedium">'.$lang['Forum_Info'].'</th>
<th align="center" width="7%" class="titlemedium">'.$lang['Topics_total'].'</th>
<th align="center" width="7%" class="titlemedium">'.$lang['Replies'].'</th>
<th align="left" width="25%" class="titlemedium">'.$lang['Updates'].'</th>
</tr>':'';
$board_data .= <<<DATA
<tr>
<td class="row4" align="center">$folderpicture</td>
<td class="row4"><b>$forumname</b><br /><span class='desc'>$forumdescription<br /><br>$lang_moder $modoutput</span></td>
<td class="row2" align="center">$threads</td>
<td class="row2" align="center">$posts</td>
<td class="row2" >$lang[Date] <b>$forumlastpost</b> $private</td>
</tr>
DATA;
$board_data .= ($last) ? ' <tr><td class="darkrow2" colspan="5"> </td></tr></table></div>': '';
?>
у меня работает |