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.
That is sound advice, I'd say. I have been tinkering with it all morning and then I just tried D6's approach with more success than I had on my own.

The only problem is that if you edit the header template, your side box content must be no 'taller' than your header-- if it is you'll have wasted space beneath the header.
(2014-01-29, 06:15 PM)Destroy666 Wrote: [ -> ]{$headerinclude} shouldn't be the search text because you add it between </head> and <body> then and that's improper HTML.

I think doing that in index is impossible (well, it is, for example start <body>, end {$forums} but again - a <div> is broken and it looks quite weird). So yes, I'd go with global.php and I'd edit header template to inject the sideboxes. However, that will of course make it appear not only on index.

(2014-01-29, 07:21 PM)Wildcard Wrote: [ -> ]That is sound advice, I'd say. I have been tinkering with it all morning and then I just tried D6's approach with more success than I had on my own.

The only problem is that if you edit the header template, your side box content must be no 'taller' than your header-- if it is you'll have wasted space beneath the header.

Nice approach guys, thank you very much, but I don't know why is not working for me.

I have created one new script:
Title: Global
Filename: global.php
Output Sideboxes To Variables Rather Than Editing Templates?: no
Template: header
Hook: global_start

And because it didn't work, I did for test the following: Replacing entire template?: Yes
And write in below box: TESTT

And nothing changed... of course in managed sideboxes I configured in global in the tab of "Which Scripts?" and script is Active
I now realize that method will not work.

ASB depends upon THIS_SCRIPT constant which will never be set to global.php
my hopes were dashed lol
Alternatives?
Maybe modifying global.php?

Im looking global.php and I can see this

if(!defined('THIS_SCRIPT'))

{

define('THIS_SCRIPT', '');

}
(2014-01-29, 11:50 PM)Wildcard Wrote: [ -> ]ASB depends upon THIS_SCRIPT constant which will never be set to global.php

Oh, didn't know it checks THIS_SCRIPT. So there is no way to add boxes globally right now?

(2014-01-30, 01:03 AM)cafeína Wrote: [ -> ]Maybe modifying global.php?

Im looking global.php and I can see this

if(!defined('THIS_SCRIPT'))

{

define('THIS_SCRIPT', '');

}

I don't think changing it is a good idea - it may not help at all (if it's executed after THIS_SCRIPT has been already defined and I think that's how it works) or break other plugins which use THIS_SCRIPT.
(2014-01-30, 02:21 AM)Destroy666 Wrote: [ -> ]So there is no way to add boxes globally right now?

No. That just isn't something that is possible. How could the plugin know what hook to use or which template to edit?
Had some times so I tested something
It seems like this hook for forumdisplay.php has a weird behaviour, it looks like exact match but it isn't.

The master's template and templates that were generated based on master's template isn't exactly same for this hook. It seems like the current workaround for the theme which has its own forumdisplay template is to replace the hook using their <div></div>, and for all other themes which are using master's to generate their own forumdisplay template.
<div class="float_right">
	{$newthread}
</div>
Another question for master Wildcard. Is it possible to use ASB with plugin pagemanager?

I have a page done called recent post so I configured a script like this:

Name: Last Post
Filename: misc.php
Action: none
Page: recent
Output Sideboxes To Variables Rather Than Editing Templates?: Yes
Hook: misc_start

But it seems doesn't work, same problem like global.php?
Regards
Check out the examples linked in the second post of this thread: http://community.mybb.com/thread-131633-...#pid956497

Here is the Page Manager example: http://community.mybb.com/attachment.php?aid=30109
Thanks mate. My fault for not doing a deeper research (in this thread). I was forgetting to declare global $asb_right and $asb_left