MyBB Central

Full Version: Multi-Backgrounds
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey everyone I was just sitting and wondering is it possible to have multiple backgrounds in MyBB like one for the top half and one for the bottom half?
Yes, it is possible. All you do is change the backgrounds links in the stylesheets. It's even possible to have a background behind your logo like here and at HF.
(Jul 15, 2010, 09:52 AM)Snooopy` Wrote: [ -> ]Yes, it is possible. All you do is change the backgrounds links in the stylesheets. It's even possible to have a background behind your logo like here and at HF.

How do you do that ?
I've always wondered Smile
I know the header thing but the background I kinda might need that maybe someone could tell me exactly how?
Bump Bump Anyone?
Try it like this my CSS isn't up to scratch but wtf Tongue
Code:
body {
    background-image: url(../background1.gif), url(../background2);
    background-repeat: repeat-y;
    background-position: top left, top right;
    width: 385px;
    height: 100px;
    border: 1px solid #000000;
}
Good luck Smile
(Jul 17, 2010, 09:36 AM)88power88 Wrote: [ -> ]Try it like this my CSS isn't up to scratch but wtf Tongue
Code:
body {
    background-image: url(../background1.gif), url(../background2);
    background-repeat: repeat-y;
    background-position: top left, top right;
    width: 385px;
    height: 100px;
    border: 1px solid #000000;
}
Good luck Smile

Hey dude can you show my a example? Just so I know the code works I don't have a test forum xD
(Jul 17, 2010, 09:37 AM)AXVIS Wrote: [ -> ]
(Jul 17, 2010, 09:36 AM)88power88 Wrote: [ -> ]Try it like this my CSS isn't up to scratch but wtf Tongue
Code:
body {
    background-image: url(../background1.gif), url(../background2);
    background-repeat: repeat-y;
    background-position: top left, top right;
    width: 385px;
    height: 100px;
    border: 1px solid #000000;
}
Good luck Smile

Hey dude can you show my a example? Just so I know the code works I don't have a test forum xD

You know you can edit the css again it will take 2 minutes XD
I can't right now because i'm on the wrong pc ;D
Here test:
PHP Code:
body {
    
background-imageurl(images/mynovablack/bg.gif),url(http://img686.imageshack.us/img686/4418/bggifv.jpg);
    
background-repeatrepeat-y;
    
background-positiontop lefttop right;
    
color#000;
    
text-aligncenter;
    
line-height1.4;
    
marginauto;
    
font-familyVerdanaArialSans-Serif;
    
font-size10px;


ScreenShot:
[img][/img]
If you don't want to deal with css there is a php based option.
Follow these steps and you can rotate the images from a custom directory as your background.
1) Create a directory, in my example it will be bg
2) Create a .php file in your directory containing the following code:
PHP Code:
<?php
$files 
glob('{*.PNG,*.png,*.JPG,*.jpg,*.GIF,*.gif}'GLOB_BRACE);
readfile($files[array_rand($files)]);
?>
In my example this file will be bg.php
3) Upload the images you want to rotate as your background to the /bg directory
4) Change the .css of the forum, update the body
Code:
body {
    background-image: url(images/bg/bg.php)

You're done, the script should rotate the images you have in the background, you don't have to edit the .css file every time you add a new image.

IMPORTANT: You DO NOT need to chmod the /bg directory. (I have done this mistake when I have found this solution and it was dangerous!
Thanks for the idea Big Grin