i tried to do this but dont working...
here is my online list..
here is sql
here is my online list..
PHP Code:
else if($action=="online")
{
addonline(getuid_sid($sid),"Online lista","");
echo "<card id=\"main\" title=\"ONLINE\">";
$tmsg = getpmcount(getuid_sid($sid));
$umsg = getunreadpm(getuid_sid($sid));
if($umsg>0)
{
echo "<small>»<a href=\"inbox.php?action=main&sid=$sid\">Privatne Poruke($umsg/$tmsg)</a><br/></small>";
}
//////ALL LISTS SCRIPT <<
if($page=="" || $page<=0)$page=1;
$num_items = getnumonline(); //changable
$items_per_page= 10;
$num_pages = ceil($num_items/$items_per_page);
if($page>$num_pages)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
//changable sql
$sql = "SELECT
a.name, b.place, b.userid, sex , a.onlinemsg, a.plusses FROM ibwf_users a
INNER JOIN ibwf_online b ON a.id = b.userid
GROUP BY 1,2
LIMIT $limit_start, $items_per_page
";
echo "<p><small>";
$mols = mysql_fetch_array(mysql_query("SELECT name, value FROM ibwf_settings WHERE id='2'"));
print "Najvise online: <b>$mols[1]</b><br/>";
$mols = mysql_fetch_array(mysql_query("SELECT ppl, dtm FROM ibwf_mpot WHERE ddt='".date("d m y")."'"));
print "Najvise online danas: <b>$mols[0]</b><br/><br/>";
$items = mysql_query($sql);
echo mysql_error();
while ($item = mysql_fetch_array($items))
{
if ($item[3]=="M"){
$icon = "<img src=\"images/male.gif\" alt=\"M\"/>";
}else
if ($item[3]=="F"){
$icon = "<img src=\"images/female.gif\" alt=\"F\"/>";
}
if ($item[5]>="0"){
$status = "Novajlija!";
}else
if ($item[5]>"24"){
$status = "Mladji clan!";
}
if ($item[5]>"49"){
$status = "Pocetnik!";
}
if ($item[5]>"249"){
$status = "Stariji clan!";
}
if ($item[5]>"499"){
$status = "Dobar clan!";
}
if ($item[5]>"749"){
$status = "Super Clan";
}
if ($item[5]>"999"){
$status = "Dobar clan";
}
if ($item[5]>"1499"){
$status = "V.I.P";
}
if ($item[5]>"1999"){
$status = "Mator clan!";
}
if ($item[5]>"2499"){
$status = "Serbian World Kralj!";
}
if ($item[5]>"2999"){
$status = "No1!";
}
if ($item[5]>"4999"){
$status = "MATORA DRTINA!";
}
if ($item[5]>"3999"){
$status = "Serbian World Slatkish!";
}
$onlmsg = parsepm($item[4], $sid);
$lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$item[0]</a>";
echo "$icon $lnk<br/><b>Status:</b> $status<br/>";
$bre = "SELECT showonline FROM ibwf_users WHERE name='".$item[0]."'";
if ($bre[0]=1)
{
echo "<b>Where:</b> $item[1] <br/>";
}else
if ($bre[0]=0)
{
echo "<b>Online privacy!</b><br/>";
}
echo "<b>Online message:</b> $onlmsg<br/><a href=\"inbox.php?action=sendpm&who=$item[2]&sid=$sid\">PP</a> | <a href=\"genproc.php?action=bud&who=$item[2]&sid=$sid&todo=add\">PR</a><br/>--------<br/>";
}
echo "</small></p>";
echo "<p align=\"center\">";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"index.php?action=online&page=$ppage&sid=$sid\">«Nazad</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"index.php?action=online&page=$npage&sid=$sid\">Napred»</a>";
}
echo "<br/>$page/$num_pages<br/>";
if($num_pages>2)
{
echo getjumper($action, $sid,"index");
}
echo "</p>";
////// UNTILL HERE >>
echo "<p align=\"center\">";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
PHP Code:
ALTER TABLE `ibwf_users` ADD `showonline` INT( 1 ) NOT NULL
Comment