Title: Ad Rotator
Author: Dmytro Shteflyuk
Published: <strong>2009 年 7 月 29 日</strong>
Last modified: 2009 年 7 月 30 日

---

搜索插件

**该插件尚未通过WordPress的最新3个主要版本进行测试**。 当与较新版本的WordPress一起
使用时，可能不再受到维护或支持，并且可能会存在兼容性问题。

![](https://s.w.org/plugins/geopattern-icon/ad-rotator.svg)

# Ad Rotator

 作者：[Dmytro Shteflyuk](https://profiles.wordpress.org/kpumuk/)

[下载](https://downloads.wordpress.org/plugin/ad-rotator.2.0.3.zip)

 * [详情](https://cn.wordpress.org/plugins/ad-rotator/#description)
 * [评价](https://cn.wordpress.org/plugins/ad-rotator/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/ad-rotator/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/ad-rotator/#developers)

 [支持](https://wordpress.org/support/plugin/ad-rotator/)

## 描述

Ad Rotator is a simple WordPress widget to display random HTML code
 from a given
group of HTML-chunks separated with `<!--more-->` on sidebar. Basically it shows
different HTML every time you requesting page. There are infinite number of instances
of this widget may exist.

#### Support

If you have any suggestions, found a bug, or just wanted to say “thank
 you”,– feel
free to email me [kpumuk@kpumuk.info](https://cn.wordpress.org/plugins/ad-rotator/kpumuk@kpumuk.info?output_format=md).
Promise, I will answer every email I received.

If you want to contribute your code, see the _Development_ section under
 the _Other
Notes_ tab.

#### Migrating from AdRotator plugin

[AdRotator](http://blog.taragana.com/index.php/archive/wordpress-plugin-adrotator-rotate-your-ads-including-adsense-dynamically/)

plugin is a simple file-based ad rotation solution. It was developed by Angsuman
Chakraborty long time ago, but occasionally we have the same plugin names from WordPress’
point of view. If you are using this plugin, you may click upgrade link from your
_Plugins_ page and it being replaced with Ad Rotator widget.

So now you have two ways to solve the problem `'getad()' function is undefined`:

1. you can download AdRotator and ignore upgrade notices, or 2. you can upgrade 
your theme to use Ad Rotator Widget.

Here is how to upgrade your theme. Find all occurrences of `getad` function,
 and
replace them with something like this:

    ```
    register_sidebar(array(
      'name' => 'ad-area',
      'id' => 'ad-area',
      'before_widget' => '',
      'after_widget' => '',
      'before_title' => '',
      'after_title' => ''
    ));
    ```

Make sure you’ve replaced `ad-area` with the name suitable for you. Also
 you can
specify additional options, like `before_title` and `after_title`.

Then open the _Appearence/Widgets_ page in _Site Admin_ and configure
 Ad Rotator
widget instances for your advertisements area. Just take into account, that in files
for AdRotator ads are separated with new line character (ie each line means separate
ad), but in Ad Rotator widget you should separate you blocks with `<!--more-->` (
so each of them may contain more then one line.)

Anyways, sorry for сonfusion, I did not want to сheat on you.

### Development

Sources of this plugin are available both in SVN and Git:

 * [WordPress SVN repository](http://svn.wp-plugins.org/ad-rotator/)
 * [GitHub](http://github.com/kpumuk/ad-rotator/)

Feel free to check them out, make your changes and send me patches.
 Promise, I 
will apply every patch (of course, if they add a value to the product). Email for
patches, suggestions, or bug reports: [kpumuk@kpumuk.info](https://cn.wordpress.org/plugins/ad-rotator/kpumuk@kpumuk.info?output_format=md).

## 屏幕截图

[⌊Ad Rotator widget configuration.⌉⌊Ad Rotator widget configuration.⌉[

Ad Rotator widget configuration.

[⌊Sidebar with Ad Rotator widgets.⌉⌊Sidebar with Ad Rotator widgets.⌉[

Sidebar with Ad Rotator widgets.

## 安装

 1. Download and unpack plugin files to the `wp-content/plugins/ad-rotator` directory.
 2. Enable **Ad Rotator** plugin on your _Plugins_ page in _Site Admin_.
 3. Go to the _Appearence/Widgets_ page in _Site Admin_ and drag as many Ad Rotator
    widgets to your sidebars as you wish. Configure instances separating HTML blocks
    with `<!--more-->`. Save changes.
 4. Now on Ad Rotator blocks should appear on your sidebars.

## 常见问题

  How to enter several ads to a single text box?

Separate your ad blocks with `<!--more-->` sequence.

  How many ads every instance of widget could handle?

Number of advertisements in each instance is unlimited.

  Can I use Google AdSense code as one of my ads?

Of course, you can use any HTML you wish (AdSense, Clicksor, Chitika,
 and everything
else).

  WordPress shows `’getad()’ function is undefined` error

See explanation on the _Description_ page in _Migrating from
 AdRotator plugin
 
section.

## 评价

此插件暂无评价。

## 贡献者及开发者

「Ad Rotator」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Dmytro Shteflyuk ](https://profiles.wordpress.org/kpumuk/)

[帮助将「Ad Rotator」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/ad-rotator)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/ad-rotator/)，查看[SVN仓库](https://plugins.svn.wordpress.org/ad-rotator/)，
或通过[RSS](https://plugins.trac.wordpress.org/log/ad-rotator/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/ad-rotator/)。

## 更新日志

#### 2.0.3 (July 30, 2009)

 * Fixed problem with backslashes appearing inside HTML (thanks to [Maxx Kremer](http://www.maxxkremer.com/)).

#### 2.0.2 (July 29, 2009)

 * Added section _Migrating from AdRotator plugin_ in readme.txt.

#### 2.0.1 (July 29, 2009)

 * Fixed Installation section in readme.txt.
 * Filter out HTML when user has no rights to edit unfiltered HTML.

#### 2.0.0 (July 29, 2009)

 * Completely rewritten using new WordPress 2.8 widgets API.
 * Readme file and couple of screenshots added.

#### 1.0.1 (March 31, 2007)

 * Plugin home page updated.

#### 1.0.0 (May 1, 2006)

 * Initial plugin implementation.

## 额外信息

 *  版本 **2.0.3**
 *  最后更新：**17 年前**
 *  活跃安装数量 **100+**
 *  WordPress 版本 ** 2.8.0 或更高版本 **
 *  已测试的最高版本为 **2.8.2**
 *  语言
 * [English (US)](https://wordpress.org/plugins/ad-rotator/)
 * 标签
 * [ad](https://cn.wordpress.org/plugins/tags/ad/)[ads](https://cn.wordpress.org/plugins/tags/ads/)
   [advertisements](https://cn.wordpress.org/plugins/tags/advertisements/)[rotate](https://cn.wordpress.org/plugins/tags/rotate/)
   [widget](https://cn.wordpress.org/plugins/tags/widget/)
 *  [高级视图](https://cn.wordpress.org/plugins/ad-rotator/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  1 条 5 星评价     ](https://wordpress.org/support/plugin/ad-rotator/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/ad-rotator/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/ad-rotator/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/ad-rotator/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/ad-rotator/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/ad-rotator/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/ad-rotator/reviews/)

## 贡献者

 *   [ Dmytro Shteflyuk ](https://profiles.wordpress.org/kpumuk/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/ad-rotator/)