MyBB Community Forums

Full Version: Advanced Sidebox 2.1.1
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2014-01-05, 03:26 PM)Wildcard Wrote: [ -> ]
(2014-01-04, 11:53 PM)Gobee129 Wrote: [ -> ]Is there some sort of tutorial, or a collection of common used custom sideboxes, that I can take a look at?

No, not that I know of.

Admins tell me that they have made custom boxes for Facebook Like/Twitter Follow/etc. I see many people creating announcements in custom boxes and sometimes even a bank of links to custom pages or once I even saw an admin with a popup in a custom box. Big Grin

Use your imagination and I am sure you will think of something. If you need help creating custom side boxes, you can always post your markup here and someone will try to help you.

Thanks Smile I think I have it working now. I used 4 boxes + 2 custom boxes, and my forumteam and I are very happy.

But there is one custom box I tried, that I couldnt get to work. I'm sure you know the NewPoints system for mybb. It features a statistic page for the richest users. The richest user are displayed in a small box:

[attachment=30785]

... so I tried "copying" that box into a custom sidebox of your plugin Wink but it didnt work :/

<tr>
<td class="{$bgcolor}" width="50%">{$user['username']}</td>
<td class="{$bgcolor}" width="50%" align="center">{$user['newpoints']}</td>
</tr>

This is the newpoints_statistic_richest_user template. Do you have an idea how to make this work?
try changing to this:

<tr>
<td class="{$bgcolor}" width="50%">{$mybb->user['username']}</td>
<td class="{$bgcolor}" width="50%" align="center">{$mybb->user['newpoints']}</td>
</tr>

I'm not certain it will work, but it is worth a try Smile
(2014-01-06, 06:07 AM)Wildcard Wrote: [ -> ]try changing to this:

<tr>
<td class="{$bgcolor}" width="50%">{$mybb->user['username']}</td>
<td class="{$bgcolor}" width="50%" align="center">{$mybb->user['newpoints']}</td>
</tr>

I'm not certain it will work, but it is worth a try Smile

Better than all I#ve tried, but now it looks like this:
[attachment=30786]
Try this then:

<tr>
<td class="{$bgcolor}" width="50%">{$mybb->user['username']} &mdash; {$mybb->user['newpoints']}</td>
</tr>

Maybe . . . :p
(2014-01-06, 03:19 PM)Wildcard Wrote: [ -> ]Try this then:

<tr>
<td class="{$bgcolor}" width="50%">{$mybb->user['username']} &mdash; {$mybb->user['newpoints']}</td>
</tr>

Maybe . . . :p

Hmmm, that shows the current user and his points, but I would want the same list of top 10 richest users, with links to their profiles. Just like on the screenshot I showed above. Or, if links arent possible, just a normal list of the top 10.

I believe this to be the code that generates the table on the newpoints_statsitic page:

<table width="100%" border="0" align="center">
                <tr>
                    <td valign="top" width="40%">
                        <table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
                            <tr>
                                <td class="thead" colspan="2"><strong>{$lang->newpoints_richest_users}</strong></td>
                            </tr>
                            <tr>
                                <td class="tcat" width="50%"><strong>{$lang->newpoints_user}</strong></td>
                                <td class="tcat" width="50%" align="center"><strong>{$lang->newpoints_amount}</strong></td>
                            </tr>
                            {$richest_users}
                        </table>
                    </td>
                </tr>
            </table>
A way to add multicolumn support in ASB's boxes without creating new tables inside shouldn't be hard - colspan="10" (so bigger than possible amount) on the thead <td> will do the thing, unless there is table-layout: fixed; enforced directly on each side box <table> (IIRC it was on main <table>, which won't disturb). It's a bit weird solution, but it works in all browsers, as I read, and is proper HTML.

@Gobee129
Variables may not be accessible on all pages. Unless they're global, they won't work on other page just like on NewPoints list. You can try adding them to, for instance, forumdisplay template and they won't work there too - it's not Advanced Sidebox's fault.
(2014-01-06, 06:26 PM)Destroy666 Wrote: [ -> ]A way to add multicolumn support in ASB's boxes without creating new tables inside shouldn't be hard - colspan="10" (so bigger than possible amount) on the thead <td> will do the thing, unless there is table-layout: fixed; enforced directly on each side box <table> (IIRC it was on main <table>, which won't disturb). It's a bit weird solution, but it works in all browsers, as I read, and is proper HTML.

@Gobee129
Variables may not be accessible on all pages. Unless they're global, they won't work on other page just like on NewPoints list. You can try adding them to, for instance, forumdisplay template and they won't work there too - it's not Advanced Sidebox's fault.

I never said it's anyone's fault? I figured the variables wouldnt be accessible, but I'm not very good with coding to find a way around it, that's why I asked someone with experience here.
Advanced Sidebox is a plugin, not a person. I'm just saying it's not able to do magic like this. You would have to write a PHP module which retrieves your needed data.
D6 is right, custom boxes can't include PHP and that is what you'll need to do what you are talking about.
Have been away from the forum so back today. Sent you a PM Wildcard, I hope you like it Smile

I have a question that others could benefit from, users still have the option to toggle the sideboxes by clicking in the top right corner of each sidebox, would it be possible to allow us admins to remove that option for forum members?

I haven't upgraded to the latest version yet as I have been busy with other things and I need to open my ftp to upload the files, so apologies if you have already covered this option in your latest upgrade!