当前位置: 首页>>代码示例>>PHP>>正文


PHP BxDolCmts::onAuthorDelete方法代码示例

本文整理汇总了PHP中BxDolCmts::onAuthorDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP BxDolCmts::onAuthorDelete方法的具体用法?PHP BxDolCmts::onAuthorDelete怎么用?PHP BxDolCmts::onAuthorDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BxDolCmts的用法示例。


在下文中一共展示了BxDolCmts::onAuthorDelete方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: profile_delete

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);
}
开发者ID:newton27,项目名称:dolphin.pro,代码行数:61,代码来源:admin.inc.php

示例2: delete

 /**
  * Delete profile.
  * @param $ID - optional profile id to delete
  * @param $bForceDelete - force deletetion is case of account profile deletion
  * @return false on error, or true on success
  */
 function delete($ID = false, $bForceDelete = false)
 {
     $ID = (int) $ID;
     if (!$ID) {
         $ID = $this->_iProfileID;
     }
     $aProfileInfo = $this->_oQuery->getInfoById($ID);
     if (!$aProfileInfo) {
         return false;
     }
     // delete system profiles (accounts) is not allowed, instead - delete whole account
     if (!$bForceDelete && 'system' == $aProfileInfo['type']) {
         return false;
     }
     // switch profile context if deleted profile is active profile context
     bx_import('BxDolAccount');
     $oAccount = BxDolAccount::getInstance($aProfileInfo['account_id']);
     $aAccountInfo = $oAccount->getInfo();
     if (!$bForceDelete && $ID == $aAccountInfo['profile_id']) {
         $oProfileAccount = BxDolProfile::getInstanceAccountProfile($aProfileInfo['account_id']);
         $oAccount->updateProfileContext($oProfileAccount->id());
     }
     // create system event before deletion
     $isStopDeletion = false;
     bx_alert('profile', 'before_delete', $ID, 0, array('stop_deletion' => &$isStopDeletion));
     if ($isStopDeletion) {
         return false;
     }
     // delete associated comments
     bx_import('BxDolCmts');
     BxDolCmts::onAuthorDelete($ID);
     // delete connections
     bx_import('BxDolConnection');
     $oConn = BxDolConnection::getObjectInstance('sys_profiles_friends');
     $oConn->onDeleteInitiatorAndContent($ID);
     $oConn = BxDolConnection::getObjectInstance('sys_profiles_subscriptions');
     $oConn->onDeleteInitiatorAndContent($ID);
     // delete profile's acl levels
     bx_import('BxDolAcl');
     BxDolAcl::getInstance()->onProfileDelete($ID);
     // delete profile
     if (!$this->_oQuery->delete($ID)) {
         return false;
     }
     // create system event
     bx_alert('profile', 'delete', $ID);
     // unset class instance to prevent creating the instance again
     $this->_iProfileID = 0;
     $sClass = get_class($this) . '_' . $ID;
     unset($GLOBALS['bxDolClasses'][$sClass]);
     return true;
 }
开发者ID:blas-dmx,项目名称:trident,代码行数:58,代码来源:BxDolProfile.php

示例3: profile_delete

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);
}
开发者ID:Arvindvi,项目名称:dolphin,代码行数:50,代码来源:admin.inc.php

示例4: profile_delete

function profile_delete($ID)
{
    global $MySQL;
    global $dir;
    global $site;
    global $logged;
    $ID = (int) $ID;
    if (!$ID) {
        return false;
    }
    if (!getProfileInfo($ID)) {
        return false;
    }
    modules_del($ID);
    db_res("DELETE FROM `VKisses` WHERE `ID` = '{$ID}' OR `Member` = '{$ID}'");
    db_res("DELETE FROM `Profiles` WHERE `ID` = '{$ID}'");
    if (!mysql_affected_rows()) {
        return false;
    }
    db_res("DELETE FROM `BlockList` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}';");
    db_res("DELETE FROM `ProfilesTrack` WHERE `Member` = '{$ID}' OR `Profile` = '{$ID}'");
    db_res("DELETE FROM `Messages` WHERE Recipient = {$ID} ");
    db_res("DELETE FROM `Guestbook` WHERE Recipient = {$ID} ");
    db_res("DELETE FROM `aff_members` WHERE idProfile = {$ID}");
    db_res("DELETE FROM `HotList` WHERE ID = {$ID} OR Profile = {$ID}");
    db_res("DELETE FROM `FriendList` WHERE ID = {$ID} OR Profile = {$ID}");
    db_res("DELETE FROM `BlockList` WHERE ID = {$ID} OR Profile = {$ID}");
    db_res("DELETE FROM `BoughtContacts` WHERE `IDBuyer` = {$ID} OR `IDContact` = {$ID}");
    db_res("DELETE FROM `ProfileMemLevels` WHERE `IDMember` = {$ID}");
    db_res("DELETE FROM `ProfilesComments` WHERE `Sender` = {$ID} OR `Recipient` = {$ID}");
    db_res("DELETE FROM `ProfilesPolls` WHERE `id_profile` = {$ID}");
    db_res("DELETE FROM `Tags` WHERE `ID` = {$ID} AND `Type` = 'profile'");
    db_res("DELETE FROM `GroupsMembers` WHERE `memberID` = {$ID}");
    // 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);
    // Clean gallery
    $albumsRes = db_res("SELECT `ID` FROM `GalleryAlbums` WHERE `IDMember` = {$ID}");
    while ($albumArr = mysql_fetch_assoc($albumsRes)) {
        $albumID = $albumArr['ID'];
        $objectsRes = db_res("SELECT `Filename`, `ThumbFilename` FROM `GalleryObjects` WHERE `IDAlbum` = {$albumID}");
        while ($objectArr = mysql_fetch_assoc($objectsRes)) {
            @unlink("{$dir['gallery']}{$objectArr['Filename']}");
            if (strlen($objectArr['ThumbFilename']) && file_exists("{$dir['gallery']}{$objectArr['ThumbFilename']}")) {
                @unlink("{$dir['gallery']}{$objectArr['ThumbFilename']}");
            }
        }
        db_res("DELETE FROM `GalleryObjects` WHERE `IDAlbum` = {$albumID}");
    }
    db_res("DELETE FROM `GalleryAlbums` WHERE `IDMember` = {$ID}");
    // Clean customizations
    $customArr = db_arr("SELECT `BackgroundFilename` FROM `ProfilesSettings` WHERE `IDMember` = {$ID}");
    if (strlen($customArr['BackgroundFilename']) && file_exists($dir['profileImage'] . $customArr['BackgroundFilename']) && is_file($dir['profileImage'] . $customArr['BackgroundFilename'])) {
        unlink($dir['profileImage'] . $customArr['BackgroundFilename']);
    }
    db_res("DELETE FROM `ProfilesSettings` WHERE `IDMember` = {$ID}");
    // delete media
    $rMedia = db_res("SELECT `med_id`, `med_file`, `med_type` FROM `media` WHERE `med_prof_id` = {$ID}");
    $oVotingMedia = new BxDolVoting('media', 0, 0);
    while ($aMedia = mysql_fetch_assoc($rMedia)) {
        switch ($aMedia['med_type']) {
            case 'photo':
                $medDir = $dir['profileImage'] . $ID . "/";
                @unlink($medDir . 'icon_' . $aMedia['med_file']);
                @unlink($medDir . 'photo_' . $aMedia['med_file']);
                @unlink($medDir . 'thumb_' . $aMedia['med_file']);
                break;
            case 'audio':
                $medDir = $dir['profileSound'] . $ID . "/";
                @unlink($medDir . $aMedia['med_file']);
                break;
            case 'video':
                $medDir = $dir['profileVideo'] . $ID . "/";
                @unlink($medDir . $aMedia['med_file']);
                break;
        }
        // delete media voting
        $oVotingMedia->deleteVotings($aMedia['med_id']);
    }
    $aMem = array();
    $aMedia = array('photo', 'music', 'video');
    foreach ($aMedia as $sVal) {
        $oMedia = new BxDolSharedMedia($sVal, $site, $dir, $aMem);
        $oMedia->deleteUserGallery($ID, $logged);
    }
    db_res("DELETE FROM `media` WHERE `med_prof_id` = {$ID}");
    @rmdir($dir['profileImage'] . $ID);
    @rmdir($dir['profileVideo'] . $ID);
    @rmdir($dir['profileSound'] . $ID);
    //Clean blogs
    $aBlog = db_arr("SELECT `ID` FROM `Blogs` WHERE `OwnerID` = {$ID}");
    $iBlogID = $aBlog['ID'];
    if ($iBlogID > 0) {
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:101,代码来源:admin.inc.php

示例5: profile_delete

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);
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:45,代码来源:admin.inc.php


注:本文中的BxDolCmts::onAuthorDelete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。