Active Members

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Active Members

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

    Place the codes below in index.php

    PHP Code:
    ///////////////////////////////////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&amp;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&amp;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&amp;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&amp;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&amp;sid=$sid\">($aut[0])</a>
    "
    ;
         echo 
    "----------
    "
    ;
    echo 
    "</p>";


      echo 
    "<p align=\"center\">";
    echo 
    "<a href=\"index.php?action=stats&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>";
    echo 
    "Statistics</a>
    "
    ;
      echo 
    "<a href=\"index.php?action=main&amp;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_page10;
        
    $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&amp;who=$item[3]&amp;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&amp;page=$ppage&amp;sid=$sid\">«Prev</a> ";
        }
        if(
    $page<$num_pages)
        {
          
    $npage $page+1;
          echo 
    "<a href=\"index.php?action=acthour&amp;page=$npage&amp;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&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>";
    echo 
    "Statistics</a>
    "
    ;
      echo 
    "<a href=\"index.php?action=main&amp;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_page7;
        
    $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&amp;who=$item[3]&amp;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&amp;page=$ppage&amp;sid=$sid\">«Prev</a> ";
        }
        if(
    $page<$num_pages)
        {
          
    $npage $page+1;
          echo 
    "<a href=\"index.php?action=actmem&amp;page=$npage&amp;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&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>";
    echo 
    "Statistics</a>
    "
    ;
      echo 
    "<a href=\"index.php?action=main&amp;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_page10;
        
    $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&amp;who=$item[3]&amp;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&amp;page=$ppage&amp;sid=$sid\">«Prev</a> ";
        }
        if(
    $page<$num_pages)
        {
          
    $npage $page+1;
          echo 
    "<a href=\"index.php?action=actmemwk&amp;page=$npage&amp;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&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>";
    echo 
    "Statistics</a>
    "
    ;
      echo 
    "<a href=\"index.php?action=main&amp;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_page10;
        
    $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&amp;who=$item[3]&amp;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&amp;page=$ppage&amp;sid=$sid\">«Prev</a> ";
        }
        if(
    $page<$num_pages)
        {
          
    $npage $page+1;
          echo 
    "<a href=\"index.php?action=actmonth&amp;page=$npage&amp;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&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>";
    echo 
    "Statistics</a>
    "
    ;
      echo 
    "<a href=\"index.php?action=main&amp;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_page10;
        
    $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&amp;who=$item[3]&amp;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&amp;page=$ppage&amp;sid=$sid\">«Prev</a> ";
        }
        if(
    $page<$num_pages)
        {
          
    $npage $page+1;
          echo 
    "<a href=\"index.php?action=active3&amp;page=$npage&amp;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&amp;sid=$sid\"><img src=\"http://coding-talk.com/images/stat.gif\" alt=\"*\"/>";
    echo 
    "Statistics</a>
    "
    ;
      echo 
    "<a href=\"index.php?action=main&amp;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&amp;sid=$sid\">Active Members</a>
    "


    WapCHAT Forum Currenltly changing over to xhtml

    My Dowloads Site

    #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...
    _______
    Info & Tips
    php.net
    w3schools.com

    Comment


      #3
      ok.

      WapCHAT Forum Currenltly changing over to xhtml

      My Dowloads Site

      Comment


        #4
        <div class='quotetop'>QUOTE (Dj-marc @ Mar 8 2009, 01:30 AM) <{POST_SNAPBACK}></div>
        ok.[/b]
        Nice Share Thanks

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

        Thanks

        Comment


          #5
          Use the search button on the top right corner of this page.

          WapCHAT Forum Currenltly changing over to xhtml

          My Dowloads Site

          Comment

          Working...
          X