Quote:
Originally Posted by VBDev
Might be one remaining in the template, have you check ?
|
Yeah, this is what I have in the display management plugin:
PHP Code:
$mgc_vbversion = substr($vbulletin->options['templateversion'],0,1);
if ($mgc_vbversion > 3)
{
global $MGCCbEvoCore;
global $style;
if (THIS_SCRIPT == 'mgc_cb_evo')
{
$vbcsspath = 'css.php?styleid=' . $vbulletin->userinfo['styleid'] . '&langid=' . LANGUAGEID . '&d=' . $style['dateline'] . '&sheet=';
$head .= '<link rel="stylesheet" href="' . $vbcsspath . 'mgc_cb_evo.css" type="text/css">';
$template_hook['headinclude_bottom_css'] .= $head;
}
}
if($MGCCbEvoCore->show_chatbox() && $MGCCbEvoCore->evo_permissions->can_view())
{
$mgc_cb_evo_display = 0;
$mgc_cb_evo_type_position = "";
switch(THIS_SCRIPT)
{
case 'index':
// Manage number of users online
if ($vbulletin->options['mgc_cb_evo_whoisonline_active'] && $vbulletin->options['mgc_cb_evo_show_number_of_users_inchat_forumhome'])
{
// Inactive mode active and delay < session delay => inactive mode delay taken
if ($vbulletin->options['mgc_cb_evo_inactive_mode'] && $vbulletin->options['mgc_cb_evo_inactive_mode_delay'] < $vbulletin->options['mgc_cb_evo_whoisonline_delay'])
{
$dateline = TIMENOW - ($vbulletin->options['mgc_cb_evo_inactive_mode_delay'] * 60);
}
else
{
$dateline = TIMENOW - ($vbulletin->options['mgc_cb_evo_whoisonline_delay'] * 60);
}
$getusers = $vbulletin->db->query_read("
SELECT DISTINCT u.username,u.displaygroupid,u.userid,s.userid AS suserid,u.usergroupid,(u.options & " . $vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible
FROM " . TABLE_PREFIX . "mgc_cb_evo_session AS cbs
LEFT JOIN " . TABLE_PREFIX . "user AS u ON (cbs.userid=u.userid)
LEFT JOIN " . TABLE_PREFIX . "session AS s ON (cbs.userid=s.userid)
WHERE cbs.dateline>='$dateline' AND cbs.userid!=0
");
$mgc_cb_evo_users_online = 0;
if ($vbulletin->db->num_rows($getusers))
{
$first = 1;
while ($user = $vbulletin->db->fetch_array($getusers))
{
if ($user['invisible'])
{
if ($MGCCbEvoCore->evo_permissions->can_see_hidden_users() OR $user['userid'] == $vbulletin->userinfo['userid'])
{
if ($user['suserid'])
{
$mgc_cb_evo_users_online++;
}
}
}
else
{
if ($user['suserid'])
{
$mgc_cb_evo_users_online++;
}
}
}
}
$mgc_cb_evo_users_in_chat = construct_phrase($vbphrase['mgc_cb_evo_x_users_in_chat'],$mgc_cb_evo_users_online);
$template_hook['forumhome_wgo_stats'] .= $mgc_cb_evo_users_in_chat;
}
// Manage stats display
if ($vbulletin->options['mgc_cb_evo_forumhome_stats'])
{
require_once(DIR . '/mgc_cb_evo/classes/class_misc.php');
$MGCCbEvoMisc = new MGCCbEvo_misc($vbulletin);
$mgc_cb_evo_stats = $MGCCbEvoMisc->construct_forumhome_stats();
$template_hook['forumhome_wgo_stats'] .= $mgc_cb_evo_stats;
}
// Manage display of the chatbox on forumhome
if ($vbulletin->options['mgc_cb_evo_forumhome'])
{
$mgc_cb_evo_display = 1;
if($vbulletin->options['mgc_cb_evo_forumhome'] == 1)
{
$mgc_cb_evo_type_position = "forumhome_above";
$mgc_cb_evo_insert_type = 'append';
$mgc_cb_evo_insert_template = 'navbar';
$mgc_cb_evo_brb = ' ';
$mgc_cb_evo_bra = ' ';
}
else
{
$mgc_cb_evo_type_position = "forumhome_below";
$mgc_cb_evo_insert_type = 'replace';
$mgc_cb_evo_insert_template = 'FORUMHOME';
$mgc_cb_evo_replace = ' $mgc_cb_evo ';
$mgc_cb_evo_find = '$forumhome_markread_script';
$mgc_cb_evo_brb = ' ';
$mgc_cb_evo_bra = ' ';
}
}
break;
case 'forumdisplay':
// Strip filtered forumids var
if (!empty($vbulletin->options['mgc_cb_evo_forumdisplay_ids']))
{
$forumids = explode(',',$vbulletin->options['mgc_cb_evo_forumdisplay_ids']);
}
// Manage display
if ($vbulletin->options['mgc_cb_evo_forumdisplay'] && (!isset($forumids) || in_array($foruminfo['forumid'],$forumids)))
{
$mgc_cb_evo_display = 1;
if($vbulletin->options['mgc_cb_evo_forumdisplay'] == 1)
{
$mgc_cb_evo_type_position = "forumdisplay_above";
$mgc_cb_evo_insert_type = 'append';
$mgc_cb_evo_insert_template = 'navbar';
$mgc_cb_evo_brb = ' ';
$mgc_cb_evo_bra = ' ';
}
else
{
$mgc_cb_evo_type_position = "forumdisplay_below";
$mgc_cb_evo_insert_type = 'replace';
$mgc_cb_evo_insert_template = 'FORUMDISPLAY';
$mgc_cb_evo_replace = ' $mgc_cb_evo ';
$mgc_cb_evo_find = '$forumhome_markread_script';
$mgc_cb_evo_brb = '';
$mgc_cb_evo_bra = ' ';
}
}
break;
case 'showthread':
// Strip the thread id to exclude
if (!empty($vbulletin->options['mgc_cb_evo_showthread_ids']))
{
$forumids = explode(',',$vbulletin->options['mgc_cb_evo_showthread_ids']);
}
// Manage display
if ($vbulletin->options['mgc_cb_evo_showthread'] && (!isset($forumids) || in_array($threadinfo['forumid'],$forumids)))
{
$mgc_cb_evo_display = 1;
if($vbulletin->options['mgc_cb_evo_showthread'] == 1)
{
$mgc_cb_evo_type_position = "showthread_above";
$mgc_cb_evo_insert_type = 'append';
$mgc_cb_evo_insert_template = 'navbar';
$mgc_cb_evo_brb = ' ';
$mgc_cb_evo_bra = ' ';
}
else
{
$mgc_cb_evo_type_position = "showthread_below";
$mgc_cb_evo_insert_type = 'replace';
$mgc_cb_evo_insert_template = 'SHOWTHREAD';
$mgc_cb_evo_replace = ' $mgc_cb_evo ';
$mgc_cb_evo_find = '$similarthreads';
$mgc_cb_evo_brb = ' ';
$mgc_cb_evo_bra = ' ';
}
}
break;
case 'mgc_cb_evo':
break;
default:
// Display on all pages except forumdisplay, forumhome, showthread and chatbox
if (($vbulletin->options['mgc_cb_evo_display_on_allpages'] || $vbulletin->options['mgc_cb_evo_store_invar_allpages']) )
{
// Exclude pages list
if (!empty($vbulletin->options['mgc_cb_evo_pages_exclude_list']))
{
$exclude_pageslists_array = explode(',',$vbulletin->options['mgc_cb_evo_pages_exclude_list']);
}
else
{
$exclude_pageslists_array = array();
}
// List of pages specified
if (!empty($vbulletin->options['mgc_cb_evo_allpages_list']))
{
$pageslists_array = explode(",", $vbulletin->options['mgc_cb_evo_allpages_list']);
foreach ($pageslists_array as $index => $script)
{
if ( (THIS_SCRIPT == $script) && (!in_array(THIS_SCRIPT,$exclude_pageslists_array)))
{
$mgc_cb_evo_display = 1;
}
}
}
else
{
if (!in_array(THIS_SCRIPT,$exclude_pageslists_array))
{
$mgc_cb_evo_display = 1;
}
}
if ($mgc_cb_evo_display)
{
if ($vbulletin->options['mgc_cb_evo_display_on_allpages'])
{
$mgc_cb_evo_type_position = "navbar_below";
$mgc_cb_evo_insert_type = 'append';
$mgc_cb_evo_insert_template = 'navbar';
$mgc_cb_evo_brb = ' ';
$mgc_cb_evo_bra = ' ';
}
else
{
$mgc_cb_evo_type_position = "var";
$mgc_cb_evo_insert_type = 'var';
}
}
}
break;
}
if ($mgc_cb_evo_display)
{
// Construct chatbox display
require_once(DIR . '/mgc_cb_evo/classes/class_display.php');
$MGCCbEvoDisplay = new MGCCbEvo_display($vbulletin,$MGCCbEvoCore);
// Headinclude
$head = '';
if ($vbulletin->options['mgc_cb_evo_js_load_locally'])
{
$head .= '<link rel="stylesheet" href="http://yui.yahooapis.com/combo?2.7.0/build/container/assets/skins/sam/container.css&2.7.0/build/button/assets/skins/sam/button.css">';
}
else
{
$head .= '<link rel="stylesheet" href="mgc_cb_evo/clientscript/yui/container/assets/skins/sam/container.css" type="text/css">';
$head .= '<link rel="stylesheet" href="mgc_cb_evo/clientscript/yui/button/assets/skins/sam/button.css" type="text/css">';
}
$head .= '<link rel="stylesheet" href="mgc_cb_evo/clientscript/widget-skin.css" type="text/css">';
$head .= '<link rel="stylesheet" href="mgc_cb_evo/clientscript/chatbox_tabs.css" type="text/css">';
if ($mgc_vbversion < 4)
{
$vbulletin->templatecache['headinclude'] .= addslashes($head);
}
else
{
global $style;
$vbcsspath = 'css.php?styleid=' . $vbulletin->userinfo['styleid'] . '&langid=' . LANGUAGEID . '&d=' . $style['dateline'] . '&sheet=';
$head .= '<link rel="stylesheet" href="' . $vbcsspath . 'mgc_cb_evo.css" type="text/css">';
$template_hook['headinclude_bottom_css'] .= $head;
}
// Display construction
$mgc_cb_evo = $MGCCbEvoDisplay->construct_display($vbulletin->options['mgc_cb_evo_normalmode_height']);
// Placement
if ($mgc_vbversion < 4)
{
switch($mgc_cb_evo_insert_type)
{
case 'append':
$mgc_cb_evo = str_replace('"','\"',$mgc_cb_evo);
$vbulletin->templatecache["$mgc_cb_evo_insert_template"] .= $mgc_cb_evo_brb . $mgc_cb_evo . $mgc_cb_evo_bra;
break;
case 'replace':
$vbulletin->templatecache["$mgc_cb_evo_insert_template"] = str_replace($mgc_cb_evo_find,$mgc_cb_evo_find . $mgc_cb_evo_brb . addslashes($mgc_cb_evo_replace) . $mgc_cb_evo_bra,$vbulletin->templatecache["$mgc_cb_evo_insert_template"]);
break;
case 'var':
$mgc_cb_evo_var = $mgc_cb_evo;
break;
}
}
else
{
switch ($mgc_cb_evo_type_position)
{
case "forumhome_above":
$template_hook['forumhome_above_forums'] .= $mgc_cb_evo;
break;
case "forumhome_below":
$template_hook['forumhome_below_forums'] .= $mgc_cb_evo;
break;
case "forumdisplay_above":
$template_hook['forumdisplay_above_threadlist'] .= $mgc_cb_evo;
break;
case "forumdisplay_below":
$template_hook['forumdisplay_below_threadlist'] .= $mgc_cb_evo;
break;
case "showthread_above":
$template_hook['showthread_above_posts'] .= $mgc_cb_evo;
break;
case "showthread_below":
$template_hook['showthread_after_activeusers'] .= $mgc_cb_evo;
break;
case "navbar_below":
// do nothing, will be processed in the next hook
break;
case "var":
if (!empty($vbulletin->options['mgc_cb_evo_templates_list']))
{
$mgc_cb_evo_templates = explode(',',$vbulletin->options['mgc_cb_evo_templates_list']);
$mgc_cb_evo_var_array['mgc_cb_evo_var'] = $mgc_cb_evo;
foreach ($mgc_cb_evo_templates AS $nom)
{
vB_Template::preRegister($nom, $mgc_cb_evo_var_array);
}
}
break;
}
}
// Manage the sidebar creation if any (vB3 only)
if ($mgc_vbversion < 4)
{
if ($vbulletin->options['mgc_cb_evo_notifications_display'] == 3 || $vbulletin->options['mgc_cb_evo_notifications_display'] == 4)
{
if ($vbulletin->options['mgc_cb_evo_notifications_display'] == 3)
{
$mgc_cb_evo_sidebar_align = 'left';
$vbulletin->templatecache['header'] .= '<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td valign=\"top\" style=\"padding-right: 15px\" width=\"' . $vbulletin->options['mgc_cb_evo_notif_sidebar_width'] . '\">' . fetch_template('mgc_cb_evo_notifs_sidebar') . '</td><td valign=\"top\">';
$vbulletin->templatecache['footer'] = '</td></tr></table>' . $vbulletin->templatecache['footer'];
}
else
{
$mgc_cb_evo_sidebar_align = 'right';
$vbulletin->templatecache['header'] .= '<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr><td valign=\"top\">';
$vbulletin->templatecache['footer'] = '</td><td valign=\"top\" style=\"padding-left: 15px\" width=\"' . $vbulletin->options['mgc_cb_evo_notif_sidebar_width'] . '\">' . fetch_template('mgc_cb_evo_notifs_sidebar') . '</td></tr></table>' . $vbulletin->templatecache['footer'];
}
}
}
}
}
and it's still not aligned!