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

    Latest Awards:

    Default Php Help (+ Rep)

    Ok, so basicly on the users profile i have this;

    PHP Code:
     <?php

    $time_min
    =time() - (1);

    $time_five=time() - (60 5);

    $time_day=time() - (3600 24);

    $time_week=time() - (3600 24 7);

    if(
    $fetch->ghostmode == "1"){ 
    $state="<font color=RED>(Offline)</font>";

    }elseif (
    $fetch->online $time_min){

    $state="<font color=00FF00>(Online)</font>";

    }elseif (
    $fetch->online $time_min){

    $state="<font color=RED>(Offline)</font>";


    }elseif (
    $fetch->online $time_five){

    $state="<font color=PURPLE>(Busy)</font>";

    }elseif (
    $fetch->online $time_five){

    $state="<font color=RED>(Offline)</font>";


    }elseif (
    $fetch->online $time_day){

    $state="<font color=RED>(Offline)</font>";

    }elseif (
    $fetch->online $time_day){

    $state="<font color=RED>(Offline)</font>";


    }elseif (
    $fetch->online $time_week){

    $state="<font color=RED>(Offline)</font>";

    }elseif (
    $fetch->online $time_week){

    $state="<font color=RED>(Offline)</font>";

    }


               echo 
    "<font color=white>$fetch->status</font> $state"?>
    How would i make it so if a user's status has just been set to dead, there status is (Bleeding to Death) for exacly one minute, they it goes to (Dead).

    + Rep for all answeres.

    Thread moved from website design by --ss-- (Forum Super Moderator): Please post in a more specific section .
    Last edited by --ss--; 11-02-2008 at 04:01 PM.

  2. #2
    Join Date
    Jan 2007
    Location
    Canada eh?
    Posts
    766
    Tokens
    75

    Default

    So, here's how I'd do it.... (in pseudo code)

    PHP Code:
    <?php
    // $whendead will be the time() for when they died
    $lastaction $whendead;
    if(
    $lastaction >= time()-60){ //If lastaction was less than 60 seconds ago
         
    $status 'Bleeding to death';
    }elseif(
    $lastaction time()-60){ //If lastaction was more than 60 seconds ago
         
    $status 'Dead';
    }
    ?>
    ?>

  3. #3
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    hehe edit
    PHP Code:
    <?php
    // $whendead will be the time() for when they died
    $lastaction $whendead;
    if(
    $lastaction >= time()-60){ //If lastaction was less than 60 seconds ago
         
    $status 'Bleeding to death';
    }elseif(
    $lastaction time()-60){ //If lastaction was more than 60 seconds ago
         
    $status 'Dead';
    }
    ?>
    How could this hapen to meeeeeeeeeeeeeee?lol.

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

    Latest Awards:

    Default

    Thanks, Rep+ to both but can anyone enter it in my code so it works?

  5. #5
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    No because your code does not include a time when they died.

    Quote Originally Posted by Assassinator View Post
    Thanks, Rep+ to both but can anyone enter it in my code so it works?

Posting Permissions

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