function phpAds_MaintenanceSelection($section)
{
    global $phpAds_config, $phpAds_TextDirection, $strBanners, $strCache, $strChooseSection, $strPriority, $strSourceEdit, $strStats, $strStorage;
    ?>
<script language="JavaScript">
<!--
function maintenance_goto_section()
{
	s = document.maintenance_selection.section.selectedIndex;

	s = document.maintenance_selection.section.options[s].value;
	document.location = 'maintenance-' + s + '.php';
}
// -->
</script>
<?php 
    echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
    echo "<tr><form name='maintenance_selection'><td height='35'>";
    echo "<b>" . $strChooseSection . ":&nbsp;</b>";
    echo "<select name='section' onChange='maintenance_goto_section();'>";
    echo "<option value='banners'" . ($section == 'banners' ? ' selected' : '') . ">" . $strBanners . "</option>";
    echo "<option value='priority'" . ($section == 'priority' ? ' selected' : '') . ">" . $strPriority . "</option>";
    if ($phpAds_config['type_web_allow'] == true && ($phpAds_config['type_web_mode'] == 0 && $phpAds_config['type_web_dir'] != '' || $phpAds_config['type_web_mode'] == 1 && $phpAds_config['type_web_ftp'] != '') && $phpAds_config['type_web_url'] != '') {
        echo "<option value='storage'" . ($section == 'storage' ? ' selected' : '') . ">" . $strStorage . "</option>";
    }
    if ($phpAds_config['delivery_caching'] != 'none') {
        echo "<option value='cache'" . ($section == 'zones' ? ' selected' : '') . ">" . $strCache . "</option>";
    }
    echo "<option value='source-edit'" . ($section == 'source-edit' ? ' selected' : '') . ">" . $strSourceEdit . "</option>";
    echo "</select>&nbsp;<a href='javascript:void(0)' onClick='maintenance_goto_section();'>";
    echo "<img src='images/" . $phpAds_TextDirection . "/go_blue.gif' border='0'></a>";
    echo "</td></form></tr>";
    echo "</table>";
    phpAds_ShowBreak();
}
function phpAds_MaintenanceSelection($section)
{
    global $phpAds_config;
    global $phpAds_TextDirection;
    global $strChooseSection, $strPriority, $strCache, $strBanners, $strStats, $strStorage, $strMaintenance;
    if ($phpAds_config['compact_stats']) {
        // Determine left over verbose stats
        $viewresult = phpAds_dbQuery("SELECT COUNT(*) AS cnt FROM " . $phpAds_config['tbl_adviews']);
        $viewrow = phpAds_dbFetchArray($viewresult);
        if (isset($viewrow["cnt"]) && $viewrow["cnt"] != '') {
            $verboseviews = $viewrow["cnt"];
        } else {
            $verboseviews = 0;
        }
        $clickresult = phpAds_dbQuery("SELECT COUNT(*) AS cnt FROM " . $phpAds_config['tbl_adclicks']);
        $clickrow = phpAds_dbFetchArray($viewresult);
        if (isset($clickrow["cnt"]) && $clickrow["cnt"] != '') {
            $verboseclicks = $clickrow["cnt"];
        } else {
            $verboseclicks = 0;
        }
    }
    ?>
<script language="JavaScript">
<!--
function maintenance_goto_section()
{
	s = document.maintenance_selection.section.selectedIndex;

	s = document.maintenance_selection.section.options[s].value;
	document.location = 'maintenance-' + s + '.php';
}
// -->
</script>
<?php 
    echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
    echo "<tr><form name='maintenance_selection'><td height='35'>";
    echo "<b>" . $strChooseSection . ":&nbsp;</b>";
    echo "<select name='section' onChange='maintenance_goto_section();'>";
    echo "<option value='maintenance'" . ($section == 'maintenance' ? ' selected' : '') . ">" . $strMaintenance . "</option>";
    echo "<option value='banners'" . ($section == 'banners' ? ' selected' : '') . ">" . $strBanners . "</option>";
    echo "<option value='priority'" . ($section == 'priority' ? ' selected' : '') . ">" . $strPriority . "</option>";
    if ($phpAds_config['compact_stats'] && ($verboseviews > 0 || $verboseclicks > 0)) {
        echo "<option value='stats'" . ($section == 'stats' ? ' selected' : '') . ">" . $strStats . "</option>";
    }
    if ($phpAds_config['type_web_allow'] == true && ($phpAds_config['type_web_mode'] == 0 && $phpAds_config['type_web_dir'] != '' || $phpAds_config['type_web_mode'] == 1 && $phpAds_config['type_web_ftp'] != '') && $phpAds_config['type_web_url'] != '') {
        echo "<option value='storage'" . ($section == 'storage' ? ' selected' : '') . ">" . $strStorage . "</option>";
    }
    if ($phpAds_config['delivery_caching'] != 'none') {
        echo "<option value='cache'" . ($section == 'zones' ? ' selected' : '') . ">" . $strCache . "</option>";
    }
    echo "</select>&nbsp;<a href='javascript:void(0)' onClick='maintenance_goto_section();'>";
    echo "<img src='images/" . $phpAds_TextDirection . "/go_blue.gif' border='0'></a>";
    echo "</td></form></tr>";
    echo "</table>";
    phpAds_ShowBreak();
}
Esempio n. 3
0
function phpAds_MaintenanceSelection($subSection, $mainSection = 'maintenance')
{
    global $phpAds_TextDirection, $strBanners, $strCache, $strChooseSection, $strPriority, $strSourceEdit, $strStats, $strStorage, $strMaintenance, $strCheckForUpdates, $strViewPastUpdates, $strEncoding, $strDeliveryLimitations, $strAppendCodes, $strMenus, $strPlugins;
    ?>
<script language="JavaScript">
<!--
function maintenance_goto_section()
{
    s = document.maintenance_selection.section.selectedIndex;

    s = document.maintenance_selection.section.options[s].value;
    document.location = '<?php 
    echo $mainSection;
    ?>
-' + s + '.php';
}
// -->
</script>
<?php 
    $conf =& $GLOBALS['_MAX']['CONF'];
    $pref =& $GLOBALS['_MAX']['PREF'];
    echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
    echo "<tr><form name='maintenance_selection'><td height='35'>";
    echo "<b>" . $strChooseSection . ":&nbsp;</b>";
    echo "<select name='section' onChange='maintenance_goto_section();'>";
    if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
        if ($mainSection == 'updates') {
            echo "<option value='product'" . ($subSection == 'product' ? ' selected' : '') . ">" . $strCheckForUpdates . "</option>";
            echo "<option value='history'" . ($subSection == 'history' ? ' selected' : '') . ">" . $strViewPastUpdates . "</option>";
        } else {
            echo "<option value='maintenance'" . ($subSection == 'maintenance' ? ' selected' : '') . ">" . $strMaintenance . "</option>";
            echo "<option value='banners'" . ($subSection == 'banners' ? ' selected' : '') . ">" . $strBanners . "</option>";
            echo "<option value='priority'" . ($subSection == 'priority' ? ' selected' : '') . ">" . $strPriority . "</option>";
            $login = '******' . $conf['store']['ftpUsername'] . ':' . $conf['store']['ftpPassword'] . '@' . $conf['store']['ftpHost'] . '/' . $conf['store']['ftpPath'];
            if ($conf['allowedBanners']['web'] == true && ($conf['store']['mode'] == 0 && $conf['store']['webDir'] != '' || $conf['store']['mode'] == 1 && $login != '') && $conf['webpath']['images'] != '') {
                echo "<option value='storage'" . ($subSection == 'storage' ? ' selected' : '') . ">" . $strStorage . "</option>";
            }
            //            if (!isset($conf['delivery']['cache']) || $conf['delivery']['cache'] != 'none')
            //                echo "<option value='cache'".($subSection == 'zones' ? ' selected' : '').">".$strCache."</option>";
            if ($conf['delivery']['acls']) {
                echo "<option value='acls'" . ($subSection == 'acls' ? ' selected' : '') . ">" . $strDeliveryLimitations . "</option>";
            }
            echo "<option value='appendcodes'" . ($subSection == 'appendcodes' ? ' selected' : '') . ">" . $strAppendCodes . "</option>";
            echo "<option value='encoding'" . ($subSection == 'encoding' ? ' selected' : '') . ">{$strEncoding}</option>";
            echo "<option value='menus'" . ($subSection == 'menus' ? ' selected' : '') . ">" . $strMenus . "</option>";
            echo "<option value='plugins'" . ($subSection == 'plugins' ? ' selected' : '') . ">" . $strPlugins . "</option>";
        }
    }
    // Switched off
    // echo "<option value='finance'".($subSection == 'finance' ? ' selected' : '').">Finance</option>";
    echo "</select>&nbsp;<a href='javascript:void(0)' onClick='maintenance_goto_section();'>";
    echo "<img src='" . OX::assetPath() . "/images/" . $phpAds_TextDirection . "/go_blue.gif' border='0'></a>";
    echo "</td></form></tr>";
    echo "</table>";
    phpAds_ShowBreak();
}
function phpAds_SettingsSelection($section)
{
    global $phpAds_TextDirection, $strHelp;
    global $tabindex;
    if (!isset($tabindex)) {
        $tabindex = 1;
    }
    ?>
<script language="JavaScript">
<!--
function settings_goto_section()
{
	s = document.settings_selection.section.selectedIndex;

	s = document.settings_selection.section.options[s].value;
	document.location = 'settings-' + s + '.php';
}
// -->
</script>

<?php 
    echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
    echo "<tr><form name='settings_selection'><td height='35'><b>";
    echo $GLOBALS['strChooseSection'] . ":&nbsp;</b>";
    echo "<select name='section' onChange='settings_goto_section();' tabindex='" . $tabindex++ . "'>";
    if (phpAds_isUser(phpAds_Admin)) {
        echo "<option value='db'" . ($section == 'db' ? ' selected' : '') . ">" . $GLOBALS['strDatabaseSettings'] . "</option>";
    }
    echo "<option value='invocation'" . ($section == 'invocation' ? ' selected' : '') . ">" . $GLOBALS['strInvocationAndDelivery'] . "</option>";
    echo "<option value='host'" . ($section == 'host' ? ' selected' : '') . ">" . $GLOBALS['strHostAndGeo'] . "</option>";
    echo "<option value='stats'" . ($section == 'stats' ? ' selected' : '') . ">" . $GLOBALS['strStatisticsSettings'] . "</option>";
    echo "<option value='banner'" . ($section == 'banner' ? ' selected' : '') . ">" . $GLOBALS['strBannerSettings'] . "</option>";
    if (phpAds_isUser(phpAds_Admin)) {
        echo "<option value='admin'" . ($section == 'admin' ? ' selected' : '') . ">" . $GLOBALS['strAdministratorSettings'] . "</option>";
    }
    echo "<option value='interface'" . ($section == 'interface' ? ' selected' : '') . ">" . $GLOBALS['strGuiSettings'] . "</option>";
    echo "<option value='defaults'" . ($section == 'defaults' ? ' selected' : '') . ">" . $GLOBALS['strInterfaceDefaults'] . "</option>";
    echo "</select>&nbsp;<a href='javascript:void(0)' onClick='settings_goto_section();'>";
    echo "<img src='images/" . $phpAds_TextDirection . "/go_blue.gif' border='0'></a>";
    echo "</td></form>";
    echo "<td height='35' align='right'><b><a href=\"#\" onClick=\"javascript:toggleHelp(); return false;\">";
    echo "<img src='images/help-book.gif' width='15' height='15' border='0' align='absmiddle'>";
    echo "&nbsp;" . $strHelp . "</a></b></td></tr></table>";
    phpAds_ShowBreak();
}
/*                                                                      */
/* 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-maintenance.inc.php";
require "lib-statistics.inc.php";
require "lib-zones.inc.php";
// Security check
phpAds_checkAccess(phpAds_Admin);
/*********************************************************/
/* HTML framework                                        */
/*********************************************************/
phpAds_PageHeader("5.3");
phpAds_ShowSections(array("5.1", "5.3", "5.4", "5.2"));
phpAds_MaintenanceSelection("storage");
/*********************************************************/
/* Main code                                             */
/*********************************************************/
echo "<br>";
echo $strStorageExplaination;
echo "<br><br>";
phpAds_ShowBreak();
echo "<img src='images/" . $phpAds_TextDirection . "/icon-undo.gif' border='0' align='absmiddle'>&nbsp;<a href='maintenance-storage-move.php'>{$strMoveToDirectory}</a>&nbsp;&nbsp;";
phpAds_ShowBreak();
/*********************************************************/
/* HTML framework                                        */
/*********************************************************/
phpAds_PageFooter();
Esempio n. 6
0
 function _function_phpAds_ShowBreak()
 {
     ob_start();
     phpAds_ShowBreak();
     return ob_get_clean();
 }
Esempio n. 7
0
 /**
  * Place invocation form - generate form with group of options for every plugin,
  * look into max/docs/developer/plugins.zuml for more details
  *
  * @param array $extra
  * @param boolean $zone_invocation
  *
  * @return string  Generated invocation form
  */
 function placeInvocationForm($extra = '', $zone_invocation = false)
 {
     $conf = $GLOBALS['_MAX']['CONF'];
     $pref = $GLOBALS['_MAX']['PREF'];
     $globalVariables = array('affiliateid', 'codetype', 'size', 'text', 'dest');
     $buffer = '';
     $this->zone_invocation = $zone_invocation;
     foreach ($globalVariables as $makeMeGlobal) {
         global ${$makeMeGlobal};
         // also make this variable a class attribute
         // so plugins could have an access to these values and modify them
         $this->{$makeMeGlobal} =& ${$makeMeGlobal};
     }
     $invocationTypes =& OX_Component::getComponents('invocationTags');
     foreach ($invocationTypes as $pluginKey => $invocationType) {
         if (!empty($invocationType->publisherPlugin)) {
             $available[$pluginKey] = $invocationType->publisherPlugin;
             $names[$pluginKey] = $invocationType->getName();
             if (!empty($invocationType->default)) {
                 $defaultPublisherPlugin = $pluginKey;
             }
         }
     }
     $affiliateid = $this->affiliateid;
     if (count($available) == 1) {
         // Only one publisher invocation plugin available
         $codetype = $defaultPublisherPlugin;
     } elseif (count($available) > 1) {
         // Multiple publisher invocation plugins available
         if (is_null($codetype)) {
             $codetype = $defaultPublisherPlugin;
         }
         echo "<form name='generate' action='" . $_SERVER['PHP_SELF'] . "' method='POST' onSubmit='return max_formValidate(this);'>\n";
         // Show the publisher invocation selection drop down
         echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
         echo "<input type='hidden' name='affiliateid' value='{$affiliateid}'>";
         echo "<tr><td height='25' colspan='3'><b>" . $GLOBALS['strChooseTypeOfInvocation'] . "</b></td></tr>";
         echo "<tr><td height='35'>";
         echo "<select name='codetype' onChange=\"this.form.submit()\" accesskey=" . $GLOBALS['keyList'] . " tabindex='" . $tabindex++ . "'>";
         foreach ($names as $pluginKey => $invocationTypeName) {
             echo "<option value='" . $pluginKey . "'" . ($codetype == $pluginKey ? ' selected' : '') . ">" . $invocationTypeName . "</option>";
         }
         echo "</select>";
         echo "&nbsp;<input type='image' src='" . OX::assetPath() . "/images/" . $GLOBALS['phpAds_TextDirection'] . "/go_blue.gif' border='0'>";
         echo "</td></tr></table>";
         echo "</form>";
         echo phpAds_ShowBreak($print = false);
         echo "<br />";
     } else {
         // No publisher invocation plugins available
         $code = 'Error: No publisher invocation plugins available';
         return;
     }
     if (!empty($codetype)) {
         $invocationTag = OX_Component::factoryByComponentIdentifier($codetype);
         if ($invocationTag === false) {
             OA::debug('Error while factory invocationTag plugin');
             exit;
         }
         $code = $this->generateInvocationCode($invocationTag);
     }
     $previewURL = MAX::constructURL(MAX_URL_ADMIN, "affiliate-preview.php?affiliateid={$affiliateid}&codetype={$codetype}");
     foreach ($invocationTag->defaultOptionValues as $feature => $value) {
         if ($invocationTag->maxInvocation->{$feature} != $value) {
             $previewURL .= "&{$feature}=" . rawurlencode($invocationTag->maxInvocation->{$feature});
         }
     }
     foreach ($this->defaultOptionValues as $feature => $value) {
         if ($this->{$feature} != $value) {
             $previewURL .= "&{$feature}=" . rawurlencode($this->{$feature});
         }
     }
     echo "<form name='generate' action='" . $previewURL . "' method='get' target='_blank'>\n";
     echo "<input type='hidden' name='codetype' value='" . $codetype . "' />";
     // Show parameters for the publisher invocation list
     echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
     echo "<tr><td height='25' colspan='3'><img src='" . OX::assetPath() . "/images/icon-overview.gif' align='absmiddle'>&nbsp;<b>" . $GLOBALS['strParameters'] . "</b></td></tr>";
     echo "<tr height='1'><td width='30'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='30'></td>";
     echo "<td width='200'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='200'></td>";
     echo "<td width='100%'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
     echo $invocationTag->generateOptions($this);
     echo "<tr><td height='10' colspan='3'>&nbsp;</td></tr>";
     //echo "<tr height='1'><td colspan='3' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
     echo "</table>";
     // Pass in current values
     echo "<input type='hidden' name='affiliateid' value='{$affiliateid}' />";
     echo "<input type='submit' value='" . $GLOBALS['strGenerate'] . "' name='submitbutton' tabindex='" . $tabindex++ . "'>";
     echo "</form>";
 }
Esempio n. 8
0
function MAX_displayAcls($acls, $aParams)
{
    $tabindex =& $GLOBALS['tabindex'];
    $page = basename($_SERVER['SCRIPT_NAME']);
    $conf = $GLOBALS['_MAX']['CONF'];
    echo "<form action='{$page}' method='post'>";
    echo "<label><img src='" . OX::assetPath() . "/images/icon-acl-add.gif' align='absmiddle'>&nbsp;" . $GLOBALS['strACLAdd'] . ": &nbsp;";
    echo "<select name='type' accesskey='{$GLOBALS['keyAddNew']}' tabindex='" . $tabindex++ . "'>";
    $deliveryLimitations = OX_Component::getComponents('deliveryLimitations', null, false);
    foreach ($deliveryLimitations as $pluginName => $plugin) {
        if ($plugin->isAllowed($page)) {
            echo "<option value='{$pluginName}'>" . $plugin->getName() . "</option>";
        }
    }
    echo "</select></label>";
    echo "&nbsp;";
    echo "<input type='submit' class='flat' name='action[new]' value='" . $GLOBALS['strAdd'] . "'";
    phpAds_ShowBreak();
    echo "<br />";
    $aErrors = OX_AclCheckInputsFields($acls, $page);
    if (!empty($GLOBALS['action'])) {
        // We are part way through making changes, show a message
        //echo "<br>";
        echo "<div class='errormessage'><img class='errormessage' src='" . OX::assetPath() . "/images/warning.gif' align='absmiddle'>";
        echo "<span class='tab-s'>{$GLOBALS['strUnsavedChanges']}</span><br>";
        echo "</div>";
    } elseif (!MAX_AclValidate($page, $aParams)) {
        echo "<div class='errormessage'><img class='errormessage' src='" . OX::assetPath() . "/images/warning.gif' align='absmiddle'>";
        echo "<span class='tab-r'>{$GLOBALS['strDeliveryLimitationsDisagree']}</span><br>";
        echo "</div>";
    }
    if ($aErrors !== true) {
        echo "<div class='errormessage'><img class='errormessage' src='" . OX::assetPath() . "/images/warning.gif' align='absmiddle'>";
        echo "<span class='tab-s'>{$GLOBALS['strDeliveryLimitationsInputErrors']}</span><br><ul>";
        foreach ($aErrors as $error) {
            echo "<li><span class='tab-s'>{$error}</span><br></li>";
        }
        echo "</ul></div>";
    }
    foreach ($aParams as $name => $value) {
        echo "<input type='hidden' name='{$name}' value='{$value}' />";
    }
    echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
    echo "<tr><td height='25' colspan='4' bgcolor='#FFFFFF'><b>{$GLOBALS['strDeliveryLimitations']}</b></td></tr>";
    echo "<tr><td height='1' colspan='4' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
    if (empty($acls)) {
        echo "<tr><td height='24' colspan='4' bgcolor='#F6F6F6'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$GLOBALS['strNoLimitations']}</td></tr>";
        echo "<tr><td height='1' colspan='4' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
    } else {
        echo "<tr><td height='25' colspan='4' bgcolor='#F6F6F6'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$GLOBALS['strOnlyDisplayWhen']}</td></tr>";
        echo "<tr><td colspan='4'><img src='" . OX::assetPath() . "/images/break-el.gif' width='100%' height='1'></td></tr>";
        foreach ($acls as $aclId => $acl) {
            if ($deliveryLimitationPlugin = OA_aclGetComponentFromRow($acl)) {
                $deliveryLimitationPlugin->init($acl);
                $deliveryLimitationPlugin->count = count($acls);
                if ($deliveryLimitationPlugin->isAllowed($page)) {
                    $deliveryLimitationPlugin->display();
                }
            }
        }
    }
    echo "<tr><td height='30' colspan='2'>";
    if (!empty($acls)) {
        $url = $page . '?';
        foreach ($aParams as $name => $value) {
            $url .= "{$name}={$value}&";
        }
        $url .= "action[clear]=true";
        echo "<img src='" . OX::assetPath() . "/images/icon-recycle.gif' border='0' align='absmiddle'>&nbsp;\n                <a href='{$url}'>{$GLOBALS['strRemoveAllLimitations']}</a>&nbsp;&nbsp;&nbsp;&nbsp;\n        ";
    }
    echo "</td><td height='30' colspan='2' align='{$GLOBALS['phpAds_TextAlignRight']}'>";
    echo "</td></tr>";
    echo "</table>";
}
Esempio n. 9
0
 /**
  * Place invocation form - generate form with group of options for every plugin,
  * look into max/docs/developer/plugins.zuml for more details
  *
  * @param array $extra
  * @param boolean $zone_invocation
  * @param array  $aParams          Input parameters, if null globals will be fetched
  *
  * @return string  Generated invocation form
  */
 function placeInvocationForm($extra = '', $zone_invocation = false, $aParams = null)
 {
     global $phpAds_TextDirection, $strWarningLocalInvocation, $strIABNoteLocalInvocation, $strIABNoteXMLRPCInvocation;
     $conf = $GLOBALS['_MAX']['CONF'];
     $pref = $GLOBALS['_MAX']['PREF'];
     $buffer = '';
     $this->zone_invocation = $zone_invocation;
     // register all the variables
     $this->assignVariables($aParams);
     if (is_array($extra)) {
         $this->assignVariables($extra);
     }
     // Deal with special variables
     $codetype = $this->codetype;
     $submitbutton = $this->submitbutton;
     // Check if affiliate is on the same server as the delivery code
     if (!empty($extra['website'])) {
         $server_max = parse_url('http://' . $conf['webpath']['delivery'] . '/');
         $server_affilate = parse_url($extra['website']);
         // this code could be extremely slow if host is unresolved
         $server_same = @gethostbyname($server_max['host']) == @gethostbyname($server_affilate['host']);
     } else {
         $server_same = true;
     }
     // Hide when integrated in zone-advanced.php
     if (!is_array($extra) || !isset($extra['zoneadvanced']) || !$extra['zoneadvanced']) {
         $buffer .= "<form id='generate' name='generate' action='" . $_SERVER['PHP_SELF'] . "' method='POST' onSubmit='return max_formValidate(this) && disableTextarea();'>\n";
     }
     // Invocation type selection
     if (!is_array($extra) || isset($extra['delivery']) && $extra['delivery'] != phpAds_ZoneInterstitial && $extra['delivery'] != phpAds_ZonePopup && $extra['delivery'] != MAX_ZoneEmail) {
         $invocationTags =& OX_Component::getComponents('invocationTags');
         $allowed = array();
         foreach ($invocationTags as $pluginKey => $invocationTag) {
             if ($invocationTag->isAllowed($extra, $server_same)) {
                 $aOrderedComponents[$invocationTag->getOrder()] = array('pluginKey' => $pluginKey, 'isAllowed' => $invocationTag->isAllowed($extra, $server_same), 'name' => $invocationTag->getName());
             }
         }
         ksort($aOrderedComponents);
         foreach ($aOrderedComponents as $order => $aComponent) {
             $allowed[$aComponent['pluginKey']] = $aComponent['isAllowed'];
         }
         if (!isset($codetype) || $allowed[$codetype] == false) {
             foreach ($allowed as $codetype => $isAllowed) {
                 break;
             }
         }
         if (!isset($codetype)) {
             $codetype = '';
         }
         if (!isset($bannerUrl)) {
             $bannerUrl = 'http://www.example.com/INSERT_BANNER_URL.gif';
         }
         $buffer .= "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
         $buffer .= "<tr><td height='25' width='350'><b>" . $GLOBALS['strChooseTypeOfBannerInvocation'] . "</b>";
         if ($codetype == "invocationTags:oxInvocationTags:adview" || $codetype == "invocationTags:oxInvocationTags:clickonly") {
             $buffer .= "";
         }
         $buffer .= "</td></tr><tr><td height='35' valign='top'>";
         $buffer .= "<select name='codetype' onChange=\"disableTextarea();this.form.submit()\" accesskey=" . $GLOBALS['keyList'] . " tabindex='" . $tabindex++ . "'>";
         $invocationTagsNames = array();
         foreach ($aOrderedComponents as $order => $aComponent) {
             $invocationTagsNames[$aComponent['pluginKey']] = $aComponent['name'];
         }
         foreach ($invocationTagsNames as $pluginKey => $invocationTagName) {
             $buffer .= "<option value='" . $pluginKey . "'" . ($codetype == $pluginKey ? ' selected' : '') . ">" . $invocationTagName . "</option>";
         }
         $buffer .= "</select>";
         $buffer .= "&nbsp;<input type='image' src='" . OX::assetPath() . "/images/" . $phpAds_TextDirection . "/go_blue.gif' border='0'></td>";
     } else {
         $invocationTags =& OX_Component::getComponents('invocationTags');
         foreach ($invocationTags as $invocationCode => $invocationTag) {
             if (isset($invocationTag->defaultZone) && $extra['delivery'] == $invocationTag->defaultZone) {
                 $codetype = $invocationCode;
                 break;
             }
         }
         if (!isset($codetype)) {
             $codetype = '';
         }
     }
     if ($codetype != '') {
         // factory plugin for this $codetype
         $invocationTag = OX_Component::factoryByComponentIdentifier($codetype);
         if ($invocationTag === false) {
             OA::debug('Error while factory invocationTag plugin');
             exit;
         }
         $invocationTag->setInvocation($this);
         $buffer .= $invocationTag->generateBannerSelection();
         $buffer .= phpAds_ShowBreak($print = false);
         $buffer .= "<br />";
         // Code
         // Layer and popup invocation types require specific paramters to be provided before invcation is possible
         if (empty($submitbutton) && ($codetype == 'invocationTags:oxInvocationTags:popup' || $codetype == 'invocationTags:oxInvocationTags:adlayer')) {
             $generated = false;
         } else {
             $buffer .= "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
             $buffer .= "<tr><td height='25'>";
             if ($codetype == 'invocationTags:oxInvocationTags:xmlrpc') {
                 $buffer .= "\n                        <div class='errormessage'><img class='errormessage' src='" . OX::assetPath() . "/images/warning.gif' align='absmiddle'>\n                            {$strIABNoteXMLRPCInvocation}\n                        </div>";
             }
             if ($codetype == "invocationTags:oxInvocationTags:clickonly" && !$this->zone_invocation) {
                 if ($bannerid == 0) {
                     $this->ads = array();
                 } else {
                     $this->ads = array($bannerid => $aAd);
                 }
             } elseif ($codetype == 'invocationTags:oxInvocationTags:local' && !$server_same) {
                 $buffer .= "\n                        <div class='errormessage'><img class='errormessage' src='" . OX::assetPath() . "/images/warning.gif' align='absmiddle'>\n                            {$strWarningLocalInvocation}\n                            <br><p>{$strIABNoteLocalInvocation}</p>\n                        </div>";
             } else {
                 if ($codetype == 'invocationTags:oxInvocationTags:local' && $server_same) {
                     $buffer .= "\n                        <div class='errormessage'><img class='errormessage' src='" . OX::assetPath() . "/images/warning.gif' align='absmiddle'>\n                            {$strIABNoteLocalInvocation}\n                        </div>";
                 }
             }
             // Supress the textarea if required by this plugin
             if (empty($invocationTag->suppressTextarea)) {
                 $buffer .= "<img src='" . OX::assetPath() . "/images/icon-generatecode.gif' align='absmiddle'>&nbsp;<b>" . $GLOBALS['strBannercode'] . "</b></td>";
                 // Show clipboard button only on IE
                 if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') > 0 && strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') < 1) {
                     $buffer .= "<td height='25' align='right'><img src='" . OX::assetPath() . "/images/icon-clipboard.gif' align='absmiddle'>&nbsp;";
                     $buffer .= "<a href='javascript:max_CopyClipboard(\"bannercode\");'>" . $GLOBALS['strCopyToClipboard'] . "</a></td></tr>";
                 } else {
                     $buffer .= "<td>&nbsp;</td>";
                 }
                 $buffer .= "<tr height='1'><td colspan='2' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
                 $buffer .= "<tr><td colspan='2'>";
                 $buffer .= "<textarea id='bannercode' name='bannercode' class='code-gray' rows='15' cols='80' style='width:95%; border: 1px solid black' readonly>";
                 $buffer .= htmlspecialchars($this->generateInvocationCode($invocationTag));
                 $buffer .= "</textarea>";
                 $buffer .= "\n                        <script type='text/javascript'>\n                        <!--\n                        \$(document).ready(function() {\n                            \$('#bannercode').selectText();\n                        });\n                        //-->\n                        </script>";
             } else {
                 $buffer .= $this->generateInvocationCode($invocationTag);
             }
             $buffer .= "</td></tr>";
             $buffer .= "</table><br />";
             $buffer .= phpAds_ShowBreak($print = false);
             $buffer .= "<br />";
             $generated = true;
         }
         // Hide when integrated in zone-advanced.php
         if (!(is_array($extra) && isset($extra['zoneadvanced']) && $extra['zoneadvanced'])) {
             // Header
             // Parameters Section
             $buffer .= "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
             $buffer .= "<tr><td height='25' colspan='3'><img src='" . OX::assetPath() . "/images/icon-overview.gif' align='absmiddle'>&nbsp;<b>" . $GLOBALS['strParameters'] . "</b></td></tr>";
             $buffer .= "<tr height='1'><td width='30'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='30'></td>";
             $buffer .= "<td width='200'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='200'></td>";
             $buffer .= "<td width='100%'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
         }
         $buffer .= $invocationTag->generateOptions($this);
         // Hide when integrated in zone-advanced.php
         if (!(is_array($extra) && isset($extra['zoneadvanced']) && $extra['zoneadvanced'])) {
             // Footer
             $buffer .= "<tr><td height='10' colspan='3'>&nbsp;</td></tr>";
             $buffer .= "<tr height='1'><td colspan='3' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
             $buffer .= "</table>";
             $buffer .= "<br /><br />";
             $buffer .= "<input type='hidden' value='" . ($generated ? 1 : 0) . "' name='generate'>";
             if ($generated) {
                 $buffer .= "<input type='submit' value='" . $GLOBALS['strRefresh'] . "' name='submitbutton' tabindex='" . $tabindex++ . "'>";
             } else {
                 $buffer .= "<input type='submit' value='" . $GLOBALS['strGenerate'] . "' name='submitbutton' tabindex='" . $tabindex++ . "'>";
             }
         }
     }
     // Put extra hidden fields
     if (is_array($extra)) {
         reset($extra);
         while (list($k, $v) = each($extra)) {
             $buffer .= "<input type='hidden' value='" . htmlspecialchars($v, ENT_QUOTES) . "' name='{$k}'>";
         }
     }
     // Hide when integrated in zone-advanced.php
     if (!is_array($extra) || !isset($extra['zoneadvanced']) || !$extra['zoneadvanced']) {
         $buffer .= "</form><br /><br />";
     }
     // Disable bannercode before submitting the form (causes problems with mod_security)
     $buffer .= "<script type='text/javascript'>\n            function disableTextarea() {\n                var form = findObj('generate');\n                if (typeof(form.bannercode) != 'undefined') {\n                    form.bannercode.disabled = true;\n                }\n                form.submit();\n            }\n            </script>\n        ";
     return $buffer;
 }
Esempio n. 10
0
function phpAds_UserlogSelection($subSection, $mainSection = 'userlog')
{
    global $phpAds_TextDirection, $strBanners, $strCache, $strChooseSection, $strPriority, $strSourceEdit, $strStats, $strStorage, $strMaintenance, $strCheckForUpdates, $strViewPastUpdates;
    require_once MAX_PATH . '/lib/max/language/Loader.php';
    Language_Loader::load('settings');
    Language_Loader::load('default');
    Language_Loader::load('userlog');
    ?>
<script language="JavaScript">
<!--
function audit_goto_section()
{
    s = document.audit_selection.section.selectedIndex;

    s = document.audit_selection.section.options[s].value;
    document.location = '<?php 
    echo $mainSection;
    ?>
-' + s + '.php';
}
// -->
</script>
<?php 
    $conf =& $GLOBALS['_MAX']['CONF'];
    $pref =& $GLOBALS['_MAX']['PREF'];
    echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
    echo "<tr><form name='audit_selection'><td height='35'>";
    echo "<b>" . $strChooseSection . ":&nbsp;</b>";
    echo "<select name='section' onChange='audit_goto_section();'>";
    if (OA_Permission::isAccount(OA_ACCOUNT_ADMIN)) {
        echo "<option value='index'" . ($subSection == 'index' ? ' selected' : '') . ">" . $GLOBALS['strAuditTrail'] . "</option>";
        echo "<option value='maintenance'" . ($subSection == 'maintenance' ? ' selected' : '') . ">" . $GLOBALS['strMaintenanceLog'] . "</option>";
    }
    echo "</select>&nbsp;<a href='javascript:void(0)' onClick='audit_goto_section();'>";
    echo "<img src='" . OX::assetPath() . "/images/" . $phpAds_TextDirection . "/go_blue.gif' border='0'></a>";
    echo "</td></form></tr>";
    echo "</table>";
    phpAds_ShowBreak();
}
function phpAds_LoginScreen($message = '', $sessionID = 0)
{
    global $phpAds_config, $phpAds_productname;
    global $strUsername, $strPassword, $strLogin, $strWelcomeTo, $strEnterUsername, $strNoAdminInteface;
    phpAds_PageHeader(phpAds_Login);
    if ($phpAds_config['ui_enabled'] == true) {
        echo "<br>";
        phpAds_ShowBreak();
        echo "<br>";
        echo "<form name='login' method='post' action='" . basename($_SERVER['PHP_SELF']);
        echo (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '' ? '?' . htmlentities($_SERVER['QUERY_STRING']) : '') . "'>";
        echo "<input type='hidden' name='phpAds_cookiecheck' value='" . $_COOKIE['sessionID'] . "'>";
        echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'><tr>";
        echo "<td width='80' valign='bottom'><img src='images/login-welcome.gif'>&nbsp;&nbsp;</td>";
        echo "<td width='100%' valign='bottom'>";
        echo "<span class='tab-s'>" . $strWelcomeTo . " " . (isset($phpAds_config['name']) && $phpAds_config['name'] != '' ? $phpAds_config['name'] : $phpAds_productname) . "</span><br>";
        echo "<span class='install'>" . $strEnterUsername . "</span><br>";
        if ($message != "") {
            echo "<div class='errormessage' style='width: 400px;'><img class='errormessage' src='images/errormessage.gif' align='absmiddle'>";
            echo "<span class='tab-r'>{$message}</span></div>";
        } else {
            echo "<img src='images/break-el.gif' width='400' height='1' vspace='8'>";
        }
        echo "</td></tr><tr><td>&nbsp;</td><td>";
        echo "<table cellpadding='0' cellspacing='0' border='0'>";
        echo "<tr height='24'><td>" . $strUsername . ":&nbsp;</td><td><input class='flat' type='text' name='phpAds_username'></td></tr>";
        echo "<tr height='24'><td>" . $strPassword . ":&nbsp;</td><td><input class='flat' type='password' name='phpAds_password'></td></tr>";
        echo "<tr height='24'><td>&nbsp;</td><td><input type='submit' value='" . $strLogin . "'></td></tr>";
        echo "</table>";
        echo "</td></tr></table>";
        echo "</form>";
        phpAds_ShowBreak();
        echo "<script language='JavaScript'>";
        ?>
<!--
		login_focus();
//-->
		<?php 
        echo "</script>";
    } else {
        phpAds_ShowBreak();
        echo "<br><img src='images/info.gif' align='absmiddle'>&nbsp;";
        echo $strNoAdminInteface;
    }
    phpAds_PageFooter();
    exit;
}
Esempio n. 12
0
 public function getTextAreaAndOptions($invocationTag, $extra)
 {
     if (!$invocationTag->displayTextAreaAndOptions) {
         return '';
     }
     $buffer = "<hr />";
     $buffer .= "<div id='div-zone-invocation'>";
     $buffer .= "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>";
     $buffer .= "<td width='40'>&nbsp;</td><td><br />";
     $buffer .= "<br />";
     // Generate tag if the plugin agrees that it's ok to proceed
     if ($invocationTag->canGenerate()) {
         $buffer .= "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
         $buffer .= "<tr><td height='25'>";
         if ($this->codetype == 'invocationTags:oxInvocationTags:xmlrpc') {
             $buffer .= "\n                    <div class='errormessage'><img class='errormessage' src='" . OX::assetPath() . "/images/warning.gif' align='absmiddle'>\n                        {$GLOBALS['strIABNoteXMLRPCInvocation']}\n                    </div>";
         }
         if ($this->codetype == 'invocationTags:oxInvocationTags:local' && !$this->server_same) {
             $buffer .= "\n                    <div class='errormessage'><img class='errormessage' src='" . OX::assetPath() . "/images/warning.gif' align='absmiddle'>\n                        {$GLOBALS['strWarningLocalInvocation']}\n                        <br><p>{$GLOBALS['strIABNoteLocalInvocation']}</p>\n                    </div>";
         } else {
             if ($this->codetype == 'invocationTags:oxInvocationTags:local' && $this->server_same) {
                 $buffer .= "\n                    <div class='errormessage'><img class='errormessage' src='" . OX::assetPath() . "/images/warning.gif' align='absmiddle'>\n                {$GLOBALS['strIABNoteLocalInvocation']}\n                    </div>";
             }
         }
         // Supress the textarea if required by this plugin
         if (empty($invocationTag->suppressTextarea)) {
             $buffer .= "<img src='" . OX::assetPath() . "/images/icon-generatecode.gif' align='absmiddle'>&nbsp;<b>" . $GLOBALS['strBannercode'] . "</b></td>";
             // Show clipboard button only on IE
             if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') > 0 && strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') < 1) {
                 $buffer .= "<td height='25' align='right'><img src='" . OX::assetPath() . "/images/icon-clipboard.gif' align='absmiddle'>&nbsp;";
                 $buffer .= "<a href='javascript:max_CopyClipboard(\"bannercode\");'>" . $GLOBALS['strCopyToClipboard'] . "</a></td></tr>";
             } else {
                 $buffer .= "<td>&nbsp;</td>";
             }
             $buffer .= "<tr height='1'><td colspan='2' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
             $buffer .= "<tr><td colspan='2'>";
             $buffer .= "<textarea id='bannercode' name='bannercode' class='code-gray' rows='15' cols='80' style='width:95%; border: 1px solid black' readonly>";
             $buffer .= htmlspecialchars($this->generateInvocationCode($invocationTag));
             $buffer .= "</textarea>";
             $buffer .= "\n                    <script type='text/javascript'>\n                    <!--\n                    \$(document).ready(function() {\n                        \$('#bannercode').selectText();\n                    });\n                    //-->\n                    </script>";
         } else {
             $buffer .= $this->generateInvocationCode($invocationTag);
         }
         $buffer .= "</td></tr>";
         $buffer .= "</table><br />";
         $buffer .= phpAds_ShowBreak($print = false);
         $buffer .= "<br />";
         $generated = true;
     } else {
         $generated = false;
     }
     // Hide when integrated in zone-advanced.php
     if (!(is_array($extra) && isset($extra['zoneadvanced']) && $extra['zoneadvanced'])) {
         // Header
         // Parameters Section
         $buffer .= "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
         $buffer .= "<tr><td height='25' colspan='3'><img src='" . OX::assetPath() . "/images/icon-overview.gif' align='absmiddle'>&nbsp;<b>" . $GLOBALS['strParameters'] . "</b></td></tr>";
         $buffer .= "<tr height='1'><td width='30'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='30'></td>";
         $buffer .= "<td width='200'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='200'></td>";
         $buffer .= "<td width='100%'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
     }
     $buffer .= $invocationTag->generateOptions($this);
     // Hide when integrated in zone-advanced.php
     if (!(is_array($extra) && isset($extra['zoneadvanced']) && $extra['zoneadvanced'])) {
         // Footer
         $buffer .= "<tr><td height='10' colspan='3'>&nbsp;</td></tr>";
         $buffer .= "<tr height='1'><td colspan='3' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
         $buffer .= "</table>";
         $buffer .= "<br /><br />";
         $buffer .= "<input type='hidden' value='" . ($generated ? 1 : 0) . "' name='generate'>";
         if ($generated) {
             $buffer .= "<input type='submit' value='" . $GLOBALS['strRefresh'] . "' name='submitbutton' tabindex='" . $this->tabindex++ . "'>";
         } else {
             $buffer .= "<input type='submit' value='" . $GLOBALS['strGenerate'] . "' name='submitbutton' tabindex='" . $this->tabindex++ . "'>";
         }
     }
     $buffer .= "</td></tr></table>";
     $buffer .= "</div>";
     return $buffer;
 }
Esempio n. 13
0
 /**
  * Build a menu with all settings or preferences
  *
  * @param string $section The drop down section name.
  */
 function selection($section)
 {
     global $phpAds_TextDirection, $strHelp;
     global $tabindex;
     $aConf = $GLOBALS['_MAX']['CONF'];
     if (!isset($tabindex)) {
         $tabindex = 1;
     }
     $this->_writeJavascriptFunctions();
     echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'><tr>";
     $aSections = $this->getSettingsPreferences($section);
     echo "<td><form name='settings_selection'><td height='35'><b>";
     echo $GLOBALS['strChooseSection'] . ":&nbsp;</b>";
     echo "<select name='section' onChange='options_goto_section();' tabindex='" . $tabindex++ . "'>";
     foreach ($aSections as $k => $v) {
         echo "<option value='{$v['link']}'" . ($section == $k ? ' selected' : '') . ">{$v['name']}</option>";
     }
     echo "</select>&nbsp;<a href='#' onClick='options_goto_section();'>";
     echo "<img src='" . OX::assetPath() . "/images/" . $phpAds_TextDirection . "/go_blue.gif' border='0'></a>";
     echo "</td></form></tr></table>";
     phpAds_ShowBreak();
 }
function phpAds_placeInvocationForm($extra = '', $zone_invocation = false)
{
    global $HTTP_SERVER_VARS, $block, $blockcampaign, $campaignid, $clientid, $codetype, $delay, $delay_type, $generate, $height, $hostlanguage, $ilayer, $layerstyle, $left, $location, $menubar, $phpAds_config, $phpAds_TextDirection, $popunder, $raw, $refresh, $resizable, $resize, $scrollbars, $source, $status, $submitbutton, $tabindex, $target, $template, $timeout, $toolbars, $top, $transparent, $uniqueid, $what, $width, $withtext, $bannerid;
    // Check if affiliate is on the same server
    if ($extra != '' && isset($extra['website']) && $extra['website']) {
        $server_phpads = parse_url($phpAds_config['url_prefix']);
        $server_affilate = parse_url($extra['website']);
        $server_same = @gethostbyname($server_phpads['host']) == @gethostbyname($server_affilate['host']);
    } else {
        $server_same = true;
    }
    // Hide when integrated in zone-advanced.php
    if (!is_array($extra) || !isset($extra['zoneadvanced']) || !$extra['zoneadvanced']) {
        echo "<form name='generate' action='" . $HTTP_SERVER_VARS['PHP_SELF'] . "' method='POST'>\n";
    }
    // Invocation type selection
    if (!is_array($extra) || isset($extra['delivery']) && $extra['delivery'] != phpAds_ZoneInterstitial && $extra['delivery'] != phpAds_ZonePopup) {
        $allowed['adlayer'] = $phpAds_config['allow_invocation_interstitial'];
        $allowed['popup'] = $phpAds_config['allow_invocation_popup'];
        $allowed['xmlrpc'] = $phpAds_config['allow_invocation_xmlrpc'];
        $allowed['adframe'] = $phpAds_config['allow_invocation_frame'];
        $allowed['adjs'] = $phpAds_config['allow_invocation_js'];
        $allowed['adview'] = $phpAds_config['allow_invocation_plain'];
        $allowed['adviewnocookies'] = $phpAds_config['allow_invocation_plain_nocookies'];
        $allowed['local'] = $phpAds_config['allow_invocation_local'];
        if (is_array($extra)) {
            $allowed['popup'] = false;
        }
        if (is_array($extra)) {
            $allowed['adlayer'] = false;
        }
        if (is_array($extra) && $server_same == false) {
            $allowed['local'] = false;
        }
        if (is_array($extra) && $server_same == false && ($extra['width'] == '-1' || $extra['height'] == '-1')) {
            $allowed['adframe'] = false;
        }
        if (is_array($extra) && $extra['delivery'] == phpAds_ZoneText) {
            // Only allow Javascript and Localmode
            // when using text ads
            $allowed['adlayer'] = $allowed['popup'] = $allowed['adframe'] = $allowed['adview'] = false;
            $allowed['adviewnocookies'] = false;
        }
        if (!isset($codetype) || $allowed[$codetype] == false) {
            while (list($k, $v) = each($allowed)) {
                if ($v) {
                    $codetype = $k;
                }
            }
        }
        if (!isset($codetype)) {
            $codetype = '';
        }
        echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
        echo "<tr><td height='25' colspan='3'><b>" . $GLOBALS['strChooseInvocationType'] . "</b></td></tr>";
        echo "<tr><td height='35'>";
        echo "<select name='codetype' onChange=\"this.form.submit()\" accesskey=" . $GLOBALS['keyList'] . " tabindex='" . $tabindex++ . "'>";
        if ($allowed['adview']) {
            echo "<option value='adview'" . ($codetype == 'adview' ? ' selected' : '') . ">" . $GLOBALS['strInvocationRemote'] . "</option>";
        }
        if ($allowed['adviewnocookies']) {
            echo "<option value='adviewnocookies'" . ($codetype == 'adviewnocookies' ? ' selected' : '') . ">" . $GLOBALS['strInvocationRemoteNoCookies'] . "</option>";
        }
        if ($allowed['adjs']) {
            echo "<option value='adjs'" . ($codetype == 'adjs' ? ' selected' : '') . ">" . $GLOBALS['strInvocationJS'] . "</option>";
        }
        if ($allowed['adframe']) {
            echo "<option value='adframe'" . ($codetype == 'adframe' ? ' selected' : '') . ">" . $GLOBALS['strInvocationIframes'] . "</option>";
        }
        if ($allowed['xmlrpc']) {
            echo "<option value='xmlrpc'" . ($codetype == 'xmlrpc' ? ' selected' : '') . ">" . $GLOBALS['strInvocationXmlRpc'] . "</option>";
        }
        if ($allowed['popup']) {
            echo "<option value='popup'" . ($codetype == 'popup' ? ' selected' : '') . ">" . $GLOBALS['strInvocationPopUp'] . "</option>";
        }
        if ($allowed['adlayer']) {
            echo "<option value='adlayer'" . ($codetype == 'adlayer' ? ' selected' : '') . ">" . $GLOBALS['strInvocationAdLayer'] . "</option>";
        }
        if ($allowed['local']) {
            echo "<option value='local'" . ($codetype == 'local' ? ' selected' : '') . ">" . $GLOBALS['strInvocationLocal'] . "</option>";
        }
        echo "</select>";
        echo "&nbsp;<input type='image' src='images/" . $phpAds_TextDirection . "/go_blue.gif' border='0'>";
        echo "</td></tr></table>";
        phpAds_ShowBreak();
        echo "<br>";
    } else {
        if ($extra['delivery'] == phpAds_ZoneInterstitial) {
            $codetype = 'adlayer';
        }
        if ($extra['delivery'] == phpAds_ZonePopup) {
            $codetype = 'popup';
        }
        if (!isset($codetype)) {
            $codetype = '';
        }
    }
    if ($codetype == 'adlayer') {
        if (!isset($layerstyle)) {
            $layerstyle = 'geocities';
        }
        include '../libraries/layerstyles/' . $layerstyle . '/invocation.inc.php';
    }
    //
    if ($codetype != '') {
        // Code
        if (isset($submitbutton) || isset($generate) && $generate) {
            echo "<table border='0' width='550' cellpadding='0' cellspacing='0'>";
            echo "<tr><td height='25'><img src='images/icon-generatecode.gif' align='absmiddle'>&nbsp;<b>" . $GLOBALS['strBannercode'] . "</b></td>";
            // Show clipboard button only on IE
            if (strpos($HTTP_SERVER_VARS['HTTP_USER_AGENT'], 'MSIE') > 0 && strpos($HTTP_SERVER_VARS['HTTP_USER_AGENT'], 'Opera') < 1) {
                echo "<td height='25' align='right'><img src='images/icon-clipboard.gif' align='absmiddle'>&nbsp;";
                echo "<a href='javascript:phpAds_CopyClipboard(\"bannercode\");'>" . $GLOBALS['strCopyToClipboard'] . "</a></td></tr>";
            } else {
                echo "<td>&nbsp;</td>";
            }
            echo "<tr height='1'><td colspan='2' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
            echo "<tr><td colspan='2'><textarea name='bannercode' class='code-gray' rows='6' cols='55' style='width:550;' readonly>" . htmlspecialchars(phpAds_GenerateInvocationCode()) . "</textarea></td></tr>";
            echo "</table><br>";
            phpAds_ShowBreak();
            echo "<br>";
            $generated = true;
        } else {
            $generated = false;
        }
        // Hide when integrated in zone-advanced.php
        if (!(is_array($extra) && isset($extra['zoneadvanced']) && $extra['zoneadvanced'])) {
            // Header
            //Parameters Section
            echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
            echo "<tr><td height='25' colspan='3'><img src='images/icon-overview.gif' align='absmiddle'>&nbsp;<b>" . $GLOBALS['strParameters'] . "</b></td></tr>";
            echo "<tr height='1'><td width='30'><img src='images/break.gif' height='1' width='30'></td>";
            echo "<td width='200'><img src='images/break.gif' height='1' width='200'></td>";
            echo "<td width='100%'><img src='images/break.gif' height='1' width='100%'></td></tr>";
            echo "<tr" . ($zone_invocation || $codetype == 'adviewnocookies' ? '' : " bgcolor='#F6F6F6'") . "><td height='10' colspan='3'>&nbsp;</td></tr>";
            //echo "<tr><td height='10' colspan='3'>&nbsp;</td></tr>";
        }
        if ($codetype == 'adview') {
            $show = array('what' => true, 'clientid' => true, 'campaignid' => true, 'target' => true, 'source' => true);
        }
        if ($codetype == 'adviewnocookies') {
            $show = array('what' => true, 'clientid' => true, 'campaignid' => true, 'target' => true, 'source' => true, 'bannerid' => true);
        }
        if ($codetype == 'adjs') {
            $show = array('what' => true, 'clientid' => true, 'campaignid' => true, 'block' => true, 'target' => true, 'source' => true, 'withtext' => true, 'blockcampaign' => true);
        }
        if ($codetype == 'adframe') {
            $show = array('what' => true, 'clientid' => true, 'campaignid' => true, 'target' => true, 'source' => true, 'refresh' => true, 'size' => true, 'resize' => true, 'transparent' => true, 'ilayer' => true);
        }
        if ($codetype == 'ad') {
            $show = array('what' => true, 'clientid' => true, 'campaignid' => true, 'target' => true, 'source' => true, 'withtext' => true, 'size' => true, 'resize' => true, 'transparent' => true);
        }
        if ($codetype == 'popup') {
            $show = array('what' => true, 'clientid' => true, 'campaignid' => true, 'target' => true, 'source' => true, 'absolute' => true, 'popunder' => true, 'timeout' => true, 'delay' => true, 'windowoptions' => true);
        }
        if ($codetype == 'adlayer') {
            $show = phpAds_getLayerShowVar();
        }
        if ($codetype == 'xmlrpc') {
            $show = array('what' => true, 'clientid' => true, 'campaignid' => true, 'target' => true, 'source' => true, 'withtext' => true, 'template' => true, 'hostlanguage' => true);
        }
        if ($codetype == 'local') {
            $show = array('what' => true, 'clientid' => true, 'campaignid' => true, 'target' => true, 'source' => true, 'withtext' => true, 'block' => true, 'blockcampaign' => true, 'raw' => true);
        }
        // What
        if (!$zone_invocation && isset($show['what']) && $show['what'] == true && $codetype != 'adviewnocookies') {
            echo "<tr bgcolor='#F6F6F6'><td width='30'>&nbsp;</td>";
            echo "<td width='200' valign='top'>" . $GLOBALS['strInvocationWhat'] . "</td><td width='370'>";
            echo "<textarea class='flat' name='what' rows='3' cols='50' style='width:350px;' tabindex='" . $tabindex++ . "'>" . (isset($what) ? stripslashes($what) : '') . "</textarea></td></tr>";
            echo "<tr bgcolor='#F6F6F6'><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
            echo "<td bgcolor='#F6F6F6' colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
        }
        /* Remove advetiser from direct invocation - not needed
        		// ClientID
        		if (!$zone_invocation && isset($show['clientid']) && $show['clientid'] == true)
        		{
        			// Display available advertisers...
        			echo "<tr bgcolor='#F6F6F6'><td width='30'>&nbsp;</td>\n";
        			echo "<td width='200'>".$GLOBALS['strInvocationClientID']."</td><td width='370'>\n";
        			echo "<select name='clientid' style='width:350px;' tabindex='".($tabindex++)."'>\n";
        				echo "<option value='0'>-</option>\n";
        			
        			$res = phpAds_dbQuery(
        				"SELECT clientid, clientname".
        				" FROM ".$phpAds_config['tbl_clients']
        			) or phpAds_sqlDie();
        				
        			while ($row = phpAds_dbFetchArray($res))
        			{
        				echo "<option value='".$row['clientid']."'".($clientid == $row['clientid'] ? ' selected' : '').">";
        				echo phpAds_buildName ($row['clientid'], $row['clientname']);
        				echo "</option>\n";
        			}
        			
        			echo "</select>\n";
        			echo "</td></tr>";
        //			echo "<tr bgcolor='#F6F6F6'><td height='10' colspan='3'>&nbsp;</td></tr>";
        //			echo "<tr height='1'><td colspan='3' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
        //			echo "<tr><td height='10' colspan='3'>&nbsp;</td></tr>";
        			echo "<tr bgcolor='#F6F6F6'><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        			echo "<td bgcolor='#F6F6F6' colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
        		}
        		*/
        // CampaignID
        if (!$zone_invocation && isset($show['campaignid']) && $show['campaignid'] == true && $codetype != 'adviewnocookies') {
            // Display available campaigns...
            echo "<tr bgcolor='#F6F6F6'><td width='30'>&nbsp;</td>\n";
            echo "<td width='200'>" . $GLOBALS['strInvocationCampaignID'] . "</td><td width='370'>\n";
            echo "<select name='campaignid' style='width:350px;' tabindex='" . $tabindex++ . "'>\n";
            echo "<option value='0'>-</option>\n";
            if (phpAds_isUser(phpAds_Admin)) {
                $query = "SELECT campaignid,campaignname" . " FROM " . $phpAds_config['tbl_campaigns'];
            } elseif (phpAds_isUser(phpAds_Agency)) {
                $query = "SELECT m.campaignid AS campaignid" . ",m.campaignname AS campaignname" . " FROM " . $phpAds_config['tbl_campaigns'] . " AS m" . "," . $phpAds_config['tbl_clients'] . " AS c" . " WHERE m.clientid=c.clientid" . " AND c.agencyid=" . phpAds_getAgencyID();
            }
            $res = phpAds_dbQuery($query) or phpAds_sqlDie();
            while ($row = phpAds_dbFetchArray($res)) {
                echo "<option value='" . $row['campaignid'] . "'" . ($campaignid == $row['campaignid'] ? ' selected' : '') . ">";
                echo phpAds_buildName($row['campaignid'], $row['campaignname']);
                echo "</option>\n";
            }
            echo "</select>\n";
            echo "</td></tr>";
            echo "<tr bgcolor='#F6F6F6'><td height='10' colspan='3'>&nbsp;</td></tr>";
            echo "<tr height='1'><td colspan='3' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
            echo "<tr><td height='10' colspan='3'>&nbsp;</td></tr>";
        }
        // BannerID
        if (isset($show['bannerid']) && $show['bannerid'] == true) {
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strInvocationBannerID'] . "</td><td width='370'>";
            echo "<input class='flat' type='text' name='bannerid' size='' value='" . (isset($bannerid) ? $bannerid : '') . "' style='width:175px;' tabindex='" . $tabindex++ . "'></td></tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
        }
        // Target
        if (isset($show['target']) && $show['target'] == true) {
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strInvocationTarget'] . "</td><td width='370'>";
            echo "<input class='flat' type='text' name='target' size='' value='" . (isset($target) ? $target : '') . "' style='width:175px;' tabindex='" . $tabindex++ . "'></td></tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // Source
        if (isset($show['source']) && $show['source'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strInvocationSource'] . "</td><td width='370'>";
            echo "<input class='flat' type='text' name='source' size='' value='" . (isset($source) ? $source : '') . "' style='width:175px;' tabindex='" . $tabindex++ . "'></td></tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // WithText
        if (isset($show['withtext']) && $show['withtext'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strInvocationWithText'] . "</td>";
            echo "<td width='370'><input type='radio' name='withtext' value='1'" . (isset($withtext) && $withtext != 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strYes'] . "<br>";
            echo "<input type='radio' name='withtext' value='0'" . (!isset($withtext) || $withtext == 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strNo'] . "</td>";
            echo "</tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // refresh
        if (isset($show['refresh']) && $show['refresh'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strIFrameRefreshAfter'] . "</td><td width='370'>";
            echo "<input class='flat' type='text' name='refresh' size='' value='" . (isset($refresh) ? $refresh : '') . "' style='width:175px;' tabindex='" . $tabindex++ . "'> " . $GLOBALS['strAbbrSeconds'] . "</td></tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // size
        if (!$zone_invocation && isset($show['size']) && $show['size'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strFrameSize'] . "</td><td width='370'>";
            echo $GLOBALS['strWidth'] . ": <input class='flat' type='text' name='width' size='3' value='" . (isset($width) ? $width : '') . "' tabindex='" . $tabindex++ . "'>&nbsp;&nbsp;&nbsp;";
            echo $GLOBALS['strHeight'] . ": <input class='flat' type='text' name='height' size='3' value='" . (isset($height) ? $height : '') . "' tabindex='" . $tabindex++ . "'>";
            echo "</td></tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // Resize
        if (isset($show['resize']) && $show['resize'] == true) {
            // Only show this if affiliate is on the same server
            if ($server_same) {
                echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
                echo "<tr><td width='30'>&nbsp;</td>";
                echo "<td width='200'>" . $GLOBALS['strIframeResizeToBanner'] . "</td>";
                echo "<td width='370'><input type='radio' name='resize' value='1'" . (isset($resize) && $resize == 1 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strYes'] . "<br>";
                echo "<input type='radio' name='resize' value='0'" . (!isset($resize) || $resize == 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strNo'] . "</td>";
                echo "</tr>";
                echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
            } else {
                echo "<input type='hidden' name='resize' value='0'>";
            }
        }
        // Transparent
        if (isset($show['transparent']) && $show['transparent'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strIframeMakeTransparent'] . "</td>";
            echo "<td width='370'><input type='radio' name='transparent' value='1'" . (isset($transparent) && $transparent == 1 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strYes'] . "<br>";
            echo "<input type='radio' name='transparent' value='0'" . (!isset($transparent) || $transparent == 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strNo'] . "</td>";
            echo "</tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // Netscape 4 ilayer
        if (isset($show['ilayer']) && $show['ilayer'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strIframeIncludeNetscape4'] . "</td>";
            echo "<td width='370'><input type='radio' name='ilayer' value='1'" . (isset($ilayer) && $ilayer == 1 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strYes'] . "<br>";
            echo "<input type='radio' name='ilayer' value='0'" . (!isset($ilayer) || $ilayer == 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strNo'] . "</td>";
            echo "</tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // Block
        if (isset($show['block']) && $show['block'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strInvocationDontShowAgain'] . "</td>";
            echo "<td width='370'><input type='radio' name='block' value='1'" . (isset($block) && $block != 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strYes'] . "<br>";
            echo "<input type='radio' name='block' value='0'" . (!isset($block) || $block == 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strNo'] . "</td>";
            echo "</tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // Blockcampaign
        if (isset($show['blockcampaign']) && $show['blockcampaign'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strInvocationDontShowAgainCampaign'] . "</td>";
            echo "<td width='370'><input type='radio' name='blockcampaign' value='1'" . (isset($blockcampaign) && $blockcampaign != 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strYes'] . "<br>";
            echo "<input type='radio' name='blockcampaign' value='0'" . (!isset($blockcampaign) || $blockcampaign == 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strNo'] . "</td>";
            echo "</tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // Raw
        if (isset($show['raw']) && $show['raw'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strInvocationTemplate'] . "</td>";
            echo "<td width='370'><input type='radio' name='raw' value='1'" . (isset($raw) && $raw != 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strYes'] . "<br>";
            echo "<input type='radio' name='raw' value='0'" . (!isset($raw) || $raw == 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strNo'] . "</td>";
            echo "</tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // AdLayer style
        if (isset($show['layerstyle']) && $show['layerstyle'] == true) {
            $layerstyles = array();
            $stylesdir = opendir('../libraries/layerstyles');
            while ($stylefile = readdir($stylesdir)) {
                if (is_dir('../libraries/layerstyles/' . $stylefile) && file_exists('../libraries/layerstyles/' . $stylefile . '/invocation.inc.php')) {
                    if (ereg('^[^.]', $stylefile)) {
                        $layerstyles[$stylefile] = isset($GLOBALS['strAdLayerStyleName'][$stylefile]) ? $GLOBALS['strAdLayerStyleName'][$stylefile] : str_replace("- ", "-", ucwords(str_replace("-", "- ", $stylefile)));
                    }
                }
            }
            closedir($stylesdir);
            asort($layerstyles, SORT_STRING);
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strAdLayerStyle'] . "</td><td width='370'>";
            echo "<select name='layerstyle' onChange='this.form.submit()' style='width:175px;' tabindex='" . $tabindex++ . "'>";
            while (list($k, $v) = each($layerstyles)) {
                echo "<option value='{$k}'" . ($layerstyle == $k ? ' selected' : '') . ">{$v}</option>";
            }
            echo "</select>";
            echo "</td></tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // popunder
        if (isset($show['popunder']) && $show['popunder'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strPopUpStyle'] . "</td>";
            echo "<td width='370'><input type='radio' name='popunder' value='0'" . (!isset($popunder) || $popunder != '1' ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . "<img src='images/icon-popup-over.gif' align='absmiddle'>&nbsp;" . $GLOBALS['strPopUpStylePopUp'] . "<br>";
            echo "<input type='radio' name='popunder' value='1'" . (isset($popunder) && $popunder == '1' ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . "<img src='images/icon-popup-under.gif' align='absmiddle'>&nbsp;" . $GLOBALS['strPopUpStylePopUnder'] . "</td>";
            echo "</tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // delay
        if (isset($show['delay']) && $show['delay'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strPopUpCreateInstance'] . "</td>";
            echo "<td width='370'><input type='radio' name='delay_type' value='none'" . (!isset($delay_type) || $delay_type != 'exit' && $delay_type != 'seconds' ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strPopUpImmediately'] . "<br>";
            echo "<input type='radio' name='delay_type' value='exit'" . (isset($delay_type) && $delay_type == 'exit' ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strPopUpOnClose'] . "<br>";
            echo "<input type='radio' name='delay_type' value='seconds'" . (isset($delay_type) && $delay_type == 'seconds' ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strPopUpAfterSec'] . "&nbsp;" . "<input class='flat' type='text' name='delay' size='' value='" . (isset($delay) ? $delay : '-') . "' style='width:50px;' tabindex='" . $tabindex++ . "'> " . $GLOBALS['strAbbrSeconds'] . "</td>";
            echo "</tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // absolute
        if (isset($show['absolute']) && $show['absolute'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strPopUpTop'] . "</td><td width='370'>";
            echo "<input class='flat' type='text' name='top' size='' value='" . (isset($top) ? $top : '-') . "' style='width:50px;' tabindex='" . $tabindex++ . "'> " . $GLOBALS['strAbbrPixels'] . "</td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strPopUpLeft'] . "</td><td width='370'>";
            echo "<input class='flat' type='text' name='left' size='' value='" . (isset($left) ? $left : '-') . "' style='width:50px;' tabindex='" . $tabindex++ . "'> " . $GLOBALS['strAbbrPixels'] . "</td></tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // timeout
        if (isset($show['timeout']) && $show['timeout'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strAutoCloseAfter'] . "</td><td width='370'>";
            echo "<input class='flat' type='text' name='timeout' size='' value='" . (isset($timeout) ? $timeout : '-') . "' style='width:50px;' tabindex='" . $tabindex++ . "'> " . $GLOBALS['strAbbrSeconds'] . "</td></tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // Window options
        if (isset($show['windowoptions']) && $show['windowoptions'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td><td width='200' valign='top'>" . $GLOBALS['strWindowOptions'] . "</td><td width='370'>";
            echo "<table cellpadding='0' cellspacing='0' border='0'>";
            echo "<tr><td>" . $GLOBALS['strShowToolbars'] . "</td><td>&nbsp;&nbsp;&nbsp;</td><td>";
            echo "<input type='radio' name='toolbars' value='1'" . (isset($toolbars) && $toolbars != 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strYes'] . "<br>";
            echo "</td><td>&nbsp;&nbsp;&nbsp;</td><td>";
            echo "<input type='radio' name='toolbars' value='0'" . (!isset($toolbars) || $toolbars == 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strNo'] . "";
            echo "</td></tr><tr><td colspan='5'><img src='images/break-l.gif' height='1' width='200' vspace='2'></td></tr>";
            echo "<tr><td>" . $GLOBALS['strShowLocation'] . "</td><td>&nbsp;&nbsp;&nbsp;</td><td>";
            echo "<input type='radio' name='location' value='1'" . (isset($location) && $location != 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strYes'] . "<br>";
            echo "</td><td>&nbsp;&nbsp;&nbsp;</td><td>";
            echo "<input type='radio' name='location' value='0'" . (!isset($location) || $location == 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strNo'] . "";
            echo "</td></tr><tr><td colspan='5'><img src='images/break-l.gif' height='1' width='200' vspace='2'></td></tr>";
            echo "<tr><td>" . $GLOBALS['strShowMenubar'] . "</td><td>&nbsp;&nbsp;&nbsp;</td><td>";
            echo "<input type='radio' name='menubar' value='1'" . (isset($menubar) && $menubar != 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strYes'] . "<br>";
            echo "</td><td>&nbsp;&nbsp;&nbsp;</td><td>";
            echo "<input type='radio' name='menubar' value='0'" . (!isset($menubar) || $menubar == 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strNo'] . "";
            echo "</td></tr><tr><td colspan='5'><img src='images/break-l.gif' height='1' width='200' vspace='2'></td></tr>";
            echo "<tr><td>" . $GLOBALS['strShowStatus'] . "</td><td>&nbsp;&nbsp;&nbsp;</td><td>";
            echo "<input type='radio' name='status' value='1'" . (isset($status) && $status != 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strYes'] . "<br>";
            echo "</td><td>&nbsp;&nbsp;&nbsp;</td><td>";
            echo "<input type='radio' name='status' value='0'" . (!isset($status) || $status == 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strNo'] . "";
            echo "</td></tr><tr><td colspan='5'><img src='images/break-l.gif' height='1' width='200' vspace='2'></td></tr>";
            echo "<tr><td>" . $GLOBALS['strWindowResizable'] . "</td><td>&nbsp;&nbsp;&nbsp;</td><td>";
            echo "<input type='radio' name='resizable' value='1'" . (isset($resizable) && $resizable != 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strYes'] . "<br>";
            echo "</td><td>&nbsp;&nbsp;&nbsp;</td><td>";
            echo "<input type='radio' name='resizable' value='0'" . (!isset($resizable) || $resizable == 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strNo'] . "";
            echo "</td></tr><tr><td colspan='5'><img src='images/break-l.gif' height='1' width='200' vspace='2'></td></tr>";
            echo "<tr><td>" . $GLOBALS['strShowScrollbars'] . "</td><td>&nbsp;&nbsp;&nbsp;</td><td>";
            echo "<input type='radio' name='scrollbars' value='1'" . (isset($scrollbars) && $scrollbars != 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strYes'] . "<br>";
            echo "</td><td>&nbsp;&nbsp;&nbsp;</td><td>";
            echo "<input type='radio' name='scrollbars' value='0'" . (!isset($scrollbars) || $scrollbars == 0 ? ' checked' : '') . " tabindex='" . $tabindex++ . "'>&nbsp;" . $GLOBALS['strNo'] . "";
            echo "</td></tr>";
            echo "</table>";
            echo "</td></tr><tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // AdLayer custom code
        if (isset($show['layercustom']) && $show['layercustom'] == true) {
            phpAds_placeLayerSettings();
        }
        // Host Language
        if (isset($show['hostlanguage']) && $show['hostlanguage'] == true) {
            echo "<td colspan='2'><img src='images/break-l.gif' height='1' width='200' vspace='6'></td></tr>";
            echo "<tr><td width='30'>&nbsp;</td>";
            echo "<td width='200'>" . $GLOBALS['strXmlRpcLanguage'] . "</td><td width='370'>";
            echo "<select name='hostlanguage' tabindex='" . $tabindex++ . "'>";
            echo "<option value='php'" . ($hostlanguage == 'php' ? ' selected' : '') . ">PHP</option>";
            //		echo "<option value='php-xmlrpc'".($hostlanguage == 'php-xmlrpc' ? ' selected' : '').">PHP with built in XML-RPC extension</option>";
            //		echo "<option value='asp'".($hostlanguage == 'asp' ? ' selected' : '').">ASP</option>";
            //		echo "<option value='jsp'".($hostlanguage == 'jsp' ? ' selected' : '').">JSP</option>";
            echo "</select>";
            echo "</td></tr>";
            echo "<tr><td width='30'><img src='images/spacer.gif' height='1' width='100%'></td>";
        }
        // Hide when integrated in zone-advanced.php
        if (!(is_array($extra) && isset($extra['zoneadvanced']) && $extra['zoneadvanced'])) {
            // Footer
            echo "<tr><td height='10' colspan='3'>&nbsp;</td></tr>";
            echo "<tr height='1'><td colspan='3' bgcolor='#888888'><img src='images/break.gif' height='1' width='100%'></td></tr>";
            echo "</table>";
            echo "<br><br>";
            echo "<input type='hidden' value='" . ($generated ? 1 : 0) . "' name='generate'>";
            if ($generated) {
                echo "<input type='submit' value='" . $GLOBALS['strRefresh'] . "' name='submitbutton' tabindex='" . $tabindex++ . "'>";
            } else {
                echo "<input type='submit' value='" . $GLOBALS['strGenerate'] . "' name='submitbutton' tabindex='" . $tabindex++ . "'>";
            }
        }
    }
    // Put extra hidden fields
    if (is_array($extra)) {
        while (list($k, $v) = each($extra)) {
            echo "<input type='hidden' value='{$v}' name='{$k}'>";
        }
    }
    // Hide when integrated in zone-advanced.php
    if (!is_array($extra) || !isset($extra['zoneadvanced']) || !$extra['zoneadvanced']) {
        echo "</form><br><br>";
    }
}