Okay, I'm wanting to use the "theme picker" which you can find the tutorial here.
I'm trying to make a different theme for each house at Hogwarts, one for Gryffindor, one for Hufflepuff, one for Ravenclaw and on for Slytherin. The problem I'm having is when you switch from the default to one of the other themes, you still get the same banner/header as the default and I need that to be different for each theme. How do I do that?
Here is my code from the theme picker....
I'm trying to make a different theme for each house at Hogwarts, one for Gryffindor, one for Hufflepuff, one for Ravenclaw and on for Slytherin. The problem I'm having is when you switch from the default to one of the other themes, you still get the same banner/header as the default and I need that to be different for each theme. How do I do that?
Here is my code from the theme picker....
- Spoiler:
- Code:
$(function() {
// disable the default stylesheet for better compatibility with themes
// if you have modified templates styled with CSS it is better to choose : false
var disable_default_stylesheet = true;
// add new themes by writing : addTheme('theme_name', 'theme_url');
// default themes below are for phpbb3, you can remove or modify them for other versions
addTheme('Gryffindor','https://en.hitskin.com/search-a-skin/stylize-darkgrey-en/129813');
addTheme('Hufflepuff','https://en.hitskin.com/search-a-skin/stylize-darkgrey-en/129813');
addTheme('Ravenclaw','https://en.hitskin.com/search-a-skin/stylize-darkgrey-en/129813');
addTheme('Slytherin','https://en.hitskin.com/search-a-skin/stylize-darkgrey-en/129813');
var c = document.cookie.split(';'), dds = disable_default_stylesheet, s;
for (i=0;i<c.length;i++) {
if (/newtheme=\/\d+-ltr\.css/.test(c[i])) {
var theme = c[i].replace(/newtheme=(\/\d+-ltr.css)/,'$1').replace(/\s/g,'');
newSheet();
if (window.localStorage) { $('#themeStyle').html(localStorage.selectedTheme); cleanStyle() }
else $('#themeStyle').load(theme,function(){cleanStyle()});
$('#themePicker option[value="'+theme+'"]').attr('selected','true');
}
}
function addTheme(name, theme) {
if (!document.getElementById('themePicker')) {
var n = document.createElement('DIV'), d = document.createElement('OPTION');
s = document.createElement('SELECT');
n.innerHTML = '<span style="font-weight:bold;font-size:12px;vertical-align:middle;">Select theme : </span>';
s.id = 'themePicker';
d.value = $('head link[href$="-ltr.css"]').attr('href') + '(default)';
d.innerHTML = 'Default';
n.appendChild(s);
s.appendChild(d);
$('#page-footer, #pun-about, #gfooter').append(n);
}
var o = document.createElement('OPTION');
o.value = theme.replace(/.*?(\d+)/,'/$1-ltr.css');
o.innerHTML = name;
s.appendChild(o);
};
s.onchange = function() {
var date = new Date();
date.setTime(date.getTime() + (365*24*60*60*1000));
if (!document.getElementById('themeStyle')) newSheet();
if (/\(default\)/.test(s.value)) {var v='default'; if ($('#themeStyle').html().length > 0 && dds==true) $('#themeStyle').load(s.value.replace(/\(default\)/,'')); else $('#themeStyle').html('')}
else {var v=s.value; $('#themeStyle').load(s.value,function(){cleanStyle();if (window.localStorage) localStorage.selectedTheme = $('#themeStyle').html()})}
document.cookie = 'newtheme='+v+'; expires='+date.toGMTString()+';';
};
function newSheet(){var t=document.createElement('STYLE'); t.id='themeStyle'; document.getElementsByTagName('HEAD')[0].appendChild(t)};
function cleanStyle(){if($('head link[href$="-ltr.css"]').length && dds==true) $('head link[href$="-ltr.css"]').remove(); $('#themeStyle').html($('#themeStyle').html().replace(/#hitskin_preview.*/,''))};
});