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 9 of 9
  1. #1
    Join Date
    Apr 2006
    Location
    Salford
    Posts
    2,108
    Tokens
    0

    Latest Awards:

    Default Quick PHP [HELP] V2!!

    Ok lmao so i got this code, but how would i make it so it only shows for userlevel 4?

    PHP Code:
     <?php

    if($fetch->ghostmode == "1")
    {

        echo(
    "Ghostmode[<font color=\"green\">ON</font>]");

    }
    elseif(
    $fetch->ghostmode == "0")
    {

        echo(
    "Ghostmode[<font color=\"red\">OFF</font>]");

    }

    ?>

  2. #2
    Join Date
    Apr 2006
    Location
    Leamington Spa
    Posts
    1,375
    Tokens
    72

    Latest Awards:

    Default

    Assuming that your userlevel variable is $fetch->level...:

    PHP Code:
    <?php
      
    if($fetch->level <= "4"){
        if(
    $fetch->ghostmode == "1") {
          echo(
    "Ghostmode[<font color=\"green\">ON</font>]");
        }elseif(
    $fetch->ghostmode == "0"){
          echo(
    "Ghostmode[<font color=\"red\">OFF</font>]");
        }
      }
    ?>
    Last edited by lolwut; 04-11-2007 at 03:51 PM.
    i've been here for over 8 years and i don't know why

  3. #3
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    wouldnt that make it so the userlevel has to be less than or equal to 4?

    PHP Code:
     <?php

    if($fetch->userlevel == "4"){

    if(
    $fetch->ghostmode == "1")
    {

        echo(
    "Ghostmode[<font color=\"green\">ON</font>]");

    }
    elseif(
    $fetch->ghostmode == "0")
    {

        echo(
    "Ghostmode[<font color=\"red\">OFF</font>]");

    }

    }

    ?>
    I think..
    Coming and going...
    Highers are getting the better of me

  4. #4
    Join Date
    Apr 2006
    Location
    Leamington Spa
    Posts
    1,375
    Tokens
    72

    Latest Awards:

    Default

    No, I did it if userlevel is greater than 4. :rolleyes:
    i've been here for over 8 years and i don't know why

  5. #5
    Join Date
    May 2006
    Posts
    1,797
    Tokens
    0

    Latest Awards:

    Default

    :S

    doesnt
    <?php
    if($fetch->level <= "4"){

    indicate less than or equal to?
    Coming and going...
    Highers are getting the better of me

  6. #6
    Join Date
    Dec 2006
    Location
    Swindon
    Posts
    3,299
    Tokens
    215
    Habbo
    dunko

    Latest Awards:

    Default

    == is equal to
    != is not equal to
    >= is more than or equal to
    <= is less than or equal to
    > is more than
    < is less than

  7. #7
    Join Date
    Apr 2006
    Location
    Salford
    Posts
    2,108
    Tokens
    0

    Latest Awards:

    Default

    None of them are coming up lol.

  8. #8
    Join Date
    Nov 2007
    Posts
    25
    Tokens
    0

    Default

    PHP Code:
     <?php
    if ($fetch->level != '4'){
    die(
    'You do not have the correct user level to enter.');
    }
      if(
    $fetch->ghostmode == "1"){

        echo(
    "Ghostmode[<font color=\"green\">ON</font>]");

    }elseif(
    $fetch->ghostmode == "0")
    {

        echo(
    "Ghostmode[<font color=\"red\">OFF</font>]");

    }

    ?>
    RuneScape is fo' sho!

    Hey, you! Guess what! Join #habbox-chat



  9. #9
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    You're trying to use integar statements with strings... Don't quote the numbers.

    PHP Code:
     <?php
    if ($fetch->level != 4){
    die(
    'You do not have the correct user level to enter.');
    }
      if(
    $fetch->ghostmode == 1){

        echo(
    "Ghostmode[<font color=\"green\">ON</font>]");

    }elseif(
    $fetch->ghostmode == 0)
    {

        echo(
    "Ghostmode[<font color=\"red\">OFF</font>]");

    }

    ?>

Posting Permissions

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