what you are asking is not easy
first, you will need to do a check for the cookie (this is the easy part)
HTML Code:
// Clean Cookie Vars
$vbulletin->input->clean_array_gpc('c', array(
COOKIE_PREFIX . 'my_table' => TYPE_UINT,
));
check based on cookie
HTML Code:
if ($vbulletin->GPC[COOKIE_PREFIX . 'my_table'])
{
// table is collapsed
do this;
}
else
{
do this;
}
however, if table is collapsed (closed) how would the script know when it is expanded (users clicks on it) - the script will need to know this in order to display your gadgets; otherwise, it will just open an empty table
you can solve this in 2 ways
(you will have to hire someone to do this for you)
1) ajax
2) skip the collapse/expand javascript and show gadgets based on a value saved for the end-user - this can be a cookie or a setting saved in the database ... either way the page will have to refresh each time the collapse/expand button is clicked
confused