自动更改广告 Drupal 广告模块
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您使用 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.