本文整理汇总了PHP中Admin_DA::getPlacementZones方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin_DA::getPlacementZones方法的具体用法?PHP Admin_DA::getPlacementZones怎么用?PHP Admin_DA::getPlacementZones使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin_DA
的用法示例。
在下文中一共展示了Admin_DA::getPlacementZones方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testPlacementZones
function testPlacementZones()
{
TestEnv::startTransaction();
$ret = Admin_DA::addPlacementZone(array('zone_id' => rand(1, 999), 'placement_id' => rand(1, 999)));
$this->assertTrue(is_int($ret));
$this->assertTrue($ret > 0);
$retVar = Admin_DA::getPlacementZones(array('placement_zone_assoc_id' => $ret));
$this->assertTrue(is_array($retVar[$ret]));
TestEnv::rollbackTransaction();
}
示例2: linkCampaign
/**
* A method to link a campaign to a zone
*
* @param int $zoneId
* @param int $campaignId
* @return bool
*/
function linkCampaign($zoneId, $campaignId)
{
if ($this->checkIdExistence('zones', $zoneId)) {
$doZones = OA_Dal::staticGetDO('zones', $zoneId);
if (!$this->checkPermissions(null, 'affiliates', $doZones->affiliateid, OA_PERM_ZONE_LINK)) {
return false;
}
if ($this->checkIdExistence('campaigns', $campaignId)) {
$aLinkedPlacements = Admin_DA::getPlacementZones(array('zone_id' => $zoneId), false, 'placement_id');
if (!isset($aLinkedPlacements[$campaignId])) {
$result = Admin_DA::addPlacementZone(array('zone_id' => $zoneId, 'placement_id' => $campaignId));
if (PEAR::isError($result)) {
$this->raiseError($result->getMessage());
return false;
}
MAX_addLinkedAdsToZone($zoneId, $campaignId);
return true;
} else {
// Already linked
return true;
}
}
}
return false;
}
示例3: MAX_duplicatePlacementZones
function MAX_duplicatePlacementZones($fromPlacementId, $toPlacementId)
{
$pAdZones = Admin_DA::getPlacementZones(array('placement_id' => $fromPlacementId), true, 'zone_id');
if (!empty($pAdZones)) {
foreach ($pAdZones as $zoneId => $placementId) {
Admin_DA::addPlacementZone(array('placement_id' => $toPlacementId, 'zone_id' => $zoneId), false);
}
}
}
示例4: 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 {
//.........这里部分代码省略.........
示例5: _hasTrackers
/**
* A private method to test to see if the current user has any trackers.
*
* @access private
* @return boolean True if the current user has trackers, false otherwise.
*/
function _hasTrackers()
{
if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
$aParams = array('advertiser_id' => OA_Permission::getEntityId());
$aTrackers = Admin_DA::getTrackers($aParams);
} elseif (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$aParams = array('agency_id' => OA_Permission::getEntityId());
$aTrackers = Admin_DA::getTrackers($aParams);
} elseif (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
$aTrackers = Admin_DA::getTrackers(array());
} elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
$aTrackers = array();
$aParams = array('publisher_id' => OA_Permission::getEntityId());
$aPlacementZones = Admin_DA::getPlacementZones($aParams, false, 'placement_id');
if (!empty($aPlacementZones)) {
$aParams = array('placement_id' => implode(',', array_keys($aPlacementZones)));
$aTrackers = array_merge($aTrackers, Admin_DA::getTrackers($aParams));
}
$aAdZones = Admin_DA::getAdZones($aParams, false, 'ad_id');
if (!empty($aAdZones)) {
$aParams = array('ad_id' => implode(',', array_keys($aAdZones)));
$aTrackers = array_merge($aTrackers, Admin_DA::getTrackers($aParams));
}
}
return !empty($aTrackers);
}
示例6: MAX_displayNavigationZone
$aOtherPublishers = Admin_DA::getPublishers(array('agency_id' => $agencyId));
$aOtherZones = Admin_DA::getZones(array('publisher_id' => $publisherId));
MAX_displayNavigationZone($pageName, $aOtherPublishers, $aOtherZones, $aEntities);
if (!empty($action) && PEAR::isError($result)) {
// Message
echo "<br>";
echo "<div class='errormessage'><img class='errormessage' src='" . OX::assetPath() . "/images/errormessage.gif' align='absmiddle'>";
echo "<span class='tab-r'>{$GLOBALS['strUnableToLinkBanner']}</span><br><br>{$GLOBALS['strErrorLinkingBanner']} <br />" . $result->message . "</div><br>";
}
MAX_displayPlacementAdSelectionViewForm($publisherId, $zoneId, $view, $pageName, $tabIndex, $aOtherZones);
$aParams = MAX_getLinkedAdParams($zoneId);
if ($view == 'placement') {
$aDirectLinkedAds = Admin_DA::getAdZones(array('zone_id' => $zoneId), true, 'ad_id');
$aOtherAdvertisers = Admin_DA::getAdvertisers($aParams + array('agency_id' => $agencyId), false);
$aOtherPlacements = !empty($advertiserId) ? Admin_DA::getPlacements($aParams + array('advertiser_id' => $advertiserId), false) : null;
$aZonesPlacements = Admin_DA::getPlacementZones(array('zone_id' => $zoneId), true, 'placement_id');
MAX_displayZoneEntitySelection('placement', $aOtherAdvertisers, $aOtherPlacements, null, $advertiserId, $placementId, $adId, $publisherId, $zoneId, $GLOBALS['strSelectCampaignToLink'], $pageName, $tabIndex);
if (!empty($aZonesPlacements)) {
$aParams = array('placement_id' => implode(',', array_keys($aZonesPlacements)));
$aParams += MAX_getLinkedAdParams($zoneId);
} else {
$aParams = null;
}
MAX_displayLinkedPlacementsAds($aParams, $publisherId, $zoneId, $hideInactive, $showMatchingAds, $pageName, $tabIndex, $aDirectLinkedAds);
} elseif ($view == 'ad') {
$aOtherAdvertisers = Admin_DA::getAdvertisers($aParams + array('agency_id' => $agencyId), false);
$aOtherPlacements = !empty($advertiserId) ? Admin_DA::getPlacements($aParams + array('advertiser_id' => $advertiserId), false) : null;
$aOtherAds = !empty($placementId) ? Admin_DA::getAds($aParams + array('placement_id' => $placementId), false) : null;
$aAdsZones = Admin_DA::getAdZones(array('zone_id' => $zoneId), true, 'ad_id');
MAX_displayZoneEntitySelection('ad', $aOtherAdvertisers, $aOtherPlacements, $aOtherAds, $advertiserId, $placementId, $adId, $publisherId, $zoneId, $GLOBALS['strSelectBannerToLink'], $pageName, $tabIndex);
$aParams = !empty($aAdsZones) ? array('ad_id' => implode(',', array_keys($aAdsZones))) : null;
示例7: _hasAnonymousCampaigns
function _hasAnonymousCampaigns()
{
$hasAnonymousCampaigns = false;
if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
$aParams = array('placement_anonymous' => 't', 'advertiser_id' => OA_Permission::getEntityId());
} elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
$aParams = array('placement_anonymous' => 't', 'publisher_id' => OA_Permission::getEntityId());
}
if (!empty($aParams)) {
$aPlacementZones = Admin_DA::getPlacementZones($aParams);
if (!empty($aPlacementZones)) {
$hasAnonymousCampaigns = true;
} else {
$aAdZones = Admin_DA::getAdZones($aParams);
if (!empty($aAdZones)) {
$hasAnonymousCampaigns = true;
}
}
}
return $hasAnonymousCampaigns;
}