当前位置: 首页>>代码示例>>PHP>>正文


PHP Admin_DA::getZones方法代码示例

本文整理汇总了PHP中Admin_DA::getZones方法的典型用法代码示例。如果您正苦于以下问题:PHP Admin_DA::getZones方法的具体用法?PHP Admin_DA::getZones怎么用?PHP Admin_DA::getZones使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Admin_DA的用法示例。


在下文中一共展示了Admin_DA::getZones方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getZones

 function getZones()
 {
     global $list_filters;
     if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
         $aParams = array();
         $aPublishers = Admin_DA::getPublishers($aParams);
         // set publisher id if list is to be filtered by publisher
         if (isset($list_filters['publisher'])) {
             $aParams = array('publisher_id' => $list_filters['publisher']);
         } else {
             // else use all publishers
             $aParams = array('publisher_id' => implode(',', array_keys($aPublishers)));
         }
         if (isset($this->_filter)) {
             $aParams['zone_inventory_forecast_type'] = $this->getForecastType();
         }
         $aZones = Admin_DA::getZones($aParams);
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
         $aParams = array('agency_id' => OA_Permission::getEntityId());
         $aPublishers = Admin_DA::getPublishers($aParams);
         // set publisher id if list is to be filtered by publisher
         if (isset($list_filters['publisher'])) {
             $aParams = array('publisher_id' => $list_filters['publisher']);
         } else {
             // else use all of this agency's publishers
             $aParams = array('publisher_id' => implode(',', array_keys($aPublishers)));
         }
         if (isset($this->_filter)) {
             $aParams['zone_inventory_forecast_type'] = $this->getForecastType();
         }
         $aZones = Admin_DA::getZones($aParams);
     } elseif (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
         $aParams = array('publisher_id' => OA_Permission::getEntityId());
         $aPublishers = Admin_DA::getPublishers($aParams);
         $aParams = array('publisher_id' => implode(',', array_keys($aPublishers)));
         if (isset($this->_filter)) {
             $aParams['zone_inventory_forecast_type'] = $this->getForecastType();
         }
         $aZones = Admin_DA::getZones($aParams);
     } else {
         $aPublishers = array();
         $aZones = array();
     }
     $aZoneArray = array();
     foreach ($aPublishers as $publisherId => $aPublisher) {
         foreach ($aZones as $zoneId => $aZone) {
             if ($aZone['publisher_id'] == $publisherId) {
                 $aZoneArray[$zoneId] = phpads_buildName($publisherId, MAX_getPublisherName($aPublisher['name'])) . " - " . phpAds_buildName($zoneId, MAX_getZoneName($aZone['name']));
             }
         }
     }
     return $aZoneArray;
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:53,代码来源:ZoneIdField.php

示例2: displayPage

function displayPage($aZone, $form)
{
    $pageName = basename($_SERVER['SCRIPT_NAME']);
    $agencyId = OA_Permission::getAgencyId();
    $aEntities = array('affiliateid' => $aZone['affiliateid'], 'zoneid' => $aZone['zoneid']);
    $aOtherPublishers = Admin_DA::getPublishers(array('agency_id' => $agencyId));
    $aOtherZones = Admin_DA::getZones(array('publisher_id' => $aZone['affiliateid']));
    MAX_displayNavigationZone($pageName, $aOtherPublishers, $aOtherZones, $aEntities);
    //get template and display form
    $oTpl = new OA_Admin_Template('zone-advanced.html');
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    _echoDeliveryCappingJs();
    //footer
    phpAds_PageFooter();
}
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:16,代码来源:zone-advanced.php

示例3: foreach

    }
}
// Get publishers if we show them
if ($showPublishers) {
    if (OA_Permission::isAccount(OA_ACCOUNT_TRAFFICKER)) {
        $tempPublisherId = OA_Permission::getEntityId();
        $aPublisherList = Admin_DA::getPublishers(array('publisher_id' => $tempPublisherId));
    } else {
        $aPublisherList = Admin_DA::getPublishers(array('agency_id' => $agencyId));
    }
    $aPublisher[0] = $GLOBALS['strSelectPublisher'];
    foreach ($aPublisherList as $key => $aValue) {
        $aPublisher[$aValue['publisher_id']] = $aValue['name'];
    }
    if (!empty($publisherId)) {
        $zone = Admin_DA::getZones(array('publisher_id' => $publisherId));
        $aZone[0] = $GLOBALS['strSelectZone'];
        foreach ($zone as $key => $aValue) {
            $aZone[$aValue['zone_id']] = $aValue['name'];
        }
    }
}
$oTrans = new OX_Translation();
$aParams = array('order' => $orderdirection, 'listorder' => $listorder, 'start_date' => $startDate, 'end_date' => $endDate, 'prevImg' => '<< ' . $oTrans->translate('Back'), 'nextImg' => $oTrans->translate('Next') . ' >>');
// Only pass advertiser or website props if we show related checkboxes
if ($showAdvertisers) {
    $aParams['advertiser_id'] = $advertiserId;
    $aParams['campaign_id'] = $campaignId;
}
if ($showPublishers) {
    $aParams['publisher_id'] = $publisherId;
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:31,代码来源:userlog-index.php

示例4: testGetZones

 function testGetZones()
 {
     $conf = $GLOBALS['_MAX']['CONF'];
     $dbh =& OA_DB::singleton();
     $ret = $this->newZone();
     $this->assertTrue(is_int($ret));
     $this->assertTrue($ret > 0);
     //  get zone record as control element
     $query = 'SELECT * FROM ' . $dbh->quoteIdentifier($conf['table']['prefix'] . 'zones', true) . ' WHERE zoneid = ' . $ret;
     $aZone1 = $dbh->queryRow($query);
     $this->assertTrue(is_array($aZone1));
     //  massage results so as to be comparable with Admin_DA::getZone()
     Admin_DA::_switch($aZone1, 'affiliateid', 'publisher_id');
     Admin_DA::_switch($aZone1, 'zonename', 'name');
     Admin_DA::_switch($aZone1, 'delivery', 'type');
     Admin_DA::_switch($aZone1, 'zoneid', 'zone_id');
     unset($aZone1['zonetype']);
     unset($aZone1['appendtype']);
     unset($aZone1['forceappend']);
     unset($aZone1['inventory_forecast_type']);
     unset($aZone1['height']);
     unset($aZone1['width']);
     unset($aZone1['updated']);
     unset($aZone1['block']);
     unset($aZone1['capping']);
     unset($aZone1['session_capping']);
     unset($aZone1['category']);
     unset($aZone1['rate']);
     unset($aZone1['pricing']);
     unset($aZone1['show_capped_no_cookie']);
     $aZone1 = array_filter($aZone1, 'strlen');
     $aZone2 = Admin_DA::getZones(array('zone_id' => $ret));
     /*
     Array
     (
         [80] => Array
             (
                 [zone_id] => 80
                 [publisher_id] => 508
                 [name] => toufreacli
                 [type] => 3
             )
     
     )
     */
     $this->assertTrue(is_array($aZone2[$ret]));
     $this->assertEqual($aZone1, $aZone2[$ret]);
     $zoneId = $this->newZone();
     $doZones = OA_DAL::staticGetDO('zones', $zoneId);
     $doZones->inventory_forecast_type = 5;
     $doZones->update();
     $aZone = Admin_DA::getZones(array('zone_inventory_forecast_type' => 1));
     $this->assertTrue($aZone);
     // The returned zone isn't null or false or empty.
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:55,代码来源:AdminDA.dal.test.php

示例5: MAX_adjustAdZones

function MAX_adjustAdZones($adId)
{
    $aAdZones = Admin_DA::getAdZones(array('ad_id' => $adId), true, 'zone_id');
    if (!empty($aAdZones)) {
        $aAd = Admin_DA::getAd($adId);
        $aZones = Admin_DA::getZones(array('zone_id' => implode(',', array_keys($aAdZones))), true);
        // get zones linked to this campaign
        $aPlacementZones = Admin_DA::getPlacementZones(array('placement_id' => $aAd['placement_id']), true, 'zone_id');
        foreach ($aZones as $zoneId => $aZone) {
            if (!MAX_checkAdZoneValid($aZone, $aAd)) {
                Admin_DA::deleteAdZones(array('zone_id' => $zoneId, 'ad_id' => $adId));
            } else {
                // if ad's campaign is linked to this zone, link ad to zone
                if (isset($aPlacementZones[$zoneId])) {
                    Admin_DA::addAdZone(array('zone_id' => $zoneId, 'ad_id' => $adId));
                }
            }
        }
    }
}
开发者ID:villos,项目名称:tree_admin,代码行数:20,代码来源:common.php

示例6: _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;
 }
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:22,代码来源:Admin_DA.php

示例7: displayPage

function displayPage($zone, $form, $zoneErrors = null)
{
    //header and breadcrumbs
    $pageName = basename($_SERVER['PHP_SELF']);
    $agencyId = OA_Permission::getAgencyId();
    $aEntities = array('affiliateid' => $zone['affiliateid'], 'zoneid' => $zone['zoneid']);
    $aOtherPublishers = Admin_DA::getPublishers(array('agency_id' => $agencyId));
    $aOtherZones = Admin_DA::getZones(array('publisher_id' => $zone['affiliateid']));
    MAX_displayNavigationZone($pageName, $aOtherPublishers, $aOtherZones, $aEntities);
    //get template and display form
    $oTpl = new OA_Admin_Template('zone-edit.html');
    $oTpl->assign('zoneid', $zone['zoneid']);
    $oTpl->assign('zoneHeight', $zone["height"]);
    $oTpl->assign('zoneWidth', $zone["width"]);
    $oTpl->assign('zoneErrors', $zoneErrors);
    $oTpl->assign('form', $form->serialize());
    $oTpl->display();
    //footer
    phpAds_PageFooter();
}
开发者ID:villos,项目名称:tree_admin,代码行数:20,代码来源:zone-edit.php

示例8: _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;
         }
     }
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:95,代码来源:Common.php

示例9: phpAds_SessionDataStore

OA_Permission::enforceAccessToObject('zones', $zoneid);
/*-------------------------------------------------------*/
/* Store preferences									 */
/*-------------------------------------------------------*/
$session['prefs']['inventory_entities'][OA_Permission::getEntityId()]['affiliateid'] = $affiliateid;
phpAds_SessionDataStore();
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
// Initialise some parameters
$pageName = basename($_SERVER['PHP_SELF']);
$tabIndex = 1;
$agencyId = OA_Permission::getAgencyId();
$aEntities = array('affiliateid' => $affiliateid, 'zoneid' => $zoneid);
$aOtherPublishers = Admin_DA::getPublishers(array('agency_id' => $agencyId));
$aOtherZones = Admin_DA::getZones(array('publisher_id' => $affiliateid));
MAX_displayNavigationZone($pageName, $aOtherPublishers, $aOtherZones, $aEntities);
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
function phpAds_showZoneBanners($zoneId)
{
    $pref = $GLOBALS['_MAX']['PREF'];
    global $phpAds_TextDirection;
    global $strUntitled, $strName, $strID, $strWeight, $strShowBanner;
    global $strCampaignWeight, $strBannerWeight, $strProbability, $phpAds_TextAlignRight, $phpAds_TextAlignLeft;
    global $strRawQueryString, $strZoneProbListChain, $strZoneProbNullPri, $strZoneProbListChainLoop;
    global $strExclusiveAds, $strHighAds, $strLowAds, $strECPMAds, $strLimitations, $strCapping, $strNoLimitations, $strPriority;
    MAX_Dal_Delivery_Include();
    $aZoneLinkedAds = OA_Dal_Delivery_getZoneLinkedAds($zoneId);
    if (empty($aZoneLinkedAds['xAds']) && empty($aZoneLinkedAds['ads']) && empty($aZoneLinkedAds['lAds']) && empty($aZoneLinkedAds['eAds'])) {
开发者ID:villos,项目名称:tree_admin,代码行数:31,代码来源:zone-probability.php

示例10: MAX_sortArray

} else {
    echo "<br /><br />";
}
$zoneToSelect = false;
if (!empty($aPublishers)) {
    MAX_sortArray($aPublishers, $listorder == 'id' ? 'publisher_id' : $listorder, $orderdirection == 'up');
    $i = 0;
    //select all checkboxes
    $publisherIdList = '';
    foreach ($aPublishers as $publisherId => $aPublisher) {
        $publisherIdList .= $publisherId . '|';
    }
    echo "<input type='checkbox' id='selectAllField' onClick='toggleAllZones(\"" . $publisherIdList . "\");'><label for='selectAllField'>" . $strSelectUnselectAll . "</label>";
    foreach ($aPublishers as $publisherId => $aPublisher) {
        $publisherName = $aPublisher['name'];
        $aZones = Admin_DA::getZones($aParams + array('publisher_id' => $publisherId), true);
        if (!empty($aZones)) {
            $zoneToSelect = true;
            $bgcolor = $i % 2 == 0 ? " bgcolor='#F6F6F6'" : '';
            $bgcolorSave = $bgcolor;
            $allchecked = true;
            foreach ($aZones as $zoneId => $aZone) {
                if (!isset($aLinkedZones[$zoneId])) {
                    $allchecked = false;
                    break;
                }
            }
            $checked = $allchecked ? ' checked' : '';
            if ($i > 0) {
                echo "\n<tr height='1'>\n    <td colspan='3' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td>\n</tr>";
            }
开发者ID:villos,项目名称:tree_admin,代码行数:31,代码来源:banner-zone.php


注:本文中的Admin_DA::getZones方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。