本文整理汇总了PHP中Admin_DA::getPlacements方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin_DA::getPlacements方法的具体用法?PHP Admin_DA::getPlacements怎么用?PHP Admin_DA::getPlacements使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin_DA
的用法示例。
在下文中一共展示了Admin_DA::getPlacements方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
function display()
{
$aParams = array();
if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$aParams['agency_id'] = OA_Permission::getEntityId();
} elseif (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
$aParams['advertiser_id'] = OA_Permission::getEntityId();
} elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
$aParams['publisher_id'] = OA_Permission::getEntityId();
}
$aPlacements = Admin_DA::getPlacements($aParams, true);
$aPlacements = $this->multiSort($aPlacements, "name", true);
echo "\n <select name='{$this->_name}' tabindex='" . $this->_tabIndex++ . "'>";
foreach ($aPlacements as $aPlacement) {
$selected = $aPlacement['placement_id'] == $this->getValue() ? " selected='selected'" : '';
$name = MAX_getPlacementName($aPlacement);
echo "\n <option value='{$aPlacement['placement_id']}'{$selected}>" . htmlspecialchars($name) . "</option>";
}
echo "\n </select>";
}
示例2: _checkObjectsExist
/**
* Function check if advertiser or placement exists
* if not: display proper error message
* Error message contains link to:
* - advertiser summary statistics if campaign does not exists
* - stats.php if advertiser does not exists
*
* @param int $advertiserId Advertiser Id
* @param int $placementId Placement Id (Campaign Id)
*/
function _checkObjectsExist($advertiserId, $placementId)
{
// Check if placement (campaign) exist
if (0 == count(Admin_DA::getPlacements($this->coreParams + array('advertiser_id' => $advertiserId, 'placement_id' => $placementId)))) {
phpAds_PageHeader('2');
// Check if advertiser (clientid) exist
if (0 == count(Admin_DA::getPlacements($this->coreParams + array('advertiser_id' => $advertiserId)))) {
phpAds_Die($GLOBALS['strDeadLink'], str_replace('{link}', 'stats.php', $GLOBALS['strNoAdvertiser']));
} else {
$link = "stats.php?" . htmlspecialchars(preg_replace('#campaignid=[0-9]*&?#', '', $_SERVER['QUERY_STRING']), ENT_QUOTES);
phpAds_Die($GLOBALS['strDeadLink'], str_replace('{link}', $link, $GLOBALS['strNoPlacement']));
}
}
}
示例3: testReturnByColumnType
function testReturnByColumnType()
{
$id = Admin_DA::addPlacement(array('campaignname' => 'foo', 'clientid' => 0, 'views' => rand(1, 9999), 'clicks' => rand(1, 9999), 'conversions' => rand(1, 9999), 'activate_time' => '2007-03-29 00:00:00', 'expire_time' => '2007-04-10 23:59:59'));
$ret = Admin_DA::getPlacements(array('placement_id' => $id), true);
$stats = each($ret);
foreach ($stats[1] as $k => $v) {
$tmp = Admin_DA::getPlacements(array('placement_id' => $id), true, $k);
$resKey = each($tmp);
$this->assertEqual($resKey['key'], $v);
}
$this->assertTrue(is_array($ret));
$this->assertTrue(count($ret));
}
示例4: getCampaignMap
function getCampaignMap($advertiserId)
{
$aCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $advertiserId));
$aCampaignMap = array();
foreach ($aCampaigns as $campaignId => $aCampaign) {
$campaignName = $aCampaign['name'];
// mask campaign name if anonymous campaign
$campaign_details = Admin_DA::getPlacement($campaignId);
$campaignName = MAX_getPlacementName($campaign_details);
$aCampaignMap[$campaignId] = array('name' => $campaignName);
}
return $aCampaignMap;
}
示例5: basename
}
if (!isset($orderdirection)) {
if (isset($session['prefs']['campaign-trackers.php']['orderdirection'])) {
$orderdirection = $session['prefs']['campaign-trackers.php']['orderdirection'];
} else {
$orderdirection = '';
}
}
// Initialise some parameters
$pageName = basename($_SERVER['PHP_SELF']);
$tabindex = 1;
$agencyId = OA_Permission::getAgencyId();
$aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid);
// Display navigation
$aOtherAdvertisers = Admin_DA::getAdvertisers(array('agency_id' => $agencyId));
$aOtherCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $clientid));
MAX_displayNavigationCampaign($campaignid, $aOtherAdvertisers, $aOtherCampaigns, $aEntities);
if (!empty($campaignid)) {
$doCampaigns = OA_Dal::factoryDO('campaigns');
if ($doCampaigns->get($campaignid)) {
$campaign = $doCampaigns->toArray();
}
}
$tabindex = 1;
echo "\t\t\t\t<form name='availabletrackers' method='post' action='campaign-trackers.php'>\n";
echo "\t\t\t\t<input type='hidden' name='campaignid' value='" . $GLOBALS['campaignid'] . "'>\n";
echo "\t\t\t\t<input type='hidden' name='clientid' value='" . $GLOBALS['clientid'] . "'>\n";
echo "\t\t\t\t<input type='hidden' name='action' value='set'>\n";
echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>" . "\n";
echo "<tr><td height='25' width='100%' colspan='3'><b>{$GLOBALS['strConversionWindow']}</b></td></tr>" . "\n";
echo "<tr height='1'><td colspan='3' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>" . "\n";
示例6: MAX_checkPlacement
function MAX_checkPlacement($advertiserId, $placementId)
{
$allowed = false;
if (MAX_checkGenericId($advertiserId) && MAX_checkGenericId($placementId)) {
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
$allowed = count(Admin_DA::getPlacements(array('advertiser_id' => $advertiserId, 'placement_id' => $placementId)));
} elseif (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$allowed = count(Admin_DA::getPlacements(array('agency_id' => OA_Permission::getAgencyId(), 'advertiser_id' => $advertiserId, 'placement_id' => $placementId)));
} elseif (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
$allowed = $advertiserId == OA_Permission::getEntityId() && count(Admin_DA::getPlacements(array('advertiser_id' => $advertiserId, 'placement_id' => $placementId)));
}
}
return $allowed;
}
示例7: displayPage
function displayPage($campaign, $campaignForm, $statusForm, $campaignErrors = null)
{
global $conf;
//header and breadcrumbs
if ($campaign['campaignid'] != "") {
//edit campaign
// Initialise some parameters
$tabindex = 1;
$agencyId = OA_Permission::getAgencyId();
$aEntities = array('clientid' => $campaign['clientid'], 'campaignid' => $campaign['campaignid']);
// Display navigation
$aOtherAdvertisers = Admin_DA::getAdvertisers(array('agency_id' => $agencyId));
$aOtherCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $campaign['clientid']));
MAX_displayNavigationCampaign($campaign['campaignid'], $aOtherAdvertisers, $aOtherCampaigns, $aEntities);
} else {
//new campaign
$advertiser = phpAds_getClientDetails($campaign['clientid']);
$advertiserName = $advertiser['clientname'];
$advertiserEditUrl = "advertiser-edit.php?clientid=" . $campaign['clientid'];
// New campaign
$builder = new OA_Admin_UI_Model_InventoryPageHeaderModelBuilder();
$oHeaderModel = $builder->buildEntityHeader(array(array("name" => $advertiserName, "url" => $advertiserEditUrl), array("name" => "")), "campaign", "edit-new");
phpAds_PageHeader("campaign-edit_new", $oHeaderModel);
}
//get template and display form
$oTpl = new OA_Admin_Template('campaign-edit.html');
$oTpl->assign('clientid', $campaign['clientid']);
$oTpl->assign('campaignid', $campaign['campaignid']);
$oTpl->assign('calendarBeginOfWeek', $GLOBALS['pref']['begin_of_week'] ? 1 : 0);
$oTpl->assign('language', $GLOBALS['_MAX']['PREF']['language']);
$oTpl->assign('conversionsEnabled', $conf['logging']['trackerImpressions']);
$oTpl->assign('adDirectEnabled', defined('OA_AD_DIRECT_ENABLED') && OA_AD_DIRECT_ENABLED === true);
$oTpl->assign('impressionsDelivered', isset($campaign['impressions_delivered']) ? $campaign['impressions_delivered'] : 0);
$oTpl->assign('clicksDelivered', isset($campaign['clicks_delivered']) ? $campaign['clicks_delivered'] : 0);
$oTpl->assign('conversionsDelivered', isset($campaign['conversions_delivered']) ? $campaign['conversions_delivered'] : 0);
$oTpl->assign('strCampaignWarningNoTargetMessage', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningNoTarget'])));
$oTpl->assign('strCampaignWarningRemnantNoWeight', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningRemnantNoWeight'])));
$oTpl->assign('strCampaignWarningEcpmNoRevenue', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningEcpmNoRevenue'])));
$oTpl->assign('strCampaignWarningExclusiveNoWeight', str_replace("\n", '\\n', addslashes($GLOBALS['strCampaignWarningExclusiveNoWeight'])));
$oTpl->assign('campaignErrors', $campaignErrors);
$oTpl->assign('CAMPAIGN_TYPE_REMNANT', OX_CAMPAIGN_TYPE_REMNANT);
$oTpl->assign('CAMPAIGN_TYPE_CONTRACT_NORMAL', OX_CAMPAIGN_TYPE_CONTRACT_NORMAL);
$oTpl->assign('CAMPAIGN_TYPE_CONTRACT_EXCLUSIVE', OX_CAMPAIGN_TYPE_CONTRACT_EXCLUSIVE);
$oTpl->assign('CAMPAIGN_TYPE_ECPM', OX_CAMPAIGN_TYPE_ECPM);
$oTpl->assign('CAMPAIGN_TYPE_CONTRACT_ECPM', OX_CAMPAIGN_TYPE_CONTRACT_ECPM);
$oTpl->assign('PRIORITY_ECPM_FROM', DataObjects_Campaigns::PRIORITY_ECPM_FROM);
$oTpl->assign('PRIORITY_ECPM_TO', DataObjects_Campaigns::PRIORITY_ECPM_TO);
$oTpl->assign('MODEL_CPM', MAX_FINANCE_CPM);
$oTpl->assign('MODEL_CPC', MAX_FINANCE_CPC);
$oTpl->assign('MODEL_CPA', MAX_FINANCE_CPA);
if ($conf['logging']['trackerImpressions']) {
$oTpl->assign('MODEL_MT', MAX_FINANCE_MT);
}
$oTpl->assign('campaignFormId', $campaignForm->getId());
$oTpl->assign('campaignForm', $campaignForm->serialize());
if (!empty($campaign['campaignid']) && defined('OA_AD_DIRECT_ENABLED') && OA_AD_DIRECT_ENABLED === true) {
$oTpl->assign('statusForm', $statusForm->serialize());
}
$oTpl->display();
_echoDeliveryCappingJs();
//footer
phpAds_PageFooter();
}
示例8: 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);
}
}
示例9: _duplicatePlacement
function _duplicatePlacement($aPlacement, $checkUniqueNames = false)
{
$placementId = $aPlacement['placement_id'];
unset($aPlacement['placement_id']);
if ($checkUniqueNames) {
$aPlacements = Admin_DA::getPlacements(array('advertiser_id' => $aPlacement['advertiser_id']));
Admin_DA::_getUniqueName($aPlacement, $aPlacements, @$GLOBALS['strCopy']);
}
// FIXME: get rid of this
$aPlacement = MAX_commonSlashArray($aPlacement);
// Massage to real field names
Admin_DA::_switch($aPlacement, 'advertiser_id', 'clientid');
Admin_DA::_switch($aPlacement, 'name', 'campaignname');
$newPlacementId = Admin_DA::addPlacement($aPlacement);
$aPlacementTrackers = Admin_DA::getPlacementTrackers(array('placement_id' => $placementId));
foreach ($aPlacementTrackers as $aPlacementTracker) {
$aPlacementTracker['placement_id'] = $newPlacementId;
Admin_DA::duplicatePlacementTracker($aPlacementTracker);
}
$aPlacementZones = Admin_DA::_getEntities('placement_zone_assoc', array('placement_id' => $placementId));
foreach ($aPlacementZones as $aPlacementZone) {
$aPlacementZone['placement_id'] = $newPlacementId;
Admin_DA::duplicatePlacementZone($aPlacementZone);
}
$aAds = Admin_DA::getAds(array('placement_id' => $placementId));
foreach ($aAds as $aAd) {
$aAd['placement_id'] = $newPlacementId;
Admin_DA::duplicateAd($aAd, $aAds);
}
return $newPlacementId;
}
示例10: OX_Translation
$translation = new OX_Translation();
$translated_message = $translation->translate($GLOBALS['strBannerAdvancedHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, 'banner-edit.php?clientid=' . $clientid . '&campaignid=' . $campaignid . '&bannerid=' . $bannerid), htmlspecialchars($doBanners->description)));
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
}
header("Location: banner-advanced.php?clientid=" . $clientid . "&campaignid=" . $campaignid . "&bannerid=" . $bannerid);
}
/*-------------------------------------------------------*/
/* HTML framework */
/*-------------------------------------------------------*/
// Initialise some parameters
$pageName = basename($_SERVER['PHP_SELF']);
$tabindex = 1;
$agencyId = OA_Permission::getAgencyId();
$aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid, 'bannerid' => $bannerid);
// 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 */
/*-------------------------------------------------------*/
$doBanners = OA_Dal::factoryDO('banners');
$doBanners->selectAdd('storagetype AS type');
$doBanners->bannerid = $bannerid;
if ($doBanners->find(true)) {
$banner = $doBanners->toArray();
}
$tabindex = 1;
if ($banner['type'] != 'txt') {
// Header
echo "<form name='appendform' method='post' action='banner-advanced.php' onSubmit='return phpAds_formSubmit() && max_formValidate(this);'>";
示例11: displayPage
function displayPage($bannerid, $campaignid, $clientid, $bannerTypes, $aBanner, $type, $form, $ext_bannertype, $formDisabled = false)
{
$pageName = 'advertiser-campaigns';
$aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid, 'bannerid' => $bannerid);
$entityId = OA_Permission::getEntityId();
$entityType = 'advertiser_id';
$aOtherCampaigns = Admin_DA::getPlacements(array($entityType => $entityId));
$aOtherBanners = Admin_DA::getAds(array('placement_id' => $campaignid), false);
$advertiserId = $aEntities['clientid'];
$campaignId = $aEntities['campaignid'];
$bannerId = $aEntities['bannerid'];
$entityString = _getEntityString($aEntities);
$aOtherEntities = $aEntities;
unset($aOtherEntities['bannerid']);
$otherEntityString = _getEntityString($aOtherEntities);
if ($pageName == 'banner-edit.php' && empty($bannerId)) {
$tabValue = 'banner-edit_new';
$pageType = 'edit-new';
} else {
$pageType = 'edit';
}
$advertiserEditUrl = '';
$campaignEditUrl = '';
if (OA_Permission::hasAccessToObject('clients', $advertiserId)) {
$advertiserEditUrl = "advertiser-edit.php?clientid={$advertiserId}";
}
if (!OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
$campaignEditUrl = "campaign-edit.php?clientid={$advertiserId}&campaignid={$campaignId}";
}
if ($bannerId && !empty($GLOBALS['_MAX']['PREF']['ui_show_banner_preview']) && empty($_GET['nopreview'])) {
require_once MAX_PATH . '/lib/max/Delivery/adRender.php';
$aBanner = Admin_DA::getAd($bannerId);
$aBanner['storagetype'] = $aBanner['type'];
$aBanner['bannerid'] = $aBanner['ad_id'];
$bannerCode = MAX_adRender($aBanner, 0, '', '', '', true, '', false, false);
} else {
$bannerCode = '';
}
$advertiserDetails = phpAds_getClientDetails($advertiserId);
$advertiserName = $advertiserDetails['clientname'];
$campaignDetails = Admin_DA::getPlacement($campaignId);
$campaignName = $campaignDetails['name'];
$bannerName = $aOtherBanners[$bannerId]['name'];
$builder = new OA_Admin_UI_Model_InventoryPageHeaderModelBuilder();
$oHeaderModel = $builder->buildEntityHeader(array(array("name" => $advertiserName, "url" => $advertiserEditUrl), array("name" => $campaignName, "url" => $campaignEditUrl), array("name" => $bannerName)), "banner", $pageType);
global $phpAds_breadcrumbs_extra;
$phpAds_breadcrumbs_extra .= "<div class='bannercode'>{$bannerCode}</div>";
if ($bannerCode != '') {
$phpAds_breadcrumbs_extra .= "<br />";
}
addPageLinkTool($GLOBALS["strDuplicate"], MAX::constructUrl(MAX_URL_ADMIN, "plugins/oxMarkedTextAdvertiser/banner-modify.php?duplicate=true&clientid={$advertiserId}&campaignid={$campaignId}&bannerid={$bannerId}&returnurl=" . urlencode(basename($_SERVER['SCRIPT_NAME']))), "iconBannerDuplicate");
addPageShortcut($GLOBALS['strBackToBanners'], MAX::constructUrl(MAX_URL_ADMIN, "campaign-banners.php?clientid={$advertiserId}&campaignid={$campaignId}"), "iconBack");
$entityString = _getEntityString($aEntities);
addPageShortcut($GLOBALS['strBannerHistory'], MAX::constructUrl(MAX_URL_ADMIN, "stats.php?entity=banner&breakdown=history&{$entityString}"), 'iconStatistics');
phpAds_PageHeader('advertiser-campaigns', $oHeaderModel);
$oTpl = new OA_Admin_Template('banner-edit.html');
$oTpl->assign('clientId', $clientid);
$oTpl->assign('campaignId', $campaignid);
$oTpl->assign('bannerId', $bannerid);
$oTpl->assign('bannerTypes', $bannerTypes);
$oTpl->assign('bannerType', 'bannerTypeText:oxMarkedText:oxMarkedTextComponent');
$oTpl->assign('bannerHeight', $aBanner["height"]);
$oTpl->assign('bannerWidth', $aBanner["width"]);
$oTpl->assign('disabled', $formDisabled);
$oTpl->assign('form', $form->serialize());
$oTpl->display();
phpAds_PageFooter();
}
示例12: array
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;
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++)
示例13: _showContext
/**
* A private method that can be inherited and used by children classes to
* output the context in the left navigation bar.
*
* {@uses phpAds_PageContext()}
*/
function _showContext($type, $current_id = 0)
{
if ($this->useDailyClass && $type == 'days') {
// Use the helper class contect method instead
$aArray = array('period_start' => MAX_getStoredValue('period_start', date('Y-m-d')), 'period_end' => MAX_getStoredValue('period_end', date('Y-m-d')));
$aDates = array_reverse($this->oHistory->getDatesArray($aArray, 'day', $this->oStartDate));
$this->oDaily->showContext($aDates, $current_id, $this);
} else {
$aParams = array();
switch ($type) {
case 'advertisers':
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$aParams['agency_id'] = OA_Permission::getEntityId();
}
$params = $this->aPageParams;
$advertisers = Admin_DA::getAdvertisers($aParams, false);
foreach ($advertisers as $advertiser) {
$params['clientid'] = $advertiser['advertiser_id'];
phpAds_PageContext(MAX_buildName($advertiser['advertiser_id'], $advertiser['name']), $this->_addPageParamsToURI($this->pageName, $params, true), $current_id == $advertiser['advertiser_id']);
}
}
break;
case 'campaigns':
$aParams['advertiser_id'] = $this->aPageParams['clientid'];
$params = $this->aPageParams;
$campaigns = Admin_DA::getPlacements($aParams, false);
foreach ($campaigns as $campaign) {
$params['campaignid'] = $campaign['placement_id'];
// mask campaign name if anonymous campaign
$campaign['name'] = MAX_getPlacementName($campaign);
phpAds_PageContext(MAX_buildName($campaign['placement_id'], $campaign['name']), $this->_addPageParamsToURI($this->pageName, $params, true), $current_id == $campaign['placement_id']);
}
break;
case 'banners':
$aParams['placement_id'] = $this->aPageParams['campaignid'];
$params = $this->aPageParams;
$banners = Admin_DA::getAds($aParams, false);
foreach ($banners as $banner) {
$params['bannerid'] = $banner['ad_id'];
// mask banner name if anonymous campaign
$campaign = Admin_DA::getPlacement($banner['placement_id']);
$campaignAnonymous = $campaign['anonymous'] == 't' ? true : false;
$banner['name'] = MAX_getAdName($banner['name'], null, null, $campaignAnonymous, $banner['ad_id']);
phpAds_PageContext(MAX_buildName($banner['ad_id'], $banner['name']), $this->_addPageParamsToURI($this->pageName, $params, true), $current_id == $banner['ad_id']);
}
break;
case 'publishers':
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$aParams['agency_id'] = OA_Permission::getEntityId();
}
$params = $this->aPageParams;
$campaigns = Admin_DA::getPublishers($aParams, false);
foreach ($campaigns as $publisher) {
$params['affiliateid'] = $publisher['publisher_id'];
phpAds_PageContext(MAX_buildName($publisher['publisher_id'], $publisher['name']), $this->_addPageParamsToURI($this->pageName, $params, true), $current_id == $publisher['publisher_id']);
}
}
break;
case 'publisher-campaigns':
if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN) || OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
$aParams = array('publisher_id' => $publisherId, 'placement_id' => $placementId, 'include' => array('placement_id'), 'exclude' => array('zone_id'));
$aPlacements = array();
foreach (Admin_DA::fromCache('getEntitiesStats', $aParams + $this->aDates) as $v) {
$aPlacements[$v['placement_id']] = true;
}
$params = $this->aPageParams;
$campaigns = Admin_DA::getPlacements(array(), false);
foreach ($campaigns as $campaign) {
if (isset($aPlacements[$campaign['placement_id']])) {
$params['campaignid'] = $campaign['placement_id'];
phpAds_PageContext(MAX_buildName($campaign['placement_id'], $campaign['name']), $this->_addPageParamsToURI($this->pageName, $params, true), $current_id == $campaign['placement_id']);
}
}
}
break;
case 'zones':
$aParams['publisher_id'] = $this->aPageParams['affiliateid'];
$params = $this->aPageParams;
$zones = Admin_DA::getZones($aParams, false);
foreach ($zones as $zone) {
$params['zoneid'] = $zone['zone_id'];
phpAds_PageContext(MAX_buildName($zone['zone_id'], $zone['name']), $this->_addPageParamsToURI($this->pageName, $params, true), $current_id == $zone['zone_id']);
}
break;
}
}
}
示例14: header
OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
header("Location: banner-acl.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}");
exit;
}
}
/*-------------------------------------------------------*/
/* HTML framework */
/*-------------------------------------------------------*/
$entityId = OA_Permission::getEntityId();
if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
$entityType = 'advertiser_id';
} else {
$entityType = 'agency_id';
}
// Display navigation
$aOtherCampaigns = Admin_DA::getPlacements(array($entityType => $entityId));
$aOtherBanners = Admin_DA::getAds(array('placement_id' => $campaignid), false);
// Setup a fake record for the "Apply to all" entry
$aOtherBanners[-1] = array('name' => '--' . $GLOBALS['strAllBannersInCampaign'] . '--', 'ad_id' => -1, 'placement_id' => $campaignid);
MAX_displayNavigationBanner($pageName, $aOtherCampaigns, $aOtherBanners, $aEntities);
/*-------------------------------------------------------*/
/* Main code */
/*-------------------------------------------------------*/
$aBanner = MAX_cacheGetAd($bannerid, false);
if (!isset($acl)) {
$acl = Admin_DA::getDeliveryLimitations(array('ad_id' => $bannerid));
// This array needs to be sorted by executionorder, this should ideally be done in SQL
// When we move to DataObject this should be addressed
ksort($acl);
}
$aParams = array('clientid' => $clientid, 'campaignid' => $campaignid, 'bannerid' => $bannerid);
示例15: displayPage
function displayPage($bannerid, $campaignid, $clientid, $bannerTypes, $aBanner, $type, $form, $ext_bannertype, $formDisabled = false)
{
// Initialise some parameters
$pageName = basename($_SERVER['SCRIPT_NAME']);
$aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid, 'bannerid' => $bannerid);
$entityId = OA_Permission::getEntityId();
if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
$entityType = 'advertiser_id';
} else {
$entityType = 'agency_id';
}
// Display navigation
$aOtherCampaigns = Admin_DA::getPlacements(array($entityType => $entityId));
$aOtherBanners = Admin_DA::getAds(array('placement_id' => $campaignid), false);
// Display banner preview
MAX_displayNavigationBanner($pageName, $aOtherCampaigns, $aOtherBanners, $aEntities);
//actual page content - type chooser and form
/*-------------------------------------------------------*/
/* Main code */
/*-------------------------------------------------------*/
$oTpl = new OA_Admin_Template('banner-edit.html');
$oTpl->assign('clientId', $clientid);
$oTpl->assign('campaignId', $campaignid);
$oTpl->assign('bannerId', $bannerid);
$oTpl->assign('bannerTypes', $bannerTypes);
$oTpl->assign('bannerType', $ext_bannertype ? $ext_bannertype : $type);
$oTpl->assign('bannerHeight', $aBanner["height"]);
$oTpl->assign('bannerWidth', $aBanner["width"]);
$oTpl->assign('disabled', $formDisabled);
$oTpl->assign('form', $form->serialize());
$oTpl->display();
/*********************************************************/
/* HTML framework */
/*********************************************************/
phpAds_PageFooter();
}