MyBB Community Forums

Full Version: quick theme select in header
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
is possible put the button/window "quick theme select" in header; now is in footer but is awkward

Thanks
Yes, Theme Selector is globally available.
Simply paste this variable into the Header Template at a position wherever you want:
{$theme_select}

[ETS]
Not quite globally - it's defined after the header template is rendered. You'd need a plugin or a core file edit to make it available in the header.
ExiTuS method not work...

so? Any solution?
Thanks
Quote:You'd need a plugin or a core file edit to make it available in the header.
Sorry for my initial suggestion! I forgot to remember that I am using a tiny modification in global.php for years, that makes the theme/language selctor available in the header as well.

So Matt is right, it is possible to use the theme selector in the header with a simple core file change in global.php - without using a plug-in. It's not a big deal to achieve.

This example refers to the most recent version of 1.8.33:

Search for the code block in line 1022:
// Are we showing the quick theme selection box?
$theme_select = $theme_options = '';
if($mybb->settings['showthemeselect'] != 0)
{
...
}

Simply move this code block a couple of lines up to line 950:
}

(LINE 950) // PASTE THIS CODE HERE

$jsTemplates = array();
foreach (array('modal', 'modal_button') as $template) {
	eval('$jsTemplates["'.$template.'"] = "'.$templates->get($template, 1, 0).'";');
	$jsTemplates[$template] = str_replace(array("\n","\r"), array("\\\n", ""), addslashes($jsTemplates[$template]));
}

You can do the same with the language selector, to make the lang.select available in the header as well.

Sorry for initial confusing - I hope this solution will match your needs.

[ExiTuS]
Sorry man, but still not work...

damn, I'm a donkey in tech Big Grin

where am i wrong? 

now it doesn't even work the footer  Huh (test here https://www.pokemonhacking.it/index.php);  

In attach my global.php, can you help me?

thanks
Your attached global.php doesn't show any changes - it's like the original.
Compare to my file attached that's working...
Remember:
This is global.php for latest version 1.8.33
Whenever a MyBB upgrade is available, check whether global.php needs changing again.

[ETS]
[ExiTuS] you are a genius! Heart (sorry for the delay)

But now, quick start (behind the select theme) not work... Undecided 

https://www.pokemonhacking.it/