Storm
Not New Member
Posts: 11
Storm said 0 great things
|
Post by Storm on May 5, 2009 11:13:30 GMT -8
Wasn't able to fit it all in the description, lols. I have a head/base cat splitter that's pretty easy to use and simple at my site here: swcv5.proboards.com(The code can't be reposted due to copyright but can be seen via the view source) I also have a head/base code for the info center as well. I am starting to add more skins to the site and I am wanting to use different head/base images with each skin as well including the info center. As currently the main skin's head/base images show on the other skins as I don't want that since they don't match to the other skins. Can this be done in a simple way please? Thankyou in advance for the time.
|
|
|
Post by Wormopolis on May 5, 2009 15:25:26 GMT -8
I have an idea and I will post it when I get home for work. you are gonna love it.
|
|
Storm
Not New Member
Posts: 11
Storm said 0 great things
|
Post by Storm on May 5, 2009 20:38:25 GMT -8
Awesome! I've been needing this for quite a while too. xD Thankyou soooo much for the time involved. Don't work too hard now. lols
|
|
|
Post by Wormopolis on May 6, 2009 1:32:19 GMT -8
Global Header:
<script type="text/javascript"> <!-- // global head/foot variables for codes on diff skins // by Wormopolis - wormocodes.proboards.com // keep header intact
// use variables below in place of URLs in any code that // require them.
var global_headimg; var global_footimg;
// now edit the URLs below for each skin id you want
switch(pb_skinid) { case 1: global_headimg="URL FOR HEADER IMAGE SKIN 1"; global_footimg="URL FOR HEADER IMAGE SKIN 1"; break; case 2: global_headimg="URL FOR HEADER IMAGE SKIN 2"; global_footimg="URL FOR HEADER IMAGE SKIN 2"; break; case 5: global_headimg="URL FOR HEADER IMAGE SKIN 5"; global_footimg="URL FOR HEADER IMAGE SKIN 5"; break; case 14: global_headimg="URL FOR HEADER IMAGE SKIN 14"; global_footimg="URL FOR HEADER IMAGE SKIN 14"; break; default: global_headimg="URL FOR HEADER IMAGE IF SKIN ID ISNT FOUND"; global_footimg="URL FOR HEADER IMAGE IF SKIN ID ISNT FOUND"; break; } //--> </script>
so now whenever a code asks you for a URL to a head or fott image, use the variables global_headimg and global_footimg.
so for example, say you have a code that starts out like:
var headerimg="URL TO HEAD IMAGE"; var footerimg="URL TO FOOT IMAGE";
you would simply put:
var headerimg=global_headimg; var footerimg=global_footimg;
and it will know the URLs you need because they were set globally above.
let me know if you have problems.
|
|
|
Post by Wormopolis on May 6, 2009 1:35:08 GMT -8
in your case, Storm:
var iHead = global_headimg; var iBase = global_footimg;
and in my code above, say these were images you wanted on skin 1:
case 1: global_headimg = 'http://i703.photobucket.com/albums/ww34/swcforum/7024415849_953456.jpg'; global_footimg = 'http://i703.photobucket.com/albums/ww34/swcforum/swc.jpg'; break;
|
|
Storm
Not New Member
Posts: 11
Storm said 0 great things
|
Post by Storm on May 6, 2009 5:52:09 GMT -8
You are awesome! Once I get some sleep, I am going to try this out.! Thankyou so ever much!
Edit to further add:
Ok, I have the code in, but it doesn't seem to want to work. What am I doing wrong? This is pretty new to me so please bear with me. Also will this work in switching the head/base images for the info center as well with each skin?
|
|
|
Post by Wormopolis on May 6, 2009 8:44:41 GMT -8
switch(pb_skinid1) {
needs to be:
switch(pb_skinid) {
|
|
|
Post by Wormopolis on May 6, 2009 8:45:45 GMT -8
and yes on the info center if you want to use the same images.
|
|
Storm
Not New Member
Posts: 11
Storm said 0 great things
|
Post by Storm on May 6, 2009 11:50:08 GMT -8
Ok, got the change made and still no images are showing. I have three skins all together so not sure why it's numbered 1, 2, 5, 14. Here's what I have of the code thus far: <!-- // global head/foot variables for codes on diff skins // by Wormopolis - wormocodes.proboards.com// keep header intact // use variables below in place of URLs in any code that // require them. var global_headimg; var global_footimg; // now edit the URLs below for each skin id you want switch(pb_skinid) { case 1: global_headimg="http://i703.photobucket.com/albums/ww34/swcforum/7024415849_953456.jpg"; global_footimg="http://i703.photobucket.com/albums/ww34/swcforum/swc.jpg"; break; case 2: global_headimg="http://i703.photobucket.com/albums/ww34/swcforum/head-1.gif"; global_footimg="http://i703.photobucket.com/albums/ww34/swcforum/base-1.gif"; break; case 5: global_headimg="http://i703.photobucket.com/albums/ww34/swcforum/header.gif"; global_footimg="http://i703.photobucket.com/albums/ww34/swcforum/base-2.gif"; break; case 14: global_headimg="URL FOR HEADER IMAGE SKIN 14"; global_footimg="URL FOR FOOTER IMAGE SKIN 14"; break; default: global_headimg="URL FOR HEADER IMAGE IF SKIN ID ISNT FOUND"; global_footimg="URL FOR FOOTER IMAGE IF SKIN ID ISNT FOUND"; break; } //--> </script>
|
|
|
Post by Wormopolis on May 6, 2009 12:12:34 GMT -8
you have to change the case numbers to whatever the skin ID is. I just used those numbers as examples.
what are the skinIDs for all your skins?
|
|
|
Post by Wormopolis on May 6, 2009 12:30:33 GMT -8
you are also missing the opening script tag
|
|
Storm
Not New Member
Posts: 11
Storm said 0 great things
|
Post by Storm on May 6, 2009 13:04:07 GMT -8
Got the opening script added lols, and the skin ids are 1,2,4. =)
|
|
|
Post by Wormopolis on May 6, 2009 13:24:36 GMT -8
so you would want to have
case 1:
case 2:
case 4:
and you can put something in for the default in case something goes wrong.. perhaps a blank.gif
|
|
|
Post by Wormopolis on May 6, 2009 13:27:58 GMT -8
now in your news fader code and info center code, where it asks for head/base images, instead of putting actual URLs there, use the global variables.
|
|
Storm
Not New Member
Posts: 11
Storm said 0 great things
|
Post by Storm on May 6, 2009 14:42:01 GMT -8
now in your news fader code and info center code, where it asks for head/base images, instead of putting actual URLs there, use the global variables. Ok, I may not need the news fader code header'base one since we don't ue the news fader that much so I will be taking that one out later tonight. But let me ask this, shouldn't the images show with what I have already there? The thin is, the code is not working at all.
|
|