本文整理汇总了PHP中_adRenderGetRealPluginVersion函数的典型用法代码示例。如果您正苦于以下问题:PHP _adRenderGetRealPluginVersion函数的具体用法?PHP _adRenderGetRealPluginVersion怎么用?PHP _adRenderGetRealPluginVersion使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_adRenderGetRealPluginVersion函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _adRenderFlash
function _adRenderFlash(&$aBanner, $zoneId = 0, $source = '', $ct0 = '', $withText = false, $logClick = true, $logView = true, $useAlt = false, $richMedia = true, $loc = '', $referer = '', $context = array())
{
$conf = $GLOBALS['_MAX']['CONF'];
$prepend = !empty($aBanner['prepend']) ? $aBanner['prepend'] : '';
$append = !empty($aBanner['append']) ? $aBanner['append'] : '';
$width = !empty($aBanner['width']) ? $aBanner['width'] : 0;
$height = !empty($aBanner['height']) ? $aBanner['height'] : 0;
$pluginVersion = !empty($aBanner['pluginversion']) ? _adRenderGetRealPluginVersion($aBanner['pluginversion']) : '4';
$logURL = _adRenderBuildLogURL($aBanner, $zoneId, $source, $loc, $referer, '&');
if (!empty($aBanner['alt_filename']) || !empty($aBanner['alt_imageurl'])) {
$altImageAdCode = _adRenderImage($aBanner, $zoneId, $source, $ct0, false, $logClick, false, true, true, $loc, $referer, $context, false);
$fallBackLogURL = _adRenderBuildLogURL($aBanner, $zoneId, $source, $loc, $referer, '&', true);
} else {
$alt = !empty($aBanner['alt']) ? htmlspecialchars($aBanner['alt'], ENT_QUOTES) : '';
$altImageAdCode = "<img src='" . _adRenderBuildImageUrlPrefix() . '/1x1.gif' . "' alt='" . $alt . "' title='" . $alt . "' border='0' />";
if ($zoneId) {
$fallBackLogURL = _adRenderBuildLogURL(array('ad_id' => 0, 'placement_id' => 0), $zoneId, $source, $loc, $referer, '&', true);
} else {
$fallBackLogURL = false;
}
}
$clickUrl = _adRenderBuildClickUrl($aBanner, $zoneId, $source, $ct0, $logClick);
if (!empty($clickUrl)) {
$status = _adRenderBuildStatusCode($aBanner);
$target = !empty($aBanner['target']) ? $aBanner['target'] : '_blank';
$swfParams = array('clickTARGET' => $target, 'clickTAG' => $clickUrl);
$clickTag = "<a href='{$clickUrl}' target='{$target}'{$status}>";
$clickTagEnd = '</a>';
} else {
$swfParams = array();
$clickTag = '';
$clickTagEnd = '';
}
if (!empty($aBanner['parameters'])) {
$aAdParams = unserialize($aBanner['parameters']);
if (isset($aAdParams['swf']) && is_array($aAdParams['swf'])) {
$swfParams = array();
$aBannerSwf = $aBanner;
$aBannerSwf['noClickTag'] = true;
foreach ($aAdParams['swf'] as $iKey => $aSwf) {
$aBannerSwf['url'] = $aSwf['link'];
$swfParams["alink{$iKey}"] = _adRenderBuildClickUrl($aBannerSwf, $zoneId, $source, $ct0, $logClick);
$swfParams["atar{$iKey}"] = $aSwf['tar'];
}
}
}
$fileUrl = _adRenderBuildFileUrl($aBanner, false);
$id = 'rv_swf_{random}';
$swfId = !empty($aBanner['alt']) ? $aBanner['alt'] : 'Advertisement';
$swfId = 'id-' . preg_replace('/[a-z0-1]+/', '', strtolower($swfId));
$code = "\n<div id='{$id}' style='display: inline;'>{$altImageAdCode}</div>\n<script type='text/javascript'><!--/" . "/ <![CDATA[\n var ox_swf = new FlashObject('{$fileUrl}', '{$swfId}', '{$width}', '{$height}', '{$pluginVersion}');\n";
foreach ($swfParams as $key => $value) {
$code .= " ox_swf.addVariable('{$key}', '" . preg_replace('#%7B(.*?)%7D#', '{$1}', urlencode($value)) . "');\n";
}
if (!empty($aBanner['transparent'])) {
$code .= " ox_swf.addParam('wmode','transparent');\n";
} else {
$code .= " ox_swf.addParam('wmode','opaque');\n";
}
$code .= " ox_swf.addParam('allowScriptAccess','always');\n";
if ($logView && $conf['logging']['adImpressions']) {
$code .= " ox_swf.write('{$id}', " . json_encode($logURL) . ", " . json_encode($fallBackLogURL) . ");\n";
} else {
$code .= " ox_swf.write('{$id}');\n";
}
$code .= "/" . "/ ]]> --></script>";
if ($fallBackLogURL) {
$code .= '<noscript>' . _adRenderImageBeacon($aBanner, $zoneId, $source, $loc, $referer, $fallBackLogURL) . '</noscript>';
}
$bannerText = $withText && !empty($aBanner['bannertext']) ? "<br />{$clickTag}{$aBanner['bannertext']}{$clickTagEnd}" : '';
return $prepend . $code . $bannerText . $append;
}
示例2: _adRenderFlash
/**
* This function generates the code to show a "flash" ad
*
* @param array $aBanner The ad-array for the ad to render code for
* @param int $zoneId The zone ID of the zone used to select this ad (if zone-selected)
* @param string $source The "source" parameter passed into the adcall
* @param string $ct0 The 3rd party click tracking URL to redirect to after logging
* @param int $withText Should "text below banner" be appended to the generated code
* @param bookean $logClick Should this click be logged (clicks in admin should not be logged)
* @param boolean $logView Should this view be logged (views in admin should not be logged
* also - 3rd party callback logging should not be logged at view time)
* @param string $loc The "current page" URL
* @param string $referer The "referring page" URL
*
* @return string The HTML to display this ad
*/
function _adRenderFlash(&$aBanner, $zoneId = 0, $source = '', $ct0 = '', $withText = false, $logClick = true, $logView = true, $useAlt = false, $richMedia = true, $loc = '', $referer = '', $context = array())
{
$conf = $GLOBALS['_MAX']['CONF'];
$prepend = !empty($aBanner['prepend']) ? $aBanner['prepend'] : '';
$append = !empty($aBanner['append']) ? $aBanner['append'] : '';
$width = !empty($aBanner['width']) ? $aBanner['width'] : 0;
$height = !empty($aBanner['height']) ? $aBanner['height'] : 0;
$pluginVersion = !empty($aBanner['pluginversion']) ? _adRenderGetRealPluginVersion($aBanner['pluginversion']) : '4';
// $imageUrlPrefix = ($_SERVER['SERVER_PORT'] == $conf['openads']['sslPort']) ? $conf['type_web_ssl_url'] : $conf['type_web_url'];
if (!empty($aBanner['alt_filename']) || !empty($aBanner['alt_imageurl'])) {
$altImageAdCode = _adRenderImage($aBanner, $zoneId, $source, $ct0, false, $logClick, false, true, true, $loc, $referer, false);
$fallBackLogURL = _adRenderBuildLogURL($aBanner, $zoneId, $source, $loc, $referer, '&', true);
} else {
$altImageAdCode = "<img src='" . _adRenderBuildImageUrlPrefix() . '/1x1.gif' . "' alt='" . $aBanner['alt'] . "' title='" . $aBanner['alt'] . "' border='0' />";
$fallBackLogURL = false;
}
// Create the anchor tag..
$clickUrl = _adRenderBuildClickUrl($aBanner, $zoneId, $source, $ct0, $logClick);
if (!empty($clickUrl)) {
// There is a link
$status = _adRenderBuildStatusCode($aBanner);
$target = !empty($aBanner['target']) ? $aBanner['target'] : '_blank';
$swfParams = array('clickTARGET' => $target, 'clickTAG' => $clickUrl);
$clickTag = "<a href='{$clickUrl}' target='{$target}'{$status}>";
$clickTagEnd = '</a>';
} else {
$swfParams = array();
$clickTag = '';
$clickTagEnd = '';
}
if (!empty($aBanner['parameters'])) {
$aAdParams = unserialize($aBanner['parameters']);
if (isset($aAdParams['swf']) && is_array($aAdParams['swf'])) {
// Converted SWF file, use paramters content
$swfParams = array();
$aBannerSwf = $aBanner;
// Set the flag to let _adRenderBuildClickUrl know that we're not using clickTAG
$aBannerSwf['noClickTag'] = true;
foreach ($aAdParams['swf'] as $iKey => $aSwf) {
$aBannerSwf['url'] = $aSwf['link'];
$swfParams["alink{$iKey}"] = _adRenderBuildClickUrl($aBannerSwf, $zoneId, $source, $ct0, $logClick);
$swfParams["atar{$iKey}"] = $aSwf['tar'];
}
}
}
$fileUrl = _adRenderBuildFileUrl($aBanner, false);
$rnd = md5(microtime());
$swfId = !empty($aBanner['alt']) ? $aBanner['alt'] : 'Advertisement';
$code = "\n<div id='ox_{$rnd}' style='display: inline;'>{$altImageAdCode}</div>\n<script type='text/javascript'><!--/" . "/ <![CDATA[\n var ox_swf = new FlashObject('{$fileUrl}', '{$swfId}', '{$width}', '{$height}', '{$pluginVersion}');\n";
foreach ($swfParams as $key => $value) {
// URL encode the value, but leave any Openads "magic macros" unescaped to allow substitution
$code .= " ox_swf.addVariable('{$key}', '" . preg_replace('#%7B(.*?)%7D#', '{$1}', urlencode($value)) . "');\n";
}
if (!empty($aBanner['transparent'])) {
$code .= "\n ox_swf.addParam('wmode','transparent');";
} else {
$code .= "\n ox_swf.addParam('wmode','opaque');";
}
$code .= "\n ox_swf.addParam('allowScriptAccess','always');\n ox_swf.write('ox_{$rnd}');\n";
if ($logView && $conf['logging']['adImpressions']) {
// Only render the log beacon if the user has the minumum required flash player version
$code .= " if (ox_swf.installedVer.versionIsValid(ox_swf.getAttribute('version'))) { document.write(\"" . _adRenderImageBeacon($aBanner, $zoneId, $source, $loc, $referer) . "\"); }";
// Otherwise log a fallback impression (if there is a fallback creative configured)
if ($fallBackLogURL) {
$code .= ' else { document.write("' . _adRenderImageBeacon($aBanner, $zoneId, $source, $loc, $referer, $fallBackLogURL) . '"); }';
}
}
$code .= "\n/" . "/ ]]> --></script>";
if ($fallBackLogURL) {
$code .= '<noscript>' . _adRenderImageBeacon($aBanner, $zoneId, $source, $loc, $referer, $fallBackLogURL) . '</noscript>';
}
$bannerText = $withText && !empty($aBanner['bannertext']) ? "<br />{$clickTag}{$aBanner['bannertext']}{$clickTagEnd}" : '';
return $prepend . $code . $bannerText . $append;
}