Location: PHPKode > scripts > OekakiPoteto > oekakipoteto/newchat/chatusers.php
<?
function rootpath(){
	global $DOCUMENT_ROOT;
	$rootdir = $DOCUMENT_ROOT;
	if ($DOCUMENT_ROOT[strlen($DOCUMENT_ROOT)] == "/"){
		return $rootdir;
	} else {
		$rootdir = $rootdir."/";
		return $rootdir;
	}
}

include('config.php');
include('dbconn.php');
?>
<html>
<?
if($OekakiU == ""){
	include("templates/".$template.".php");
	} else {
	$testrslt = mysql_query("SELECT usrname, usrpass, templatesel, usrflags FROM ".$OekakiPoteto_MemberPrefix."oekaki WHERE usrname='$OekakiU'");
	
	//extract the fields selected above into variables
	$row = mysql_fetch_array($testrslt);

	include("templates/".$row[templatesel].".php");
}

?>
<head>
<script><!--
  function o(url) {
	  window.open("profile.php?user="+url, 'profileWin', "width=300,height=400,resizable=yes,scrollbars=yes,status=no,menubar=no,toolbar=no,location=no");
	  return false;
  }
//--></script>
<meta http-equiv="refresh" content="60;url=chatusers.php">
</head>
<body bgcolor="<?=$bgColor?>" text="<?=$textColor?>" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="templates/<?=$bgImage?>" link="<?=$link?>" vlink="<?=$vLink?>" alink="<?=$aLink?>">
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="infotable">
<tr> 
  <td> 
	<div align="right"><b> Users:</b></div>
  </td>
</tr>
<?
	function vand($a,$b=' ') {
		if ($a) return $a.$b;
	}


	function format_duration($seconds) {
		if ($seconds<60) return 'less than a minute';
		$days=(int)($seconds/86400);
		$seconds-=$days*86400;
		$hours=(int)($seconds/3600);
		$seconds-=$hours*3600;
		$minutes=(int)($seconds/60);
		$seconds-=$minutes*60;
		if ($days) $str=$days.'day';
		if ($hours) $str=vand($str).$hours.'hr';
		if ($days<4 && $minutes) $str=vand($str).$minutes.'min';
		return $str;
	}
  
  //Custom titles (refer to manual.html on how to give your users custom titles)
  $user_tags = array( 
		'Example'                   =>      'Title',
		'Example2'		    =>	    'Some other title'
		);
  
  if (($result = mysql_query("SELECT usrname FROM ".$OekakiPoteto_MemberPrefix."oekaki WHERE usrflags LIKE '%G%' ORDER BY deleted DESC LIMIT  0, 1")) && ($row = mysql_fetch_array($result))) $search_slayer = $row[usrname];
 
 
 	$result = mysql_query("SELECT ".$OekakiPoteto_MemberPrefix."oekakichatmodusers.usrname,UNIX_TIMESTAMP(NOW())-UNIX_TIMESTAMP(lastmessage) AS idle,usrflags,".$OekakiPoteto_MemberPrefix."oekakichatmodusers.afk FROM ".$OekakiPoteto_MemberPrefix."oekakichatmodusers LEFT JOIN ".$OekakiPoteto_MemberPrefix."oekaki USING(usrname) ORDER BY ".$OekakiPoteto_MemberPrefix."oekaki.usrname");
  
  while ($row = mysql_fetch_array($result)) {
	  ?>
	  <tr><td align="right">
	  <?
	  if ($row[afk]=='yes') { ?><i><? }
	  if (eregi('[COSA]',$row[usrflags])){?><b><?}
	  if ($row['usrflags']){?><a onClick="return o('<?=urlencode($row[usrname])?>')" href="#"><?}?><ACRONYM title="Idle: <?=format_duration($row[idle])?>"><?=$row[usrname]?></ACRONYM><?if ($row['usrflags']){?></a><?}?><?
	  if (eregi('C',$row[usrflags])){?><i>[c]</i></b><?}
	  if (eregi('O',$row[usrflags])){?><i>[o]</i></b><?}
	  else if (eregi('S',$row[usrflags])){?><i>[s]</i></b><?}
	  else if (eregi('A',$row[usrflags])){?><i>[a]</i></b><?}
	  
	  if ($user_tags[$row[usrname]]){?>[<?=$user_tags[$row[usrname]]?>]<?}
	  if ($row[usrname]==$search_slayer) {?><font face='Webdings' size='+1'>&amp;</font><?}
	  if ($row[afk]=='yes') { ?>*afk*</i><? }
	  ?></td></tr>
	  <?
  }
  ?>
</table>
</body>
</html>
Return current item: OekakiPoteto