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


PHP Admin_DA::getZone方法代码示例

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


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

示例1: beforePageHeader

 public function beforePageHeader(OX_Admin_UI_Event_EventContext $oEventContext)
 {
     $pageId = $oEventContext->data['pageId'];
     $pageData = $oEventContext->data['pageData'];
     $oHeaderModel = $oEventContext->data['headerModel'];
     $agencyId = $pageData['agencyid'];
     $campaignId = $pageData['campaignid'];
     $advertiserId = $pageData['clientid'];
     $oEntityHelper = $this->oMarkedTextAdvertiserComponent->getEntityHelper();
     if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
         switch ($pageId) {
             case 'campaign-banners':
                 $oDalZones = OA_Dal::factoryDAL('zones');
                 $linkedWebsites = $oDalZones->getWebsitesAndZonesListByCategory($agencyId, null, $campaignId, true);
                 $arraylinkedWebsitesKeys = array_keys($linkedWebsites);
                 $linkedWebsitesKey = $arraylinkedWebsitesKeys[0];
                 $arraylinkedZonesKeys = array_keys($linkedWebsites[$linkedWebsitesKey]['zones']);
                 $zoneId = $arraylinkedZonesKeys[0];
                 $aZone = Admin_DA::getZone($zoneId);
                 if ($aZone['type'] == 3) {
                     if (OA_Permission::hasAccessToObject('clients', $clientid) && OA_Permission::hasAccessToObject('campaigns', $campaignid)) {
                         OX_Admin_Redirect::redirect('plugins/' . $this->oMarkedTextAdvertiserComponent->group . "/oxMarkedTextAdvertiser-index.php?campaignid={$campaignId}&clientid={$advertiserId}");
                     }
                 }
                 break;
         }
     }
 }
开发者ID:rcdesign-cemetery,项目名称:openx-markedtext,代码行数:28,代码来源:EntityScreenManager.php

示例2: testGetZone

 function testGetZone()
 {
     $conf = $GLOBALS['_MAX']['CONF'];
     $dbh =& OA_DB::singleton();
     $id = $this->newZone();
     $this->assertTrue(is_int($id));
     $this->assertTrue($id > 0);
     // Get zone record as control element
     $query = 'SELECT * FROM ' . $dbh->quoteIdentifier($conf['table']['prefix'] . 'zones', true) . ' WHERE zoneid = ' . $id;
     $aZone1 = $dbh->getRow($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['updated']);
     $aZone1 = array_filter($aZone1, 'strlen');
     $aZone2 = Admin_DA::getZone($id);
     /*
     Array
     (
         [zone_id] => 80
         [publisher_id] => 508
         [name] => toufreacli
         [type] => 3
         [description] =>
         [width] => 0
         [height] => 0
         [chain] =>
         [prepend] =>
         [append] =>
         [appendtype] => 0
         [forceappend] => f
         [inventory_forecast_type] => 0
     )
     */
     $this->assertTrue(is_array($aZone2));
     $this->assertTrue(count($aZone2) > 0);
     $this->assertTrue(array_key_exists('zone_id', $aZone2));
     $this->assertTrue(array_key_exists('publisher_id', $aZone2));
     $this->assertTrue(array_key_exists('name', $aZone2));
     $this->assertTrue(array_key_exists('type', $aZone2));
     $this->assertTrue(array_key_exists('description', $aZone2));
     $this->assertTrue(array_key_exists('width', $aZone2));
     $this->assertTrue(array_key_exists('height', $aZone2));
     $this->assertTrue(array_key_exists('chain', $aZone2));
     $this->assertTrue(array_key_exists('prepend', $aZone2));
     $this->assertTrue(array_key_exists('append', $aZone2));
     $this->assertTrue(array_key_exists('appendtype', $aZone2));
     $this->assertTrue(array_key_exists('forceappend', $aZone2));
     $this->assertTrue(array_key_exists('inventory_forecast_type', $aZone2));
     $this->assertTrue(array_key_exists('comments', $aZone2));
     $this->assertTrue(array_key_exists('block', $aZone2));
     $this->assertTrue(array_key_exists('capping', $aZone2));
     $this->assertTrue(array_key_exists('session_capping', $aZone2));
     $this->assertTrue(array_key_exists('show_capped_no_cookie', $aZone2));
     $aZone2 = array_filter($aZone2, 'strlen');
     $this->assertEqual($aZone1, $aZone2);
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:61,代码来源:AdminDA.dal.test.php

示例3: basename

        }
    } else {
        if (!isset($aCampaigns[$campaignid])) {
            $page = basename($_SERVER['SCRIPT_NAME']);
            OX_Admin_Redirect::redirect("{$page}?clientid={$clientid}");
        }
    }
}
$agencyId = OA_Permission::getAgencyId();
$oDalZones = OA_Dal::factoryDAL('zones');
$linkedWebsites = $oDalZones->getWebsitesAndZonesListByCategory($agencyId, null, $campaignid, true);
$arraylinkedWebsitesKeys = array_keys($linkedWebsites);
$linkedWebsitesKey = $arraylinkedWebsitesKeys[0];
$arraylinkedZonesKeys = array_keys($linkedWebsites[$linkedWebsitesKey]['zones']);
$zoneId = $arraylinkedZonesKeys[0];
$aZone = Admin_DA::getZone($zoneId);
if ($aZone['type'] != 3) {
    OX_Admin_Redirect::redirect("campaign-banners.php?clientid={$clientid}&campaignid={$campaignid}");
}
$pageName = 'campaign-banners';
$tabindex = 1;
$aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid);
$oTrans = new OX_Translation();
$oHeaderModel = buildHeaderModel($aEntities);
phpAds_PageHeader('advertiser-campaigns', $oHeaderModel);
if (!isset($hideinactive)) {
    if (isset($session['prefs']['campaign-banners.php'][$campaignid]['hideinactive'])) {
        $hideinactive = $session['prefs']['campaign-banners.php'][$campaignid]['hideinactive'];
    } else {
        $pref =& $GLOBALS['_MAX']['PREF'];
        $hideinactive = $pref['ui_hide_inactive'] == true;
开发者ID:rcdesign-cemetery,项目名称:openx-markedtext,代码行数:31,代码来源:oxMarkedTextAdvertiser-index.php

示例4: MAX_getLinkedAdParams

function MAX_getLinkedAdParams($zoneId)
{
    $aParams = array();
    $aZone = Admin_DA::getZone($zoneId);
    if ($aZone['type'] == phpAds_ZoneText) {
        $aParams['ad_type'] = 'txt';
    } else {
        $aParams['ad_type'] = '!txt';
        if ($aZone['width'] > -1) {
            $aParams['ad_width'] = $aZone['width'];
        }
        if ($aZone['height'] > -1) {
            $aParams['ad_height'] = $aZone['height'];
        }
    }
    return $aParams;
}
开发者ID:villos,项目名称:tree_admin,代码行数:17,代码来源:common.php

示例5: isZoneVast

 public function isZoneVast($zoneId)
 {
     $zone = Admin_DA::getZone($zoneId);
     return in_array($zone['type'], array(OX_ZoneVideoOverlay, OX_ZoneVideoInstream));
 }
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:5,代码来源:stats-api.php

示例6: duplicateZone

 function duplicateZone($zoneId)
 {
     $aZone = Admin_DA::getZone($zoneId);
     return Admin_DA::_duplicateZone($aZone, true);
 }
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:5,代码来源:Admin_DA.php

示例7: 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 {
//.........这里部分代码省略.........
开发者ID:villos,项目名称:tree_admin,代码行数:101,代码来源:zone-edit.php

示例8: MAX_getLinkedAdParams

function MAX_getLinkedAdParams($zoneId)
{
    $aParams = array();
    $aZone = Admin_DA::getZone($zoneId);
    if ($aZone['type'] == phpAds_ZoneText) {
        $aParams['ad_type'] = 'txt';
    } else {
        $aParams['ad_type'] = '!txt';
        if ($aZone['width'] != -1) {
            $aParams['ad_width'] = $aZone['width'];
        }
        if ($aZone['height'] != -1) {
            $aParams['ad_height'] = $aZone['height'];
        }
    }
    // Allow linking *x* banners
    $aParams['ad_nosize'] = true;
    return $aParams;
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:19,代码来源:common.php


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