Hey guys who can help me i need a code to show who online but male alone and female alone
index.php
core.php
this is the code im using
index.php
Code:
if ($action=="online") { echo "<card id=\"viewforum\" title=\"Online list\">"; echo "<p align=\"center\">"; $onlinetot=mysql_fetch_array(mysql_query("SELECT DISTINCT COUNT(*) FROM online WHERE username IS NOT NULL")); $onlinetot[0]=$onlinetot[0]-1; $onlinetot=ceil($onlinetot[0]/10); $pagefrw=$page+1; $pagepws=$page-1; echo onlinelist($nick,$pass,$page); echo "<br/>"; if ($page<$onlinetot) echo "<a href=\"index.php?action=online&nick=$nick&pass=$pass&page=$pagefrw\">Next »</a><br/>"; $page=$page-2; if ($page>-1) echo "<a href=\"index.php?action=online&nick=$nick&pass=$pass&page=$pagepws\">« Prev</a><br/>"; $page=$page+2; if ($onlinetot==0) $onlinetot=1; echo "Page: $page/$onlinetot<br/>"; echo "<br/><a href=\"index.php?nick=$nick&pass=$pass\"><img src=\"./images/home.gif\" alt=\"*\"/>Forum Home</a><br/>"; echo "</p>"; echo "</card>"; }
Code:
///////////////////////////////////Online//////////////////////////////////// function onlineadd($nick) { $nick=strtolower($nick); $taimautas_sekundem = 500; $laikas = time(); $timeout = $laikas-$taimautas_sekundem; if ($nick!=null) { $insert = mysql_query("INSERT INTO online VALUES ('".$laikas."','".$nick."')"); } $deleted = mysql_query("DELETE FROM online WHERE laikas<".$timeout.""); };
Comment