本文整理汇总了PHP中Admin_DA::getPlacement方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin_DA::getPlacement方法的具体用法?PHP Admin_DA::getPlacement怎么用?PHP Admin_DA::getPlacement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Admin_DA
的用法示例。
在下文中一共展示了Admin_DA::getPlacement方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getBanners
/**
* Get banner stats
*
* @param array Query parameters
* @param int Tree level
* @param string Expand GET parameter, used only when called from other get methods
* @return Entities array
*/
function getBanners($aParams, $level, $expand = '')
{
global $phpAds_IAB;
require_once MAX_PATH . '/www/admin/lib-size.inc.php';
$aParams['include'] = array('placement_id');
// Needed to fetch the advertiser_id
$aParams['exclude'] = array('zone_id');
$this->prepareData($aParams);
$period_preset = MAX_getStoredValue('period_preset', 'today');
$aAds = $this->mergeData($aParams, 'ad_id');
MAX_sortArray($aAds, $this->listOrderField == 'id' ? 'ad_id' : $this->listOrderField, $this->listOrderDirection == 'up');
$aEntitiesData = array();
foreach ($aAds as $bannerId => $banner) {
$banner['active'] = $this->_hasActiveStats($banner);
if ($this->startLevel > $level || !$this->hideInactive || $banner['active']) {
$this->_summarizeStats($banner);
// mask banner name if anonymous campaign
$campaign = Admin_DA::getPlacement($banner['placement_id']);
$campaignAnonymous = $campaign['anonymous'] == 't' ? true : false;
if ($banner['type'] == DataObjects_Banners::BANNER_TYPE_MARKET) {
$marketBannerNameAndAdvertiserId = $this->getMarketBannerName($banner['name']);
$banner['name'] = $marketBannerNameAndAdvertiserId['name'];
$banner['marketAdvertiserId'] = $marketBannerNameAndAdvertiserId['marketAdvertiserId'];
}
$banner['name'] = MAX_getAdName($banner['name'], null, null, $campaignAnonymous, $bannerId);
$banner['prefix'] = 'b';
$banner['id'] = $bannerId;
$banner['linkparams'] = "clientid={$banner['advertiser_id']}&campaignid={$banner['placement_id']}&bannerid={$bannerId}&";
if (is_array($aParams) && count($aParams) > 0) {
foreach ($aParams as $key => $value) {
if ($key != "include" && $key != "exclude") {
$banner['linkparams'] .= $key . "=" . $value . "&";
}
}
} else {
$banner['linkparams'] .= "&";
}
$banner['linkparams'] .= "period_preset={$period_preset}&period_start=" . MAX_getStoredValue('period_start', date('Y-m-d')) . "&period_end=" . MAX_getStoredValue('period_end', date('Y-m-d'));
$banner['expanded'] = false;
$banner['icon'] = MAX_getEntityIcon('ad', $banner['active'], $banner['type'], $banner['marketAdvertiserId']);
$aEntitiesData[] = $banner;
} elseif ($this->startLevel == $level) {
$this->hiddenEntities++;
}
}
return $aEntitiesData;
}
示例2: 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;
}
示例3: testDuplicatePlacement
function testDuplicatePlacement()
{
TestEnv::startTransaction();
$placementId = 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'));
$this->assertTrue(is_int($placementId));
$this->assertTrue($placementId > 0);
$placement1 = Admin_DA::getPlacement($placementId);
$ret = Admin_DA::duplicatePlacement($placementId);
$this->assertTrue(is_int($ret));
$this->assertTrue($ret > 0);
$placement2 = Admin_DA::getPlacement($ret);
$this->assertTrue(is_array($placement2));
$this->assertTrue(count($placement2));
// compare two placements
unset($placement1['placement_id']);
unset($placement2['placement_id']);
unset($placement1['name']);
unset($placement2['name']);
$this->assertEqual($placement1, $placement2);
TestEnv::rollbackTransaction();
}
示例4: MAX_displayNavigationBanner
function MAX_displayNavigationBanner($pageName, $aOtherCampaigns, $aOtherBanners, $aEntities)
{
global $phpAds_TextDirection;
$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}";
}
// Build banner preview
if ($bannerId && !empty($GLOBALS['_MAX']['PREF']['ui_show_banner_preview']) && empty($_GET['nopreview'])) {
$bannerCode = MAX_bannerPreview($bannerId);
} 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 />";
}
addBannerPageTools($advertiserId, $campaignId, $bannerId, $aOtherCampaigns, $aOtherBanners, $aEntities);
phpAds_PageHeader($tabValue, $oHeaderModel);
}
示例5: OA_Admin_Template
}
}
/*-------------------------------------------------------*/
/* Main code */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
$oTpl = new OA_Admin_Template('campaign-index.html');
// Get clients & campaign and build the tree
$doCampaigns = OA_Dal::factoryDO('campaigns');
$doCampaigns->clientid = $clientid;
$doCampaigns->addListOrderBy($listorder, $orderdirection);
$doCampaigns->find();
while ($doCampaigns->fetch() && ($row_campaigns = $doCampaigns->toArray())) {
$campaigns[$row_campaigns['campaignid']]['campaignid'] = $row_campaigns['campaignid'];
// mask campaign name if anonymous campaign
$campaign_details = Admin_DA::getPlacement($row_campaigns['campaignid']);
$row_campaigns['campaignname'] = MAX_getPlacementName($campaign_details);
$campaigns[$row_campaigns['campaignid']]['campaignname'] = $row_campaigns['campaignname'];
$campaigns[$row_campaigns['campaignid']]['impressions'] = phpAds_formatNumber($row_campaigns['views']);
$campaigns[$row_campaigns['campaignid']]['clicks'] = phpAds_formatNumber($row_campaigns['clicks']);
$campaigns[$row_campaigns['campaignid']]['conversions'] = phpAds_formatNumber($row_campaigns['conversions']);
if ($row_campaigns['activate'] && $row_campaigns['activate'] != '0000-00-00') {
$oActivateDate =& new Date($row_campaigns['activate']);
$campaigns[$row_campaigns['campaignid']]['activate'] = $oActivateDate->format($date_format);
} else {
$campaigns[$row_campaigns['campaignid']]['activate'] = '-';
}
if ($row_campaigns['activate'] && $row_campaigns['expire'] != '0000-00-00') {
$oExpireDate =& new Date($row_campaigns['expire']);
$campaigns[$row_campaigns['campaignid']]['expire'] = $oExpireDate->format($date_format);
} else {
示例6: duplicatePlacement
function duplicatePlacement($placementId)
{
$aPlacement = Admin_DA::getPlacement($placementId);
return Admin_DA::_duplicatePlacement($aPlacement, true);
}
示例7: array
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/lib/OA/Dll.php';
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/lib/OA/Permission.php';
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER);
$aEntityMap = array();
if (!empty($clientid)) {
if (!OA_Permission::hasAccessToObject('clients', $clientid)) {
echo "{ }";
exit;
}
// Retrieve list of campaigns
$aCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $clientid));
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);
$aEntityMap[$campaignId] = $campaignName;
}
}
if (count($aEntityMap)) {
while (list($k, $v) = each($aEntityMap)) {
$aEntityMap[$k] = $k . ': { "name": "' . addslashes($v) . '" }';
}
echo "{" . implode(', ', $aEntityMap) . "}";
exit;
}
echo "{ }";
示例8: 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();
}
示例9: _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;
}
}
}
示例10: displayNavigationBanner
function displayNavigationBanner($pageName, $aOtherCampaigns, $aOtherBanners, $aEntities)
{
global $phpAds_TextDirection;
$advertiserId = $aEntities['clientid'];
$campaignId = $aEntities['campaignid'];
$bannerId = $aEntities['bannerid'];
$entityString = _getEntityString($aEntities);
$aOtherEntities = $aEntities;
unset($aOtherEntities['bannerid']);
$otherEntityString = _getEntityString($aOtherEntities);
if ($pageName == 'banner-designer.php' && empty($bannerId)) {
$tabValue = 'banner-designer_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}";
}
// Build ad preview
if ($bannerId && 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 />";
}
addBannerPageTools($advertiserId, $campaignId, $bannerId, $aOtherCampaigns, $aOtherBanners, $aEntities);
phpAds_PageHeader($tabValue, $oHeaderModel);
}