require "lib-zones.inc.php";
require "../libraries/lib-priority.inc.php";
// Register input variables
phpAds_registerGlobal('value');
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Client);
/*********************************************************/
/* Main code                                             */
/*********************************************************/
if ($value == "t") {
    $value = "f";
} else {
    $value = "t";
}
if (phpAds_isUser(phpAds_Client)) {
    if ($value == 'f' && phpAds_isAllowed(phpAds_DisableBanner) || $value == 't' && phpAds_isAllowed(phpAds_ActivateBanner)) {
        $result = phpAds_dbQuery("\n\t\t\tSELECT\n\t\t\t\tclientid\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_banners'] . "\n\t\t\tWHERE\n\t\t\t\tbannerid = '{$bannerid}'\n\t\t\t") or phpAds_sqlDie();
        $row = phpAds_dbFetchArray($result);
        if ($row["clientid"] == '' || phpAds_getUserID() != phpAds_getParentID($row["clientid"])) {
            phpAds_PageHeader("1");
            phpAds_Die($strAccessDenied, $strNotAdmin);
        } else {
            $campaignid = $row["clientid"];
            $res = phpAds_dbQuery("\n\t\t\t\tUPDATE\n\t\t\t\t\t" . $phpAds_config['tbl_banners'] . "\n\t\t\t\tSET\n\t\t\t\t\tactive = '{$value}'\n\t\t\t\tWHERE\n\t\t\t\t\tbannerid = '{$bannerid}'\n\t\t\t\t") or phpAds_sqlDie();
            // Rebuild priorities
            phpAds_PriorityCalculate();
            // Rebuild cache
            if (!defined('LIBVIEWCACHE_INCLUDED')) {
                include phpAds_path . '/libraries/deliverycache/cache-' . $phpAds_config['delivery_caching'] . '.inc.php';
            }
            phpAds_cacheDelete();
        $extra .= "<img src='images/break.gif' height='1' width='160' vspace='4'><br>";
        $extra .= "<a href='stats-reset.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}'" . phpAds_DelConfirm($strConfirmResetBannerStats) . ">";
        $extra .= "<img src='images/" . $phpAds_TextDirection . "/icon-undo.gif' align='absmiddle' border='0'>&nbsp;{$strResetStats}</a>";
        $extra .= "<br><br>";
    }
    phpAds_PageHeader("2.1.2.2.1", $extra);
    echo "<img src='images/icon-advertiser.gif' align='absmiddle'>&nbsp;" . phpAds_getParentClientName($campaignid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-campaign.gif' align='absmiddle'>&nbsp;" . phpAds_getCampaignName($campaignid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-banner-stored.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getBannerName($bannerid) . "</b><br><br>";
    echo phpAds_buildBannerCode($bannerid) . "<br><br><br><br>";
    phpAds_ShowSections(array("2.1.2.2.1", "2.1.2.2.2"));
} elseif (phpAds_isUser(phpAds_Client)) {
    $sections[] = "1.2.2.1";
    if (phpAds_isAllowed(phpAds_ModifyBanner)) {
        $sections[] = "1.2.2.2";
    }
    $sections[] = "1.2.2.4";
    phpAds_PageHeader("1.2.2.1");
    echo "<img src='images/icon-campaign.gif' align='absmiddle'>&nbsp;" . phpAds_getCampaignName($campaignid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-banner-stored.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getBannerName($bannerid) . "</b><br><br>";
    echo phpAds_buildBannerCode($bannerid) . "<br><br><br><br>";
    phpAds_ShowSections($sections);
}
/*********************************************************/
/* Main code                                             */
/*********************************************************/
$lib_history_hourlyurl = "stats-banner-daily.php";
$lib_history_where = "bannerid = " . $bannerid;
    while ($row = phpAds_dbFetchArray($res)) {
        $extra .= "<option value='" . $row['affiliateid'] . "'>" . phpAds_buildAffiliateName($row['affiliateid'], $row['name']) . "</option>";
    }
    $extra .= "</select>&nbsp;<input type='image' src='images/" . $phpAds_TextDirection . "/go_blue.gif'><br>";
    $extra .= "<img src='images/break.gif' height='1' width='160' vspace='4'><br>";
    $extra .= "<img src='images/icon-recycle.gif' align='absmiddle'>&nbsp;<a href='zone-delete.php?affiliateid={$affiliateid}&zoneid={$zoneid}&returnurl=affiliate-zones.php'" . phpAds_DelConfirm($strConfirmDeleteZone) . ">{$strDelete}</a><br>";
    $extra .= "</form>";
    phpAds_PageHeader("4.2.3.6", $extra);
    echo "<img src='images/icon-affiliate.gif' align='absmiddle'>&nbsp;" . phpAds_getAffiliateName($affiliateid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-zone.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getZoneName($zoneid) . "</b><br><br><br>";
    phpAds_ShowSections(array("4.2.3.2", "4.2.3.6", "4.2.3.3", "4.2.3.4", "4.2.3.5"));
} else {
    $sections[] = "2.1.2";
    $sections[] = "2.1.6";
    if (phpAds_isAllowed(phpAds_LinkBanners)) {
        $sections[] = "2.1.3";
    }
    $sections[] = "2.1.4";
    $sections[] = "2.1.5";
    phpAds_PageHeader("2.1.6");
    echo "<img src='images/icon-affiliate.gif' align='absmiddle'>&nbsp;" . phpAds_getAffiliateName($affiliateid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-zone.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getZoneName($zoneid) . "</b><br><br><br>";
    phpAds_ShowSections($sections);
}
/*********************************************************/
/* Main code                                             */
/*********************************************************/
$res = phpAds_dbQuery("\n\tSELECT\n\t\t*\n\tFROM\n\t\t" . $phpAds_config['tbl_zones'] . "\n\tWHERE\n\t\tzoneid=" . $zoneid . "\n") or phpAds_sqlDie();
if (phpAds_dbNumRows($res)) {
    echo "</tr>";
    echo "<tr height='1'>";
    echo "<td " . ($i % 2 == 0 ? "bgcolor='#F6F6F6'" : "") . "><img src='images/spacer.gif' width='1' height='1'></td>";
    echo "<td colspan='3' bgcolor='#888888'><img src='images/break-l.gif' height='1' width='100%'></td>";
    echo "</tr>";
    echo "<tr height='25' " . ($i % 2 == 0 ? "bgcolor='#F6F6F6'" : "") . ">";
    // Empty
    echo "<td>&nbsp;</td>";
    // Button 1, 2 & 3
    echo "<td height='25' colspan='3'>";
    if (phpAds_isUser(phpAds_Admin) || phpAds_isAllowed(phpAds_LinkBanners)) {
        echo "<a href='zone-include.php?affiliateid=" . $affiliateid . "&zoneid=" . $row_zones['zoneid'] . "'><img src='images/icon-zone-linked.gif' border='0' align='absmiddle' alt='{$strIncludedBanners}'>&nbsp;{$strIncludedBanners}</a>&nbsp;&nbsp;&nbsp;&nbsp;";
    }
    echo "<a href='zone-probability.php?affiliateid=" . $affiliateid . "&zoneid=" . $row_zones['zoneid'] . "'><img src='images/icon-zone-probability.gif' border='0' align='absmiddle' alt='{$strProbability}'>&nbsp;{$strProbability}</a>&nbsp;&nbsp;&nbsp;&nbsp;";
    echo "<a href='zone-invocation.php?affiliateid=" . $affiliateid . "&zoneid=" . $row_zones['zoneid'] . "'><img src='images/icon-generatecode.gif' border='0' align='absmiddle' alt='{$strInvocationcode}'>&nbsp;{$strInvocationcode}</a>&nbsp;&nbsp;&nbsp;&nbsp;";
    if (phpAds_isUser(phpAds_Admin) || phpAds_isAllowed(phpAds_DeleteZone)) {
        echo "<a href='zone-delete.php?affiliateid=" . $affiliateid . "&zoneid=" . $row_zones['zoneid'] . "&returnurl=affiliate-zones.php'" . phpAds_DelConfirm($strConfirmDeleteZone) . "><img src='images/icon-recycle.gif' border='0' align='absmiddle' alt='{$strDelete}'>&nbsp;{$strDelete}</a>&nbsp;&nbsp;&nbsp;&nbsp;";
    }
    echo "</td></tr>";
    $i++;
}
if (phpAds_dbNumRows($res_zones) > 0) {
    echo "<tr height='1'><td colspan='4' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
}
echo "</table>";
echo "<br><br>";
/*********************************************************/
/* Store preferences                                     */
/*********************************************************/
$Session['prefs']['affiliate-zones.php']['listorder'] = $listorder;
$Session['prefs']['affiliate-zones.php']['orderdirection'] = $orderdirection;
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
// Include required files
require "config.php";
require "lib-statistics.inc.php";
require "lib-zones.inc.php";
require "lib-languages.inc.php";
// Register input variables
phpAds_registerGlobal('move', 'name', 'website', 'contact', 'email', 'language', 'publiczones', 'errormessage', 'username', 'password', 'affiliatepermissions', 'submit', 'publiczones_old', 'pwold', 'pw', 'pw2');
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Agency + phpAds_Affiliate);
/*********************************************************/
/* Affiliate interface security                          */
/*********************************************************/
if (phpAds_isUser(phpAds_Affiliate)) {
    if (phpAds_isAllowed(phpAds_ModifyInfo)) {
        $query = "SELECT agencyid" . " FROM " . $phpAds_config['tbl_affiliates'] . " WHERE affiliateid=" . phpAds_getUserID();
        $res = phpAds_dbQuery($query) or phpAds_sqlDie();
        if ($row = phpAds_dbFetchArray($res)) {
            $agencyid = $row['agencyid'];
            $affiliateid = phpAds_getUserID();
        } else {
            phpAds_PageHeader("2");
            phpAds_Die($strAccessDenied, $strNotAdmin);
        }
    } else {
        phpAds_PageHeader("1");
        phpAds_Die($strAccessDenied, $strNotAdmin);
    }
} elseif (phpAds_isUser(phpAds_Agency)) {
    $agencyid = phpAds_getUserID();
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
// Include required files
require "config.php";
require "lib-statistics.inc.php";
require "lib-expiration.inc.php";
// Register input variables
phpAds_registerGlobal('period', 'start', 'limit');
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Agency + phpAds_Client);
// Check so that user doesnt access page through URL
if (phpAds_isUser(phpAds_Client)) {
    if (phpAds_isAllowed(phpAds_ViewTargetingStats)) {
        $clientid = phpAds_getUserID();
        if (isset($campaignid) && $campaignid != '') {
            $query = "SELECT c.clientid" . " FROM " . $phpAds_config['tbl_clients'] . " AS c" . "," . $phpAds_config['tbl_campaigns'] . " AS m" . " WHERE c.clientid=m.clientid" . " AND c.clientid=" . $clientid . " AND m.campaignid=" . $campaignid . " AND agencyid=" . phpAds_getAgencyID();
        } else {
            $query = "SELECT c.clientid" . " FROM " . $phpAds_config['tbl_clients'] . " AS c" . " WHERE c.clientid=" . $clientid . " AND agencyid=" . phpAds_getAgencyID();
        }
        $res = phpAds_dbQuery($query) or phpAds_sqlDie();
        if (phpAds_dbNumRows($res) == 0) {
            phpAds_PageHeader("2");
            phpAds_Die($strAccessDenied, $strNotAdmin);
        }
    } else {
        phpAds_PageHeader("2");
        phpAds_Die($strAccessDenied, $strNotAdmin);
    }
Example #7
0
    header("Location: upgrade.php");
    exit;
}
// Check for SLL requirements
if ($phpAds_config['ui_forcessl'] && $_SERVER['SERVER_PORT'] != 443) {
    header('Location: https://' . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF']);
    exit;
}
// Adjust url_prefix if SLL is used
if ($_SERVER['SERVER_PORT'] == 443) {
    $phpAds_config['url_prefix'] = str_replace('http://', 'https://', $phpAds_config['url_prefix']);
}
// First thing to do is clear the $Session variable to
// prevent users from pretending to be logged in.
unset($Session);
// Authorize the user
phpAds_Start();
// Load language strings
@(include phpAds_path . '/language/english/default.lang.php');
if ($phpAds_config['language'] != 'english' && file_exists(phpAds_path . '/language/' . $phpAds_config['language'] . '/default.lang.php')) {
    @(include phpAds_path . '/language/' . $phpAds_config['language'] . '/default.lang.php');
}
// Register variables
phpAds_registerGlobal('bannerid', 'campaignid', 'clientid', 'zoneid', 'affiliateid', 'userlogid', 'day');
// Check for missing required parameters
phpAds_checkIds();
// Setup navigation
$phpAds_nav = array("admin" => array("2" => array("stats-global-client.php" => $strStats), "2.1" => array("stats-global-client.php" => $strClientsAndCampaigns), "2.1.1" => array("stats-client-history.php?clientid={$clientid}" => $strClientHistory), "2.1.1.1" => array("stats-client-daily.php?clientid={$clientid}&day={$day}" => $strDailyStats), "2.1.1.2" => array("stats-client-daily-hosts.php?clientid={$clientid}&day={$day}" => $strHosts), "2.1.2" => array("stats-client-campaigns.php?clientid={$clientid}" => $strCampaignOverview), "2.1.2.1" => array("stats-campaign-history.php?clientid={$clientid}&campaignid={$campaignid}" => $strCampaignHistory), "2.1.2.1.1" => array("stats-campaign-daily.php?clientid={$clientid}&campaignid={$campaignid}&day={$day}" => $strDailyStats), "2.1.2.1.2" => array("stats-campaign-daily-hosts.php?clientid={$clientid}&campaignid={$campaignid}&day={$day}" => $strHosts), "2.1.2.2" => array("stats-campaign-banners.php?clientid={$clientid}&campaignid={$campaignid}" => $strBannerOverview), "2.1.2.2.1" => array("stats-banner-history.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}" => $strBannerHistory), "2.1.2.2.1.1" => array("stats-banner-daily.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}&day={$day}" => $strDailyStats), "2.1.2.2.1.2" => array("stats-banner-daily-hosts.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}&day={$day}" => $strHosts), "2.1.2.2.2" => array("stats-banner-affiliates.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}" => $strDistribution), "2.1.2.3" => array("stats-campaign-target.php?clientid={$clientid}&campaignid={$campaignid}" => $strTargetStats), "2.2" => array("stats-global-history.php" => $strGlobalHistory), "2.2.1" => array("stats-global-daily.php?day={$day}" => $strDailyStats), "2.2.2" => array("stats-global-daily-hosts.php?day={$day}" => $strHosts), "2.4" => array("stats-global-affiliates.php" => $strAffiliatesAndZones), "2.4.1" => array("stats-affiliate-history.php?affiliateid={$affiliateid}" => $strAffiliateHistory), "2.4.1.1" => array("stats-affiliate-daily.php?affiliateid={$affiliateid}&day={$day}" => $strDailyStats), "2.4.1.2" => array("stats-affiliate-daily-hosts.php?affiliateid={$affiliateid}&day={$day}" => $strHosts), "2.4.2" => array("stats-affiliate-zones.php?affiliateid={$affiliateid}" => $strZoneOverview), "2.4.2.1" => array("stats-zone-history.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strZoneHistory), "2.4.2.1.1" => array("stats-zone-daily.php?affiliateid={$affiliateid}&zoneid={$zoneid}&day={$day}" => $strDailyStats), "2.4.2.1.2" => array("stats-zone-daily-hosts.php?affiliateid={$affiliateid}&zoneid={$zoneid}&day={$day}" => $strHosts), "2.4.2.2" => array("stats-zone-linkedbanners.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strLinkedBannersOverview), "2.4.2.2.1" => array("stats-linkedbanner-history.php?affiliateid={$affiliateid}&zoneid={$zoneid}&bannerid={$bannerid}" => $strLinkedBannerHistory), "2.5" => array("stats-global-misc.php" => $strMiscellaneous), "3" => array("report-index.php" => $strReports), "4" => array("client-index.php" => $strAdminstration), "4.1" => array("client-index.php" => $strClientsAndCampaigns), "4.1.1" => array("client-edit.php" => $strAddClient), "4.1.2" => array("client-edit.php?clientid={$clientid}" => $strClientProperties), "4.1.3" => array("client-campaigns.php?clientid={$clientid}" => $strCampaignOverview), "4.1.3.1" => array("campaign-edit.php?clientid={$clientid}" => $strAddCampaign), "4.1.3.2" => array("campaign-edit.php?clientid={$clientid}&campaignid={$campaignid}" => $strCampaignProperties), "4.1.3.3" => array("campaign-zone.php?clientid={$clientid}&campaignid={$campaignid}" => $strLinkedZones), "4.1.3.4" => array("campaign-banners.php?clientid={$clientid}&campaignid={$campaignid}" => $strBannerOverview), "4.1.3.4.1" => array("banner-edit.php?clientid={$clientid}&campaignid={$campaignid}" => $strAddBanner), "4.1.3.4.2" => array("banner-edit.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}" => $strBannerProperties), "4.1.3.4.3" => array("banner-acl.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}" => $strModifyBannerAcl), "4.1.3.4.4" => array("banner-zone.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}" => $strLinkedZones), "4.1.3.4.5" => array("banner-swf.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}" => $strConvertSWFLinks), "4.1.3.4.6" => array("banner-append.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}" => $strAppendOthers), "4.2" => array("affiliate-index.php" => $strAffiliatesAndZones), "4.2.1" => array("affiliate-edit.php" => $strAddNewAffiliate), "4.2.2" => array("affiliate-edit.php?affiliateid={$affiliateid}" => $strAffiliateProperties), "4.2.3" => array("affiliate-zones.php?affiliateid={$affiliateid}" => $strZoneOverview), "4.2.3.1" => array("zone-edit.php?affiliateid={$affiliateid}" => $strAddNewZone), "4.2.3.2" => array("zone-edit.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strZoneProperties), "4.2.3.3" => array("zone-include.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strIncludedBanners), "4.2.3.4" => array("zone-probability.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strProbability), "4.2.3.5" => array("zone-invocation.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strInvocationcode), "4.2.3.6" => array("zone-advanced.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strAdvanced), "4.3" => array("admin-generate.php" => $strGenerateBannercode), "5" => array("settings-index.php" => $strSettings), "5.1" => array("settings-db.php" => $strMainSettings), "5.3" => array("maintenance-index.php" => $strMaintenance), "5.2" => array("userlog-index.php" => $strUserLog), "5.2.1" => array("userlog-details.php?userlogid={$userlogid}" => $strUserLogDetails), "5.4" => array("maintenance-updates.php" => $strProductUpdates)), "client" => array("1" => array("stats-client-history.php?clientid={$clientid}" => $strHome), "1.1" => array("stats-client-history.php?clientid={$clientid}" => $strClientHistory), "1.1.1" => array("stats-client-daily.php?clientid={$clientid}&day={$day}" => $strDailyStats), "1.1.2" => array("stats-client-daily-hosts.php?clientid={$clientid}&day={$day}" => $strHosts), "1.2" => array("stats-client-campaigns.php?clientid={$clientid}" => $strCampaignOverview), "1.2.1" => array("stats-campaign-history.php?clientid={$clientid}&campaignid={$campaignid}" => $strCampaignHistory), "1.2.1.1" => array("stats-campaign-daily.php?clientid={$clientid}&campaignid={$campaignid}&day={$day}" => $strDailyStats), "1.2.1.2" => array("stats-campaign-daily-hosts.php?clientid={$clientid}&campaignid={$campaignid}&day={$day}" => $strHosts), "1.2.2" => array("stats-campaign-banners.php?clientid={$clientid}&campaignid={$campaignid}" => $strBannerOverview), "1.2.2.1" => array("stats-banner-history.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}" => $strBannerHistory), "1.2.2.1.1" => array("stats-banner-daily.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}&day={$day}" => $strDailyStats), "1.2.2.1.2" => array("stats-banner-daily-hosts.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}&day={$day}" => $strHosts), "1.2.2.2" => array("banner-edit.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}" => $strBannerProperties), "1.2.2.3" => array("banner-swf.php?clientid={$clientid}&campaignid={$campaignid}&bannerid={$bannerid}" => $strConvertSWFLinks), "1.2.3" => array("stats-campaign-target.php?clientid={$clientid}&campaignid={$campaignid}" => $strTargetStats), "3" => array("report-index.php" => $strReports)), "affiliate" => array("1" => array("stats-affiliate-zones.php?affiliateid={$affiliateid}" => $strHome), "1.1" => array("stats-affiliate-zones.php?affiliateid={$affiliateid}" => $strZones), "1.1.1" => array("stats-zone-history.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strZoneHistory), "1.1.1.1" => array("stats-zone-daily.php?affiliateid={$affiliateid}&zoneid={$zoneid}&day={$day}" => $strDailyStats), "1.1.1.2" => array("stats-zone-daily-hosts.php?affiliateid={$affiliateid}&zoneid={$zoneid}&day={$day}" => $strHosts), "1.1.2" => array("stats-zone-linkedbanners.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strLinkedBannersOverview), "1.1.2.1" => array("stats-linkedbanner-history.php?affiliateid={$affiliateid}&zoneid={$zoneid}&bannerid={$bannerid}" => $strLinkedBannerHistory), "1.2" => array("stats-affiliate-history.php?affiliateid={$affiliateid}" => $strAffiliateHistory), "1.2.1" => array("stats-affiliate-daily.php?affiliateid={$affiliateid}&day={$day}" => $strDailyStats), "1.2.2" => array("stats-affiliate-daily-hosts.php?affiliateid={$affiliateid}&day={$day}" => $strHosts), "3" => array("report-index.php" => $strReports), "2" => array("affiliate-zones.php?affiliateid={$affiliateid}" => $strAdminstration), "2.1" => array("affiliate-zones.php?affiliateid={$affiliateid}" => $strZones), "2.1.1" => array("zone-edit.php?affiliateid={$affiliateid}&zoneid=0" => $strAddZone), "2.1.2" => array("zone-edit.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strModifyZone), "2.1.3" => array("zone-include.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strIncludedBanners), "2.1.4" => array("zone-probability.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strProbability), "2.1.5" => array("zone-invocation.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strInvocationcode), "2.1.6" => array("zone-advanced.php?affiliateid={$affiliateid}&zoneid={$zoneid}" => $strChains), "2.2" => array("affiliate-edit.php?affiliateid={$affiliateid}" => $strPreferences)));
if (phpAds_isUser(phpAds_Client) && phpAds_isAllowed(phpAds_ModifyInfo)) {
    $phpAds_nav["client"]["2"] = array("client-edit.php" => $strPreferences);
}
        echo $row_trackers['trackername'];
    }
    //	echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    echo "</td>\n";
    // ID
    echo "\t\t\t\t\t<td height='25'>" . $row_trackers['trackerid'] . "</td>\n";
    // Button 1, 2 & 3
    echo "\t\t\t\t\t<td height='25'>";
    if (phpAds_isUser(phpAds_Admin) || phpAds_isUser(phpAds_Agency) || phpAds_isAllowed(phpAds_LinkCampaigns)) {
        echo "<a href='tracker-campaigns.php?clientid=" . $clientid . "&trackerid=" . $row_trackers['trackerid'] . "'><img src='images/icon-zone-linked.gif' border='0' align='absmiddle'>&nbsp;{$strLinkedCampaigns}</a>";
    } else {
        echo "&nbsp;";
    }
    echo "</td>\n";
    echo "\t\t\t\t\t<td height='25'>";
    if (phpAds_isUser(phpAds_Admin) || phpAds_isUser(phpAds_Agency) || phpAds_isAllowed(phpAds_DeleteTracker)) {
        echo "<a href='tracker-delete.php?clientid=" . $clientid . "&trackerid=" . $row_trackers['trackerid'] . "&returnurl=advertiser-trackers.php'" . phpAds_DelConfirm($strConfirmDeleteTracker) . "><img src='images/icon-recycle.gif' border='0' align='absmiddle' alt='{$strDelete}'>&nbsp;{$strDelete}</a>";
    } else {
        echo "&nbsp;";
    }
    echo "</td>\n";
    echo "\t\t\t\t</tr>\n";
    $i++;
}
if (phpAds_dbNumRows($res_trackers) > 0) {
    //	echo "\t\t\t\t<tr height='1'>\n";
    //	echo "\t\t\t\t\t<td colspan='4' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td>\n";
    //	echo "\t\t\t\t</tr>\n";
    //}
    //if (isset($campaigns) && count($campaigns))
    //{
        $extra .= "<option value='" . $row['affiliateid'] . "'>" . phpAds_buildAffiliateName($row['affiliateid'], $row['name']) . "</option>";
    }
    $extra .= "</select>&nbsp;<input type='image' src='images/" . $phpAds_TextDirection . "/go_blue.gif'><br>";
    $extra .= "<img src='images/break.gif' height='1' width='160' vspace='4'><br>";
    $extra .= "<img src='images/icon-recycle.gif' align='absmiddle'>&nbsp;<a href='zone-delete.php?affiliateid={$affiliateid}&zoneid={$zoneid}&returnurl=affiliate-zones.php'" . phpAds_DelConfirm($strConfirmDeleteZone) . ">{$strDelete}</a><br>";
    $extra .= "</form>";
    phpAds_PageHeader("4.2.3.3", $extra);
    echo "<img src='images/icon-affiliate.gif' align='absmiddle'>&nbsp;" . phpAds_getAffiliateName($affiliateid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-zone.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getZoneName($zoneid) . "</b><br><br><br>";
    phpAds_ShowSections(array("4.2.3.2", "4.2.3.6", "4.2.3.3", "4.2.3.4", "4.2.3.5"));
} else {
    if (phpAds_isAllowed(phpAds_EditZone)) {
        $sections[] = "2.1.2";
    }
    if (phpAds_isAllowed(phpAds_EditZone)) {
        $sections[] = "2.1.6";
    }
    $sections[] = "2.1.3";
    $sections[] = "2.1.4";
    $sections[] = "2.1.5";
    phpAds_PageHeader("2.1.3");
    echo "<img src='images/icon-affiliate.gif' align='absmiddle'>&nbsp;" . phpAds_getAffiliateName($affiliateid);
    echo "&nbsp;<img src='images/" . $phpAds_TextDirection . "/caret-rs.gif'>&nbsp;";
    echo "<img src='images/icon-zone.gif' align='absmiddle'>&nbsp;<b>" . phpAds_getZoneName($zoneid) . "</b><br><br><br>";
    phpAds_ShowSections($sections);
}
/*********************************************************/
/* Main code                                             */
/*********************************************************/
function phpAds_showZoneCampaign($width, $height, $what, $delivery)
Example #10
0
/************************************************************************/
// Include required files
require "config.php";
require "lib-zones.inc.php";
// Register input variables
phpAds_registerGlobal('returnurl');
// Security check
phpAds_checkAccess(phpAds_Admin + phpAds_Agency + phpAds_Affiliate);
/*********************************************************/
/* Main code                                             */
/*********************************************************/
if (isset($zoneid) && $zoneid != '') {
    if (phpAds_isUser(phpAds_Affiliate)) {
        $result = phpAds_dbQuery("\n\t\t\tSELECT\n\t\t\t\taffiliateid\n\t\t\tFROM\n\t\t\t\t" . $phpAds_config['tbl_zones'] . "\n\t\t\tWHERE\n\t\t\t\tzoneid = '{$zoneid}'\n\t\t\t") or phpAds_sqlDie();
        $row = phpAds_dbFetchArray($result);
        if ($row["affiliateid"] == '' || phpAds_getUserID() != $row["affiliateid"] || !phpAds_isAllowed(phpAds_DeleteZone)) {
            phpAds_PageHeader("1");
            phpAds_Die($strAccessDenied, $strNotAdmin);
        } else {
            $affiliateid = $row["affiliateid"];
        }
    } elseif (phpAds_isUser(phpAds_Agency)) {
        $query = "SELECT z.affiliateid AS affiliateid" . " FROM " . $phpAds_config['tbl_zones'] . " AS z" . "," . $phpAds_config['tbl_affiliates'] . " AS a" . " WHERE z.affiliateid = a.affiliateid" . " AND a.agencyid=" . phpAds_getUserID();
        $res = phpAds_dbQuery($query) or phpAds_sqlDie();
        if (phpAds_dbNumRows($res) == 0) {
            phpAds_PageHeader("2");
            phpAds_Die($strAccessDenied, $strNotAdmin);
        }
    }
    // Reset append codes which called this zone
    if (phpAds_isUser(phpAds_Admin)) {
             }
             /*
               Deactivated for now because of security reasons -- Niels
               if (phpAds_isUser(phpAds_Admin) || (phpAds_isUser(phpAds_Client) && phpAds_isAllowed(phpAds_ModifyBanner))) // only for the admin
             */
             if (phpAds_isUser(phpAds_Admin)) {
                 echo "<a href='banner-edit.php?clientid=" . $clientid . "&campaignid=" . $campaignid . "&bannerid=" . $row_banners['bannerid'] . "'>";
                 echo "<img src='images/icon-edit.gif' align='absmiddle' border='0'>&nbsp;" . $strBannerProperties . "</a>";
                 echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
             }
             if (phpAds_isUser(phpAds_Client) && phpAds_isAllowed(phpAds_DisableBanner) && $row_banners['active'] == 't') {
                 echo "<a href='banner-activate.php?clientid=" . $clientid . "&campaignid=" . $campaignid . "&bannerid=" . $row_banners['bannerid'] . "&value=t'>";
                 echo "<img src='images/icon-deactivate.gif' align='absmiddle' border='0'>&nbsp;" . $strDeActivate . "</a>";
                 echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
             }
             if (phpAds_isUser(phpAds_Client) && phpAds_isAllowed(phpAds_ActivateBanner) && $row_banners['active'] != 't') {
                 echo "<a href='banner-activate.php?clientid=" . $clientid . "&campaignid=" . $campaignid . "&bannerid=" . $row_banners['bannerid'] . "&value=f'>";
                 echo "<img src='images/icon-activate.gif' align='absmiddle' border='0'>&nbsp;" . $strActivate . "</a>";
                 echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
             }
             echo "</tr><td>";
             echo "</table>";
             echo "</div>";
         }
         echo "</td></tr>";
     }
 }
 echo "<tr><td height='1' colspan='6' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
 echo "<tr>";
 echo "<form action='stats-campaign-banners.php'>";
 echo "<td colspan='6' height='35' align='right'>";