コード例 #1
0
 /**
  * Outputs the HTML to display the data for this limitation
  *
  * @return void
  */
 function displayData()
 {
     $this->data = $this->_expandData($this->data);
     $tabindex =& $GLOBALS['tabindex'];
     // The region plugin is slightly different since we need to allow for multiple regions in different countries
     echo "\n            <table border='0' cellpadding='2'>\n                <tr>\n                    <th>" . $this->translate('Country') . "</th>\n                    <td>\n                        <select name='acl[{$this->executionorder}][data][]' {$disabled}>";
     foreach ($this->res as $countryCode => $countryName) {
         if (count($countryName) === 1) {
             continue;
         }
         $selected = $this->data[0] == $countryCode ? 'selected="selected"' : '';
         echo "<option value='{$countryCode}' {$selected}>{$countryName[0]}</option>";
     }
     echo "\n                        </select>\n                    &nbsp;<input type='image' name='action[none]' src='" . OX::assetPath() . "/images/{$GLOBALS['phpAds_TextDirection']}/go_blue.gif' border='0' align='absmiddle' alt='{$GLOBALS['strSave']}'></td>\n                </tr>";
     if (!empty($this->data[0])) {
         // A country has been selected, show city list for this country...
         // Note: Since a disabled field does not pass it's value through, we need to pass the selected country in...
         echo "<tr><th>" . $this->translate('Region(s)') . "</th><td><div class='box'>";
         $aRegions = $this->res[$this->data[0]];
         unset($aRegions[0]);
         $aSelectedRegions = $this->data;
         unset($aSelectedRegions[0]);
         foreach ($aRegions as $sCode => $sName) {
             echo "<div class='boxrow'>";
             echo "<input tabindex='" . $tabindex++ . "' ";
             echo "type='checkbox' id='c_{$this->executionorder}_{$sCode}' name='acl[{$this->executionorder}][data][]' value='{$sCode}'" . (in_array($sCode, $aSelectedRegions) ? ' CHECKED' : '') . ">{$sName}</div>";
         }
         echo "</div></td></tr>";
     }
     echo "\n            </table>\n        ";
     $this->data = $this->_flattenData($this->data);
 }
コード例 #2
0
 /**
  * A method that echos the HTML for this field.
  */
 function display()
 {
     $oStartDate = $this->getStartDate();
     $startDateStr = is_null($oStartDate) ? '' : $oStartDate->format('%Y-%m-%d');
     $oEndDate = $this->getEndDate();
     $endDateStr = is_null($oEndDate) ? '' : $oEndDate->format('%Y-%m-%d');
     echo "\n        <select name='{$this->_name}_preset' id='{$this->_name}_preset' onchange='{$this->_name}FormChange(" . ($this->_autoSubmit ? 1 : 0) . ")' tabindex='" . $this->_tabIndex++ . "'>";
     foreach ($this->_fieldSelectionNames as $v => $n) {
         $selected = $v == $this->_fieldSelectionValue ? " selected='selected'" : '';
         echo "\n            <option value='{$v}'{$selected}>{$n}</option>";
     }
     echo "\n        </select>\n        <label for='{$this->_name}_start' style='margin-left: 1em'> " . $this->oTrans->translate('From') . "</label>\n        <input class='date' name='{$this->_name}_start' id='{$this->_name}_start' type='text' value='{$startDateStr}' tabindex='" . $this->_tabIndex++ . "' />\n        <input type='image' src='" . OX::assetPath() . "/images/icon-calendar.gif' id='{$this->_name}_start_button' align='absmiddle' border='0' tabindex='" . $this->_tabIndex++ . "' />\n        <label for='{$this->_name}_end' style='margin-left: 1em'> " . $this->oTrans->translate('To') . "</label>\n        <input class='date' name='{$this->_name}_end' id='{$this->_name}_end' type='text' value='{$endDateStr}' tabindex='" . $this->_tabIndex++ . "' />\n        <input type='image' src='" . OX::assetPath() . "/images/icon-calendar.gif' id='{$this->_name}_end_button' align='absmiddle' border='0' tabindex='" . $this->_tabIndex++ . "' />\n        <script type='text/javascript'>\n        <!--\n        Calendar.setup({\n            inputField : '{$this->_name}_start',\n            ifFormat   : '%Y-%m-%d',\n            button     : '{$this->_name}_start_button',\n            align      : 'Bl',\n            weekNumbers: false,\n            firstDay   : " . ($GLOBALS['pref']['ui_week_start_day'] ? 1 : 0) . ",\n            electric   : false\n        })\n        Calendar.setup({\n            inputField : '{$this->_name}_end',\n            ifFormat   : '%Y-%m-%d',\n            button     : '{$this->_name}_end_button',\n            align      : 'Bl',\n            weekNumbers: false,\n            firstDay   : " . ($GLOBALS['pref']['ui_week_start_day'] ? 1 : 0) . ",\n            electric   : false\n        })\n        // Tabindex handling\n        {$this->_name}TabIndex = " . ($this->_tabIndex - 4) . ";\n        // Functions\n        function {$this->_name}Reset()\n        {\n            document.getElementById('{$this->_name}_start').value = '{$startDateStr}';\n            document.getElementById('{$this->_name}_start').value = '{$endDateStr}';\n            document.getElementById('{$this->_name}_preset').value = '{$this->_fieldSelectionValue}';\n        }\n        function {$this->_name}FormSubmit() {\n            submitForm();\n            return false;\n        }\n        function {$this->_name}FormChange(bAutoSubmit)\n        {\n            var o = document.getElementById('{$this->_name}_preset');\n            var {$this->_name}SelectName = o.options[o.selectedIndex].value;\n            var specific = {$this->_name}SelectName == 'specific';";
     $oTmpDaySpan = new OA_Admin_DaySpan();
     foreach ($this->_fieldSelectionNames as $v => $n) {
         if ($v != 'specific') {
             if ($v != 'all_events') {
                 $oTmpDaySpan->setSpanPresetValue($v);
                 $oTmpStartDate = $oTmpDaySpan->getStartDate();
                 $sTmpStartDate = $oTmpStartDate->format('%Y-%m-%d');
                 $oTmpEndDate = $oTmpDaySpan->getEndDate();
                 $sTmpEndDate = $oTmpEndDate->format('%Y-%m-%d');
             } else {
                 $sTmpStartDate = '';
                 $sTmpEndDate = '';
             }
             echo "\n            if ({$this->_name}SelectName == '{$v}') {\n                document.getElementById('{$this->_name}_start').value = '{$sTmpStartDate}';\n                document.getElementById('{$this->_name}_end').value = '{$sTmpEndDate}';\n            }\n                ";
         }
     }
     echo "\n\n            document.getElementById('{$this->_name}_start').readOnly = !specific;\n            document.getElementById('{$this->_name}_end').readOnly = !specific;\n\n            if (!specific) {\n                document.getElementById('{$this->_name}_start').style.backgroundColor = '#CCCCCC';\n                document.getElementById('{$this->_name}_end').style.backgroundColor = '#CCCCCC';\n                document.getElementById('{$this->_name}_start').tabIndex = null;\n                document.getElementById('{$this->_name}_start_button').tabIndex = null;\n                document.getElementById('{$this->_name}_end').tabIndex = null;\n                document.getElementById('{$this->_name}_end_button').tabIndex = null;\n            } else {\n                document.getElementById('{$this->_name}_start').style.backgroundColor = '#FFFFFF';\n                document.getElementById('{$this->_name}_end').style.backgroundColor = '#FFFFFF';\n                document.getElementById('{$this->_name}_start').tabIndex = {$this->_name}TabIndex;\n                document.getElementById('{$this->_name}_start_button').tabIndex = {$this->_name}TabIndex + 1;\n                document.getElementById('{$this->_name}_end').tabIndex = {$this->_name}TabIndex + 2;\n                document.getElementById('{$this->_name}_end_button').tabIndex = {$this->_name}TabIndex + 3;\n            }\n\n            document.getElementById('{$this->_name}_start_button').readOnly = !specific;\n            document.getElementById('{$this->_name}_end_button').readOnly = !specific;\n            document.getElementById('{$this->_name}_start_button').src = specific ? '" . OX::assetPath() . "/images/icon-calendar.gif' : '" . OX::assetPath() . "/images/icon-calendar-d.gif';\n            document.getElementById('{$this->_name}_end_button').src = specific ? '" . OX::assetPath() . "/images/icon-calendar.gif' : '" . OX::assetPath() . "/images/icon-calendar-d.gif';\n            document.getElementById('{$this->_name}_start_button').style.cursor = specific ? 'auto' : 'default';\n            document.getElementById('{$this->_name}_end_button').style.cursor = specific ? 'auto' : 'default';\n\n            if (!specific && bAutoSubmit) {\n                submitForm();\n            }\n        }\n        {$this->_name}FormChange(0);\n        //-->\n        </script>";
 }
コード例 #3
0
ファイル: Flexy.php プロジェクト: villos/tree_admin
 function showAveragedColumnLegend()
 {
     if (!self::$averagedColumnDisplayed) {
         return '';
     }
     return '<img src="' . OX::assetPath() . '/images/warning.gif" width="16 height="16" alt="" title="" />: ' . $GLOBALS['strAveragedColumnLegend'];
 }
コード例 #4
0
 /**
  * PHP5-style constructor
  */
 function __construct()
 {
     $this->_useDefaultDal();
     $this->advertiser_id = MAX_getValue('clientid', 0);
     $this->tracker_id = MAX_getValue('trackerid', 0);
     $this->assetPath = OX::assetPath();
     $this->showReminder = false;
 }
コード例 #5
0
ファイル: Grid.php プロジェクト: hostinger/revive-adserver
 /**
  * A method to launch and display the widget
  *
  */
 function display()
 {
     $oTpl = new OA_Admin_Template('dashboard/grid.html');
     $oTpl->assign('dashboardURL', MAX::constructURL(MAX_URL_ADMIN, 'dashboard.php'));
     $oTpl->assign('cssURL', OX::assetPath() . "/css");
     $oTpl->assign('imageURL', OX::assetPath() . "/images");
     $oTpl->assign('jsURL', OX::assetPath() . "/js");
     $oTpl->display();
 }
コード例 #6
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();
}
コード例 #7
0
 /**
  * Outputs the HTML to display the data for this limitation
  *
  * @return void
  */
 function displayData()
 {
     $this->data = $this->_expandData($this->data);
     $tabindex =& $GLOBALS['tabindex'];
     if ($this->data['day'] == 0 && $this->data['month'] == 0 && $this->data['year'] == 0) {
         $set = false;
     } else {
         $set = true;
     }
     echo "<table><tr><td>";
     if ($set) {
         $oDate = new Date($this->data['year'] . '-' . $this->data['month'] . '-' . $this->data['day']);
     }
     $dateStr = is_null($oDate) ? '' : $oDate->format('%d %B %Y ');
     echo "\n        <input class='date' name='acl[{$this->executionorder}][data][date]' id='acl[{$this->executionorder}][data][day]' type='text' value='{$dateStr}' tabindex='" . $tabindex++ . "' />\n        <input type='image' src='" . OX::assetPath() . "/images/icon-calendar.gif' id='{$this->executionorder}_button' align='absmiddle' border='0' tabindex='" . $tabindex++ . "' />\n        <script type='text/javascript'>\n        <!--\n        Calendar.setup({\n            inputField : 'acl[{$this->executionorder}][data][day]',\n            ifFormat   : '%d %B %Y',\n            button     : '{$this->executionorder}_button',\n            align      : 'Bl',\n            weekNumbers: false,\n            firstDay   : " . ($GLOBALS['pref']['begin_of_week'] ? 1 : 0) . ",\n            electric   : false\n        })\n        //-->\n        </script>";
     echo "</td></tr></table>";
     $this->data = $this->_flattenData($this->data);
 }
コード例 #8
0
 function placeLayerSettings()
 {
     global $align, $collapsetime, $padding, $closetext;
     global $tabindex;
     if (!isset($align)) {
         $align = 'right';
     }
     if (!isset($collapsetime)) {
         $collapsetime = '-';
     }
     if (!isset($padding)) {
         $padding = '2';
     }
     if (!isset($closetext)) {
         $closetext = $this->translate("[Close]");
     }
     $buffer = '';
     $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-el.gif' height='1' width='100%'></td></tr>";
     $buffer .= "<tr><td height='10' colspan='3'>&nbsp;</td></tr>";
     $buffer .= "<tr><td width='30'>&nbsp;</td>";
     $buffer .= "<td width='200'>" . $this->translate("Alignment") . "</td><td width='370'>";
     $buffer .= "<select name='align' style='width:175px;' tabindex='" . $tabindex++ . "'>";
     $buffer .= "<option value='left'" . ($align == 'left' ? ' selected' : '') . ">" . $this->translate("Left") . "</option>";
     $buffer .= "<option value='center'" . ($align == 'center' ? ' selected' : '') . ">" . $this->translate("Center") . "</option>";
     $buffer .= "<option value='right'" . ($align == 'right' ? ' selected' : '') . ">" . $this->translate("Right") . "</option>";
     $buffer .= "</select>";
     $buffer .= "</td></tr>";
     $buffer .= "<tr><td width='30'><img src='" . OX::assetPath() . "/images/spacer.gif' height='5' width='100%'></td></tr>";
     $buffer .= "<tr><td width='30'>&nbsp;</td>";
     $buffer .= "<td width='200'>" . $this->translate("Close text") . "</td><td width='370'>";
     $buffer .= "<input class='flat' type='text' name='closetext' size='' value='" . $closetext . "' style='width:175px;' tabindex='" . $tabindex++ . "'></td></tr>";
     $buffer .= "<tr><td width='30'><img src='" . OX::assetPath() . "/images/spacer.gif' height='5' width='100%'></td></tr>";
     $buffer .= "<tr><td width='30'>&nbsp;</td>";
     $buffer .= "<td width='200'>" . $this->translate("Automatically collapse after") . "</td><td width='370'>";
     $buffer .= "<input class='flat' type='text' name='collapsetime' size='' value='" . (isset($collapsetime) ? $collapsetime : '-') . "' style='width:60px;' tabindex='" . $tabindex++ . "'> " . $GLOBALS['strAbbrSeconds'] . "</td></tr>";
     $buffer .= "<tr><td width='30'><img src='" . OX::assetPath() . "/images/spacer.gif' height='5' width='100%'></td></tr>";
     $buffer .= "<tr><td width='30'>&nbsp;</td>";
     $buffer .= "<td width='200'>" . $this->translate("Banner padding") . "</td><td width='370'>";
     $buffer .= "<input class='flat' type='text' name='padding' size='' value='" . (isset($padding) ? $padding : '0') . "' style='width:60px;' tabindex='" . $tabindex++ . "'> " . $GLOBALS['strAbbrPixels'] . "</td></tr>";
     $buffer .= "<tr><td width='30'><img src='" . OX::assetPath() . "/images/spacer.gif' height='5' width='100%'></td></tr>";
     return $buffer;
 }
コード例 #9
0
function phpAds_showCache()
{
    $conf = $GLOBALS['_MAX']['CONF'];
    global $strSize, $strKiloByte;
    global $phpAds_TextDirection;
    $rows = phpAds_cacheInfo();
    if (is_array($rows)) {
        $i = 0;
        // Header
        echo "<table width='100%' border='0' align='center' cellspacing='0' cellpadding='0'>";
        echo "<tr height='25'>";
        echo "<td height='25'><b>" . $strSize . "</b></td>";
        echo "</tr>";
        echo "<tr height='1'><td colspan='5' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
        foreach (array_keys($rows) as $key) {
            strtok($key, "=");
            $what = strtok("&");
            if ($i > 0) {
                echo "<tr height='1'><td colspan='5' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break-l.gif' height='1' width='100%'></td></tr>";
            }
            echo "<tr height='25' " . ($i % 2 == 0 ? "bgcolor='#F6F6F6'" : "") . ">";
            echo "<td height='25'>";
            echo "&nbsp;&nbsp;";
            // Icon
            if (substr($what, 0, 5) == 'zone:') {
                echo "<img src='" . OX::assetPath() . "/images/icon-zone.gif' align='absmiddle'>&nbsp;";
            } else {
                echo "<img src='" . OX::assetPath() . "/images/icon-generatecode.gif' align='absmiddle'>&nbsp;";
            }
            // Name
            echo $what;
            echo "</td>";
            echo "<td height='25'>" . round($rows[$key] / 1024) . " " . $strKiloByte . "</td>";
            echo "</tr>";
            $i++;
        }
        // Footer
        echo "<tr height='1'><td colspan='5' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
        echo "</table>";
    }
}
コード例 #10
0
 /**
  * Outputs the HTML to display the data for this limitation
  *
  * @return void
  */
 function displayData()
 {
     $this->data = $this->_expandData($this->data);
     $tabindex =& $GLOBALS['tabindex'];
     // The city plugin is slightly different since we need to allow for multiple city names in different countries
     echo "\n            <table border='0' cellpadding='2'>\n                <tr>\n                    <th>" . $this->translate('Country') . "</th>\n                    <td>\n                        <select name='acl[{$this->executionorder}][data][]' {$disabled}>";
     foreach ($this->res as $countryCode => $countryName) {
         $selected = $this->data[0] == $countryCode ? 'selected="selected"' : '';
         echo "<option value='{$countryCode}' {$selected}>{$countryName}</option>";
     }
     echo "\n                        </select>\n                    &nbsp;<input type='image' name='action[none]' src='" . OX::assetPath() . "/images/{$GLOBALS['phpAds_TextDirection']}/go_blue.gif' border='0' align='absmiddle' alt='{$GLOBALS['strSave']}'></td>\n                </tr>";
     if (isset($this->data[0])) {
         // A country has been selected, show city list for this country...
         // Note: Since a disabled field does not pass it's value through, we need to pass the selected country in...
         echo "<tr><th>" . $this->translate('City(s)') . "</th><td>";
         echo "<input type='text' name='acl[{$this->executionorder}][data][]' value='" . htmlspecialchars($this->data[1], ENT_QUOTES) . "' tabindex='" . $tabindex++ . "' />";
         echo "</td></tr>";
     }
     echo "\n            </table>\n        ";
     $this->data = $this->_flattenData($this->data);
 }
コード例 #11
0
 /**
  * Display new password form
  *
  * @param string error message text
  */
 function displayRecoveryResetForm($id, $errormessage = '')
 {
     if (!empty($errormessage)) {
         echo "<div class='errormessage' style='width: 400px;'><img class='errormessage' src='" . OX::assetPath() . "/images/errormessage.gif' align='absmiddle'>";
         echo "<span class='tab-r'>{$errormessage}</span></div>";
     }
     echo "<form method='post' action='password-recovery.php'>\n";
     echo "<input type='hidden' name='id' value=\"" . htmlspecialchars($id) . "\" />";
     echo "<div class='install'>" . $GLOBALS['strPwdRecEnterPassword'] . "</div>";
     echo "<table cellpadding='0' cellspacing='0' border='0'>";
     echo "<tr><td colspan='2'><img src='" . OX::assetPath() . "/images/break-el.gif' width='400' height='1' vspace='8'></td></tr>";
     echo "<tr height='24'><td>" . $GLOBALS['strPassword'] . ":&nbsp;</td><td><input type='password' name='newpassword' /></td></tr>";
     echo "<tr height='24'><td>" . $GLOBALS['strRepeatPassword'] . ":&nbsp;</td><td><input type='password' name='newpassword2' /></td></tr>";
     echo "<tr height='24'><td>&nbsp;</td><td><input type='submit' value='" . $GLOBALS['strProceed'] . "' /></td></tr>";
     echo "<tr><td colspan='2'><img src='" . OX::assetPath() . "/images/break-el.gif' width='400' height='1' vspace='8'></td></tr>";
     echo "</table>";
     echo "</form>\n";
 }
コード例 #12
0
| but WITHOUT ANY WARRANTY; without even the implied warranty of            |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             |
| GNU General Public License for more details.                              |
|                                                                           |
| You should have received a copy of the GNU General Public License         |
| along with this program; if not, write to the Free Software               |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA |
+---------------------------------------------------------------------------+
$Id: banner-htmlpreview.php 37157 2009-05-28 12:31:10Z andrew.hill $
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-statistics.inc.php';
require_once MAX_PATH . '/lib/max/Delivery/adRender.php';
require_once MAX_PATH . '/lib/max/Admin_DA.php';
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
$aBanner = Admin_DA::getAd($bannerid);
$aBanner['bannerid'] = $aBanner['ad_id'];
if (!empty($aBanner)) {
    $conf = $GLOBALS['_MAX']['CONF'];
    $bannerName = strip_tags(phpAds_buildBannerName($bannerid, $aBanner['name'], $aBanner['alt']));
    $sizeDescription = $aBanner['type'] == 'txt' ? '&nbsp;' : "&nbsp;&nbsp;&nbsp;width: {$aBanner['width']}&nbsp;&nbsp;height: {$aBanner['height']}";
    $bannerCode = MAX_adRender($aBanner, 0, '', '', '', true, '', false, false);
    $protocol = $_SERVER['SERVER_PORT'] == $conf['openads']['sslPort'] ? "https" : "http";
    $deliveryUrl = $protocol . ':' . MAX_commonConstructPartialDeliveryUrl($conf['file']['flash']);
    echo "\n<html>\n<head>\n<title>{$bannerName}</title>\n<link rel='stylesheet' href='" . OX::assetPath() . "/css/interface-{$phpAds_TextDirection}.css'>\n<script type='text/javascript' src='{$deliveryUrl}'></script>\n</head>\n<body marginheight='0' marginwidth='0' leftmargin='0' topmargin='0' bgcolor='#EFEFEF'>\n<table cellpadding='0' cellspacing='0' border='0'>\n<tr height='32'>\n    <td width='32'><img src='" . OX::assetPath() . "/images/cropmark-tl.gif' width='32' height='32'></td>\n    <td background='" . OX::assetPath() . "/images/ruler-top.gif'>&nbsp;</td>\n    <td width='32'><img src='" . OX::assetPath() . "/images/cropmark-tr.gif' width='32' height='32'></td>\n</tr>\n<tr height='{$aBanner['height']}'>\n    <td width='32' background='" . OX::assetPath() . "/images/ruler-left.gif'>&nbsp;</td>\n    <td bgcolor='#FFFFFF' width='{$aBanner['width']}'>\n        {$bannerCode}\n    </td>\n    <td width='32'>&nbsp;</td>\n</tr>\n<tr height='32'>\n    <td width='32'><img src='" . OX::assetPath() . "/images/cropmark-bl.gif' width='32' height='32'></td>\n    <td>{$sizeDescription}</td>\n    <td width='32'><img src='" . OX::assetPath() . "/images/cropmark-br.gif' width='32' height='32'></td>\n</tr>\n</table>\n</body>\n</html>";
}
コード例 #13
0
    // Action
    $action = $strUserlog[$row['action']];
    $action = str_replace('{id}', $row['object'], $action);
    echo "<td height='20' colspan='2'><img src='" . OX::assetPath() . "/images/spacer.gif' height='16' width='16' align='absmiddle'>&nbsp;" . $action . "</td>";
    echo "</tr>";
    $i++;
}
if ($doUserLog->getRowCount() > 0) {
    echo "<tr height='1'><td colspan='4' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
    echo "<tr><td height='25' colspan='2'>";
    echo "<img src='" . OX::assetPath() . "/images/icon-recycle.gif' border='0' align='absmiddle'>&nbsp;<a href='userlog-delete.php?token=" . urlencode(phpAds_SessionGetToken()) . "'>" . $strDeleteLog . "</a>";
    echo "</td><td height='25' colspan='2' align='" . $phpAds_TextAlignRight . "'>";
    if ($start > 0) {
        echo "<a href='userlog-maintenance.php?start=" . ($start - 1) . "'>";
        echo "<img src='" . OX::assetPath() . "/images/arrow-l.gif' border='0' align='absmiddle'>" . $strPrevious . "</a>";
    }
    if ($count > ($start + 1) * $limit) {
        if ($start > 0) {
            echo "&nbsp;|&nbsp;";
        }
        echo "<a href='userlog-maintenance.php?start=" . ($start + 1) . "'>";
        echo $strNext . "<img src='" . OX::assetPath() . "/images/arrow-r.gif' border='0' align='absmiddle'></a>";
    }
    echo "</td></tr>";
}
echo "</table>";
echo "<br /><br />";
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageFooter();
コード例 #14
0
ファイル: adsense-create.php プロジェクト: villos/tree_admin
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/www/admin/config.php';
// Register input variables
// TODO: This variable has been added to demonstrate that clicking on
// links from error messages could bring the already entered e-mail address
// to the new form. Feel free to keep it or remove, depending on the
// implementation strategy.
phpAds_registerGlobalUnslashed('email');
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageHeader("4.1.3.4.7.2");
// TODO: The path here should probably start with the advertiser's data
// Not sure if we need to include the campaign and banner in the path though.
// We'll need to clarify this with the Product team.
echo "<img src='" . OX::assetPath() . "/images/icon-affiliate.gif' align='absmiddle'>&nbsp;<b>Create AdSense Account</b><br /><br /><br />";
phpAds_ShowSections(array("4.1.3.4.7.2"));
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
require_once MAX_PATH . '/lib/OA/Admin/Template.php';
$oTpl = new OA_Admin_Template('adsense-create.html');
$oTpl->assign('fields', array(array('title' => 'Email address for AdSense Account', 'fields' => array(array('name' => 'email', 'label' => 'Email', 'value' => '', 'id' => 'adsenseemail', 'title' => 'Provide valid email', 'clientValid' => 'required:true,email:true'))), array('title' => 'Name for the AdSense Account in Openads', 'fields' => array(array('name' => 'name', 'label' => 'Name for the AdSense Account in Openads', 'value' => '', 'id' => 'accountname', 'title' => 'Provide name in Openads', 'clientValid' => 'required:true')))));
//var_dump($oTpl);
//die();
$oTpl->display();
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageFooter();
コード例 #15
0
 /**
  * Generate the HTML option
  *
  * @return string    A string containing html for option
  */
 function layerstyle()
 {
     $option = '';
     $layerstyles = array();
     $layerStylesFolder = dirname(__FILE__) . '/layerstyles';
     $stylesdir = opendir($layerStylesFolder);
     while ($stylefile = readdir($stylesdir)) {
         if (is_dir($layerStylesFolder . '/' . $stylefile) && file_exists($layerStylesFolder . '/' . $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);
     $option .= "<tr><td width='30'>&nbsp;</td>";
     $option .= "<td width='200'>" . $this->translate("Style") . "</td><td width='370'>";
     $option .= "<select name='layerstyle' onChange='this.form.submit()' style='width:175px;' tabindex='" . $this->maxInvocation->tabindex++ . "'>";
     reset($layerstyles);
     while (list($k, $v) = each($layerstyles)) {
         $option .= "<option value='{$k}'" . ($this->maxInvocation->layerstyle == $k ? ' selected' : '') . ">{$v}</option>";
     }
     $option .= "</select>";
     $option .= "</td></tr>";
     $option .= "<tr><td width='30'><img src='" . OX::assetPath() . "/images/spacer.gif' height='1' width='100%'></td></tr>";
     return $option;
 }
コード例 #16
0
ファイル: TestAndCorrect.php プロジェクト: villos/tree_admin
 /**
  * A method to search for any aligned hours in the data_intermediate_ad and
  * data_summary_ad_hourly tables where the number of requests, impressions,
  * clicks or conversions do not agree with each other, and, where any such
  * hours are found, to search these hours for any cases of the
  * data_summary_ad_hourly table containing fewer requests, impressions,
  * clicks or conversions that the data_intermediate_ad table, and where
  * these cases are found, to update the data_summary_ad_hourly to match
  * the values found in the data_intermediate_ad table.
  *
  * @param Date $oStartDate The start date/time of the range to operate on.
  * @param Date $oEndDate   The end date/time of the farnce to operate on.
  */
 function issueTwo($oStartDate, $oEndDate)
 {
     $aConf = $GLOBALS['_MAX']['CONF'];
     $sQuery = "\n            SELECT\n                t1.hour_date_time AS date_time,\n                t1.requests AS intermediate_requests,\n                t2.requests AS summary_requests,\n                t1.impressions AS intermediate_impressions,\n                t2.impressions AS summary_impressions,\n                t1.clicks AS intermediate_clicks,\n                t2.clicks AS summary_clicks,\n                t1.conversions AS intermediate_conversions,\n                t2.conversions AS summary_conversions\n            FROM\n                (\n                    SELECT\n                        DATE_FORMAT(date_time, '%Y-%m-%d %H:00:00') AS hour_date_time,\n                        SUM(requests) AS requests,\n                        SUM(impressions) AS impressions,\n                        SUM(clicks) AS clicks,\n                        SUM(conversions) AS conversions\n                    FROM\n                        {$aConf['table']['prefix']}data_intermediate_ad\n                    WHERE\n                        date_time >= " . $this->oDbh->quote($oStartDate->format('%Y-%m-%d %H:%M:%S'), 'timestamp') . "\n                        AND\n                        date_time <= " . $this->oDbh->quote($oEndDate->format('%Y-%m-%d %H:%M:%S'), 'timestamp') . "\n                    GROUP BY\n                        hour_date_time\n                ) AS t1,\n                (\n                    SELECT\n                        DATE_FORMAT(date_time, '%Y-%m-%d %H:00:00') AS hour_date_time,\n                        SUM(requests) AS requests,\n                        SUM(impressions) AS impressions,\n                        SUM(clicks) AS clicks,\n                        SUM(conversions) AS conversions\n                    FROM\n                        {$aConf['table']['prefix']}data_summary_ad_hourly\n                    WHERE\n                        date_time >= " . $this->oDbh->quote($oStartDate->format('%Y-%m-%d %H:%M:%S'), 'timestamp') . "\n                        AND\n                        date_time <= " . $this->oDbh->quote($oEndDate->format('%Y-%m-%d %H:%M:%S'), 'timestamp') . "\n                    GROUP BY\n                        hour_date_time\n                ) AS t2\n            WHERE\n                t1.hour_date_time = t2.hour_date_time\n            HAVING\n                intermediate_requests > summary_requests\n                OR\n                intermediate_impressions > summary_impressions\n                OR\n                intermediate_clicks > summary_clicks\n                OR\n                intermediate_conversions > summary_conversions\n            ORDER BY\n                date_time";
     OX::disableErrorHandling();
     $rsResult = $this->oDbh->query($sQuery);
     OX::enableErrorHandling();
     if (PEAR::isError($rsResult)) {
         $message = "\n    Database error while searching for invalid data:\n    " . $rsResult->getMessage() . "\n    Cannot detect issues, so will not attepmt any corrections.\n";
         echo $message;
         return;
     }
     $rows = $rsResult->numRows();
     if ($rows == 0) {
         $message = "\n    Did not detect any issues; no statistics data correction required.\n";
         echo $message;
         return;
     }
     $message = "\n    Detected {$rows} operation intervals that need further inspection...\n";
     echo $message;
     while ($aRow = $rsResult->fetchRow()) {
         $message = "        Inspecting operation interval {$aRow['date_time']}...\n";
         echo $message;
         $message = "            Correcting...\n";
         echo $message;
         $oDate = new Date($aRow['date_time']);
         $sInnerQuery = "\n                SELECT\n                    t1.hour_date_time AS date_time,\n                    t1.ad_id AS ad_id,\n                    t1.zone_id AS zone_id,\n                    t1.requests AS intermediate_requests,\n                    t2.requests AS summary_requests,\n                    t1.impressions AS intermediate_impressions,\n                    t2.impressions AS summary_impressions,\n                    t1.clicks AS intermediate_clicks,\n                    t2.clicks AS summary_clicks,\n                    t1.conversions AS intermediate_conversions,\n                    t2.conversions AS summary_conversions\n                FROM\n                    (\n                        SELECT\n                            DATE_FORMAT(date_time, '%Y-%m-%d %H:00:00') AS hour_date_time,\n                            ad_id AS ad_id,\n                            zone_id AS zone_id,\n                            SUM(requests) AS requests,\n                            SUM(impressions) AS impressions,\n                            SUM(clicks) AS clicks,\n                            SUM(conversions) AS conversions\n                        FROM\n                            {$aConf['table']['prefix']}data_intermediate_ad\n                        WHERE\n                            date_time >= " . $this->oDbh->quote($oDate->format('%Y-%m-%d %H:00:00'), 'timestamp') . "\n                            AND\n                            date_time <= " . $this->oDbh->quote($oDate->format('%Y-%m-%d %H:59:59'), 'timestamp') . "\n                        GROUP BY\n                            hour_date_time, ad_id, zone_id\n                    ) AS t1,\n                    (\n                        SELECT\n                            DATE_FORMAT(date_time, '%Y-%m-%d %H:00:00') AS hour_date_time,\n                            ad_id AS ad_id,\n                            zone_id AS zone_id,\n                            SUM(requests) AS requests,\n                            SUM(impressions) AS impressions,\n                            SUM(clicks) AS clicks,\n                            SUM(conversions) AS conversions\n                        FROM\n                            {$aConf['table']['prefix']}data_summary_ad_hourly\n                        WHERE\n                            date_time >= " . $this->oDbh->quote($oDate->format('%Y-%m-%d %H:00:00'), 'timestamp') . "\n                            AND\n                            date_time <= " . $this->oDbh->quote($oEndDate->format('%Y-%m-%d %H:59:59'), 'timestamp') . "\n                        GROUP BY\n                            hour_date_time, ad_id, zone_id\n                    ) AS t2\n                WHERE\n                    t1.hour_date_time = t2.hour_date_time\n                    AND\n                    t1.ad_id = t2.ad_id\n                    AND\n                    t1.zone_id = t2.zone_id\n                HAVING\n                    intermediate_requests > summary_requests\n                    OR\n                    intermediate_impressions > summary_impressions\n                    OR\n                    intermediate_clicks > summary_clicks\n                    OR\n                    intermediate_conversions > summary_conversions\n                ORDER BY\n                    date_time, ad_id, zone_id";
         OX::disableErrorHandling();
         $rsInnerResult = $this->oDbh->query($sInnerQuery);
         OX::enableErrorHandling();
         if (PEAR::isError($rsInnerResult)) {
             $message = "                Error while selecting unsummarised rows, please re-run script later!\n";
             echo $message;
             continue;
         }
         while ($aInnerRow = $rsInnerResult->fetchRow()) {
             $message = "                Correcting data for '{$aRow['date_time']}', Creative ID '{$aInnerRow['ad_id']}', Zone ID '{$aInnerRow['zone_id']}'...\n";
             echo $message;
             $sUpdateQuery = "\n                    UPDATE\n                        {$aConf['table']['prefix']}data_summary_ad_hourly\n                    SET\n                        requests = " . $this->oDbh->quote($aInnerRow['intermediate_requests'], 'integer') . ",\n                        impressions = " . $this->oDbh->quote($aInnerRow['intermediate_impressions'], 'integer') . ",\n                        clicks = " . $this->oDbh->quote($aInnerRow['intermediate_clicks'], 'integer') . ",\n                        conversions = " . $this->oDbh->quote($aInnerRow['intermediate_conversions'], 'integer') . "\n                    WHERE\n                        date_time = " . $this->oDbh->quote($aInnerRow['date_time'], 'timestamp') . "\n                        AND\n                        ad_id = " . $this->oDbh->quote($aInnerRow['ad_id'], 'integer') . "\n                        AND\n                        zone_id = " . $this->oDbh->quote($aInnerRow['zone_id'], 'integer') . "\n                        AND\n                        requests = " . $this->oDbh->quote($aInnerRow['summary_requests'], 'integer') . "\n                        AND\n                        impressions = " . $this->oDbh->quote($aInnerRow['summary_impressions'], 'integer') . "\n                        AND\n                        clicks = " . $this->oDbh->quote($aInnerRow['summary_clicks'], 'integer') . "\n                        AND\n                        conversions = " . $this->oDbh->quote($aInnerRow['summary_conversions'], 'integer') . "\n                    LIMIT 1";
             if (defined('DEBUG_ONLY')) {
                 $message = "                Running in debug mode only, if running correctly, the following would have been performed:\n";
                 echo $message;
                 $message = $sUpdateQuery;
                 $message = preg_replace('/\\n/', '', $message);
                 $message = preg_replace('/^ +/', '', $message);
                 $message = preg_replace('/ +/', ' ', $message);
                 $message = wordwrap($message, 75, "\n                    ");
                 $message = "                    " . $message . ";\n";
                 echo $message;
             } else {
                 OX::disableErrorHandling();
                 $rsUpdateResult = $this->oDbh->exec($sUpdateQuery);
                 OX::enableErrorHandling();
                 if (PEAR::isError($rsUpdateResult)) {
                     $message = "                Error while updating an incomplete row, please re-run script later!\n";
                     echo $message;
                     continue;
                 }
                 if ($rsUpdateResult > 1) {
                     $message = "                Error: More than one incomplete row updated, please manually inspect data!\n                       once the script has completed running!\n";
                     echo $message;
                     continue;
                 }
                 $message = "                Updated {$rsUpdateResult} incomplete row.\n";
                 echo $message;
             }
             if (defined('DEBUG_ONLY')) {
                 sleep(1);
             }
         }
     }
 }
コード例 #17
0
        echo "<td><br />" . $maint_update[1]['description'] . "<br /><br />";
        echo "</td>";
        echo "<td width='32'>&nbsp;</td>";
        echo "</tr>";
        if ($maint_update[1]['url_zip'] != '' || $maint_update[1]['url_tgz'] != '') {
            echo "<tr height='1'><td colspan='2' bgcolor='#F6F6F6'><img src='" . OX::assetPath() . "/images/spacer.gif' height='1' width='100%'>";
            echo "<td colspan='2' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break-el.gif' height='1' width='100%'></td></tr>";
            echo "<tr height='25' bgcolor='#F6F6F6'><td height='25' colspan='2'>&nbsp;&nbsp;</td><td>";
            if ($maint_update[1]['url_zip'] != '') {
                echo "<img src='" . OX::assetPath() . "/images/icon-filetype-zip.gif' align='absmiddle'>&nbsp;";
                echo "<a href='" . $maint_update[1]['url_zip'] . "'>" . $strDownloadZip . "</a>";
                if ($maint_update[1]['url_tgz'] != '') {
                    echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
                }
            }
            if ($maint_update[1]['url_tgz'] != '') {
                echo "<img src='" . OX::assetPath() . "/images/icon-filetype-zip.gif' align='absmiddle'>&nbsp;";
                echo "<a href='" . $maint_update[1]['url_tgz'] . "'>" . $strDownloadGZip . "</a>";
            }
            echo "</td><td>&nbsp;</td></tr>";
        }
        echo "<tr height='1'><td colspan='4' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
        echo "</table>";
    } else {
        phpAds_Die($strErrorOccurred, $strUpdateServerDown);
    }
}
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageFooter();
コード例 #18
0
ファイル: common.php プロジェクト: ballistiq/revive-adserver
 static function getWarningMessage($message)
 {
     return "<div class='errormessage' style='width:750px;'><img class='errormessage' src='" . OX::assetPath() . "/images/info.gif' align='absmiddle'>\n              <span class='tab-r' style='font-weight:normal;'>&nbsp;" . $message . "</span>\n              </div>";
 }
コード例 #19
0
 /**
  * A Flexy helper method to return the appropriate image to display
  * the current sorting order, if appropriate.
  *
  * @param string $fieldname The name of the field.
  * @return string|false The image URI if the field is sorted, false otherwise.
  */
 function listOrderImage($fieldname)
 {
     if ($this->listOrderField == $fieldname) {
         return OX::assetPath("images/caret-" . ($this->listOrderDirection == 'up' ? 'u' : 'ds') . ".gif");
     } else {
         return false;
     }
 }
コード例 #20
0
 /**
  * Add "blanks" stats to an entity array
  *
  * @param array Query parameters
  * @param array Entities array
  */
 function addBlanks($aParams, &$aEntitiesData)
 {
     $aParams['exclude'] = array('zone_id');
     $aParams['ad_id'] = 0;
     // Get plugin aParams
     $pluginParams = array();
     foreach ($this->aPlugins as $oPlugin) {
         $oPlugin->addQueryParams($pluginParams);
     }
     $aBlanks = Admin_DA::fromCache('getEntitiesStats', $aParams + $this->aDates, 1);
     // Merge plugin additional data
     foreach ($this->aPlugins as $oPlugin) {
         $oPlugin->mergeData($aBlanks, 'getEntitiesStats', $aParams + $this->aDates, $this->aEmptyRow);
     }
     if (count($aBlanks)) {
         $zone = current($aBlanks) + $this->aEmptyRow;
         $zone['active'] = $this->_hasActiveStats($zone);
         if ($zone['active']) {
             $this->_summarizeStats($zone);
             $zone['name'] = 'Blank impressions';
             $zone['prefix'] = 'x';
             $zone['id'] = '-';
             $zone['icon'] = OX::assetPath() . '/images/icon-banner-disabled.png';
             $zone['htmlclass'] = 'last';
             if ($this->listOrderField != 'name' && $this->listOrderField != 'id') {
                 $aEntitiesData[] = $zone;
                 MAX_sortArray($aEntitiesData, $this->listOrderField, $this->listOrderDirection == 'up');
             } elseif ($this->listOrderDirection == 'up') {
                 array_push($aEntitiesData, $zone);
             } else {
                 array_unshift($aEntitiesData, $zone);
             }
         }
     }
 }
コード例 #21
0
// total number of agencies
$agencyCount = count($aManagers);
echo "\t\t\t\t<br /><br /><br /><br />\n";
echo "\t\t\t\t<table width='100%' border='0' align='center' cellspacing='0' cellpadding='0'>\n";
echo "\t\t\t\t<tr>\n";
echo "\t\t\t\t\t<td height='25' colspan='3'>&nbsp;&nbsp;<b>" . $strOverall . "</b></td>\n";
echo "\t\t\t\t</tr>\n";
echo "\t\t\t\t<tr height='1'>\n";
echo "\t\t\t\t\t<td colspan='4' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td>\n";
echo "\t\t\t\t</tr>\n";
echo "\t\t\t\t<tr>\n";
echo "\t\t\t\t\t<td height='25'>&nbsp;&nbsp;" . $strTotalAgencies . ": <b>" . $agencyCount . "</b></td>\n";
echo "\t\t\t\t\t<td height='25' colspan='2'></td>\n";
echo "\t\t\t\t</tr>\n";
echo "\t\t\t\t<tr height='1'>\n";
echo "\t\t\t\t\t<td colspan='3' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td>\n";
echo "\t\t\t\t</tr>\n";
echo "\t\t\t\t</table>\n";
echo "\t\t\t\t<br /><br />\n";
/*-------------------------------------------------------*/
/* Store preferences                                     */
/*-------------------------------------------------------*/
$session['prefs']['agency-index.php']['hideinactive'] = $hideinactive;
$session['prefs']['agency-index.php']['listorder'] = $listorder;
$session['prefs']['agency-index.php']['orderdirection'] = $orderdirection;
$session['prefs']['agency-index.php']['nodes'] = implode(",", $node_array);
phpAds_SessionDataStore();
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageFooter();
コード例 #22
0
 /**
  * Outputs the HTML to display the data for this limitation
  *
  * @return void
  */
 function displayArrayData()
 {
     $conf = $GLOBALS['_MAX']['CONF'];
     $this->bannerid = isset($GLOBALS['bannerid']) ? $GLOBALS['bannerid'] : 0;
     $tabindex =& $GLOBALS['tabindex'];
     $aChannels = array();
     // Get all of the agency channels that could be used for this banner
     //  select the agency ID that owns this banner (it may be the admin ID, 0)
     $doChannel = OA_Dal::factoryDO('channel');
     $doAgency = OA_Dal::factoryDO('agency');
     $doClients = OA_Dal::factoryDO('clients');
     $doCampaigns = OA_Dal::factoryDO('campaigns');
     $doBanners = OA_Dal::factoryDO('banners');
     $doBanners->bannerid = $this->bannerid;
     $doCampaigns->joinAdd($doBanners);
     $doClients->joinAdd($doCampaigns);
     $doAgency->joinAdd($doClients);
     $doChannel->joinAdd($doAgency);
     $doChannel->affiliateid = 0;
     $doChannel->selectAdd("{$doChannel->tableName()}.name as channelname");
     $doChannel->find();
     while ($doChannel->fetch()) {
         $aChannel = $doChannel->toArray();
         $channelId = $aChannel['channelid'];
         $aChannels[$channelId] = $aChannel;
     }
     // Get all of the publisher channels that could be used for this banner
     //  only publishers (affiliates) which are linked to the banner
     $doChannel = OA_Dal::factoryDO('channel');
     $doAffiliates = OA_Dal::factoryDO('affiliates');
     $doZones = OA_Dal::factoryDO('zones');
     $doAdZoneAssoc = OA_Dal::factoryDO('ad_zone_assoc');
     $doAdZoneAssoc->ad_id = $this->bannerid;
     $doZones->joinAdd($doAdZoneAssoc);
     $doAffiliates->joinAdd($doZones);
     $doChannel->joinAdd($doAffiliates);
     $doChannel->selectAdd("{$doChannel->tableName()}.name as channelname");
     $doChannel->find();
     while ($doChannel->fetch()) {
         $aChannel = $doChannel->toArray();
         $channelId = $aChannel['channelid'];
         $aChannels[$channelId] = $aChannel;
     }
     $aSelectedChannels = array();
     // Sort the list, and move selected items to the top of the list
     usort($aChannels, '_sortByChannelName');
     foreach ($aChannels as $index => $aChannel) {
         if (in_array($aChannel['channelid'], $this->data)) {
             $aSelectedChannels[$index] = $aChannel;
             unset($aChannels[$index]);
         }
     }
     $aChannels = $aSelectedChannels + $aChannels;
     echo "<div class='box'>";
     foreach ($aChannels as $aChannel) {
         if (empty($aChannel['affiliateid'])) {
             $editUrl = "channel-acl.php?agencyid={$this->agencyid}&channelid={$aChannel['channelid']}";
         } else {
             $editUrl = "channel-acl.php?affiliateid={$aChannel['affiliateid']}&channelid={$aChannel['channelid']}";
         }
         echo "\n                <div class='boxrow'>\n                    <input\n                        tabindex='" . $tabindex++ . "'\n                        type='checkbox'\n                        id='c_{$this->executionorder}_{$aChannel['channelid']}'\n                        name='acl[{$this->executionorder}][data][]'\n                        value='{$aChannel['channelid']}'" . (in_array($aChannel['channelid'], $this->data) ? ' checked="checked"' : '') . "\n                    />\n                    " . htmlspecialchars($aChannel['channelname']) . "\n                    <a href='{$editUrl}' target='_blank'><img src='" . OX::assetPath() . "/images/{$GLOBALS['phpAds_TextDirection']}/go_blue.gif' border='0' align='absmiddle' alt='{$GLOBALS['strView']}'></a>\n                </div>";
     }
     echo "</div>";
 }
コード例 #23
0
// Standard messages
$haltMessage = "\nThe {$scriptName} script will NOT be run.\n\n";
if ($argc !== 2) {
    echo "\nRequires the hostname to be passed in as a string, as per the standard maintenance CLI script.\n";
    echo $haltMessage;
    exit;
}
if (!defined('INTERVAL_START') || !defined('INTERVAL_END')) {
    echo "\nPlease ensure that you have read the comments in the {$scriptName} script.\n\nYou will also find out how to make this script work by reading the comments. :-)\n";
    echo $haltMessage;
    exit;
}
// Initialise the script
OX::disableErrorHandling();
$result = OX_OperationInterval::checkOperationIntervalValue(OX_OperationInterval::getOperationInterval());
OX::enableErrorHandling();
if (PEAR::isError($result)) {
    $message = "\nThe operation interval in your OpenX configuration file is not valid. Please see the OpenX\ndocumentation for more details on valid operation interval values.\n";
    echo $message;
    echo $haltMessage;
    exit;
}
$oStartDate = new Date(INTERVAL_START);
$result = OX_OperationInterval::checkDateIsStartDate($oStartDate);
if (!$result) {
    $message = "\nThe start date defined in the {$scriptName} script is not a valid operation interval start date.\nPlease edit the statisticsTestAndCorrect.php script before running.\n";
    echo $message;
    echo $haltMessage;
    exit;
}
$oEndDate = new Date(INTERVAL_END);
コード例 #24
0
function phpAds_showBanners()
{
    $conf = $GLOBALS['_MAX']['CONF'];
    global $strUntitled, $strName, $strID, $strWeight;
    global $strProbability, $strPriority, $strRecalculatePriority;
    global $phpAds_TextDirection;
    $doAdZoneAssoc = OA_Dal::factoryDO('ad_zone_assoc');
    $doAdZoneAssoc->selectAdd();
    $doAdZoneAssoc->selectAs(array('ad_id'), 'bannerid');
    $doAdZoneAssoc->selectAdd('priority');
    $doAdZoneAssoc->zoneid = 0;
    $doAdZoneAssoc->OrderBy('priority DESC');
    $doAdZoneAssoc->find();
    $rows = array();
    $prioritysum = 0;
    while ($doAdZoneAssoc->fetch() && ($tmprow = $doAdZoneAssoc->toArray())) {
        if ($tmprow['priority']) {
            $prioritysum += $tmprow['priority'];
            $rows[$tmprow['bannerid']] = $tmprow;
        }
    }
    if (is_array($rows)) {
        $i = 0;
        // Header
        echo "<table width='100%' border='0' align='center' cellspacing='0' cellpadding='0'>";
        echo "<tr height='25'>";
        echo "<td height='25'><b>&nbsp;&nbsp;" . $strName . "</b></td>";
        echo "<td height='25'><b>" . $strID . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></td>";
        echo "<td height='25'><b>" . $strPriority . "</b></td>";
        echo "<td height='25'><b>" . $strProbability . "</b></td>";
        echo "</tr>";
        echo "<tr height='1'><td colspan='5' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
        // Banners
        foreach (array_keys($rows) as $key) {
            $name = phpAds_getBannerName($rows[$key]['bannerid'], 60, false);
            if ($i > 0) {
                echo "<tr height='1'><td colspan='5' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break-l.gif' height='1' width='100%'></td></tr>";
            }
            echo "<tr height='25' " . ($i % 2 == 0 ? "bgcolor='#F6F6F6'" : "") . ">";
            echo "<td height='25'>";
            echo "&nbsp;&nbsp;";
            // Banner icon
            if ($rows[$key]['storagetype'] == 'html') {
                echo "<img src='" . OX::assetPath() . "/images/icon-banner-html.gif' align='absmiddle'>&nbsp;";
            } elseif ($rows[$key]['storagetype'] == 'url') {
                echo "<img src='" . OX::assetPath() . "/images/icon-banner-url.gif' align='absmiddle'>&nbsp;";
            } else {
                echo "<img src='" . OX::assetPath() . "/images/icon-banner-stored.gif' align='absmiddle'>&nbsp;";
            }
            // Name
            echo $name;
            echo "</td>";
            echo "<td height='25'>" . $rows[$key]['bannerid'] . "</td>";
            echo "<td height='25'>" . $rows[$key]['priority'] . "</td>";
            echo "<td height='25'>" . number_format($rows[$key]['priority'] / $prioritysum * 100, $pref['ui_percentage_decimals']) . "%</td>";
            echo "</tr>";
            $i++;
        }
        // Footer
        echo "<tr height='1'><td colspan='5' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
        echo "</table>";
    }
}
コード例 #25
0
        echo "</form>";
        echo "</table>";
    } else {
        echo "<tr><td height='25' colspan='4' bgcolor='#F6F6F6'>&nbsp;&nbsp;" . $strNoVarsToTrack . "</td></tr>\n";
        echo "<tr><td colspan='4'><img src='" . OX::assetPath() . "/images/break-el.gif' width='100%' height='1'></td></tr>\n";
        echo "<tr>";
        echo "<td colspan='4'><img src='" . OX::assetPath() . "/images/spacer.gif' width='1' height='10' /></td>";
        echo "</tr>";
        echo "<tr>";
        echo "<td colspan='4' align='right'>";
        echo "<img src='" . OX::assetPath() . "/images/icon-acl-add.gif' align='absmiddle'>&nbsp;&nbsp;" . $strAddVariable . "&nbsp;&nbsp;";
        echo "<input type='image' name='action[new]' src='" . OX::assetPath() . "/images/" . $phpAds_TextDirection . "/go_blue.gif' border='0' align='absmiddle' alt='{$strSave}'>";
        echo "</td>";
        echo "</tr>";
        echo "<tr>";
        echo "<td colspan='4'><img src='" . OX::assetPath() . "/images/spacer.gif' width='1' height='10' /></td>\n";
        echo "</tr>";
        echo "<tr>";
        echo "<td colspan='4'>";
        echo "<input type='submit' name='action[save]' value='Save Changes' tabindex='15'>\n";
        echo "</td>";
        echo "</tr>";
        echo "</form>";
        echo "</table>";
    }
}
/*-------------------------------------------------------*/
/* Store preferences                                     */
/*-------------------------------------------------------*/
$session['prefs']['tracker-variables.php']['variables'] = $variables;
$session['prefs']['tracker-variables.php']['trackerid'] = $trackerid;
コード例 #26
0
 function _function_oa_title_sort($aParams, &$smarty)
 {
     if (!empty($aParams['str'])) {
         if (!empty($aParams['item'])) {
             $str = $this->_function_t($aParams, $smarty);
             $item = $aParams['item'];
             $order = !empty($aParams['order']) ? $aParams['order'] : 'down';
             $url = !empty($aParams['url']) ? $aParams['url'] : '#';
             $url .= strpos($url, '?') !== false ? '&' : '?';
             $buffer = '<a href="' . htmlspecialchars($url . 'listorder=' . $item) . '">' . $str . '</a>';
             $listorder = $smarty->get_template_vars('listorder');
             $orderdirection = $smarty->get_template_vars('orderdirection');
             if (empty($listorder) && !empty($aParams['default']) && $aParams['default']) {
                 $listorder = $item;
             }
             if (empty($orderdirection)) {
                 $orderdirection = $order;
             }
             if ($listorder == $item) {
                 $order = $orderdirection == 'down' ? 'up' : 'down';
                 $caret = $orderdirection == 'down' ? 'ds' : 'u';
                 $buffer .= ' <a href="' . htmlspecialchars($url . 'orderdirection=' . $order) . '">';
                 $buffer .= '<img src="' . OX::assetPath() . '/images/caret-' . $caret . '.gif" border="0" alt="" title="">';
                 $buffer .= '</a>';
             }
             return $buffer;
         } else {
             $smarty->trigger_error("t: missing 'item' parameter");
         }
     } else {
         $smarty->trigger_error("t: missing 'str'parameter");
     }
 }
コード例 #27
0
ファイル: Dal.php プロジェクト: Jaree/revive-adserver
 /**
  * Performs a batch insert using plain INSERTs
  *
  * @see OA_Dal::batchInsert()
  *
  * @param string $tableName The unquoted table name
  * @param array  $aFields   The array of unquoted field names
  * @param array  $aValues   The array of data to be inserted
  * @param bool $replace Should the primary key be replaced when already present?
  * @return int   The number of rows inserted or PEAR_Error on failure
  */
 private function _batchInsertPgSQL($qTableName, $fieldList, $aValues, $replace, $primaryKey)
 {
     $oDbh = OA_DB::singleton();
     $delim = "\t";
     $eol = "\n";
     $null = '\\N';
     // Disable error handler
     OX::disableErrorHandling();
     // we start by manually deleting conflicting unique rows
     foreach ($aValues as $aRow) {
         // because Postgresql doesn't have the REPLACE keyword,
         // we manually delete the rows with the primary key first
         if ($replace) {
             $where = '';
             foreach ($primaryKey as $fieldName) {
                 $where .= $fieldName . ' = \'' . $aRow[$fieldName] . '\'  AND ';
             }
             $where = substr($where, 0, strlen($where) - 5);
             $oDbh->query('DELETE FROM ' . $qTableName . ' WHERE ' . $where);
         }
     }
     $pg = $oDbh->getConnection();
     $result = $oDbh->exec("\n            COPY\n                {$qTableName} {$fieldList}\n            FROM\n                STDIN\n        ");
     if (PEAR::isError($result)) {
         return MAX::raiseError('Error issuing the COPY query for the batch INSERTs.', PEAR_ERROR_RETURN);
     }
     foreach ($aValues as $aRow) {
         // Stringify row
         $row = '';
         foreach ($aRow as $value) {
             if (!isset($value) || $value === false) {
                 $row .= $null . $delim;
             } else {
                 $row .= $value . $delim;
             }
         }
         // Replace delim with eol
         $row[strlen($row) - 1] = $eol;
         // Send line
         $ret = pg_put_line($pg, $row);
         if (!$ret) {
             return MAX::raiseError('Error COPY-ing data: ' . pg_errormessage($pg), PEAR_ERROR_RETURN);
         }
     }
     $result = pg_put_line($pg, '\\.' . $eol) && pg_end_copy($pg);
     $result = $result ? count($aValues) : new PEAR_Error('Error at the end of the COPY: ' . pg_errormessage($pg));
     // Enable error handler again
     OX::enableErrorHandling();
     return $result;
 }
コード例 #28
0
|                                                                           |
| You should have received a copy of the GNU General Public License         |
| along with this program; if not, write to the Free Software               |
| Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA |
+---------------------------------------------------------------------------+
$Id: maintenance-appendcodes.php 37157 2009-05-28 12:31:10Z andrew.hill $
*/
// Require the initialisation file
require_once '../../init.php';
// Required files
require_once MAX_PATH . '/www/admin/config.php';
require_once MAX_PATH . '/www/admin/lib-maintenance.inc.php';
// Security check
OA_Permission::enforceAccount(OA_ACCOUNT_ADMIN);
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageHeader("maintenance-index");
phpAds_MaintenanceSelection("appendcodes");
/*-------------------------------------------------------*/
/* Main code                                             */
/*-------------------------------------------------------*/
echo "<br />";
echo "<img src='" . OX::assetPath() . "/images/" . $phpAds_TextDirection . "/icon-undo.gif' border='0' align='absmiddle'>" . $strAppendCodesDesc . "<br /><br />";
echo "&nbsp;<a href='maintenance-appendcode-check.php'>" . $strCheckAppendCodes . "</a>&nbsp;&nbsp;";
echo "<br /><br />";
phpAds_ShowBreak();
/*-------------------------------------------------------*/
/* HTML framework                                        */
/*-------------------------------------------------------*/
phpAds_PageFooter();
コード例 #29
0
ファイル: CodeMunger.php プロジェクト: Jaree/revive-adserver
 /**
  * Parse the file uses the PHP tokeniser to analyse a php script and pull included/required files inline
  *
  * @param string $filename The full/path/to the file to be processed
  * @return string The compiled script contents
  */
 public function parseFile($filename)
 {
     // Don't try and process the file if the tokenizer isn't available
     if (!function_exists('token_get_all')) {
         return false;
     }
     // Track included files to allow require_once/include_once to work correctly
     $thisFile = OX::realPathRelative(getcwd() . '/' . $filename);
     $this->onlyOnce[$thisFile] = true;
     // Read the file
     $source = file_get_contents($filename);
     // Tokenize the source
     $tokens = token_get_all($source);
     // Start in standard state
     $state = STATE_STD;
     // Track if we are in a STRIP_DELIVERY codeblock
     $strip_delivery = false;
     // Track if we just output a newline
     $was_nl = false;
     // The compiled script goes in here, return value
     $ret = '';
     // If we meet a require/require_once, we store the filename here for recursion
     // (the filename may be build by concatination ...)
     $cur = '';
     // Hold the original content we left off from start of a require/require_once, so
     // if we are currently waiting for the filename to be completed, and realize a
     // dynamic filename (i.e. T_VARIABLE), we can give up on this filename, and
     // output the original, unchanged source
     $orig = '';
     // Iterate over the file tokens (note: grey magic ;)
     foreach ($tokens as $token) {
         if (is_string($token)) {
             // next token is a none special, simple character
             // we can clear newline-flag ...
             $was_nl = false;
             // if we currently strip off none delivery code, ignore
             // this token, start with next
             if ($strip_delivery) {
                 continue;
             }
             // in normal state, just add to our return buffer
             if ($state === STATE_STD) {
                 $ret .= $token;
             } else {
                 // we waiting to complete a require/require_once, so
                 // this is just happen !!!
                 if ($token === ';') {
                     switch ($state) {
                         case STATE_REQUIRE_ONCE:
                             // if we have done this file, don't slurp it again
                             $thisfile = OX::realPathRelative($cur);
                             if (array_key_exists($thisfile, $this->onlyOnce)) {
                                 break;
                             }
                             //fall through
                         //fall through
                         case STATE_REQUIRE:
                             // try to load the file, if ...
                             if (!($content = $this->flattenFile($cur))) {
                                 // we are unable to slurp it, just add the original
                                 // require-statement into our buffer
                                 $ret .= $orig . ";\n";
                             } else {
                                 $ret .= $content;
                             }
                             break;
                     }
                     // require/require_once statement finished, return to normal
                     $state = STATE_STD;
                 } else {
                     // we are currently collecting a require/require_once filename,
                     // so keep the original content
                     $orig .= $token;
                     // and capture the filename if not the concat op.
                     if (strpos('.()', $token) === false) {
                         $cur .= $token;
                     }
                 }
             }
         } else {
             // token array
             list($id, $text) = $token;
             // if we currently strip off none delivery code, we could leave
             // this mode only in a comment ...
             if ($strip_delivery && !$this->isComment($id)) {
                 continue;
             }
             // is last was a newline and we don't like whitespace ...
             if ($was_nl && !$this->echoWhite) {
                 // ... but this is one, cont. on next token
                 if ($id === T_WHITESPACE) {
                     continue;
                 } else {
                     if (!$this->echoComment && $this->isComment($id)) {
                     } else {
                         $was_nl = false;
                     }
                 }
             }
             if ($this->dumpToken) {
                 $ret .= "[{$id}:" . token_name($id) . ":" . $text . "]";
             }
             switch ($id) {
                 case T_COMMENT:
                 case T_ML_COMMENT:
                     // we've defined this
                 // we've defined this
                 case T_DOC_COMMENT:
                     // and this
                     // comments are only added on request
                     // check if we reach or leave a none-delivery-code secition
                     // and set flag ...
                     if ($this->echoComment) {
                         if ($state === STATE_STD) {
                             $ret .= $text;
                         }
                     }
                     if ($strip_delivery) {
                         if (strstr($text, '###END_STRIP_DELIVERY') !== false) {
                             $strip_delivery = false;
                         }
                     } else {
                         if (strstr($text, '###START_STRIP_DELIVERY') !== false) {
                             $strip_delivery = true;
                         }
                     }
                     break;
                 case T_OPEN_TAG:
                     // keep track of begin/end php-code sections, to avoid
                     // have more than one begin or end in our result code
                     if ($this->insidePhp == 0) {
                         $ret .= $text;
                     }
                     $this->insidePhp++;
                     break;
                 case T_CLOSE_TAG:
                     $this->insidePhp--;
                     if ($this->insidePhp == 0) {
                         $ret .= $text;
                     }
                     break;
                 case T_REQUIRE:
                     // require found
                     $state = STATE_REQUIRE;
                     // clear out filename buffer
                     $cur = '';
                     // start collecting the original content
                     $orig = $text;
                     break;
                 case T_REQUIRE_ONCE:
                     // require_once found, see above
                     $state = STATE_REQUIRE_ONCE;
                     $cur = '';
                     $orig = $text;
                     break;
                 case T_CONSTANT_ENCAPSED_STRING:
                     // just a string with quotes
                     if ($state === STATE_STD) {
                         $ret .= $text;
                     } else {
                         // strip off the quotes and add to filename
                         $cur .= substr($text, 1, strlen($text) - 2);
                         $orig .= $text;
                     }
                     break;
                 case T_VARIABLE:
                     if ($state === STATE_STD) {
                         $ret .= $text;
                     } else {
                         // sorry boy, dynamic filename found
                         // append the original code to the output
                         // and return to normal state
                         $ret .= $orig . $text;
                         $state = STATE_STD;
                     }
                     break;
                 case T_STRING:
                     if ($state === STATE_STD) {
                         $ret .= $text;
                     } else {
                         // a require/require_once path may contain our
                         // special MAX_PATH, so add the real value instead
                         if ($text === 'MAX_PATH') {
                             $cur .= MAX_PATH;
                         }
                         if ($text === 'OX_PATH') {
                             $cur .= OX_PATH;
                         }
                         $orig .= $text;
                     }
                     break;
                 case T_WHITESPACE:
                     // one or more spaces, newlines, ...
                     if ($state === STATE_STD) {
                         if ($this->echoWhite) {
                             $ret .= $text;
                         } else {
                             if (strstr($text, "\n") !== false) {
                                 // a newline found, set our flag to avoid
                                 // multiple empty lines
                                 $was_nl = true;
                                 $ret .= "\n";
                             } else {
                                 // reduce incoming spaces to a single one
                                 $ret .= ' ';
                             }
                         }
                     } else {
                         $orig .= $text;
                     }
                     break;
                 default:
                     if ($state === STATE_STD) {
                         $ret .= $text;
                     } else {
                         $cur .= $text;
                         $orig .= $text;
                     }
                     break;
             }
         }
     }
     return $ret;
 }
コード例 #30
0
function _getChainZonesImage($aZone)
{
    switch ($aZone['delivery']) {
        case phpAds_ZoneBanner:
            $imageName = '/images/icon-zone.gif';
            break;
        case phpAds_ZoneInterstitial:
            $imageName = '/images/icon-interstitial.gif';
            break;
        case phpAds_ZonePopup:
            $imageName = '/images/icon-popup.gif';
            break;
        case phpAds_ZoneText:
            $imageName = '/images/icon-textzone.gif';
            break;
        default:
            $imageName = '';
    }
    if ($imageName) {
        $image = "<img src='" . OX::assetPath() . "{$imageName}' align='absmiddle'>";
    }
    return $image;
}