本文整理汇总了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;
}
}
}
示例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));
}
示例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 {
//.........这里部分代码省略.........
示例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));
}
}
}
}
示例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);