MyBB Community Forums

Full Version: ProStats Collapsible (Thread 2)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Entitled Thread 2 as I do not wish to necropost for an addition.

I currently have ProStats by SaeedGh, a great system to display your forum's current threads, newest members and the like. However, some members desire that the Prostats be hidden away, or collapsible.

Now I did find a thread that allowed one to make the ProStats mod work within a collapsible window: (>CLICK<). However, the collapsed-window effect only lasts as long as you stay within that page. If you surf away or shut down your computer, the ProStats window will revert back to its 'revealed' default status.

What I am asking for is a method to save the opened/closed status of the collapse-window's status. I figure it would have to do something with cookies, but I'll be honest that I am a novice with cookies.

And as the code that mark-in-dallas supplied in 09 was simple enough to install, I figure implementing what someone comes up with may not be a challenge.
Left the template here, the code in the other thread is wrong.
Pardon me? I don't understand when you say 'Left the template here.' because I do not see a link to a template. And insofar as the code in the other thread, the collapsible 'prostats' code in the thread I linked does work. I just doesn't save the hide/show stats for later.
The code inside the ProStats template, coyp/paste it here.
My original template code before I used the supplied fix from that thread was this:
        <table width="100%" border="0" cellspacing="{$theme[borderwidth]}" cellpadding="0" class="tborder">
        <thead>
        <tr><td colspan="{$num_columns}">
            <table border="0" cellspacing="0" cellpadding="{$theme[tablespace]}" width="100%">
            <tr class="thead">
            <td><strong>{$lang->prostats_prostats}</strong></td>
            <td style="text-align:{$ps_ralign};"><a href="" onclick="return prostats_reload();">{$lang->prostats_reload} <img src="{$mybb->settings['bburl']}/images/prostats/ps_reload.gif" style="vertical-align:middle;" alt="" /></a></td>

It has since been changed to this:
    <table width="100%" border="0" cellspacing="{$theme[borderwidth]}" cellpadding="0" class="tborder">
    <thead>
    <tr><td colspan="{$num_columns}">
        <table  border="0" cellspacing="0" cellpadding="{$theme[tablespace]}" width="100%">
        <tr class="thead">
        <td><div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['prostats']}.gif" id="prostats_img" class="expander" alt="[-]" title="[-]" /></div>
        <div><strong>{$lang->prostats_prostats}</strong></div></td>
        </tr>
        </table>
    </td>
    </tr>
    </thead>
    <tbody>
        {$trow_message_top}
    <tbody style="{$collapsed['prostats_e']}" id="prostats_e">
        <tr valign="top">
        {$prostats_content}
        </tr>
        {$trow_message_down}
        </tbody>
        </table>
        <!-- Don't remove this part! you can remove copyright by changing settings of plugin. -->
        {$prostats_copyright}
        <br />
And with that, the ProStats board can be hidden, though only until you leave the main board. It has another side-effect in that the small 'Refresh' icon is gone, but I'm not worried about that. Though I wouldn't complain if it came back.
Try this one.
<table width="100%" border="0" cellspacing="{$theme[borderwidth]}" cellpadding="0" class="tborder">
    <thead>
    <tr><td colspan="{$num_columns}">
        <table  border="0" cellspacing="0" cellpadding="{$theme[tablespace]}" width="100%">
        <tr class="thead">
        <td><div class="expcolimage"><img src="{$theme['imgdir']}/collapse{$collapsedimg['prostats']}.gif" id="prostats_img" class="expander" alt="[-]" title="[-]" /></div>
        <div><strong>{$lang->prostats_prostats}</strong></div></td>
        </tr>
        </table>
    </td>
    </tr>
    </thead>
    <tbody style="{$collapsed['prostats_e']}" id="prostats_e1">
        {$trow_message_top}
        <tr valign="top">
        {$prostats_content}
        </tr>
        {$trow_message_down}
        </tbody>
        </table>
        <!-- Don't remove this part! you can remove copyright by changing settings of plugin. -->
        {$prostats_copyright}
        <br />

This is the code for the refresh button:
<a href="" onclick="return prostats_reload();">{$lang->prostats_reload} <img src="{$mybb->settings['bburl']}/images/prostats/ps_reload.gif" style="vertical-align:middle;" alt="" /></a>
I'm afraid that doesn't work. The button that should trigger the window to hide no longer functions with that code. No hiding occurs.
Doin' the bump.

Oh, and I tried the refresh button code. Seems to interfere with the collapse/restore button. :s Maybe its where I placed it (examining the original code as a reference), but it freezes the page.
I think this is not possible, because the {$expdisplay} variable can't be used in global templates.