本文整理汇总了PHP中Admin_DA::getAdZones方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin_DA::getAdZones方法的具体用法?PHP Admin_DA::getAdZones怎么用?PHP Admin_DA::getAdZones使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin_DA
的用法示例。
在下文中一共展示了Admin_DA::getAdZones方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MAX_duplicateAdZones
function MAX_duplicateAdZones($fromAdId, $toAdId)
{
$aAdZones = Admin_DA::getAdZones(array('ad_id' => $fromAdId), true, 'zone_id');
if (!empty($aAdZones)) {
foreach ($aAdZones as $zoneId => $adId) {
Admin_DA::addAdZone(array('ad_id' => $toAdId, 'zone_id' => $zoneId));
}
}
}
示例2: linkBanner
/**
* A method to link a banner to a zone
*
* @param int $zoneId
* @param int $bannerId
* @return bool
*/
function linkBanner($zoneId, $bannerId)
{
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('banners', $bannerId)) {
$aLinkedAds = Admin_DA::getAdZones(array('zone_id' => $zoneId), false, 'ad_id');
if (!isset($aLinkedAds[$bannerId])) {
$result = Admin_DA::addAdZone(array('zone_id' => $zoneId, 'ad_id' => $bannerId));
if (PEAR::isError($result)) {
$this->raiseError($result->getMessage());
return false;
}
return true;
} else {
// Already linked
return true;
}
}
}
return false;
}
示例3: _duplicateZone
function _duplicateZone($aZone, $checkUniqueNames = false)
{
$zoneId = $aZone['zone_id'];
unset($aZone['zone_id']);
if ($checkUniqueNames) {
$aZones = Admin_DA::getZones(array('publisher_id' => $aZone['publisher_id']));
Admin_DA::_getUniqueName($aZone, $aZones, @$GLOBALS['strCopy']);
}
$newZoneId = Admin_DA::addZone($aZone);
// FIXME
$aPlacementZones = Admin_DA::_getEntities('placement_zone_assoc', array('zone_id' => $zoneId));
foreach ($aPlacementZones as $aPlacementZone) {
$aPlacementZone['zone_id'] = $newZoneId;
Admin_DA::duplicatePlacementZone($aPlacementZone);
}
$aAdZones = Admin_DA::getAdZones(array('zone_id' => $zoneId));
foreach ($aAdZones as $aAdZone) {
$aAdZone['zone_id'] = $newZoneId;
Admin_DA::duplicateAdZone($aAdZone);
}
return $newZoneId;
}
示例4: MAX_displayLinkedPlacementsAds
function MAX_displayLinkedPlacementsAds($aParams, $publisherId, $zoneId, $hideInactive, $showMatchingAds, $pageName, &$tabIndex, $directLinkedAds = false)
{
echo "\n <br /><strong>{$GLOBALS['strCampaignLinkedAds']}:</strong><br />\n <table id='linked-campaigns' width='100%' border='0' align='center' cellspacing='0' cellpadding='0'>\n <tr height='25'>\n <td width='40%'><b> {$GLOBALS['strName']}</b></td>\n <td width='20%'><b> {$GLOBALS['strType']}</b></td>\n <td><b>{$GLOBALS['strID']} </b></td>\n <td> </td>\n </tr>\n <tr height='1'>\n <td colspan='4' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td>\n </tr>";
$i = 0;
$inactive = 0;
$aPlacements = !empty($aParams) ? Admin_DA::getPlacements($aParams) : array();
foreach ($aPlacements as $placementId => $aPlacement) {
$placementActive = $aPlacement['status'] == OA_ENTITY_STATUS_RUNNING;
if (!$hideInactive || $placementActive) {
$pParams = $aParams;
$pParams['placement_id'] = $placementId;
$aAds = Admin_DA::getAds($pParams, true);
$bgcolor = $i % 2 == 0 ? " bgcolor='#F6F6F6'" : '';
// Remove these ad(s) from the direct linked ads
foreach ($aAds as $dAdId) {
unset($directLinkedAds[$dAdId['ad_id']]);
}
// Remove from array any ads not linked to the zone.
// These might exist if campaign has been linked to zone
// and indivual ads have then been unlinked
$pParams = array('zone_id' => $zoneId);
$aAdZones = Admin_DA::getAdZones($pParams, true);
$aAdZoneLinks = array();
foreach ($aAdZones as $aAdZone) {
$aAdZoneLinks[] = $aAdZone['ad_id'];
}
foreach ($aAds as $adId => $aAd) {
if (!in_array($adId, $aAdZoneLinks)) {
unset($aAds[$adId]);
}
}
$placementIcon = MAX_getEntityIcon('placement', $placementActive);
$placementName = htmlspecialchars(MAX_getDisplayName($aPlacement['name']));
$placementLink = OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER) ? "<a href='campaign-edit.php?clientid={$aPlacement['advertiser_id']}&campaignid={$placementId}'>{$placementName}</a>" : $placementName;
$placementTypeName = OX_Util_Utils::getCampaignTypeName($aPlacement['priority']);
$adCount = empty($aAds) ? 0 : count($aAds);
$placementDescription = $showMatchingAds ? ' ' : str_replace('{count}', $adCount, $GLOBALS['strMatchingBanners']);
if ($i > 0) {
echo "\n <tr height='1'>\n <td colspan='4' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break-l.gif' height='1' width='100%'></td>\n </tr>";
}
echo "\n <tr height='25'{$bgcolor}>\n <td>\n <a href='{$pageName}?affiliateid={$publisherId}&zoneid={$zoneId}&campaignid={$placementId}&action=remove'><img src='" . OX::assetPath() . "/images/caret-l.gif' border='0' align='absmiddle'></a>\n <img src='{$placementIcon}' align='absmiddle'>\n {$placementLink}\n </td>\n <td><span class='campaign-type'>{$placementTypeName}</span></td>\n <td>{$placementId}</td>\n <td>{$placementDescription}</td>\n </tr>";
if ($showMatchingAds && !empty($aAds)) {
foreach ($aAds as $adId => $aAd) {
$adActive = $aAd['status'] == OA_ENTITY_STATUS_RUNNING && $aPlacement['status'] == OA_ENTITY_STATUS_RUNNING;
if (!$hideInactive || $adActive) {
$adIcon = MAX_getEntityIcon('ad', $adActive, $aAd['type']);
$adName = htmlspecialchars(MAX_getDisplayName($aAd['name']));
$adLink = OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER) ? "<a href='banner-edit.php?clientid={$aPlacement['advertiser_id']}&campaignid={$placementId}&bannerid={$adId}'>{$adName}</a>" : $adName;
$adWidth = $aAd['contenttype'] == 'txt' ? 300 : $aAd['width'] + 64;
$adHeight = $aAd['contenttype'] == 'txt' ? 200 : $aAd['height'] + (!empty($aAd['bannertext']) ? 90 : 64);
echo "\n <tr height='1'>\n <td{$bgcolor}><img src='" . OX::assetPath() . "/images/spacer.gif' width='1' height='1'></td>\n <td colspan='3' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break-el.gif' height='1' width='100%'></td>\n </tr>\n <tr height='25'{$bgcolor}>\n <td> <img src='{$adIcon}' align='absmiddle'> {$adLink}</td>\n <td></td>\n <td>{$adId}</td>\n <td align=" . $GLOBALS['phpAds_TextAlignRight'] . ">\n <img src='" . OX::assetPath() . "/images/icon-zoom.gif' align='absmiddle' border='0'> <a href='banner-htmlpreview.php?bannerid={$adId}' target='_new' onClick=\"return openWindow('banner-htmlpreview.php?bannerid={$adId}', '', 'status=no,scrollbars=no,resizable=no,width={$adWidth},height={$adHeight}');\">{$GLOBALS['strShowBanner']}</a> \n </td>\n </tr>";
} else {
$inactive++;
}
}
}
$i++;
} else {
$inactive++;
}
}
$showMatchingText = $showMatchingAds ? $GLOBALS['strHideMatchingBanners'] : $GLOBALS['strShowMatchingBanners'];
$showMatchingValue = $showMatchingAds ? '0' : '1';
$hideInactiveText = $hideInactive ? $GLOBALS['strShowAll'] : $GLOBALS['strHideInactiveCampaigns'];
$hideInactiveStats = $hideInactive ? " | {$inactive} {$GLOBALS['strInactiveCampaignsHidden']}" : '';
$hideInactiveValue = $hideInactive ? '0' : '1';
$hideInactiveIcon = OX::assetPath($hideInactive ? 'images/icon-activate.gif' : 'images/icon-hideinactivate.gif');
echo "\n <tr height='1'>\n <td colspan='4' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td>\n </tr>\n <tr height='25'>\n <td colspan='3'>\n <img src='{$hideInactiveIcon}' align='absmiddle' border='0'>\n <a href='{$pageName}?affiliateid={$publisherId}&zoneid={$zoneId}&hideinactive={$hideInactiveValue}'>{$hideInactiveText}</a>{$hideInactiveStats}\n </td>\n <td align='right'>\n <img src='" . OX::assetPath() . "/images/icon-banner-stored-d.gif' align='absmiddle' border='0'>\n <a href='{$pageName}?affiliateid={$publisherId}&zoneid={$zoneId}&showbanners={$showMatchingValue}'>{$showMatchingText}</a>\n </table>";
if (!empty($directLinkedAds)) {
echo "<br /><strong>{$GLOBALS['strBannerLinkedAds']}:</strong><br />";
$aParams = array('ad_id' => implode(',', array_keys($directLinkedAds)));
MAX_displayLinkedAdsPlacements($aParams, $publisherId, $zoneId, $hideInactive, $showParentPlacements, $pageName, $tabIndex);
}
}
示例5: 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 {
//.........这里部分代码省略.........
示例6: _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);
}
示例7: array
$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;
MAX_displayLinkedAdsPlacements($aParams, $publisherId, $zoneId, $hideInactive, $showParentPlacements, $pageName, $tabIndex);
}
?>
<script language='Javascript'>
<!--
function toggleall()
{
allchecked = false;
for (var i=0; i<document.zonetypeselection.elements.length; i++)
{
if (document.zonetypeselection.elements[i].name == 'bannerid[]' ||
示例8: _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;
}
示例9: MAX_displayNavigationBanner
}
// Display navigation
$aOtherCampaigns = Admin_DA::getPlacements(array('agency_id' => $agencyId));
$aOtherBanners = Admin_DA::getAds(array('placement_id' => $campaignId), false);
MAX_displayNavigationBanner($pageName, $aOtherCampaigns, $aOtherBanners, $aEntities);
// Main code
$aAd = Admin_DA::getAd($bannerId);
$aParams = array('agency_id' => $agencyId);
if ($aAd['type'] == 'txt') {
$aParams['zone_type'] = phpAds_ZoneText;
} else {
$aParams['zone_width'] = $aAd['width'] . ',-1';
$aParams['zone_height'] = $aAd['height'] . ',-1';
}
$aPublishers = Admin_DA::getPublishers($aParams, true);
$aLinkedZones = Admin_DA::getAdZones(array('ad_id' => $bannerId), false, 'zone_id');
echo "\n<table border='0' width='100%' cellpadding='0' cellspacing='0'>\n<form name='zones' action='{$pageName}' method='post'>\n<input type='hidden' name='clientid' value='{$advertiserId}'>\n<input type='hidden' name='campaignid' value='{$campaignId}'>\n<input type='hidden' name='bannerid' value='{$bannerId}'>";
MAX_displayZoneHeader($pageName, $listorder, $orderdirection, $aEntities);
if ($error) {
// 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>";
echo "</div>";
} else {
echo "<br /><br />";
}
$zoneToSelect = false;
if (!empty($aPublishers)) {
MAX_sortArray($aPublishers, $listorder == 'id' ? 'publisher_id' : $listorder, $orderdirection == 'up');
$i = 0;