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:
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: