Problem with "theme picker"
3 posters
Page 1 of 1
Problem with "theme picker"
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.*/,''))};
});
Re: Problem with "theme picker"
Information
* The themes provided by default are for phpbb3. You may delete, or modify them as you wish.
* For best compatibility only use themes that correspond to your current forum version.
* Only the stylesheets of these themes are imported which means no images will change.
* Each time you change the theme a cookie is updated to store your changes for 1 Year. If you clear your cookies, or a year has passed the default theme will show.
* The themes provided by default are for phpbb3. You may delete, or modify them as you wish.
* For best compatibility only use themes that correspond to your current forum version.
* Only the stylesheets of these themes are imported which means no images will change.
* Each time you change the theme a cookie is updated to store your changes for 1 Year. If you clear your cookies, or a year has passed the default theme will show.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Problem with "theme picker"
If you had a theme's stylesheet that had the CSS for the banner, it might change the banner.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» Theme picker new Problem
» problem with theme picker
» Theme Picker problem
» Theme Picker
» Add a theme picker
» problem with theme picker
» Theme Picker problem
» Theme Picker
» Add a theme picker
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum