MyBB Community Forums

Full Version: Collapse/Expand buttons
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to add collapse/expand buttons to my shoutbox using exactly the same code that is used in the board statistics and in the forum categories.
They expand and colapse, save to a cookie (I've checked) but they do not stay closed despite the cookie saying that it should.

What am I doing wrong?

http://danielchorley.co.uk/dystopia


Thanks in advance,

~DC
Can you provide the code you've used ?
Quote:<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<thead>
<tr>
<td class="thead"><div class="expcolimage"><img src="images/blackbb/collapse.gif" id="sb_img" class="expander" alt="[-]" title="[-]" /></div>
<div><strong>Shoutbox</strong></div></td>
</tr>
</thead>
<tbody style="" id="sb_e"><tr>
<td valign="top">
<div align="center"><!-- start: shoutbox_add_shout -->
<form method="post" action="index.php?go_to=shoutbox&amp;view_mode=index&amp;action=add">
<input type="text" class="textbox" name="message" size="80" maxlength="150" />
&nbsp;<input type="submit" class="textbox" name="submit" value="Shout / Refresh" /><br />
</form>
<!-- end: shoutbox_add_shout --></div>
<!-- start: shoutbox_shout -->
(the shouts are usually here, I removed them to save some post space)
<!-- end: shoutbox_shout -->

<!-- start: shoutbox_multipage_links -->
<tr>
<td class="trow1" align="center">
<span class="smalltext"><!-- start: multipage -->
<div class="pagination">
<span class="pages">Pages (66):</span>
<!-- start: multipage_prevpage -->
<a href="index.php?page=65" class="pagination_previous">&laquo; Previous</a>
<!-- end: multipage_prevpage --><!-- start: multipage_start -->
<a href="index.php?page=1" class="pagination_first">1</a> ...
<!-- end: multipage_start --><!-- start: multipage_page -->
<a href="index.php?page=62" class="pagination_page">62</a>

<!-- end: multipage_page --><!-- start: multipage_page -->
<a href="index.php?page=63" class="pagination_page">63</a>
<!-- end: multipage_page --><!-- start: multipage_page -->
<a href="index.php?page=64" class="pagination_page">64</a>
<!-- end: multipage_page --><!-- start: multipage_page -->
<a href="index.php?page=65" class="pagination_page">65</a>
<!-- end: multipage_page --><!-- start: multipage_page_current -->
<span class="pagination_current">66</span>
<!-- end: multipage_page_current -->
</div>
<!-- end: multipage --></span>
</td>

</tr>
<!-- end: shoutbox_multipage_links -->

</td>
</tr>
</tbody>
</table>
<br />
<a name="shoutbox" id="shoutbox"></a>

There you go. I basically copied and pasted the template from templates and modified it ensuring that "boardstats" which is what it was before was changed to "sb" in every circumstance.

It closes and expands, it just doesn't save its state.