示例#1
0
function profile_delete($ID)
{
    //global $MySQL;
    global $dir;
    //recompile global profiles cache
    $GLOBALS['MySQL']->cleanCache('sys_browse_people');
    $ID = (int) $ID;
    if (!$ID) {
        return false;
    }
    if (!($aProfileInfo = getProfileInfo($ID))) {
        return false;
    }
    $iLoggedInId = getLoggedId();
    db_res("DELETE FROM `sys_admin_ban_list` WHERE `ProfID`='" . $ID . "' LIMIT 1");
    db_res("DELETE FROM `sys_greetings` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}'");
    db_res("DELETE FROM `sys_block_list` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}'");
    db_res("DELETE FROM `sys_messages` WHERE Recipient = {$ID} OR `Sender` = {$ID}");
    db_res("DELETE FROM `sys_fave_list` WHERE ID = {$ID} OR Profile = {$ID}");
    db_res("DELETE FROM `sys_friend_list` WHERE ID = {$ID} OR Profile = {$ID}");
    db_res("DELETE FROM `sys_acl_levels_members` WHERE `IDMember` = {$ID}");
    db_res("DELETE FROM `sys_tags` WHERE `ObjID` = {$ID} AND `Type` = 'profile'");
    db_res("DELETE FROM `sys_sbs_entries` WHERE `subscriber_id` = {$ID} AND `subscriber_type` = '1'");
    // delete profile votings
    require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolVoting.php';
    $oVotingProfile = new BxDolVoting('profile', 0, 0);
    $oVotingProfile->deleteVotings($ID);
    // delete profile comments
    require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolCmts.php';
    $oCmts = new BxDolCmts('profile', $ID);
    $oCmts->onObjectDelete();
    // delete all comments in all comments' systems, this user posted
    $oCmts->onAuthorDelete($ID);
    $iPossibleCoupleID = (int) db_value("SELECT `ID` FROM `Profiles` WHERE `Couple` = '{$ID}'");
    if ($iPossibleCoupleID) {
        db_res("DELETE FROM `Profiles` WHERE `ID` = '{$iPossibleCoupleID}'");
        //delete cache file
        deleteUserDataFile($iPossibleCoupleID);
    }
    // delete associated locations
    if (BxDolModule::getInstance('BxWmapModule')) {
        BxDolService::call('wmap', 'response_entry_delete', array('profiles', $ID));
    }
    db_res("DELETE FROM `Profiles` WHERE `ID` = '{$ID}'");
    // create system event
    $oZ = new BxDolAlerts('profile', 'delete', $ID, 0, array('profile_info' => $aProfileInfo, 'logged_in' => $iLoggedInId));
    $oZ->alert();
    //delete cache file
    deleteUserDataFile($ID);
}
示例#2
0
function profile_delete($ID, $isDeleteSpammer = false)
{
    //global $MySQL;
    global $dir;
    //recompile global profiles cache
    $GLOBALS['MySQL']->cleanCache('sys_browse_people');
    $ID = (int) $ID;
    if (!$ID) {
        return false;
    }
    if (!($aProfileInfo = getProfileInfo($ID))) {
        return false;
    }
    $iLoggedInId = getLoggedId();
    db_res("DELETE FROM `sys_admin_ban_list` WHERE `ProfID`='" . $ID . "' LIMIT 1");
    db_res("DELETE FROM `sys_greetings` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}'");
    db_res("DELETE FROM `sys_block_list` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}'");
    db_res("DELETE FROM `sys_messages` WHERE Recipient = {$ID} OR `Sender` = {$ID}");
    db_res("DELETE FROM `sys_fave_list` WHERE ID = {$ID} OR Profile = {$ID}");
    db_res("DELETE FROM `sys_friend_list` WHERE ID = {$ID} OR Profile = {$ID}");
    db_res("DELETE FROM `sys_acl_levels_members` WHERE `IDMember` = {$ID}");
    db_res("DELETE FROM `sys_tags` WHERE `ObjID` = {$ID} AND `Type` = 'profile'");
    db_res("DELETE FROM `sys_sbs_entries` WHERE `subscriber_id` = {$ID} AND `subscriber_type` = '1'");
    // delete profile votings
    require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolVoting.php';
    $oVotingProfile = new BxDolVoting('profile', 0, 0);
    $oVotingProfile->deleteVotings($ID);
    // delete profile comments
    require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolCmts.php';
    $oCmts = new BxDolCmts('profile', $ID);
    $oCmts->onObjectDelete();
    // delete all comments in all comments' systems, this user posted
    $oCmts->onAuthorDelete($ID);
    $iPossibleCoupleID = (int) db_value("SELECT `ID` FROM `Profiles` WHERE `Couple` = '{$ID}'");
    if ($iPossibleCoupleID) {
        db_res("DELETE FROM `Profiles` WHERE `ID` = '{$iPossibleCoupleID}'");
        //delete cache file
        deleteUserDataFile($iPossibleCoupleID);
    }
    // delete associated locations
    if (BxDolModule::getInstance('BxWmapModule')) {
        BxDolService::call('wmap', 'response_entry_delete', array('profiles', $ID));
    }
    //delete all subscriptions
    $oSubscription = BxDolSubscription::getInstance();
    $oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => 'profile', 'object_id' => $ID));
    db_res("DELETE FROM `Profiles` WHERE `ID` = '{$ID}'");
    if ($isDeleteSpammer) {
        bx_import('BxDolStopForumSpam');
        $oBxDolStopForumSpam = new BxDolStopForumSpam();
        $oBxDolStopForumSpam->submitSpammer(array('username' => $aProfileInfo['NickName'], 'email' => $aProfileInfo['Email'], 'ip' => bx_member_ip_get_last($ID)));
    }
    // delete moxiemanager files
    $sMoxieFilesPath = BX_DIRECTORY_PATH_ROOT . 'media/moxie/files/' . substr($aProfileInfo['NickName'], 0, 1) . '/' . substr($aProfileInfo['NickName'], 0, 2) . '/' . substr($aProfileInfo['NickName'], 0, 3) . '/' . $aProfileInfo['NickName'];
    bx_rrmdir($sMoxieFilesPath);
    // create system event
    $oZ = new BxDolAlerts('profile', 'delete', $ID, 0, array('profile_info' => $aProfileInfo, 'logged_in' => $iLoggedInId, 'delete_spammer' => $isDeleteSpammer));
    $oZ->alert();
    //delete cache file
    deleteUserDataFile($ID);
}
示例#3
0
function profile_delete($ID)
{
    //global $MySQL;
    global $dir;
    //recompile global profiles cache
    $GLOBALS['MySQL']->cleanCache('sys_browse_people');
    $ID = (int) $ID;
    if (!$ID) {
        return false;
    }
    if (!getProfileInfo($ID)) {
        return false;
    }
    db_res("DELETE FROM `sys_admin_ban_list` WHERE `ProfID`='" . $ID . "' LIMIT 1");
    db_res("DELETE FROM `sys_greetings` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}'");
    db_res("DELETE FROM `sys_block_list` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}'");
    db_res("DELETE FROM `sys_messages` WHERE Recipient = {$ID} ");
    db_res("DELETE FROM `sys_fave_list` WHERE ID = {$ID} OR Profile = {$ID}");
    db_res("DELETE FROM `sys_friend_list` WHERE ID = {$ID} OR Profile = {$ID}");
    db_res("DELETE FROM `sys_acl_levels_members` WHERE `IDMember` = {$ID}");
    db_res("DELETE FROM `sys_tags` WHERE `ObjID` = {$ID} AND `Type` = 'profile'");
    // delete profile votings
    require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolVoting.php';
    $oVotingProfile = new BxDolVoting('profile', 0, 0);
    $oVotingProfile->deleteVotings($ID);
    // delete profile comments
    require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolCmts.php';
    $oCmts = new BxDolCmts('profile', $ID);
    $oCmts->onObjectDelete();
    // delete all comments in all comments' systems, this user posted
    $oCmts->onAuthorDelete($ID);
    $iPossibleCoupleID = (int) db_value("SELECT `ID` FROM `Profiles` WHERE `Couple` = '{$ID}'");
    if ($iPossibleCoupleID) {
        db_res("DELETE FROM `Profiles` WHERE `ID` = '{$iPossibleCoupleID}'");
        //delete cache file
        deleteUserDataFile($iPossibleCoupleID);
    }
    db_res("DELETE FROM `Profiles` WHERE `ID` = '{$ID}'");
    // create system event
    require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php';
    $oZ = new BxDolAlerts('profile', 'delete', $ID);
    $oZ->alert();
    //delete cache file
    deleteUserDataFile($ID);
}