/**
  * The constructor method.
  */
 function Test_OA_Dal_DeliveryDB_Image()
 {
     $this->UnitTestCase();
     // Make sure we don't get a Status: header, but a HTTP/1.0 instead
     $GLOBALS['_MAX']['CONF']['delivery']['cgiForceStatusHeader'] = false;
     $_SERVER["SERVER_PROTOCOL"] = 'HTTP/1.0';
     MAX_Dal_Delivery_Include();
 }
 /**
  * The constructor method.
  */
 function __construct()
 {
     parent::__construct();
     // Make sure we don't get a Status: header, but a HTTP/1.0 instead
     $GLOBALS['_MAX']['CONF']['delivery']['cgiForceStatusHeader'] = false;
     $_SERVER["SERVER_PROTOCOL"] = 'HTTP/1.0';
     MAX_Dal_Delivery_Include();
 }
 function Test_OA_Dal_Delivery_getAccountTZs()
 {
     $this->UnitTestCase();
     $this->oDbh = OA_DB::singleton();
     $this->prefix = $GLOBALS['_MAX']['CONF']['table']['prefix'];
     // Disable caching
     $GLOBALS['OA_Delivery_Cache']['expiry'] = -1;
     MAX_Dal_Delivery_Include();
 }
 function __construct()
 {
     parent::__construct();
     $this->oDbh = OA_DB::singleton();
     $this->prefix = $GLOBALS['_MAX']['CONF']['table']['prefix'];
     // Disable caching
     $GLOBALS['OA_Delivery_Cache']['expiry'] = -1;
     MAX_Dal_Delivery_Include();
 }
Beispiel #5
0
function OA_cacheGetPublisherZones($affiliateid, $cached = true)
{
    $sName = OA_Delivery_Cache_getName(__FUNCTION__, $affiliateid);
    if (!$cached || ($output = OA_Delivery_Cache_fetch($sName)) === false) {
        MAX_Dal_Delivery_Include();
        $output = OA_Dal_Delivery_getPublisherZones($affiliateid);
        $output = OA_Delivery_Cache_store_return($sName, $output);
    }
    return $output;
}
<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
/**
 * @package    Plugin
 * @subpackage openxDeliveryLog
 */
MAX_Dal_Delivery_Include();
/**
 * A function to log conversions.
 *
 * @param integer $trackerId The ID of the tracker for which the conversion is to be logged.
 * @param array $serverRawIp The "raw IP address" value to use for the conversion.
 * @param array $aConversion An array of the conversion details, as returned from the
 *                           MAX_trackerCheckForValidAction() function.
 * @return array An array...
 */
function Plugin_deliveryLog_oxLogConversion_logConversion_Delivery_logConversion($trackerId, $serverRawIp, $aConversion, $okToLog = true)
{
    if (!$okToLog) {
        return false;
    }
    // Initiate the connection to the database (before using mysql_real_escape_string)
Beispiel #7
0
function phpAds_showZoneBanners($zoneId)
{
    $pref = $GLOBALS['_MAX']['PREF'];
    global $phpAds_TextDirection;
    global $strUntitled, $strName, $strID, $strWeight, $strShowBanner;
    global $strCampaignWeight, $strBannerWeight, $strProbability, $phpAds_TextAlignRight, $phpAds_TextAlignLeft;
    global $strRawQueryString, $strZoneProbListChain, $strZoneProbNullPri, $strZoneProbListChainLoop;
    global $strExclusiveAds, $strHighAds, $strLowAds, $strECPMAds, $strLimitations, $strCapping, $strNoLimitations, $strPriority;
    MAX_Dal_Delivery_Include();
    $aZoneLinkedAds = OA_Dal_Delivery_getZoneLinkedAds($zoneId);
    if (empty($aZoneLinkedAds['xAds']) && empty($aZoneLinkedAds['ads']) && empty($aZoneLinkedAds['lAds']) && empty($aZoneLinkedAds['eAds'])) {
        echo "<table width='100%' border='0' align='center' cellspacing='0' cellpadding='0'>";
        echo "<tr height='25'><th align='{$phpAds_TextAlignLeft}' colspan='5'><strong>{$strZoneProbNullPri}</strong></th></tr>";
        echo "</table>";
    } else {
        $usedHighProbability = 0;
        echo "<table width='100%' border='0' align='center' cellspacing='0' cellpadding='0'>";
        // Exclusive Advertisements
        if (!empty($aZoneLinkedAds['xAds'])) {
            echo "<tr height='25'><th align='{$phpAds_TextAlignLeft}' colspan='6'><strong>{$strExclusiveAds}:</strong></th></tr>";
            echo "<tr height='25'>";
            echo "<td height='25' width='40%'>&nbsp;&nbsp;<b>" . $strName . "</b></td>";
            echo "<td height='25'><b>" . $strID . "</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>";
            echo "<td height='25'>&nbsp;</td>";
            echo "<td height='25'>&nbsp;</td>";
            echo "<td height='25'><b>{$strLimitations}</b></td>";
            echo "<td height='25' align='" . $phpAds_TextAlignRight . "'>&nbsp;</td>";
            echo "</tr>";
            echo "<tr height='1'><td colspan='6' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
            $i = -1;
            foreach ($aZoneLinkedAds['xAds'] as $adId => $aLinkedAd) {
                $i++;
                $name = phpAds_getBannerName($adId, 60, false);
                echo "<tr height='1'><td colspan='6' 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 ($aLinkedAd['type'] == 'html') {
                    echo "<img src='" . OX::assetPath() . "/images/icon-banner-html.gif' align='absmiddle'>&nbsp;";
                } elseif ($aLinkedAd['type'] == 'txt') {
                    echo "<img src='" . OX::assetPath() . "/images/icon-banner-text.gif' align='absmiddle'>&nbsp;";
                } elseif ($aLinkedAd['type'] == '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
                if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
                    echo "<a href='banner-edit.php?clientid=" . phpAds_getCampaignParentClientID($aLinkedAd['placement_id']) . "&campaignid=" . $aLinkedAd['placement_id'] . "&bannerid=" . $adId . "'>" . htmlspecialchars($name) . "</a>";
                } else {
                    echo htmlspecialchars($name);
                }
                echo "</td>";
                echo "<td height='25'>" . $adId . "</td>";
                echo "<td height='25'>&nbsp;</td>";
                echo "<td height='25'>&nbsp;</td>";
                $capping = _isAdCapped($aLinkedAd);
                $limitations = _isAdLimited($aLinkedAd);
                echo "<td height='25'>";
                if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
                    $linkStart = "<a href='banner-acl.php?clientid=" . phpAds_getCampaignParentClientID($aLinkedAd['placement_id']) . "&campaignid={$aLinkedAd['placement_id']}&bannerid={$aLinkedAd['ad_id']}'>";
                    $linkEnd = "</a>";
                } else {
                    $linkStart = '';
                    $linkEnd = '';
                }
                if (!$capping && !$limitations) {
                    echo "<img src='" . OX::assetPath() . "/images/icon-no-acl.gif' alt='Limitations' align='middle' border='0'>&nbsp;{$linkStart}<strong>{$strNoLimitations}</strong>{$linkEnd}";
                } elseif ($limitations && $capping) {
                    echo "<img src='" . OX::assetPath() . "/images/icon-acl.gif' alt='Limitations' align='middle' border='0'>&nbsp;{$linkStart}{$strLimitations} &amp; {$strCapping}{$linkEnd}";
                } elseif ($limitations) {
                    echo "<img src='" . OX::assetPath() . "/images/icon-acl.gif' alt='Limitations' align='middle' border='0'>&nbsp;{$linkStart}{$strLimitations}{$linkEnd}";
                } elseif ($capping) {
                    echo "<img src='" . OX::assetPath() . "/images/icon-acl.gif' alt='Capping' align='middle' border='0'>&nbsp;{$linkStart}{$strCapping}{$linkEnd}";
                }
                echo "</td>";
                // Show banner
                if ($aLinkedAd['type'] == 'txt') {
                    $width = 300;
                    $height = 200;
                } else {
                    $width = $aLinkedAd['width'] + 64;
                    $height = $aLinkedAd['bannertext'] ? $aLinkedAd['height'] + 90 : $aLinkedAd['height'] + 64;
                }
                echo "<td height='25' align='" . $phpAds_TextAlignRight . "'>";
                echo "<img src='" . OX::assetPath() . "/images/icon-zoom.gif' align='absmiddle' border='0'>&nbsp;";
                echo "<a href='banner-htmlpreview.php?bannerid=" . $adId . "' target='_new' ";
                echo "onClick=\"return openWindow('banner-htmlpreview.php?bannerid=" . $adId . "', '', 'status=no,scrollbars=no,resizable=no,width=" . $width . ",height=" . $height . "');\">";
                echo $strShowBanner . "</a>&nbsp;&nbsp;";
                echo "</td>";
                echo "</tr>";
            }
            echo "<tr height='1'><td colspan='6' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
            echo "<tr><td colspan='6'><br /><br /></td></tr>";
        }
        // High-Priority Advertisements
        if (!empty($aZoneLinkedAds['ads'])) {
            echo "<tr height='25'><th align='{$phpAds_TextAlignLeft}' colspan='6'><strong>{$strHighAds}:</strong></th></tr>";
            echo "<tr height='25'>";
            echo "<td height='25' width='40%'><b>&nbsp;&nbsp;" . $strName . "</b></td>";
            echo "<td height='25'><b>" . $strID . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></td>";
            echo "<td height='25'><b>" . $strProbability . "</b></td>";
            echo "<td height='25'><b>{$strPriority}</b></td>";
            echo "<td height='25'><b>{$strLimitations}</b></td>";
            echo "<td height='25' align='" . $phpAds_TextAlignRight . "'>&nbsp;</td>";
            echo "</tr>";
            echo "<tr height='1'><td colspan='6' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
            for ($i = 10; $i > 0; $i--) {
                if (empty($aZoneLinkedAds['ads'][$i])) {
                    continue;
                }
                foreach ($aZoneLinkedAds['ads'][$i] as $adId => $aLinkedAd) {
                    $name = phpAds_getBannerName($adId, 60, false);
                    echo "<tr height='1'><td colspan='6' 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 ($aLinkedAd['type'] == 'html') {
                        echo "<img src='" . OX::assetPath() . "/images/icon-banner-html.gif' align='absmiddle'>&nbsp;";
                    } elseif ($aLinkedAd['type'] == 'txt') {
                        echo "<img src='" . OX::assetPath() . "/images/icon-banner-text.gif' align='absmiddle'>&nbsp;";
                    } elseif ($aLinkedAd['type'] == '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
                    if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
                        echo "<a href='banner-edit.php?clientid=" . phpAds_getCampaignParentClientID($aLinkedAd['placement_id']) . "&campaignid=" . $aLinkedAd['placement_id'] . "&bannerid=" . $adId . "'>" . htmlspecialchars($name) . "</a>";
                    } else {
                        echo htmlspecialchars($name);
                    }
                    echo "</td>";
                    echo "<td height='25'>" . $adId . "</td>";
                    // Probability
                    $probability = $aLinkedAd['priority'] * 100;
                    $usedHighProbability += $aLinkedAd['priority'];
                    $exactProbability = $probability == 0 ? '0.00' : sprintf('%0.64f', $probability);
                    echo "<td height='25'><acronym title='{$exactProbability}%'>" . number_format($probability, $pref['ui_percentage_decimals']) . "%</acronym></td>";
                    // Priority
                    echo "<td height='25'>{$aLinkedAd['campaign_priority']}/10</td>";
                    $capping = _isAdCapped($aLinkedAd);
                    $limitations = _isAdLimited($aLinkedAd);
                    if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
                        $linkStart = "<a href='banner-acl.php?clientid=" . phpAds_getCampaignParentClientID($aLinkedAd['placement_id']) . "&campaignid={$aLinkedAd['placement_id']}&bannerid={$aLinkedAd['ad_id']}'>";
                        $linkEnd = "</a>";
                    } else {
                        $linkStart = '';
                        $linkEnd = '';
                    }
                    echo "<td height='25'>";
                    if (!$capping && !$limitations) {
                        echo "<img src='" . OX::assetPath() . "/images/icon-no-acl.gif' alt='Limitations' align='middle' border='0'>&nbsp;{$linkStart}{$strNoLimitations}{$linkEnd}";
                    } elseif ($limitations && $capping) {
                        echo "<img src='" . OX::assetPath() . "/images/icon-acl.gif' alt='Limitations' align='middle' border='0'>&nbsp;{$linkStart}{$strLimitations} &amp; {$strCapping}{$linkEnd}";
                    } elseif ($limitations) {
                        echo "<img src='" . OX::assetPath() . "/images/icon-acl.gif' alt='Limitations' align='middle' border='0'>&nbsp;{$linkStart}{$strLimitations}{$linkEnd}";
                    } elseif ($capping) {
                        echo "<img src='" . OX::assetPath() . "/images/icon-acl.gif' alt='Capping' align='middle' border='0'>&nbsp;{$linkStart}{$strCapping}{$linkEnd}";
                    }
                    echo "</td>";
                    // Show banner
                    if ($aLinkedAd['type'] == 'txt') {
                        $width = 300;
                        $height = 200;
                    } else {
                        $width = $aLinkedAd['width'] + 64;
                        $height = $aLinkedAd['bannertext'] ? $aLinkedAd['height'] + 90 : $aLinkedAd['height'] + 64;
                    }
                    echo "<td height='25' align='" . $phpAds_TextAlignRight . "'>";
                    echo "<img src='" . OX::assetPath() . "/images/icon-zoom.gif' align='absmiddle' border='0'>&nbsp;";
                    echo "<a href='banner-htmlpreview.php?bannerid=" . $adId . "' target='_new' ";
                    echo "onClick=\"return openWindow('banner-htmlpreview.php?bannerid=" . $adId . "', '', 'status=no,scrollbars=no,resizable=no,width=" . $width . ",height=" . $height . "');\">";
                    echo $strShowBanner . "</a>&nbsp;&nbsp;";
                    echo "</td>";
                    echo "</tr>";
                }
            }
            echo "<tr height='1'><td colspan='6' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
            echo "<tr><td colspan='6'><br /><br /></td></tr>";
        }
        // eCPM Advertisements
        if (!empty($aZoneLinkedAds['eAds'])) {
            echo "<tr height='25'><th align='{$phpAds_TextAlignLeft}' colspan='6'><strong>{$strECPMAds}:</strong></th></tr>";
            echo "<tr height='25'>";
            echo "<td height='25' width='40%'><b>&nbsp;&nbsp;" . $strName . "</b></td>";
            echo "<td height='25'><b>" . $strID . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></td>";
            echo "<td height='25'><b>" . $strProbability . "</b></td>";
            echo "<td height='25'><b>{$strLimitations}</b></td>";
            echo "<td height='25' align='" . $phpAds_TextAlignRight . "'>&nbsp;</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 ($aZoneLinkedAds['eAds'] as $adId => $aLinkedAd) {
                $name = phpAds_getBannerName($adId, 60, false);
                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 ($aLinkedAd['type'] == 'html') {
                    echo "<img src='" . OX::assetPath() . "/images/icon-banner-html.gif' align='absmiddle'>&nbsp;";
                } elseif ($aLinkedAd['type'] == 'txt') {
                    echo "<img src='" . OX::assetPath() . "/images/icon-banner-text.gif' align='absmiddle'>&nbsp;";
                } elseif ($aLinkedAd['type'] == '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
                if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
                    echo "<a href='banner-edit.php?clientid=" . phpAds_getCampaignParentClientID($aLinkedAd['placement_id']) . "&campaignid=" . $aLinkedAd['placement_id'] . "&bannerid=" . $adId . "'>" . htmlspecialchars($name) . "</a>";
                } else {
                    echo htmlspecialchars($name);
                }
                echo "</td>";
                echo "<td height='25'>" . $adId . "</td>";
                // Probability
                $probability = $aLinkedAd['priority'] * 100;
                $usedHighProbability += $aLinkedAd['priority'];
                $exactProbability = $probability == 0 ? '0.00' : sprintf('%0.64f', $probability);
                echo "<td height='25'><acronym title='{$exactProbability}%'>" . number_format($probability, $pref['ui_percentage_decimals']) . "%</acronym></td>";
                $capping = _isAdCapped($aLinkedAd);
                $limitations = _isAdLimited($aLinkedAd);
                if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
                    $linkStart = "<a href='banner-acl.php?clientid=" . phpAds_getCampaignParentClientID($aLinkedAd['placement_id']) . "&campaignid={$aLinkedAd['placement_id']}&bannerid={$aLinkedAd['ad_id']}'>";
                    $linkEnd = "</a>";
                } else {
                    $linkStart = '';
                    $linkEnd = '';
                }
                echo "<td height='25'>";
                if (!$capping && !$limitations) {
                    echo "<img src='" . OX::assetPath() . "/images/icon-no-acl.gif' alt='Limitations' align='middle' border='0'>&nbsp;{$linkStart}{$strNoLimitations}{$linkEnd}";
                } elseif ($limitations && $capping) {
                    echo "<img src='" . OX::assetPath() . "/images/icon-acl.gif' alt='Limitations' align='middle' border='0'>&nbsp;{$linkStart}{$strLimitations} &amp; {$strCapping}{$linkEnd}";
                } elseif ($limitations) {
                    echo "<img src='" . OX::assetPath() . "/images/icon-acl.gif' alt='Limitations' align='middle' border='0'>&nbsp;{$linkStart}{$strLimitations}{$linkEnd}";
                } elseif ($capping) {
                    echo "<img src='" . OX::assetPath() . "/images/icon-acl.gif' alt='Capping' align='middle' border='0'>&nbsp;{$linkStart}{$strCapping}{$linkEnd}";
                }
                echo "</td>";
                // Show banner
                if ($aLinkedAd['type'] == 'txt') {
                    $width = 300;
                    $height = 200;
                } else {
                    $width = $aLinkedAd['width'] + 64;
                    $height = $aLinkedAd['bannertext'] ? $aLinkedAd['height'] + 90 : $aLinkedAd['height'] + 64;
                }
                echo "<td height='25' align='" . $phpAds_TextAlignRight . "'>";
                echo "<img src='" . OX::assetPath() . "/images/icon-zoom.gif' align='absmiddle' border='0'>&nbsp;";
                echo "<a href='banner-htmlpreview.php?bannerid=" . $adId . "' target='_new' ";
                echo "onClick=\"return openWindow('banner-htmlpreview.php?bannerid=" . $adId . "', '', 'status=no,scrollbars=no,resizable=no,width=" . $width . ",height=" . $height . "');\">";
                echo $strShowBanner . "</a>&nbsp;&nbsp;";
                echo "</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>";
            echo "<tr><td colspan='5'><br /><br /></td></tr>";
        }
        // Low-Priority Advertisements
        if (!empty($aZoneLinkedAds['lAds'])) {
            echo "<tr height='25'><th align='{$phpAds_TextAlignLeft}' colspan='6'><strong>{$strLowAds}:</strong></th></tr>";
            echo "<tr height='25'>";
            echo "<td height='25' width='40%'><b>&nbsp;&nbsp;" . $strName . "</b></td>";
            echo "<td height='25'><b>" . $strID . "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></td>";
            echo "<td height='25'><b>" . $strProbability . "</b></td>";
            echo "<td height='25'><b>{$strWeight}</b></td>";
            echo "<td height='25'><b>{$strLimitations}</b></td>";
            echo "<td height='25' align='" . $phpAds_TextAlignRight . "'>&nbsp;</td>";
            echo "</tr>";
            echo "<tr height='1'><td colspan='6' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
            $ofPriority = (1 - $usedHighProbability) * 100;
            if ($ofPriority < 0) {
                $ofPriority = 0;
            }
            foreach ($aZoneLinkedAds['lAds'] as $adId => $aLinkedAd) {
                $name = phpAds_getBannerName($adId, 60, false);
                echo "<tr height='1'><td colspan='6' 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 ($aLinkedAd['type'] == 'html') {
                    echo "<img src='" . OX::assetPath() . "/images/icon-banner-html.gif' align='absmiddle'>&nbsp;";
                } elseif ($aLinkedAd['type'] == 'txt') {
                    echo "<img src='" . OX::assetPath() . "/images/icon-banner-text.gif' align='absmiddle'>&nbsp;";
                } elseif ($aLinkedAd['type'] == '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
                if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
                    echo "<a href='banner-edit.php?clientid=" . phpAds_getCampaignParentClientID($aLinkedAd['placement_id']) . "&campaignid=" . $aLinkedAd['placement_id'] . "&bannerid=" . $adId . "'>" . htmlspecialchars($name) . "</a>";
                } else {
                    echo htmlspecialchars($name);
                }
                echo "</td>";
                echo "<td height='25'>" . $adId . "</td>";
                // Probability
                $probability = $aLinkedAd['priority'] / $aZoneLinkedAds['priority']['lAds'] * 100;
                $realProbability = $probability * $ofPriority / 100;
                $exactProbability = sprintf("%0.64f", $realProbability);
                echo "<td height='25'><acronym title='{$exactProbability}'>" . number_format($realProbability, $pref['ui_percentage_decimals']) . "%</acronym> (" . number_format($probability, $pref['ui_percentage_decimals']) . "% of " . number_format($ofPriority, $pref['ui_percentage_decimals']) . "%)</td>";
                // Weight
                $weight = $aLinkedAd['campaign_weight'] * $aLinkedAd['weight'];
                echo "<td height='25'>{$weight}</td>";
                // Limitations
                $capping = _isAdCapped($aLinkedAd);
                $limitations = _isAdLimited($aLinkedAd);
                if (OA_Permission::isAccount(OA_ACCOUNT_MANAGER)) {
                    $linkStart = "<a href='banner-acl.php?clientid=" . phpAds_getCampaignParentClientID($aLinkedAd['placement_id']) . "&campaignid={$aLinkedAd['placement_id']}&bannerid={$aLinkedAd['ad_id']}'>";
                    $linkEnd = "</a>";
                } else {
                    $linkStart = '';
                    $linkEnd = '';
                }
                echo "<td height='25'>";
                if (!$capping && !$limitations) {
                    echo "<img src='" . OX::assetPath() . "/images/icon-no-acl.gif' alt='Limitations' align='middle' border='0'>&nbsp;{$linkStart}{$strNoLimitations}{$linkEnd}";
                } elseif ($limitations && $capping) {
                    echo "<img src='" . OX::assetPath() . "/images/icon-acl.gif' alt='Limitations' align='middle' border='0'>&nbsp;{$linkStart}{$strLimitations} &amp; {$strCapping}{$linkEnd}";
                } elseif ($limitations) {
                    echo "<img src='" . OX::assetPath() . "/images/icon-acl.gif' alt='Limitations' align='middle' border='0'>&nbsp;{$linkStart}{$strLimitations}{$linkEnd}";
                } elseif ($capping) {
                    echo "<img src='" . OX::assetPath() . "/images/icon-acl.gif' alt='Capping' align='middle' border='0'>&nbsp;{$linkStart}{$strCapping}{$linkEnd}";
                }
                echo "</td>";
                // Show banner
                if ($aLinkedAd['type'] == 'txt') {
                    $width = 300;
                    $height = 200;
                } else {
                    $width = $aLinkedAd['width'] + 64;
                    $height = $aLinkedAd['bannertext'] ? $aLinkedAd['height'] + 90 : $aLinkedAd['height'] + 64;
                }
                echo "<td height='25' align='" . $phpAds_TextAlignRight . "'>";
                echo "<img src='" . OX::assetPath() . "/images/icon-zoom.gif' align='absmiddle' border='0'>&nbsp;";
                echo "<a href='banner-htmlpreview.php?bannerid=" . $adId . "' target='_new' ";
                echo "onClick=\"return openWindow('banner-htmlpreview.php?bannerid=" . $adId . "', '', 'status=no,scrollbars=no,resizable=no,width=" . $width . ",height=" . $height . "');\">";
                echo $strShowBanner . "</a>&nbsp;&nbsp;";
                echo "</td>";
                echo "</tr>";
            }
            echo "<tr height='1'><td colspan='6' bgcolor='#888888'><img src='" . OX::assetPath() . "/images/break.gif' height='1' width='100%'></td></tr>";
        }
        echo "</table>";
        echo "<br /><br />";
    }
}