自动更改广告 Drupal 广告模块

发布于 2024-08-16 16:17:55 字数 163 浏览 2 评论 0原文

我正在使用 Drupal 6 的广告模块 (http://drupal.org/project/ad) 。我想知道即使用户不刷新页面,我是否可以每 60 秒自动更改一次广告。

I am using the Ad module for Drupal 6 (http://drupal.org/project/ad). I am wondering if I can make the ad changes automatically every 60 seconds even if the user doesn't refresh the page.

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

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

发布评论

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

评论(1

浅听莫相离 2024-08-23 16:17:55

假设您使用 JavaScript 方法插入广告,您会注意到 Ad 模块向页面添加了一个脚本,该脚本从 Ad 模块目录中名为serve.php 的文件中获取一些代码(因此它绕过了 Drupal 引导等) )。使用 Firebug 并查看 Net 选项卡、JS 子选项卡来查看这一点。假设您有编码能力,您可以向您的主题或自定义模块添加一些 JavaScript,该模块基本上会删除当前广告并重新调用serve.php,就像广告模块的脚本一样。

Assuming you're using the JavaScript method of ad insertion, you'll notice that the Ad module adds a script to the page which fetches some code from a file named serve.php in the Ad module directory (so it's bypassing Drupal bootstrapping and such). Use Firebug and check out the Net tab, JS subtab to take a peek at this. Assuming you have the coding chops, you could add a bit of JavaScript to your theme or a custom module which basically removes the current ad and re-calls serve.php just like the Ad module's script does.

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