PHP Login System with Admin Features

This forum was created to talk about the PHP Login System with admin features created by jpmaster77 on evolt's website


    i am online

    Share
    avatar
    ranishop

    Number of posts : 3
    Registration date : 2011-01-21

    i am online

    Post  ranishop on Fri Jan 21, 2011 2:33 pm

    hi
    is there a way that when somebody is onlile in his profile it will said
    i am online?
    meanning that non registred users can see that this specific user is online
    like in this forum for example -
    Status: Online
    avatar
    Linchpin311

    Number of posts : 220
    Age : 32
    Localisation : Long Island
    Registration date : 2007-05-14

    Re: i am online

    Post  Linchpin311 on Fri Feb 04, 2011 2:16 pm

    this is possible and easy enough to accomplish. i would copy some code from view_active.php. if you query the database about all the active users against a certain user name, you could then put that result in a conditional. if the conditional returns true, you can echo whatever text (and maybe an image if you want) you want.

    Let me know if this is what you're looking for.


    _________________
    in the end, the universe tends to unfold as it should...

    Also note that it is your responsibility to die() if necessary.
    avatar
    ranishop

    Number of posts : 3
    Registration date : 2011-01-21

    i am online

    Post  ranishop on Sat Feb 05, 2011 10:18 am

    well...
    i added this code

    /* If logged in user viewing own account, give link to edit */
    if(strcmp($session->username,$req_user_info) == 0){
    echo "<b>I AM ONLINE:</b></br> ".$req_user_info['pname']."<br><br>";
    }

    in the userinfo.php page (this is where i want to show if specifc user is online)
    but itws not working.

    any idea?
    thnks again in advance
    avatar
    ranishop

    Number of posts : 3
    Registration date : 2011-01-21

    please help

    Post  ranishop on Sat Feb 05, 2011 4:06 pm

    hi
    i made new file

    view_online.php

    with include

    <?
    if(!defined('TBL_ACTIVE_USERS')) {
    die("Error processing page");
    }

    $q = "SELECT username FROM ".TBL_ACTIVE_USERS
    ." ORDER BY timestamp DESC,username";
    $result = $database->query($q);
    /* Error occurred, return given name by default */
    $num_rows = mysql_numrows($result);
    if(!$result || ($num_rows < 0)){
    echo "Error displaying info";
    }

    $username = mysql_result($result,$i,"username");






    if(strcmp($session->username,$req_user) == 0){
    echo "$username is On";
    }
    /* Visitor not viewing own account */
    else{
    echo "$username is On";
    }




    ?>

    dosent work Sad

    Sponsored content

    Re: i am online

    Post  Sponsored content


      Current date/time is Tue Sep 19, 2017 9:30 am