+ Reply to Thread (include dating software, release, and patch number!)
Results 1 to 5 of 5

Thread: Automatically suspend old profiles ?

  1. #1
    Kleetus
    Guest

    Default Automatically suspend old profiles ?

    Hi all,

    i'm interested in a way to automatically suspend or reject profiles which were not logged in for the last x days. Perhaps with a cronjob which checks it every day ?

    Would something like this be possible ?
    Thanks !

  2. #2
    Kleetus
    Guest

    Default

    I got help from Boo***'s AntonLV:

    PHP Code:
    $res db_res("SELECT `ID` FROM `Profiles` WHERE TO_DAYS(NOW()) - TO_DAYS(`LastLoggedIn`) >= 2");
    while(
    $arr mysql_fetch_assoc($res)) db_res("UPDATE `Profiles` SET `Status` = 'Suspended' WHERE `ID` = '{$arr['ID']}'"); 
    But it suspends all profiles which where not logged in for the last 2 days!

    Can i use the GetMemberMembershipInfo function to just suspend the standard membership? Or is there a better way ?

    It could look like:
    PHP Code:
    $memlev getMemberMembershipInfo$member['ID'] );
    if ( 
    $memlev['ID'] != MEMBERSHIP_ID_STANDARD 
    Thanks for your ideas !

  3. #3
    Kleetus
    Guest

    Default

    Ok, this is how it works :

    PHP Code:
    $res db_res("SELECT `ID` FROM `Profiles` WHERE `Status` = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(`LastLoggedIn`)) >= 7");
    while(
    $arr mysql_fetch_assoc($res))
    {
        
    $memlev_standard getMemberMembershipInfo$arr['ID'] );
        if ( 
    $memlev_standard['ID'] == MEMBERSHIP_ID_STANDARD )
        
    db_res("UPDATE `Profiles` SET `Status` = 'Suspended' WHERE `ID` = '{$arr['ID']}'");


  4. #4
    mwep
    Guest

    Default

    Where did you install this code ?

    Thanks!!!

    Ashley

  5. #5
    Kleetus
    Guest

    Default

    I put this code in my periodic/notifies.php under
    PHP Code:
    set_time_limit36000 );
    ignore_user_abort(); 
    I set up a cronjob every 5 minutes, so my "old" standard profiles are checked every 5 minutes. I did that because i don't want "standards" to be shown on my site

+ Reply to Thread (include dating software, release, and patch number!)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Replies: 17
    Last Post: 09-11-2009, 04:24 PM
  2. How to remove the "Suspend Account" Link
    By Troy in forum Dolphin General Discussion v6.00 and above
    Replies: 7
    Last Post: 01-06-2008, 09:51 AM
  3. Membership levels not automatically upgrading
    By DiabloD in forum Dolphin General Discussion v5.3 to v5.6.5
    Replies: 13
    Last Post: 05-22-2007, 05:14 PM
  4. Replies: 2
    Last Post: 04-29-2007, 12:27 PM
  5. remove suspend account
    By stevie in forum General Issues, Comments, Questions
    Replies: 1
    Last Post: 07-04-2005, 04:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts