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


PHP Admin_DA::getAds方法代码示例

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


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

示例1: MAX_addLinkedAdsToZone

function MAX_addLinkedAdsToZone($zoneId, $placementId)
{
    $aParams = MAX_getLinkedAdParams($zoneId);
    $aParams['placement_id'] = $placementId;
    $aAds = Admin_DA::getAds($aParams);
    //  FIXME
    $aLinkedAds = Admin_DA::getAdZones(array('zone_id' => $zoneId), false, 'ad_id');
    foreach ($aAds as $adId => $aAd) {
        if (!isset($aLinkedAds[$adId])) {
            $ret = Admin_DA::addAdZone(array('zone_id' => $zoneId, 'ad_id' => $adId));
            if (PEAR::isError($ret)) {
                return false;
            }
        }
    }
    return true;
}
开发者ID:villos,项目名称:tree_admin,代码行数:17,代码来源:common.php

示例2: deletePlacementZones

 /**
  * @param array $aParams
  * @param bool $allFields
  * @return mixed 0 if no rows affected, true on success, false otherwise
  */
 function deletePlacementZones($aParams, $allFields = false)
 {
     $result = SqlBuilder::_doDelete('placement_zone_assoc', $aParams);
     // Unlink any ads in the campaign that are linked to the zone.
     $pAds = Admin_DA::getAds(array('placement_id' => $aParams['placement_id']));
     foreach ($pAds as $adId => $pAd) {
         SqlBuilder::_doDelete('ad_zone_assoc', array('zone_id' => $aParams['zone_id'], 'ad_id' => $adId));
     }
     return $result;
 }
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:15,代码来源:Admin_DA.php

示例3: 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>&nbsp;&nbsp;{$GLOBALS['strName']}</b></td>\n        <td width='20%'><b>&nbsp;&nbsp;{$GLOBALS['strType']}</b></td>\n        <td><b>{$GLOBALS['strID']}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></td>\n        <td>&nbsp;</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 ? '&nbsp;' : 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            &nbsp;&nbsp;<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            &nbsp;&nbsp;<img src='{$placementIcon}' align='absmiddle'>\n            &nbsp;{$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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src='{$adIcon}' align='absmiddle'>&nbsp;{$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'>&nbsp;<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>&nbsp;&nbsp;\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 ? "&nbsp;&nbsp;|&nbsp;&nbsp;{$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);
    }
}
开发者ID:Spark-Eleven,项目名称:revive-adserver,代码行数:74,代码来源:html.php

示例4: processForm


//.........这里部分代码省略.........
            // 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 {
                if ($size_changed) {
                    $aZone = Admin_DA::getZone($aFields['zoneid']);
                    // Loop through all appended banners and make sure that they still fit...
                    $aAds = Admin_DA::getAdZones(array('zone_id' => $aFields['zoneid']), false, 'ad_id');
                    if (!empty($aAds)) {
                        foreach ($aAds as $adId => $aAd) {
                            $aAd = Admin_DA::getAd($adId);
                            if ($aZone['type'] == phpAds_ZoneText && $aAd['type'] != 'txt' || $aAd['width'] != $aZone['width'] && $aZone['width'] > -1 || $aAd['height'] != $aZone['height'] && $aZone['height'] > -1) {
                                Admin_DA::deleteAdZones(array('zone_id' => $aFields['zoneid'], 'ad_id' => $adId));
                            }
                        }
                    }
                    // Check if any campaigns linked to this zone have ads that now fit.
                    // If so, link them to the zone.
                    $aPlacementZones = Admin_DA::getPlacementZones(array('zone_id' => $aFields['zoneid']), true);
                    if (!empty($aPlacementZones)) {
                        foreach ($aPlacementZones as $aPlacementZone) {
                            // get ads in this campaign
                            $aAds = Admin_DA::getAds(array('placement_id' => $aPlacementZone['placement_id']), true);
                            foreach ($aAds as $adId => $aAd) {
                                Admin_DA::addAdZone(array('zone_id' => $aFields['zoneid'], 'ad_id' => $adId));
                            }
                        }
                    }
                }
            }
            // Queue confirmation message
            $translation = new OX_Translation();
            $translated_message = $translation->translate($GLOBALS['strZoneHasBeenUpdated'], array(MAX::constructURL(MAX_URL_ADMIN, "zone-edit.php?affiliateid=" . $aFields['affiliateid'] . "&zoneid=" . $aFields['zoneid']), htmlspecialchars($aFields['zonename'])));
            OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
            OX_Admin_Redirect::redirect("zone-edit.php?affiliateid=" . $aFields['affiliateid'] . "&zoneid=" . $aFields['zoneid']);
        } else {
            $doZones = OA_Dal::factoryDO('zones');
            $doZones->affiliateid = $aFields['affiliateid'];
            $doZones->zonename = $aFields['zonename'];
            $doZones->zonetype = phpAds_ZoneCampaign;
            $doZones->description = $aFields['description'];
            $doZones->comments = $aFields['comments'];
            $doZones->width = $aFields['width'];
            $doZones->height = $aFields['height'];
            $doZones->delivery = $aFields['delivery'];
            $doZones->oac_category_id = $aFields['oac_category_id'];
            // The following fields are NOT NULL but do not get values set in the form.
            // Should these fields be changed to NULL in the schema or should they have a default value?
            $doZones->category = '';
            $doZones->ad_selection = '';
            $doZones->chain = '';
            $doZones->prepend = '';
            $doZones->append = '';
            $aFields['zoneid'] = $doZones->insert();
            // Ad  Networks
            $doPublisher = OA_Dal::factoryDO('affiliates');
            $doPublisher->get($aFields['affiliateid']);
            $anWebsiteId = $doPublisher->as_website_id;
            if ($anWebsiteId) {
                $oAdNetworks = new OA_Central_AdNetworks();
                $oAdNetworks->updateZone($doZones, $anWebsiteId);
            }
            // Queue confirmation message
            $translation = new OX_Translation();
            $translated_message = $translation->translate($GLOBALS['strZoneHasBeenAdded'], array(MAX::constructURL(MAX_URL_ADMIN, 'zone-edit.php?affiliateid=' . $aFields['affiliateid'] . '&zoneid=' . $aFields['zoneid']), htmlspecialchars($aFields['zonename'])));
            OA_Admin_UI::queueMessage($translated_message, 'local', 'confirm', 0);
            OX_Admin_Redirect::redirect("affiliate-zones.php?affiliateid=" . $aFields['affiliateid']);
        }
    }
    return $errors;
}
开发者ID:villos,项目名称:tree_admin,代码行数:101,代码来源:zone-edit.php

示例5: array

        $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);'>";
    echo "<input type='hidden' name='clientid' value='" . (isset($clientid) && $clientid != '' ? $clientid : '') . "'>";
开发者ID:villos,项目名称:tree_admin,代码行数:31,代码来源:banner-advanced.php

示例6: 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();
}
开发者ID:rcdesign-cemetery,项目名称:openx-markedtext,代码行数:68,代码来源:banner-edit.php

示例7: array

    $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++)
            {
开发者ID:villos,项目名称:tree_admin,代码行数:31,代码来源:zone-include.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: 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();
}
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:36,代码来源:banner-edit.php

示例10: display_page

function display_page($banner_id, $campaign_id, $client_id)
{
    $page_name = basename($_SERVER['PHP_SELF']);
    $entities = array('clientid' => $client_id, 'campaignid' => $campaign_id, 'bannerid' => $banner_id);
    $entity_id = OA_Permission::getEntityId();
    if (OA_Permission::isAccount(OA_ACCOUNT_ADVERTISER)) {
        $entity_type = 'advertiser_id';
    } else {
        $entity_type = 'agency_id';
    }
    // Display navigation
    $other_campaigns = Admin_DA::getPlacements(array($entity_type => $entity_id));
    $other_banners = Admin_DA::getAds(array('placement_id' => $campaign_id), false);
    displayNavigationBanner($page_name, $other_campaigns, $other_banners, $entities);
    if (!empty($banner_id)) {
        $template_id = OA_Dal::factoryDO('Zpbanners')->get_zp_banner_id((int) $banner_id);
        $form = explode('|', form_ajax_request($template_id));
    }
    $template = new OA_Plugin_Template('designer-form.html', 'bannerDesigner');
    //$oTpl->debugging = true;
    $template->assign('bannerid', $banner_id);
    $template->assign('campaignid', $campaign_id);
    $template->assign('clientid', $client_id);
    $template->assign('template_id', $template_id);
    $template->assign('form', $form);
    $template->display();
    phpAds_PageFooter();
}
开发者ID:TheProjecter,项目名称:openx-banner-creator,代码行数:28,代码来源:banner-designer.php


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