PDA

View Full Version : Confusing issue with the sidebar


HMBeaty
12-08-2011, 12:23 AM
Not sure where else to look for this, but I've managed to get the default vBulletin sidebar added to forumdisplay and showthread by using 2 plugins and some minor edits to the forumdisplay and showthread templates (no file edits now :D).

Everything worked just fine when I was doing everything via file and template edits, but now that I've moved the file edits to the plugin system, I ran into a.....very odd issue lol.

If in vBulletin Options, I set Store CSS Stylesheets as Files? to No, everything looks as it should. However, if I set Store CSS Stylesheets as Files? to Yes, the sidebar goes all crazy :confused:

https://vborg.vbsupport.ru/attachment.php?attachmentid=134909&stc=1&d=1323306959

The contents of both plugins are pretty much the same and I'm using the hook locations forumdisplay_complete and showthread_complete...
$specialtemplates = array(
'activeblocks'
);

$globaltemplates = array(
'block_blogentries',
'block_cmsarticles',
'block_newposts',
'block_sgdiscussions',
'block_tagcloud',
'block_threads',
'block_html',
'tag_cloud_link'
);

cache_templates($specialtemplates, $style['templatelist']);
cache_templates($globaltemplates, $style['templatelist']);

// ### SIDEBAR #################################################
$show['sidebar'] = false;
// disable blocks for ie6
if ($vbulletin->options['enablesidebar'] AND !(is_browser('ie') AND !is_browser('ie', 7)) AND !VB_API)
{
require_once(DIR . '/includes/class_block.php');
$blockmanager = vB_BlockManager::create($vbulletin);
$sidebar = $blockmanager->getSidebarHTML();
if ($sidebar)
{
$show['sidebar'] = true;
}

$show['sidebarposition'] = vB_Template_Runtime::fetchStyleVar($vbulletin->options['sidebarposition'] == 0 ? 'left' : 'right');
}

vB_Template::preRegister('SHOWTHREAD',array('sideb ar' => $sidebar));
Also, the css has been added to both templates...

SHOWTHREAD
FIND:
{vb:cssfile toolsmenu.css,postlist.css,showthread.css,postbit. css,options.css,attachment.css,poll.css,lightbox.c ss}
REPLACE WITH:
{vb:cssfile toolsmenu.css,postlist.css,showthread.css,postbit. css,options.css,attachment.css,poll.css,lightbox.c ss,sidebar.css,tagcloud.css,widgets.css}

FIND:
<!--[if lt IE 8]>{vb:cssfile toolsmenu-ie.css,postlist-ie.css,showthread-ie.css,postbit-ie.css,poll-ie.css}<![endif]-->
REPLACE WITH:
<!--[if lt IE 8]>{vb:cssfile toolsmenu-ie.css,postlist-ie.css,showthread-ie.css,postbit-ie.css,poll-ie.css,sidebar-ie.css}<![endif]-->

FORUMDISPLAY
FIND:
{vb:cssfile toolsmenu.css,forumbits.css,forumdisplay.css,threa dlist.css,options.css}
REPLACE WITH:
{vb:cssfile toolsmenu.css,forumbits.css,forumdisplay.css,threa dlist.css,options.css,sidebar.css,tagcloud.css,wid gets.css}

FIND:
{vb:cssfile toolsmenu-ie.css,forumbits-ie.css,forumdisplay-ie.css,threadlist-ie.css,options-ie.css}
REPLACE WITH:
{vb:cssfile toolsmenu-ie.css,forumbits-ie.css,forumdisplay-ie.css,threadlist-ie.css,options-ie.css,sidebar-ie.css}

So now I'm at a loss as to why when I turn on Store CSS Stylesheets as Files?, it gets thrown off. Any ideas? :confused:

kh99
12-08-2011, 02:26 AM
Have you checked for css files not loading or having errors? I usually use the error console in Firefox (although it's been so long I can't remember if it's an add-on or a standard feature).

Max Taxable
12-08-2011, 02:28 AM
I just checked it and it all looks fine, did you fix this issue already?

HMBeaty
12-08-2011, 02:48 AM
I just checked it and it all looks fine, did you fix this issue already?
No. I set Store CSS Stylesheets as Files? back to No

--------------- Added 1323316588 at 1323316588 ---------------

I set it back to No if anyone wants to take a look again

--------------- Added 1323317209 at 1323317209 ---------------

Hmm, I think I found the issue :p. Looking at the templates again....

FORUMDISPLAY
<vb:if condition="$vboptions['storecssasfile']">
{vb:cssfile forumdisplay-rollup.css}
<vb:else />
{vb:cssfile toolsmenu.css,forumbits.css,forumdisplay.css,threa dlist.css,options.css,sidebar.css,tagcloud.css,wid gets.css}
</vb:if>SHOWTHREAD
<vb:if condition="$vboptions['storecssasfile']">
{vb:cssfile showthread-rollup.css}
<vb:else />
{vb:cssfile toolsmenu.css,postlist.css,showthread.css,postbit. css,options.css,attachment.css,poll.css,lightbox.c ss,sidebar.css,tagcloud.css,widgets.css}
</vb:if>
When I change
{vb:cssfile forumdisplay-rollup.css}
To
{vb:cssfile forumdisplay-rollup.css,sidebar.css,tagcloud.css,widgets.css}
And change
{vb:cssfile showthread-rollup.css}
To
{vb:cssfile showthread-rollup.css,sidebar.css,tagcloud.css,widgets.css}
It works again. Which still has me confused because I thought xxxxxxx-rollup.css already included all that other stuff :confused: