最佳实践:使用 OpenX 传送壁纸横幅

发布于 2024-09-15 18:00:43 字数 412 浏览 4 评论 0原文

我正在寻找一种解决方案来通过广告服务器“openx”提供“壁纸”横幅。壁纸由排行榜横幅(728x90 像素)和垂直摩天大楼组成。我在 OpenX 本身中找不到任何选项,所以我猜一定有某种肮脏的方法来完成它。

这里有人有这方面的经验吗?我正在考虑只提供一个排行榜横幅,然后附加一个剪裁到横幅的 html - 其中包含我的摩天大楼横幅的标记... :-/

greg0ire >您可以在此网站上看到“壁纸”横幅的示例(您之前可能会遇到覆盖横幅,请确保禁用广告拦截扩展):http://www.allocine.fr/ 有时它在 Flash 中,有时它只是在 body 元素上设置的背景图像 css 属性。我想实现第二种选择。

谢谢!

I am looking for a solution to deliver a "wallpaper" banner with the adserver "openx". A wallpaper consists of a leaderboard banner (728x90 px) and a vertical skyscraper. I cant find any option in OpenX itself, so I guess there must be some kind of dirty methods to get it done.

Anyone here having experiences with it? I'm thinking of delivering just an leaderboard banner and then attaching a html snipped to the banner - which contains the markup to my skyscraper-banner... :-/

greg0ire > You can see an example of a "wallpaper" banner on this site (you might experience an overlay banner before, make sure you disable ad blocking extensions): http://www.allocine.fr/ Some days it is in flash, other days it is just a background-image css property set on the body element. I'd like to achieve the second option.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

濫情▎り 2024-09-22 18:00:43

我使用这种方法通过 openx 获得了壁纸广告。

首先,我在网站的内容包装器下方创建了一个 div(使用 wordpress、header.php 文件)。

<div id="adbg" style=" margin: 0pt auto; height: 1000px; width: 100%; position: fixed; cursor:pointer;  ">

然后我在 CSS 中创建了一个带有壁纸图像的 div 块,并将其作为文本横幅添加到 OpenX

<div OnClick="location.href='#';" style="background: url('image.jpg') no-repeat scroll center top #026eb4; height: 100%; width: 100%;  margin: 0pt auto; cursor:pointer; "></div>

最后,我获取了 openx 嵌入代码并将其放置在我上面粘贴的 ADBG div 中。

这种技术在所有浏览器上对我来说都很有效。

您当然可以将 adbg div 中的 CSS 存储在 CSS 文件中。

I got wallpapers ads to work through openx using this method.

First I created a div below the content wrapper of my site (using wordpress, header.php file).

<div id="adbg" style=" margin: 0pt auto; height: 1000px; width: 100%; position: fixed; cursor:pointer;  ">

Then I created a div block with the wallpaper image in the CSS and added it to OpenX as a TEXT BANNER

<div OnClick="location.href='#';" style="background: url('image.jpg') no-repeat scroll center top #026eb4; height: 100%; width: 100%;  margin: 0pt auto; cursor:pointer; "></div>

Finally, I took the openx embed code and place it within the ADBG div I pasted above.

This technique worked well for me on all browsers.

You can of course take the CSS in the adbg div and store it in your CSS file.

傲性难收 2024-09-22 18:00:43

目前,我最终这样做了,但我希望看到更好的解决方案:

<div class="openx_<?php echo $_block->getBlockParameter('css_class');?> openx_background hidden">
 <?php echo str_replace('INSERT_RANDOM_NUMBER_HERE', rand(0, 9000), $_block->getBlockParameter('html', ESC_RAW));?>
  <?php echo javascript_tag()?>
    var checkImg = window.setInterval(function(){
      if (jQuery('.openx_background img').length)
      {
        jQuery("body").css('background', 'url("' + jQuery('.openx_background img').attr('src') + '") no-repeat');
        window.clearInterval(checkImg);
      }
    }, 1000);
    //give up 3 s later
    setTimeout(function(){
      if (jQuery('.openx_background img').length == 0)
      {
        clearInterval(checkImg);
      }
    }, 3001);
  <?php echo end_javascript_tag()?>
</div>

$_block->getBlockParameter('html', ESC_RAW) 包含 openx javascript 调用代码。

For the moment, I ended up doing this, but I'd like to see better solutions:

<div class="openx_<?php echo $_block->getBlockParameter('css_class');?> openx_background hidden">
 <?php echo str_replace('INSERT_RANDOM_NUMBER_HERE', rand(0, 9000), $_block->getBlockParameter('html', ESC_RAW));?>
  <?php echo javascript_tag()?>
    var checkImg = window.setInterval(function(){
      if (jQuery('.openx_background img').length)
      {
        jQuery("body").css('background', 'url("' + jQuery('.openx_background img').attr('src') + '") no-repeat');
        window.clearInterval(checkImg);
      }
    }, 1000);
    //give up 3 s later
    setTimeout(function(){
      if (jQuery('.openx_background img').length == 0)
      {
        clearInterval(checkImg);
      }
    }, 3001);
  <?php echo end_javascript_tag()?>
</div>

$_block->getBlockParameter('html', ESC_RAW) contains the openx javascript invocation code.

零度° 2024-09-22 18:00:43

不确定这是否仍然令人感兴趣,但 openX 中有一个名为“同伴定位”的设置。查看第 4.6 点下的 OpenX 参考指南:

http://opensourceusers.com/sites /default/files/openx_reference_guide.pdf

这是一种确保每次交付某个排行榜时都交付摩天大楼的方法。然后,您可以使用前置/附加功能为背景着色,将这个“曲棍球棒”变成完整的壁纸。

Not sure if this is still of interest, but there's a setting in openX for that called "Companion positioning". Have a look at the OpenX reference guide under point 4.6:

http://opensourceusers.com/sites/default/files/openx_reference_guide.pdf

It's a method to make sure that a skyscraper is delivered every time a certain leaderboard is delivered. You can then use the prepend/append functionality to color the background to turn this "hockey stick" into a full blown wallpaper.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文