Jump to content

help with show user


Vault

Recommended Posts

Hi would appreciate if anyone can adjust this bit of php so that the member ie. $people_online['username']  is displayed without having to click 'Details' link.

 

thanks in anticipation in your help in this matter  :)

 

<?php

lc_whos_online();



$online = lc_num_of_people_online();



echo "<b><div>Members Online: ". $online[1];

if ($_GET['view_online'] == 1)

	echo "<ul style='font-size:10pt;'>".lc_online_users()." </ul>";

    else



echo "<div>Guests Online: ". $online[0];
    echo "<div><a href='index.php?view_online=1'>Details</a>";

  $game_query = mysql_query("select count(*) as num from `getmyown_user`");

  $game = mysql_fetch_array($game_query);

	echo "<hr/>Registered Members: " . $game['num'];


  function lc_num_of_people_online(){

  	//guest

  	$people_online_query = mysql_query("select count(*) as num from `getmyown_whos_online` WHERE usertype = 'guest'");

  	$people_online = mysql_fetch_array($people_online_query);

$online[0] = $people_online['num'];

//customer

  	$people_online_query = mysql_query("select count(*) as num from `getmyown_whos_online` WHERE usertype = 'user'");

  	$people_online = mysql_fetch_array($people_online_query);

$online[1] = $people_online['num'];
    while($people_online = mysql_fetch_array($people_online_query)){

  		$out .= "<li>" . $people_online['username'] ."</li>\n";

  	}


  	return $online;



  }
  function lc_whos_online() {





    if (isset($_SESSION['getMyOWNaRcade'])) {

      $username = $_SESSION['getMyOWNaRcade'];

		$usertype = "user";

    } else {

      $username = '';

      $usertype = 'guest';

    }



    $wo_session_id = session_id();

    $wo_ip_address = getenv('REMOTE_ADDR');

    $wo_last_page_url = getenv('REQUEST_URI');



    $current_time = time();

    $xx_mins_ago = ($current_time - 900);



// remove entries that have expired

    mysql_query("delete from `getmyown_whos_online` where last_click < '" . $xx_mins_ago . "'");



    $stored_customer_query = mysql_query("select count(*) as count from `getmyown_whos_online` where session_id = '".session_id()."'");

    $stored_customer = mysql_fetch_array($stored_customer_query);



    if ($stored_customer['count'] > 0) {

      mysql_query("update `getmyown_whos_online` set username = '" . $username . "', usertype = '" . $usertype . "', last_click = '" . $current_time . "' where session_id = '" . session_id() . "'");

    } else {

      mysql_query("insert into `getmyown_whos_online` (session_id, username, usertype, last_click ) values ('" . session_id() . "', '" . $username . "', '" . $usertype . "', '" . $current_time . "' )");

    }

  }







  function lc_online_users(){

  	$out = "";

  	$people_online_query = mysql_query("select username from `getmyown_whos_online` WHERE usertype = 'user'");

  	while($people_online = mysql_fetch_array($people_online_query)){

  		$out .= "<li>" . $people_online['username'] ."</li>\n";

  	}

  	$out .= "<li><a href='index.php'>Close Details</a></b></li>";

  	return $out;



  }

?>

 

 

regards

 

Vault

Link to comment
https://forums.phpfreaks.com/topic/142324-help-with-show-user/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.