Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2005
    Posts
    166
    Tokens
    0

    Default Habbling.com - NEEDS YOU

    Habbling Version 6 is coming soon...

    We have one problem though. We are making the background of the site change everytime you reload. And need 3 different Backgrounds of things like Trees, Hills, Buildings and things like that.

    OR...

    We need 1 background which is in Day and then in Night. So we can code it so it changes with the user's computer clock.

    If you think in ANY way you could help, reply

    Thanks,
    Ultimative

  2. #2
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    Here you go, this should do it. Put this at the top:

    PHP Code:
    <?php
    $number 
    rand(13);
    if (
    $number == "1")
    $background "first background URL";
    if (
    $number == "2")
    $background "second background URL";
    if (
    $number == "3")
    $background "third background URL";
    ?>
    Then in the CSS where the background goes put this:

    PHP Code:
    <?php echo $background?>
    Last edited by timROGERS; 26-02-2006 at 09:47 AM.



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  3. #3
    Join Date
    Mar 2005
    Posts
    166
    Tokens
    0

    Default

    Cheers, anyone able to design the Backgrounds then?

  4. #4
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    I'm not really a graphics designer type I just write the PHP



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


  5. #5
    Join Date
    Sep 2005
    Posts
    94
    Tokens
    0

    Default

    Err, if your wanting the code to change backrounds depending on day or night, thats not the one for you. I can write a code on here for a different image every day of the week, but i have never worked with time in javascript before.

    Code:
    <BODY>
    
    <SCRIPT LANGUAGE="JavaScript">
    today = new Date();
    day = today.getDay();
    arday = new Array("sunday.gif", "monday.gif", "tuesday.gif", 
    "wednesday.gif", "thursday.gif", "friday.gif", "saturday.gif");
    
    document.write("<body background='" + arday[day] + "'>");
    </script>
    I think that will work, im not too experienced in javascript, but i dont have a clue how to emulate that to php [although i can code in php, just ive never bothered with time in both of the languages.
    Your local: VB C PHP HTML PERL coder

    Just ask


  6. #6
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    3,285
    Tokens
    0

    Latest Awards:

    Default

    Thats not a good way to do it J!, you shouldn't use body background, you should use CSS If he wants it I can do a time based one though



    i used to be NintendoNews. visit my blog or add me on twitter.
    need help with vista? i am a microsoft certified technology specialist in configuring windows vista and connected home integrator.. pm me for help!


    "I am the way, the truth, and the life. No one comes to the Father except through me"
    John 14:6 (NIV)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •