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 !
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 !
I got help from Boo***'s AntonLV:
But it suspends all profiles which where not logged in for the last 2 days!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']}'");
Can i use the GetMemberMembershipInfo function to just suspend the standard membership? Or is there a better way ?
It could look like:
Thanks for your ideas !PHP Code:$memlev = getMemberMembershipInfo( $member['ID'] );
if ( $memlev['ID'] != MEMBERSHIP_ID_STANDARD )
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']}'");
}
Where did you install this code ?
Thanks!!!
Ashley
I put this code in my periodic/notifies.php underI 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 sitePHP Code:set_time_limit( 36000 );
ignore_user_abort();
![]()
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks