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


PHP Admin_DA::deleteAdZones方法代码示例

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


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

示例1: unlinkBanner

 /**
  * A method to unlink a banner from a zone
  *
  * @param int $zoneId
  * @param int $bannerId
  * @return bool
  */
 function unlinkBanner($zoneId, $bannerId)
 {
     if ($this->checkIdExistence('zones', $zoneId) && $this->checkIdExistence('banners', $bannerId)) {
         $doZones = OA_Dal::staticGetDO('zones', $zoneId);
         if (!$this->checkPermissions(null, 'affiliates', $doZones->affiliateid, OA_PERM_ZONE_LINK)) {
             return false;
         }
         // $result will be true on success, false on failure and 0 on no rows affected.
         $result = Admin_DA::deleteAdZones(array('zone_id' => $zoneId, 'ad_id' => $bannerId));
         if ($result === 0) {
             $this->raiseError('Unknown link for zoneId and bannerId Error');
             return false;
         } else {
             return $result;
         }
     }
 }
开发者ID:Jaree,项目名称:revive-adserver,代码行数:24,代码来源:Zone.php

示例2: testdeleteAdZones

 function testdeleteAdZones()
 {
     $this->_generateStats();
     $ret = Admin_DA::addAdZone(array('zone_id' => $this->zoneId, 'ad_id' => $this->bannerId));
     $this->assertTrue(is_int($ret));
     $this->assertTrue($ret > 0);
     Admin_DA::deleteAdZones(array('zone_id' => $this->zoneId, 'ad_id' => $this->adId));
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:8,代码来源:AdminDA.dal.test.php

示例3: processForm

/**
 * Processes submit values of zone form
 *
 * @param OA_Admin_UI_Component_Form $form form to process
 * @return An array of Pear::Error objects if any
 */
function processForm($form)
{
    $aFields = $form->exportValues();
    switch ($aFields['delivery']) {
        case phpAds_ZoneText:
            $aFields['width'] = $aFields['height'] = 0;
            break;
        case OX_ZoneVideoOverlay:
            $aFields['width'] = $aFields['height'] = -2;
            break;
        case OX_ZoneVideoInstream:
            $aFields['width'] = $aFields['height'] = -3;
            break;
        default:
            if ($aFields['sizetype'] == 'custom') {
                if (isset($aFields['width']) && $aFields['width'] == '*') {
                    $aFields['width'] = -1;
                }
                if (isset($aFields['height']) && $aFields['height'] == '*') {
                    $aFields['height'] = -1;
                }
            } else {
                list($aFields['width'], $aFields['height']) = explode('x', $aFields['size']);
            }
            break;
    }
    if (!is_numeric($aFields['oac_category_id']) || $aFields['oac_category_id'] <= 0) {
        $aFields['oac_category_id'] = 'NULL';
    }
    if (empty($errors)) {
        // Edit
        if (!empty($aFields['zoneid'])) {
            // before we commit any changes to db, store whether the size has changed
            $aZone = Admin_DA::getZone($aFields['zoneid']);
            $size_changed = $aFields['width'] != $aZone['width'] || $aFields['height'] != $aZone['height'] ? true : false;
            $type_changed = $aFields['delivery'] != $aZone['delivery'] ? true : false;
            $doZones = OA_Dal::factoryDO('zones');
            $doZones->zonename = $aFields['zonename'];
            $doZones->description = $aFields['description'];
            $doZones->width = $aFields['width'];
            $doZones->height = $aFields['height'];
            $doZones->comments = $aFields['comments'];
            $doZones->delivery = $aFields['delivery'];
            if ($aFields['delivery'] != phpAds_ZoneText && $aFields['delivery'] != phpAds_ZoneBanner) {
                $doZones->append = '';
            }
            if ($aFields['delivery'] != phpAds_ZoneText) {
                $doZones->prepend = '';
            }
            $doZones->oac_category_id = $aFields['oac_category_id'];
            $doZones->zoneid = $aFields['zoneid'];
            $doZones->update();
            // Ad  Networks
            $doPublisher = OA_Dal::factoryDO('affiliates');
            $doPublisher->get($aFields['affiliateid']);
            $anWebsiteId = $doPublisher->as_website_id;
            if ($anWebsiteId) {
                $oAdNetworks = new OA_Central_AdNetworks();
                $doZones->get($aFields['zoneid']);
                $oAdNetworks->updateZone($doZones, $anWebsiteId);
            }
            // Reset append codes which called this zone
            $doZones = OA_Dal::factoryDO('zones');
            $doZones->appendtype = phpAds_ZoneAppendZone;
            if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
                $doZones->addReferenceFilter('agency', OA_Permission::getEntityId());
            } elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
                $doZones->addReferenceFilter('affiliates', OA_Permission::getEntityId());
            }
            $doZones->find();
            while ($doZones->fetch() && ($row = $doZones->toArray())) {
                $append = phpAds_ZoneParseAppendCode($row['append']);
                if ($append[0]['zoneid'] == $aFields['zoneid']) {
                    $doZonesClone = clone $doZones;
                    $doZonesClone->appendtype = phpAds_ZoneAppendRaw;
                    $doZonesClone->append = '';
                    $doZonesClone->update();
                }
            }
            if ($type_changed && $aFields['delivery'] == MAX_ZoneEmail) {
                // Unlink all campaigns/banners linked to this zone
                $aPlacementZones = Admin_DA::getPlacementZones(array('zone_id' => $aFields['zoneid']), true, 'placement_id');
                if (!empty($aPlacementZones)) {
                    foreach ($aPlacementZones as $placementId => $aPlacementZone) {
                        Admin_DA::deletePlacementZones(array('zone_id' => $aFields['zoneid'], 'placement_id' => $placementId));
                    }
                }
                $aAdZones = Admin_DA::getAdZones(array('zone_id' => $aFields['zoneid']), false, 'ad_id');
                if (!empty($aAdZones)) {
                    foreach ($aAdZones as $adId => $aAdZone) {
                        Admin_DA::deleteAdZones(array('zone_id' => $aFields['zoneid'], 'ad_id' => $adId));
                    }
                }
            } else {
//.........这里部分代码省略.........
开发者ID:villos,项目名称:tree_admin,代码行数:101,代码来源:zone-edit.php

示例4: MAX_adjustZoneAds

function MAX_adjustZoneAds($zoneId)
{
    $aAdZones = Admin_DA::getAdZones(array('zone_id' => $zoneId), true, 'ad_id');
    if (!empty($aAdZones)) {
        $aZone = Admin_DA::getZone($zoneId);
        $aAds = Admin_DA::getAds(array('ad_id' => implode(',', array_keys($aAdZones))));
        foreach ($aAds as $adId => $aAd) {
            if (!MAX_checkAdZoneValid($aZone, $aAd)) {
                Admin_DA::deleteAdZones(array('zone_id' => $zoneId, 'ad_id' => $adId));
            }
        }
    }
}
开发者ID:villos,项目名称:tree_admin,代码行数:13,代码来源:common.php

示例5: foreach

     case 'ad':
         $aPrevious = Admin_DA::getAdZones(array('zone_id' => $zoneId));
         $key = 'ad_id';
         break;
 }
 // First, remove any placements/adverts that should be deleted.
 if (!empty($aPrevious)) {
     foreach ($aPrevious as $aZoneAssoc) {
         $id = $aZoneAssoc[$key];
         if (empty($aCurrent[$id])) {
             // The user has removed this zone link
             $aParameters = array('zone_id' => $zoneId, $key => $id);
             if ($view == 'placement') {
                 Admin_DA::deletePlacementZones($aParameters);
             } else {
                 Admin_DA::deleteAdZones($aParameters);
             }
         } else {
             // Remove this key, because it is already there and does not need to be added again.
             unset($aCurrent[$id]);
         }
     }
 }
 $addResult = true;
 if (!empty($aCurrent)) {
     foreach ($aCurrent as $id => $value) {
         $aVariables = array('zone_id' => $zoneId, $key => $id);
         if ($view == 'placement') {
             $addResult = Admin_DA::addPlacementZone($aVariables);
         } else {
             $addResult = Admin_DA::addAdZone($aVariables);
开发者ID:villos,项目名称:tree_admin,代码行数:31,代码来源:zone-include.php


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