idle user delete

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

    idle user delete

    How to delete idle user more than 6 months?

    whats code for that?

    Thanks

    #2
    hey i have the lavalair version if this helps.........



    Code:
    This is the link to idle members
    
      echo "<a href=\"ownercp.php?action=idlemembers&amp;sid=$sid\">Idle Members List</a><br/>";
      
      
      This is the code in ownercp 
      
      //////////////////////////////////////// idle members
    
    else if($action=="idlemembers")
    {
      echo "<head>";
      echo "<title>Owner Tools</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
      echo "</head>";
      echo "<b>Idle Members</b><br/>";
    
        $timeout2 = 1209600;
      $timeon2 = time()-$timeout2;
            $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$timeon2."'"));
      echo "Current Number of Idle Members:".$noi[0]."<br/><br/>";
      $tdte = date("d m y-H:i:s", $timeon2);
      echo "Idle Date: $tdte,<br/>Only Members Who have NOT been online after this date are displayed below<br/><br/>";
      $nolq = mysql_query("SELECT * FROM ibwf_users WHERE lastact<'".$timeon2."'");
    
      while ($row=mysql_fetch_array($nolq))
      {
        echo "Username: <a href=\"index.php?action=viewuser&amp;who=$row[id]&amp;sid=$sid\">$row[name]</a>";
        echo "<br/>";
        $jdt = date("d m y-H:i:s",$row[lastact]);
        echo "Last Online: $jdt <br/><br/>";
      }
      echo "<br/><b>9 </b><a accesskey=\"9\" href=\"ownercp.php?action=admincp&amp;sid=$sid\"><img src=\"../images/admn.gif\" alt=\"\"/>Admin Tools</a><br/>";
      echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo "</p>";
      echo "</body>";
    }
    
    This is the sql just insert into your ibwf_users
    
      `lastact` int(100) NOT NULL DEFAULT '0',
      
      
      hope this helps you

    Comment


      #3
      would you believe i posted the wrong one lol i have this here somewhere sorry will go look for it if any1 else got it please post sorry about that lol

      Comment


        #4
        // convert seconds into month
        $b = $time_wait; // time to wait - default 3 month - after last visit - 3 month in seconds
        $c = $time_month; // time - default 1 month - seconds for 1 month - 1 month in seconds
        $a = $b/$c; // difference total seconds / seconds for 1 month => number of month

        $e = $time_delete_final/$time_month;
        // start delete users with no visits in 4 month - default

        $dulv = "SELECT username, last_visit FROM users WHERE `presence` < ".$now." - '$time_delete_final' ORDER BY `presence` DESC";
        $result = mysql_query($dulv);

        or proceed to delete....
        remember this is a little example.
        http://ngeo.ro

        Comment


          #5
          u can modify this



          Code:
           <?php
            }
          }else if($a=="w")
          {
            if(check_log())
            {
              $page = $_GET["p"];
              if($page==""||$page==0)$page=1;
              $time_limit = 3*7*24*60*60;
              $inactive_time = time()-$time_limit;
              $items_per_page = 50;
              $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact<'".$inactive_time."' AND chmsgs='0' AND posts='0'"));
              $pages = ceil($noi[0]/$items_per_page);
              $limit_start = ($page-1)*$items_per_page;
              $sql = "SELECT id, name FROM ibwf_users WHERE lastact<'".$inactive_time."' AND chmsgs='0' AND posts='0' LIMIT $limit_start, $items_per_page";
            ?>

          it shows inactive users
          Last edited by wapmetal; 05.11.09, 12:55.
          com site: http://vampist.net
          download site: http://wapdloads.net
          fb: http://www.facebook.com/pmplx

          Comment


            #6
            Thank u very much friends

            Comment

            Working...
            X