Ad Rotator

· English (46,373 views)

Ad Rotator — это простой виджет для WordPress, позволяющий отображать в боковой панели случайный код HTML из заданного набора блоков, разделенных <!--more-->. По сути он отображает разный HTML каждый раз, когда вы запрашиваете страницу. Количество блоков и экземпляров виджета неограничено.

Установка

  1. Загрузите и распакуйте файлы плагина в каталог wp-content/plugins/ad-rotator/.

  2. Включите плагин Ad Rotator на странице Plugins (Плагины) в Site Admin (Панель управления).

  3. Зайдите на страницу Appearence/Widgets (Внешний вид/Виджеты) в Site Admin (Панель управления) и перетяните такое количество виджетов “Ad Rotator” в ваши боковые панели, которое вам нужно. Отредактируйте экземпляры виджетов, разделяя блоки кода с помощью <!--more-->. Сохраните настройки.

    Настройки виджета Ad Rotator

    Боковая панель с виджетами Ad Rotator

  4. Теперь виджеты Ad Rotator должны появится в ваших боковых панелях.

Миграция с плагина AdRotator

Плагин AdRotator — это простое решение для ротации рекламы, основанное на текстовых файлах. Он был разработан Angsuman Chakraborty очень давно, но по случайности мы использовали одинаковое название для плагина (с точки зрения WordPress). Если вы используете этот плагин, вы можете нажать ссылку “обновить” на странице Plugins, и он будет заменен виджетом Ad Rotator.

Итак, у вас есть два пути решения проблемы 'getad()' function is undefined:

  1. Вы можете скачать плагин AdRotator и игнорировать все последующие нотификации о наличии новой версии, или

  2. Вы можете обновить вашу тему для использования виджета Ad Rotator.

Как обновить тему для использования виджета? Найдите все вхождения функции getad, и замените их чем-то вроде:

1
2
3
4
5
6
7
8
register_sidebar(array(
  'name' => 'ad-area',
  'id' => 'ad-area',
  'before_widget' => '',
  'after_widget' => '',
  'before_title' => '',
  'after_title' => ''
));

Убедитесь, что вы заменили ad-area на другое имя, более подходящее для вас. Кроме того, вы можете указать дополнительные настройки вроде before_title и after_title.

Теперь откройте страницу Appearence/Widgets (Внешний вид/Виджеты) в Site Admin (Панель управления) и настройте экземпляры виджета Ad Rotator для ваших рекламных блоков. Просто примите во внимание, что в файлах для AdRotator блоки рекламы разделены символом новой строки (то есть каждая строка означает отдельный рекламный блок), а для виджета Ad Rotator вы должны разделять блоки с помощью <!--more--> (поэтому каждый из них может содержать более одной строки).

В любом случае, парни, извините за путаницу. Я не хотел вас обманывать.

Требования

Для работы плагина требуется Wordpress версии 2.8 или выше. Также убедитесь, что ваша тема поддерживает виджеты.

Загрузка

Последняя версия виджета “Ad Rotator” — 2.0.3, и она может быть загружена отсюда:

version2.0.3DownloadAd Rotator

Если у Вас есть предложения, Вы хотите оставить отзыв или нашли ошибки, пожалуйста, отпишитесь в комментариях. Это очень важно для меня!

Часто задаваемые вопросы

В. Как ввести несколько блоков рекламы в одно поле ввода?
О. Разделяйте ваши блоки с помощью последовательности <!--more-->.

В. Сколько блоков рекламы может содержать один экземпляр виджета?
О. Количество рекламных блоков неограничено.

В. Могу я использовать код Google AdSense code как один и блоков?
О. Конечно, вы можете использовать любые куски HTML, какие захотите (AdSense, Clicksor, Chitika, и все остальное).

В. WordPress показывает ошибку `’getad()’ function is undefined`
О. Смотрите объяснение в разделе Миграция с плагина AdRotator.

Список изменений

  • 2.0.3 (July 30, 2009)
    • Исправлена проблема с экранированием кавычек слешами внутри HTML (спасибо Maxx Kremer).
  • 2.0.2 (July 29, 2009)
    • Добавлен раздел Migrating from AdRotator plugin в readme.txt.
  • 2.0.1 (29 июля 2009)
    • Исправлен раздел “Installation” в readme.txt.
    • Теперь HTML будет фильтроваться для пользователей, которые не имеют права редактировать неотфильтрованный HTML.
  • 2.0.0 (29 июля 2009)
    • Виджет польностью переписан с использованием нового API для виджетов, который появился в WordPress 2.8.
    • Добавлены readme.txt и пара скриншотов.
  • 1.0.1 (31 марта 2007)
    • Обновлена домашняя страница плагина.
  • 1.0.0 (1 мая 2006)
    • Базовая реализация плагина.

Другие плагины

Полный список плагинов, которые я написал, можно найти здесь.

91 Responses to this entry

Subscribe to comments with RSS or TrackBack to 'Ad Rotator'.

said on 12.04.2007 at 15.37 · Permalink · Ответить

my site admin in 2.1 does not have a presentation/sidebar widgets section, and this plugin pushes the sidebar out of alignment

said on 12.04.2007 at 17.01 · Permalink · Ответить

Looks like your theme does not supports widgets at all. In this case Ad Rotator is used and can’t break down your sidebar alignment.

said on 13.04.2007 at 0.51 · Permalink · Ответить

Random block is shown on each request. It’s possible that sometimes ad would be repeated, but usually random HTML would be displayed.

said on 16.04.2007 at 12.30 · Permalink · Ответить

Thanks for this. It works well aside from a small problem I’m having where sometimes I get a blank space where the ad should be.

I’m wondering if I’m doing something wrong or if it’s some kind of timing problem. Should the <!--more--> delimiter only appear after the code chunks?

Any ideas?

Thanks

Gary

said on 16.04.2007 at 13.41 · Permalink · Ответить

It should appear between code chunks. It is just divider and separates chunks between each other. Therefor if you would past it after all chunks, blank area would be displayed sometimes because Ad Rotator would think that another chunk exists after last one. Just for example:

1
2
3
<img src="ad1.jpg" />
<!--more-->
<img src="ad2.jpg" />

This is correct using of plugin. And here is another wrong one:

1
2
3
4
<img src="ad1.jpg" />
<!--more-->
<img src="ad2.jpg" />
<!--more-->

In the first case you have two chunks, in the second case there are three chunks exists, and one of them is blank.

JR
said on 18.05.2007 at 13.33 · Permalink · Ответить

Hi,
is this widget supporting <code> tags?

I am trying to steer it to my wordpress theme directory using <code></code>

Cheers

Casey V. @
said on 28.05.2007 at 7.52 · Permalink · Ответить

I was wondering how to add additional Ad Rotator widgets to my sidebar?

said on 08.06.2007 at 21.59 · Permalink · Ответить

For some reason, this code:
<a href=”http://www.noliberties.com/” target=”_blank”><img src=”http://www.noliberties.com/img/banners/tl_skyscraper.jpg” alt=”Taking Liberties” width=”160″ height=”600″ border=”0″ /></a>

is being rendered as

<div class=”adrotatorwidget”><a href=”http://www.noliberties.com/”><!– –></a></div>
</li>

by both this and the text box plugin. It’s driving me crazy… and so am removing the widget for now.

Any idea? As it seems insane not to be able to easily display arbitrary html snippets!

Thanks.

lex @
said on 15.06.2007 at 20.19 · Permalink · Ответить

Dmytro,

AdRotator was working great for me until I “upgraded” to WP2.2 – now my (paid for) content isn’t showing up, even though the proper html is in AdRotator boxes.

Has anyone else mentioned this?

lex @
said on 15.06.2007 at 20.51 · Permalink · Ответить

It turns out that whatever html is in AdRotator Widget #1 is displayed on every other widget even if the html they contain are different…

Josh @
said on 25.06.2007 at 21.55 · Permalink · Ответить

I’ve used this fantastic widget/plugin for a few weeks and it works great.

However, Fantastico recommended that I upgrade my Wordpress install from 2.1.3 to 2.2, and when I did the Ad Rotator instances that I have running in my sidebar turned into duplicates. So, instead of running Ad Rotator Widgets 1, 2, and 3. It just displays the content for Ad Rotator Widget 1 three different times.

Anyone else run into this?

Thanks!
Josh

lex @
said on 29.06.2007 at 13.23 · Permalink · Ответить

It was a known problem with the widgets.php apparently. You can download and replace the file here

said on 20.07.2007 at 2.08 · Permalink · Ответить

I am working with a fresh install of Wordpress 2.2 (about a week old) and I just installed Adrotator. It installed fine and I put the widget in the sidebar but the title is the only thing that appears. In Firefox, I get nothing at all and in IE I get a broken link symbol. I tried downloading that new widgets.php file, but it didn’t change anything. Any other suggestions?

James @
said on 03.08.2007 at 2.23 · Permalink · Ответить

Hello,

I want to confirm that all code chunks as described below go in the function widget_adrotator_control($number) section.

Following that, the next step is to insert the code add_action(‘plugins_loaded’, ‘widget_adrotator_init’);
to the sidebar and then paste the adrotator code to the correct section of the sidebar.

I hope this makes some sense.

said on 16.09.2007 at 7.59 · Permalink · Ответить

Can anyone tell me why the limit is 9 ad rotator widgets?

Any way of upping that limit?

said on 27.09.2007 at 2.06 · Permalink · Ответить

Hi.

Is this plugin still being supported and updated?

In version 2.3 of Wordpress the plugin has a small issue. You can no longer grab and drag the mouse across to select the code when editing an instance of the rotator.

Try editing your code in the box, you’ll see what I mean.

This is my favourite plugin and is so versatile I’m hoping for an upgrade…

cheers!

lisa @
said on 01.10.2007 at 0.59 · Permalink · Ответить

Hi. I’m a first time user and a total novice. I cannot save the new ads to my widget. I open the code pop up, delete my old code, add the new code and then close the window. That should be it right? When I do this the new ads don’t save. I’ve cleared my cache and cookies and still nothing. Please can you help?!

said on 07.11.2007 at 6.27 · Permalink · Ответить

Great and easy to use widget – but, just a question, how do I add another instance of the Widget? I tried renaming and uploading another file but it isn’t showing in the list. Probably obvious ot seasoned WP users but it’s got me stumped!

said on 07.11.2007 at 6.33 · Permalink · Ответить

Oops figured it out! Forgot to activate the new AdRotator in the Plugins… duh (well I’m over 50 gimme a break)

said on 07.11.2007 at 6.36 · Permalink · Ответить

Oops agin, no it doesn’t work in 2.3 – plugin generated a fatal error… is this what will be fixed in the new release maybe? But still happy that it works so well!

Bert Degenaar
said on 17.11.2007 at 11.05 · Permalink · Ответить

This pluggin is working great. No difficulties getting it up and running. Great job. Thx alot.

Brian @
said on 20.11.2007 at 22.26 · Permalink · Ответить

Hello, the adrotator is working fine but the ad address link would also show on a widget that is underneath it, for example if a have a text widget underneath the ad rotator the text would show underline and if you click on it will take you to the ad website that is showing on top.

Please let me know how can I fix this.

Thank you.

said on 18.12.2007 at 22.04 · Permalink · Ответить

Hello –

I have installed the adrotater plugin in the plugin directory along with the other plugins, but it doesn’t show up in my Wordpress plugin admin panel like the other ones. Any thoughts? I’m using 2.3.1.

Thanks, David

said on 18.12.2007 at 22.07 · Permalink · Ответить

Never mind; I just had to log out and log back in; now it’s there. (I had previously also updated the widget.php module, as mentioned above in #15.)

– David

said on 18.12.2007 at 22.26 · Permalink · Ответить

Actually, now if I have the plugin activated, I lose access to my widgets admin screen until I turn the plugin off. Again, any thoughts would be appreciated.

– David

-- cobalt @
said on 28.12.2007 at 7.55 · Permalink · Ответить

If I have my own directory of jpg images that I want to rotate through, what “text” / “code” could I use to randomly go through the ads?

stilfx
said on 02.01.2008 at 6.00 · Permalink · Ответить

Is there any way to not use widgets with this and do inline ads?

Chris @
said on 03.01.2008 at 18.19 · Permalink · Ответить

I unwittingly put some javacode in my ad rotator box. Unfortunately, it crashed and i cannot simply go back in and change what is in the box. I even deleted and re-installed adrotator and it still doesn’t work. I just don’t understand and now my whole blog is damaged. any thoughts?

Ninjadoll
said on 10.01.2008 at 8.53 · Permalink · Ответить

Chris, you may wish to use your phpmyadmin and see whether the crashing code is still in your database. If it is, flush it. You should then be able to reinstall the widget without it repeating the process. Look for whatever entry has “Ad-Rotator” (or similar) and browse it to find the offending entry.

Ninjadoll
said on 10.01.2008 at 9.01 · Permalink · Ответить

I don’t want to use this plugin as a sidebar widget, I want to call it from elswhere on the site. Is there a way to make it work independently so I can stick it in a post?

said on 07.02.2008 at 6.16 · Permalink · Ответить

I have adsense in my blog. Now I want to install ad rotator for amazon. I am afraid there will be some problems. Is is OK ? Please advice.
Thank you.
Bambang Udoyono

john @
said on 04.03.2008 at 2.37 · Permalink · Ответить

I am using wordpress 2.33 WITH K2
I am not a programmer.
I’ve enabled Ad Rotator 1.0.1

What is the code that I would use to get the plugin to appear in the K2 Sidebar Manager.

I would love it if this was a “module” for K2.

said on 19.03.2008 at 16.21 · Permalink · Ответить

У меня ничего не получается :( Хотя делаю по инструкции, но виджет в СайдБар Виджетс не появляется :( Менять тему? Обновлять ВП (у меня 2.1.3)?

sagbee @
said on 29.05.2008 at 15.44 · Permalink · Ответить

Awesome wordpress plugin, which can do alot of things :) , i really like it!!! however doest it work with wordpress 2.5.1 ? It wasn’t working when i was using ?

let me know please, whats going on..

said on 28.06.2008 at 13.33 · Permalink · Ответить

Thanks for sharing about what looks to be a good plugin. Getting it now to try it out on my blog. Much appreciated.

English& Proud
said on 07.09.2008 at 4.53 · Permalink · Ответить

Erm… The UNION FLAG should be used for English (top right corner of your website) NOT the American flag, they didn’t invent the language and STILL can’t speak it properly.

Please amend this as it is offensive to REAL English people.

Tami @
said on 12.09.2008 at 7.08 · Permalink · Ответить

Please excuse my naivete, but I have installed the widget but I have a question.

I understand that I am supposed to take the “html code” and add it to the widget. My question is where do I get the code from? Do I need to sign up somewhere? When I unzipped the file, there was only a widget.php file. Is there something I missed? I’m using Wordpress 2.5.1.

Any ideas?

Thanks in advance for the help!

Tami

Kris
said on 14.10.2008 at 23.19 · Permalink · Ответить

Just wondering why the code would pull a random Google ad from elsewhere in the page, even though the code is not listed in the ad rotator widget.

James
said on 30.12.2008 at 17.34 · Permalink · Ответить

Hi!

Sorry the link doesn’t exist, well i can’t download, i trying but i can’t, somebody can see, what happened please.

Mimi @
said on 04.02.2009 at 15.50 · Permalink · Ответить

i was add something to my adrotator then this is what i’ve got. can somebody please help how should i fix this?

1
Fatal error: Cannot use string offset as an array in /home/public_html/wp-content/plugins/adrotator.php on line 44
said on 16.02.2009 at 23.10 · Permalink · Ответить

What a fantastic widget! I have been looking high and low for a widget that you could put custom HTML instead of just text, and this is it! You could advertise this as a custom HTML widget as well, cause I know I can’t be the only one looking for it.

said on 05.03.2009 at 0.18 · Permalink · Ответить

hi there can any one tell me how to Random Ad Rotator to evenly Ad Rotator. please i need it in my webpress
thanks
Jams

Mike @
said on 25.03.2009 at 17.54 · Permalink · Ответить

I have wordpress 2.7 and there is no “configure” button showing. Can anyone please tell me how to run multiple instances?

said on 12.05.2009 at 23.33 · Permalink · Ответить

Hi. is there soemthing wrong witht he plugin?

After installing it wont let me activate it. is the version still compatible. im using wordpress 2.7.

I made this web site. It’s all about celebrity news and gossip…So I’d appreciate your opinion on web site, this ad widget sounds cool.

said on 19.05.2009 at 7.28 · Permalink · Ответить

I’m getting the same “Fatal error: Cannot use string offset as an array” problem as Mimi above. It happens when I try to go to my “Widgets” page in wp-admin. It used to work fine, now it doesn’t. I tried erasing the data in Mysql but it didn’t work. Suggestions please? It was such a useful plugin.

said on 18.06.2009 at 7.14 · Permalink · Ответить

I did a fresh install of wordpress 2.8 and when I go to add more ad-rotator widgets it won’t add anymore than just one. Any ideas on a quick fix?

Thanks

Stacie @
said on 27.06.2009 at 2.03 · Permalink · Ответить

Right now I have 3 ad rotator widgets that are all working fairly well however, I want more. I have tried to request more using the “how many do you want” option but no matter how many I choose none appear. What am I doing wrong?

Jason Rogers
said on 03.07.2009 at 7.44 · Permalink · Ответить

This widget doesn’t work in multi-mode in wp2.8 anymore, as they have changed the way widgets are created and coded from 2.8 and on:

http://codex.wordpress.org/Plugins/WordPress_Widgets_Api

Might want to update it and maybe, just maybe submit it to the Wordpress Plugin database so we can find the updated version on there too… it would be a waste if you didn’t and left the widget here to die.

Steve @
said on 10.07.2009 at 13.10 · Permalink · Ответить

Prior to upgrading to Wordpress 2.8, Ad Rotator had the option to select multiple instances of the plugin. Now the selection for multiple instances is still there but no additional Ad Rotators appear after choosing a number of extra copies. Is this something that can be tweaked in the plugin to make it compatible or is this a bug to be pursued at Wordpress.org?

said on 29.07.2009 at 22.22 · Permalink · Ответить

Um.. I ran into that WP upgrade error because I am using the real AdRotator. You should change the name so your widget doesn’t do that.

said on 30.07.2009 at 1.09 · Permalink · Ответить

Cole, I’m not sure that this is the best solution. This widget is more than 3 years old, so it has his own users, and I am not ready to stop providing them a good solution for this day-to-day problem.

Maxx @
said on 30.07.2009 at 1.16 · Permalink · Ответить

Hi Dmytro,

Thanks for updating the plugin. This is a great plugin that I would be lost without!

Kudos to you!

Ike @
said on 30.07.2009 at 6.31 · Permalink · Ответить

I’m having an issue since the upgrade — backslashes are now appearing before all of my double-quotes and apostrophes.

Look in my sidebar under “Rave Reviews” to see what I mean.

Steve @
said on 30.07.2009 at 8.31 · Permalink · Ответить

Where is 2.0.3? I just downloaded the plugin and it appears to still be 2.0.2 and still the same issue with backslashes.

Dave @
said on 31.07.2009 at 0.03 · Permalink · Ответить

Hi,

Is there any way to stop the plugin from trying to escape quotes when you add some html? I am trying to add a banner image withing a link and it doesn’t show up because the plugin automatically escapes the quotes.

Regards,

said on 31.07.2009 at 4.00 · Permalink · Ответить

How do I have the rotating ads show up in my Theme? I did not understand the directions. I created a TXT file with the HTML for images and links, and uploaded it to the wp-content folder. Is this method still used with this new version?

Stacie @
said on 03.08.2009 at 6.56 · Permalink · Ответить

I just updated and I’ve had a few issues. First, the update essentially deleted all my existing rotators. Luckily I was planning on changing the ads anyway. Now, as I’m starting over, the rotators are showing multiple ads stacked on each other with (!–more–) between them.

said on 15.08.2009 at 5.19 · Permalink · Ответить

Can I enter another web site widget code into the rotator? I’d like to enter widgets like weather and stuff and have them rotate. Thanks.

said on 27.08.2009 at 8.41 · Permalink · Ответить

I’m getting this error when I try to activate the plugin:

Fatal error: Class ‘WP_Widget’ not found in /zine/wp-content/plugins/ad-rotator/adrotator.php on line 28

How might I go about fixing it?

said on 27.08.2009 at 10.26 · Permalink · Ответить

Looks like you are using outdated WordPress version. You should update it to at least 2.8.0 to use this plugin. And I think you should do the upgrade, because there are many known security holes in old version, and your blog could be hacked by someone.

said on 31.08.2009 at 4.44 · Permalink · Ответить

I’m using this plugin in all of my websites.. The beauty is this will decrease down the ad blindness and users tends to click more on ads..More over other benifit is I can keep track of CTR and check which ad is performing well and remove the non performer..
My Kudos to this pligin

Dave @
said on 23.09.2009 at 14.46 · Permalink · Ответить

I installed this plugin this morning because I was being prompted to upgrade from the old Ad Rotator plugin at http://blog.taragana.com/index.php/archive/wordpress-plugin-adrotator-rotate-your-ads-including-adsense-dynamically/
This plugin appears to do exactly what that one had done. The only difference between the two is that this one works in a widget whereas the old one worked with a template tag. I had gotten around the template tag issue when widgets were introduced by writing my own widget for the old plugin so I essentially had the same functionality on my website before I installed this one. And I have not had to update it for different Wordpress versions (while this one seems to need updating occasionally). I’ll use this one for a while to see if there’s any real benefit to it but will probably switch back after a while.

And FYI – if you’re running the old version and want to keep it without getting prompted to upgrade to this one simply change the filename of the old one.

said on 11.10.2009 at 19.33 · Permalink · Ответить

Having two plugins with the same name is bad enough, but making one rewriting over the other is very ugly thing in life. Having to redownload and reinstall the old one just because you thing widgets are nice is not appreciated.

said on 07.11.2009 at 19.40 · Permalink · Ответить

[...] you find another theme that doesn’t include adsense, I’d recommend checking out the Ad Rotator. I haven’t tried it out, but it is supposed to be able to include ads into any WordPress [...]

Post a comment

You can use simple HTML-formatting tags (like <a>, <strong>, <em>, <ul>, <blockquote>, and other). To format your code sample use [cc lang="php"]$a = "hello";[/cc] (allowed languages are ruby, php, yaml, html, csharp, javascript). Also you can use [cc][/cc] block and its syntax would not be highlighted.

Отправить комментарий