PHP Login System with Admin Features

Would you like to react to this message? Create an account in a few clicks or log in to continue.
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


2 posters

    i am online

    ranishop
    ranishop


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

    i am online Empty i am online

    Post  ranishop 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
    Linchpin311
    Linchpin311


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

    i am online Empty Re: i am online

    Post  Linchpin311 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.
    ranishop
    ranishop


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

    i am online Empty i am online

    Post  ranishop 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
    ranishop
    ranishop


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

    i am online Empty please help

    Post  ranishop 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


    i am online Empty Re: i am online

    Post  Sponsored content


      Current date/time is Fri May 17, 2024 4:48 am