if (empty($clientid)) {
        //was empty, is still empty - just pick one, no need for redirect
        $ids = array_keys($aAdvertisers);
        $clientid = !empty($ids) ? $ids[0] : -1;
        //if no advertisers set to non-existent id
    }
} else {
    if (!isset($aAdvertisers[$clientid])) {
        $page = basename($_SERVER['SCRIPT_NAME']);
        OX_Admin_Redirect::redirect($page);
    }
}
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
$oHeaderModel = buildHeaderModel($clientid, $aAdvertisers);
phpAds_PageHeader(null, $oHeaderModel);
/*-------------------------------------------------------*/
/* Get preferences                                       */
/*-------------------------------------------------------*/
if (!isset($hideinactive)) {
    if (isset($session['prefs']['advertiser-campaigns.php'][$clientid]['hideinactive'])) {
        $hideinactive = $session['prefs']['advertiser-campaigns.php'][$clientid]['hideinactive'];
    } else {
        $pref =& $GLOBALS['_MAX']['PREF'];
        $hideinactive = $pref['ui_hide_inactive'] == true;
    }
}
if (!isset($listorder)) {
    if (isset($session['prefs']['advertiser-campaigns.php'][$clientid]['listorder'])) {
        $listorder = $session['prefs']['advertiser-campaigns.php'][$clientid]['listorder'];
Esempio n. 2
0
+---------------------------------------------------------------------------+
$Id: website-index.php 37157 2009-05-28 12:31:10Z andrew.hill $
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/lib/OA/Dal.php';
require_once MAX_PATH . '/www/admin/config.php';
// Register input variables
phpAds_registerGlobalUnslashed('hideinactive', 'listorder', 'orderdirection', 'pubid', 'url', 'country', 'language', 'category', 'adnetworks', 'advsignup', 'formId');
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER);
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageHeader(null, buildHeaderModel());
/*-------------------------------------------------------*/
/* Get preferences                                       */
/*-------------------------------------------------------*/
if (!isset($listorder)) {
    if (isset($session['prefs']['website-index.php']['listorder'])) {
        $listorder = $session['prefs']['website-index.php']['listorder'];
    } else {
        $listorder = '';
    }
}
if (!isset($orderdirection)) {
    if (isset($session['prefs']['website-index.php']['orderdirection'])) {
        $orderdirection = $session['prefs']['website-index.php']['orderdirection'];
    } else {
        $orderdirection = '';
        }
    }
}
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
// Initialise some parameters
$pageName = basename($_SERVER['SCRIPT_NAME']);
$tabindex = 1;
$agencyId = OA_Permission::getAgencyId();
$aEntities = array('clientid' => $clientid, 'campaignid' => $campaignid);
$oTrans = new OX_Translation();
// Display navigation
$aOtherAdvertisers = Admin_DA::getAdvertisers(array('agency_id' => $agencyId));
$aOtherCampaigns = Admin_DA::getPlacements(array('advertiser_id' => $clientid));
$oHeaderModel = buildHeaderModel($aEntities);
phpAds_PageHeader(null, $oHeaderModel);
/*-------------------------------------------------------*/
/* Get preferences                                       */
/*-------------------------------------------------------*/
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;
    }
}
if (!isset($listorder)) {
    if (isset($session['prefs']['campaign-banners.php'][$campaignid]['listorder'])) {
        $listorder = $session['prefs']['campaign-banners.php'][$campaignid]['listorder'];
        //was empty, is still empty - just pick one, no need for redirect
        $ids = array_keys($aWebsites);
        $affiliateid = !empty($ids) ? $ids[0] : -1;
        //if no websites set to non-existent id
    }
} else {
    if (!isset($aWebsites[$affiliateid])) {
        //bad id, redirect
        $page = basename($_SERVER['SCRIPT_NAME']);
        OX_Admin_Redirect::redirect($page);
    }
}
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
$oHeaderModel = buildHeaderModel($affiliateid);
phpAds_PageHeader(null, $oHeaderModel);
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
$oTpl = new OA_Admin_Template('channel-index.html');
$channels = Admin_DA::getChannels(array('publisher_id' => $affiliateid), true);
$aChannels = array();
foreach ($channels as $channelId => $channel) {
    $aChannels[$channelId] = $channel;
}
$oTpl->assign('aChannels', $aChannels);
$oTpl->assign('entityUrl', 'affiliate-channels.php');
$oTpl->assign('entityId', 'affiliateid=' . $affiliateid);
$oTpl->assign('affiliateId', $affiliateid);