Active Members

Started on the old forum in March 2009 · view the original in the archive · old links redirect here

4 replies · 667 views · started 17 years ago · 5 min read

3 participants
Dj-marc Developer · 164 posts #1

here are some codes that might be useful to you...

Place the codes below in index.php

///////////////////////////////////Active Members
else if($action=="active")
{

  addonline(getuid_sid($sid),"[Active Users List]","index.php?action=$action");
	echo "<card id=\"main\" title=\"Active Users List\">";
echo "<p align=\"center\">";
echo "On this page you will find out the active members in different time periods.";
echo "</p>";
echo "<p align=\"left\">";

  
$tm60 = time() - (60*60);
	  $aut = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$tm60."'"));
	  echo mysql_error();
	  echo "Active users this hour: <a href=\"index.php?action=acthour&sid=$sid\">($aut[0])</a>
";
echo "----------
";
$tm24 = time() - (24*60*60);
	  $aut = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$tm24."'"));
	  echo mysql_error();
	  echo "Active users today: <a href=\"index.php?action=actmem&sid=$sid\">($aut[0])</a>
";
echo "----------
";
$tm3 = time() - (3*24*60*60);
	  $aut = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$tm3."'"));
	  echo mysql_error();
	  echo "Active users Last 3 days: <a href=\"index.php?action=active3&sid=$sid\">($aut[0])</a>
";
echo "----------
";
$tm7 = time() - (7*24*60*60);
	  $aut = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$tm7."'"));
	  echo mysql_error();
	  echo "Active users this week: <a href=\"index.php?action=actmemwk&sid=$sid\">($aut[0])</a>
";
   echo "----------
";
$tm4 = time() - (4*7*24*60*60);
	  $aut = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$tm4."'"));
	  echo mysql_error();
	  echo "Active users this month: <a href=\"index.php?action=actmonth&sid=$sid\">($aut[0])</a>
";
	 echo "----------
";
echo "</p>";

  echo "<p align=\"center\">";
echo "<a href=\"index.php?action=stats&sid=$sid\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>";
echo "Statistics</a>
";
  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
  echo "</card>";
}
///////////////////////////////////Active Members This Hour
else if($action=="acthour")
{

  addonline(getuid_sid($sid),"[Active Users For This Hour]","index.php?action=$action");
	echo "<card id=\"main\" title=\"Active Users For This Hour\">";
	
	$tm60 = time() - (60*60);
			$aut = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$tm60."'"));
			echo mysql_error();
	if($page=="" || $page<=0)$page=1;
	$num_items = $aut[0]; //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;

	$sql = "SELECT name, sex, lastact, id FROM ibwf_users WHERE lastact>'".$tm60."' ORDER BY lastact DESC LIMIT $limit_start, $items_per_page";
   echo "

";
$items = mysql_query($sql);
	echo mysql_error();
	while ($item = mysql_fetch_array($items))
	{
	 if($item[1]==M)
  {
	$usex = "<img src=\"http://coding-talk.com/images/male.gif\" alt=\"M\"/>";
  }else if($item[1]==F){
	$usex = "<img src=\"http://coding-talk.com/images/female.gif\" alt=\"F\"/>";
  }else{ 
	$usex = "<img src=\"http://coding-talk.com/images/unknown.gif\" alt=\"X\"/>";
  }
   $lnk = "<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$item[0]</a>";
			  echo "$usex $lnk -".date("D d M y - H:i:s a", $item[2])."
";
	 echo "-------
";
}

echo "</p>";
	echo "<p align=\"center\">";
	if($page>1)
	{
	  $ppage = $page-1;
	  echo "<a href=\"index.php?action=acthour&page=$ppage&sid=$sid\">«Prev</a> ";
	}
	if($page<$num_pages)
	{
	  $npage = $page+1;
	  echo "<a href=\"index.php?action=acthour&page=$npage&sid=$sid\">Next»</a>";
	}
	echo "
$page/$num_pages
";
	if($num_pages>2)
	{
	  echo getjumper($action, $sid,"index");
	}
	echo "</p>";
  ////// UNTILL HERE >>

  echo "<p align=\"center\">";
echo "<a href=\"index.php?action=stats&sid=$sid\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>";
echo "Statistics</a>
";
  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
  echo "</card>";
}
///////////////////////////////////Active Members Today
else if($action=="actmem")
{

  addonline(getuid_sid($sid),"[Active Users Today]","index.php?action=$action");
	echo "<card id=\"main\" title=\"Active Users today\">";
	
	$tm24 = time() - (24*60*60);
			$aut = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$tm24."'"));
			echo mysql_error();
	if($page=="" || $page<=0)$page=1;
	$num_items = $aut[0]; //changable
	$items_per_page= 7;
	$num_pages = ceil($num_items/$items_per_page);
	if($page>$num_pages)$page= $num_pages;
	$limit_start = ($page-1)*$items_per_page;

	$sql = "SELECT name, sex, lastact, id FROM ibwf_users WHERE lastact>'".$tm24."' ORDER BY lastact DESC LIMIT $limit_start, $items_per_page";
   echo "

";
$items = mysql_query($sql);
	echo mysql_error();
	while ($item = mysql_fetch_array($items))
	{
	 if($item[1]==M)
  {
	$usex = "<img src=\"http://coding-talk.com/images/male.gif\" alt=\"M\"/>";
  }else if($item[1]==F){
	$usex = "<img src=\"http://coding-talk.com/images/female.gif\" alt=\"F\"/>";
  }else{ 
	$usex = "<img src=\"http://coding-talk.com/images/unknown.gif\" alt=\"X\"/>";
  }
   $lnk = "<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$item[0]</a>";
			  echo "$usex $lnk -".date("D d M y - H:i:s a", $item[2])."
";
	 echo "-------
";
}

echo "</p>";
	echo "<p align=\"center\">";
	if($page>1)
	{
	  $ppage = $page-1;
	  echo "<a href=\"index.php?action=actmem&page=$ppage&sid=$sid\">«Prev</a> ";
	}
	if($page<$num_pages)
	{
	  $npage = $page+1;
	  echo "<a href=\"index.php?action=actmem&page=$npage&sid=$sid\">Next»</a>";
	}
	echo "
$page/$num_pages
";
	if($num_pages>2)
	{
	  echo getjumper($action, $sid,"index");
	}
	echo "</p>";
  ////// UNTILL HERE >>

  echo "<p align=\"center\">";
echo "<a href=\"index.php?action=stats&sid=$sid\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>";
echo "Statistics</a>
";
  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
  echo "</card>";
}
///////////////////////////////////Active Members This Week
else if($action=="actmemwk")
{

  addonline(getuid_sid($sid),"[Active Users For This Week]","index.php?action=$action");
	echo "<card id=\"main\" title=\"Active Users this week\">";
	
	$tm7 = time() - (7*24*60*60);
			$aut = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$tm7."'"));
			echo mysql_error();
	if($page=="" || $page<=0)$page=1;
	$num_items = $aut[0]; //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;

	$sql = "SELECT name, sex, lastact, id FROM ibwf_users WHERE lastact>'".$tm7."' ORDER BY lastact DESC LIMIT $limit_start, $items_per_page";
   echo "

";
$items = mysql_query($sql);
	echo mysql_error();
	while ($item = mysql_fetch_array($items))
	{
	 if($item[1]==M)
  {
	$usex = "<img src=\"http://coding-talk.com/images/male.gif\" alt=\"M\"/>";
  }else if($item[1]==F){
	$usex = "<img src=\"http://coding-talk.com/images/female.gif\" alt=\"F\"/>";
  }else{ 
	$usex = "<img src=\"http://coding-talk.com/images/unknown.gif\" alt=\"X\"/>";
  }
   $lnk = "<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$item[0]</a>";
			  echo "$usex $lnk -".date("D d M y - H:i:s a", $item[2])."
";
	 echo "-------
";
}

echo "</p>";
	echo "<p align=\"center\">";
	if($page>1)
	{
	  $ppage = $page-1;
	  echo "<a href=\"index.php?action=actmemwk&page=$ppage&sid=$sid\">«Prev</a> ";
	}
	if($page<$num_pages)
	{
	  $npage = $page+1;
	  echo "<a href=\"index.php?action=actmemwk&page=$npage&sid=$sid\">Next»</a>";
	}
	echo "
$page/$num_pages
";
	if($num_pages>2)
	{
	  echo getjumper($action, $sid,"index");
	}
	echo "</p>";
  ////// UNTILL HERE >>

  echo "<p align=\"center\">";
echo "<a href=\"index.php?action=stats&sid=$sid\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>";
echo "Statistics</a>
";
  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
  echo "</card>";
}

///////////////////////////////////Active Members This Month
else if($action=="actmonth")
{

  addonline(getuid_sid($sid),"[Active Users For This Month]","index.php?action=$action");
	echo "<card id=\"main\" title=\"Active Users this week\">";
	
	$tm4 = time() - (4*7*24*60*60);
			$aut = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$tm4."'"));
			echo mysql_error();
	if($page=="" || $page<=0)$page=1;
	$num_items = $aut[0]; //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;

	$sql = "SELECT name, sex, lastact, id FROM ibwf_users WHERE lastact>'".$tm4."' ORDER BY lastact DESC LIMIT $limit_start, $items_per_page";
   echo "

";
$items = mysql_query($sql);
	echo mysql_error();
	while ($item = mysql_fetch_array($items))
	{
	 if($item[1]==M)
  {
	$usex = "<img src=\"http://coding-talk.com/images/male.gif\" alt=\"M\"/>";
  }else if($item[1]==F){
	$usex = "<img src=\"http://coding-talk.com/images/female.gif\" alt=\"F\"/>";
  }else{ 
	$usex = "<img src=\"http://coding-talk.com/images/unknown.gif\" alt=\"X\"/>";
  }
   $lnk = "<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$item[0]</a>";
			  echo "$usex $lnk -".date("D d M y - H:i:s a", $item[2])."
";
	 echo "-------
";
}

echo "</p>";
	echo "<p align=\"center\">";
	if($page>1)
	{
	  $ppage = $page-1;
	  echo "<a href=\"index.php?action=actmonth&page=$ppage&sid=$sid\">«Prev</a> ";
	}
	if($page<$num_pages)
	{
	  $npage = $page+1;
	  echo "<a href=\"index.php?action=actmonth&page=$npage&sid=$sid\">Next»</a>";
	}
	echo "
$page/$num_pages
";
	if($num_pages>2)
	{
	  echo getjumper($action, $sid,"index");
	}
	echo "</p>";
  ////// UNTILL HERE >>

  echo "<p align=\"center\">";
echo "<a href=\"index.php?action=stats&sid=$sid\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>";
echo "Statistics</a>
";
  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
  echo "</card>";
}
///////////////////////////////////Active Members LAST 3 DAYS
else if($action=="active3")
{

  addonline(getuid_sid($sid),"[Active Users For 3 Days]","index.php?action=$action");
	echo "<card id=\"main\" title=\"Active Users For 3 Days\">";
	
	$tm3 = time() - (3*24*60*60);
			$aut = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$tm3."'"));
			echo mysql_error();
	if($page=="" || $page<=0)$page=1;
	$num_items = $aut[0]; //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;

	$sql = "SELECT name, sex, lastact, id FROM ibwf_users WHERE lastact>'".$tm3."' ORDER BY lastact DESC LIMIT $limit_start, $items_per_page";
   echo "

";
$items = mysql_query($sql);
	echo mysql_error();
	while ($item = mysql_fetch_array($items))
	{
	 if($item[1]==M)
  {
	$usex = "<img src=\"http://coding-talk.com/images/male.gif\" alt=\"M\"/>";
  }else if($item[1]==F){
	$usex = "<img src=\"http://coding-talk.com/images/female.gif\" alt=\"F\"/>";
  }else{ 
	$usex = "<img src=\"http://coding-talk.com/images/unknown.gif\" alt=\"X\"/>";
  }
   $lnk = "<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$item[0]</a>";
			  echo "$usex $lnk -".date("D d M y - H:i:s a", $item[2])."
";
	 echo "-------
";
}

echo "</p>";
	echo "<p align=\"center\">";
	if($page>1)
	{
	  $ppage = $page-1;
	  echo "<a href=\"index.php?action=active3&page=$ppage&sid=$sid\">«Prev</a> ";
	}
	if($page<$num_pages)
	{
	  $npage = $page+1;
	  echo "<a href=\"index.php?action=active3&page=$npage&sid=$sid\">Next»</a>";
	}
	echo "
$page/$num_pages
";
	if($num_pages>2)
	{
	  echo getjumper($action, $sid,"index");
	}
	echo "</p>";
  ////// UNTILL HERE >>

  echo "<p align=\"center\">";
echo "<a href=\"index.php?action=stats&sid=$sid\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>";
echo "Statistics</a>
";
  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"http://coding-talk.com/images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
  echo "</card>";
}</div>

Place this code in index.php?action=stats
[code]echo "<a href=\"index.php?action=active&sid=$sid\">Active Members</a>
";
subzero Super moderator Fellow · 3,954 posts #2

nice share bro but i dont use lavalair or any scripts here lol

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

friend Developer · 112 posts #4

QUOTE (Dj-marc @ Mar 8 2009, 01:30 AM) <{POST_SNAPBACK}>

ok.

Nice Share Thanks

Bro.. What script for total time online for user?

Thanks

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close