WordPress Widgets: Ad Rotator

May 01
2006 15:16 (WordPress) · English (44,446 views)

Компания Automattic выпустила отличный плагин для Wordpress — WordPress Widgets, который может быть использован для настройки Вашего блога без знания HTML. Вам вообще не нужно редактировать Вашу тему Wordpress! Просто выберите необходимый виджет и перетяните его на боковую панель. Уже существует множество виджетов, созданных разными разработчиками, которые Вы можете использовать в своем блоге.

У меня не получилось найти виджет, который бы брал несколько кусков HTML-кода и отображал один из них на боковой панели, потому я решил написать свой. Вы можете скачать плагин Ad Rotator, распаковать архив, скопировать adrotator.php в каталог BLOG_DIR/wp-content/plugins/widgets/ и активировать его на странице Плагины.

Вы можете увидеть пример на этом блоге: несколько моих любимых книг с сайта Amazon выводятся в боковой панели, для каждого запроса отображается одна книга.

Окно редактирования выглядит следующим образом:

Окно редактирования Ad Rotator

Вы можете ввести заголовок Вашего виджета и HTML-код. Куски кода разделяются с помощью конструкции <--more-->.

Загрузка

Вы всегда можете загрузить последнюю версию плагина здесь.

46 отзывов на 'WordPress Widgets: Ad Rotator'

Подписаться на комментарии по RSS или TrackBack на 'WordPress Widgets: Ad Rotator'.

1
сказал 01.05.2006 в 22.06

[...] This widget was built with advertisements in mind but it looks like you can use it to rotate any sort of HTML. Quotes, photos, sponsor badges, you name it. [...]

2
сказал 02.05.2006 в 1.39

[...] This Ad Rotator Widget, by Dmytro Shteflyuk, is a simple and useful extension to the text widget. [...]

3
сказал 12.05.2006 в 11.15

[...] Dmytro Shteflyuk’s Home » Blog Archive » WordPress Widgets: Ad Rotator “I failed to find widget which can get several chunks of HTML code and show one of them on sidebar therefor I decided to create it myself” (tags: rotator plugin wordpress widgets) [...]

4
сказал 16.05.2006 в 1.18

[...] Dmytro Shteflyuk’s Home » Blog Archive » WordPress Widgets: Ad Rotator “I failed to find widget which can get several chunks of HTML code and show one of them on sidebar therefor I decided to create it myself” (tags: rotator plugin wordpress widgets) [...]

5
Totem
сказал 06.06.2006 в 19.21

I think after installing the widget you should explain how else to go forward as there is no documentation after that.

I installed the widget and activated it in WP and there is no title nor link where i can add banners and such.

6
сказал 08.06.2006 в 16.15

hey there, great plugin! it works great. quick question though. i’d like to run multiple of this widget simultaneiously, but when i rename the widget, upload, and activate it, i get a “can’t redeclare” error in php.

is there any way to run a few of these at the same time???

thanks!
mark

7
сказал 08.06.2006 в 16.23

nevermind my moronic question, just saw at the bottom of the page the “how many ad rotator widgets do you want?” question.

sorry..

8
сказал 14.06.2006 в 8.13

Totem: Do you have the WordPress Widgets plugin installed? Ad Rotator is a widget for this plugin and it can’t work without Wordpress Widgets.

When you have installed Ad Rotator you can see it in the list of available widgets. Just drag and drop it to your sidebar and enter ads. Pretty simple, isn’t it?

9
сказал 18.07.2006 в 0.46

Nice widget - and it works :)
The next step would be a “category sensitive” ad displa for the sidebar, so one could choose which ad(s) to display separately for each the category.
I think those Amazon links would do better if they’d they match the post’s category (i.e. books about programming in a blog category named Developement and Dilbert books in My Life ;) - yeah, that would be some great widget that I’d be willing to pay for as well ;)
Keep it up!

10
сказал 14.08.2006 в 4.49

[...] Ad-Rotator – If you have any ad banner (can be used for other things) – this should do just fine for you. If you have Google Adsense account, you can just post codes into Widgets text box.  [...]

11
сказал 14.08.2006 в 18.33

[...] Thinking of having different sorts of texts rotating on your sidebar? It’s not that difficult. Whether it’s a bunch of Amazon ads or whatever, you could use the Ad Rotator Widget for your blog. [...]

12
ewan
сказал 22.08.2006 в 11.52

Hello,

Fantastic little widget! Works very well.

I was just thinking, for ease of use is there anyway it could be set to link to and rotate a Wordpress post?

13
сказал 30.08.2006 в 5.44

[...] As you may have noticed I’ve installed a rotating blogads style advertisement on the sidebar of this website. It’s using Ad rotator on wordpress Widgets. [...]

14
сказал 31.08.2006 в 3.07

[...] Ad Rotator [...]

15
сказал 25.09.2006 в 13.48

Hello, ewan
Currenly it’s impossible, but no so hard to implement. If you need this futurem, I can help you

16
сказал 26.09.2006 в 14.16

[...] Ad Rotator Widget For those who are using the widgets plugin, you could try out the Ad Rotator widget. What it does is that it shows the possible ad codes you might have and they are shown randomly. Well, in case you have an Adsense account, you don’t really need to use the randomization feature of this plugin. The thing is that at least you could easily post the snippet of code on to your blog sidebar and voila! You have your ad on the sidebar. [...]

17
сказал 06.10.2006 в 17.01

отличный ротатор!

18
сказал 17.10.2006 в 10.29

This is a great tool. Thank you. Is it possible to turn off the randomization part of this widget, so that it displays blocks of text serially rather than randomly?

19
сказал 26.10.2006 в 19.25

Great plugin! I’d love to know if it could be modified to use in the body of the post.

20
Pete
сказал 03.12.2006 в 19.22

Fantastic widget! Works like a charm. Thank you very much! Bravo!!

21
сказал 08.12.2006 в 6.10

[...] Ad Rotator Widget : Simple way to create random advertisement on your widget enabled theme [...]

22
сказал 25.12.2006 в 1.19

Thanks for the simple, yet really useful widget. Keep up the good work.

23
сказал 28.12.2006 в 7.08

i’m using your widget/ plugin thank it works well. But i seem to be showing every ad at the same time? Even when i use the more tag? I thought it should rotate the ads? Am i doing it wrong?

24
сказал 12.01.2007 в 9.53

[...] Ad Rotator - For the rotating text messages on the sidebar. [...]

25
сказал 12.01.2007 в 11.12

Really like the concept behind this widget. Is there any reason why the amazon ads aren’t showing up in the box? All my other widgets work fine, but for some reason the amazon links for individual books won’t show in this widget or a regular php widget. Any chance there could be a conflict with my theme (anaconda) or another widget? Any help or suggestions would be appreciated. Thanks.

26
сказал 22.01.2007 в 6.29

[...] I started with the AdRotator widget. This little darling will rotate up to 9 chunks of code, which is perfect for what I wanted. Then the hacking, cursing, and pacing about asking the cat for advice started. [...]

27
сказал 24.01.2007 в 23.52

Hi, I have created my first widget, the Oddball Widget…
What does the Oddball Widget do?

The Oddball Widget will provide webmasters with easy to install, fresh daily content for FREE!

The Oddball Widget allows the webmaster to choose how many funny ebay auctions they wish to display in their sidebar. Oddball Auctions will update these auctions every day, so webmasters will have fresh, interesting content every time a viewer returns. Unlike most widgets and RSS feeds, this widget will not “steal” your viewers. If a viewer clicks on an interesting auction, a new window or tab will open, so you don’t lose your viewers! The auctions listed will not have any adult items, so this widget is suitable for any web site.

Additionally, if a webmaster has an ebay affiliate account, the widget allows them to enter their PID, and receive credit for 50% of the clicks from their site. Once someone clicks on an interesting auction, ebay places a 7-day cookie on their computer. So, if the viewer buys ANYTHING on ebay in the next 7 days, ebay pays a commission. For example, if one of your viewers clicks on “image of donald duck in a pancake”, then leaves ebay, then, the next day they buy a car from ebay, ebay pays a commission on the car!

So not only do you get free, daily content, but it can make money for you as well! If a webmaster just wants to display the free daily content without getting an ebay PID, that’s fine too. Want to sign up for a PID? Get one quickly here

This widget is fully stylable using CSS, so it will fit in perfectly with the look of your site.

The widget zip file consists of only 2 files, a brief readme.txt with installation instructions, and the widget itself. The widget should be installed in your /wp-content/plugins/widgets folder.

I was wondering if you’d like to add this widget to your site.

28
сказал 26.03.2007 в 6.23

So far so good. Nice plugin. Running 2.1.2.

29
сказал 08.04.2007 в 8.22

[...] time to time helps alleviate this issue. If you are using Wordpress widgets, you can try using the Ad-Rotator Plugin, which will help rotate your Google Ads [...]

30
сказал 15.04.2007 в 8.51

[...] of all, I installed the WordPress sidebar widget plugin to allow me to install the ad rotator plugin. This allows me to rotate two (or more, but for now, two) different ads along the sidebar [...]

31
сказал 21.05.2007 в 17.50

Hi, I added a simple bit of coding to make the super ad rotator take php (and java if it didn’t take that already it does now)

In the function widget_adrotator just before the place this code (note I am showing the existing ‘div’ bit below to make clear where to place the extra line)

<?php $chunks[$chunkno] = eval_html($chunks[$chunkno]);?>
<div class="adrotatorwidget"><?php echo $chunks[$chunkno] ?></div>

Now, at the very end of the php file copy paste this coding:

function eval_buffer($string) {
    ob_start();
    eval("$string[2];");
    $ret = ob_get_contents();
    ob_end_clean();
    return $ret;
}

function eval_html($string) {
    return preg_replace_callback("/(<\?php|<\?)(.*?)\?>/si",
"eval_buffer",$string);
}

And now it takes php as well..

If you like a similar function but just for anywhere in the body, I just finished programming a piece of code… it is slightly limited in that you can only use it in one location for now..

Leave a message here if you like to test it.

32
сказал 21.05.2007 в 18.14

Hello, thanks for suggestion.

If you don’t mind, I could integrate your code with the plugin and add some options (to render or not the div, to execute or not PHP code).

Of course, I would add “thanks” to the changelog along with the link to your site.

33
сказал 06.06.2007 в 16.45

Hi,

I have set up two adrotator widgets, one with linksynergy ads and one with amazon ads, however they are both displaying the linksynergy ads.

http://yellowmonkey.mintdesigns.co.uk

If you view source you can see it references adrotator-1 and adrotator-2.

If I swap the code around I just get the amazon ads.

At one point it was even displaying google ads (i am using adsense manager).

Please help.

34
stash
сказал 17.06.2007 в 15.17

I have a similar problem to the above user. I have used this widget on several blogs in the past and they all worked great, but now i have one new blog that i just built and it got set up with wordpress 2.2 and if i put in more than on instance of the rotator they will all show the same rotator.

is there something in w-p 2.2 that i can change to fix this?

for now im just going with one instance of this program running at a time

thanks if there are any options to fix this error

I LOVE THIS WIDGET and would love it on all my future blogs

thanks

35
сказал 19.06.2007 в 4.41

First of all, great plugin. I’m finding it very useful. However, I am running into the same problem that Steven seems to be having. I can only run one ad rotator at a time, because the second rotator simply reflects the same ads as the 1st rotator even with different chunks of html in them.

What would you suggest I look at?

36
сказал 02.07.2007 в 16.48

Hi all,
since I can’t remember what exactly I changed, but you can download the working version from my site.

http://www.jrbeltman.com/downloads/

Dmytro Shteflyuk I dont know m8 if you got my email a while ago with the updated code, but please post a later version here when ever it is ready. I dont like putting a link up on my site, but feel sorry for those having issues using your great plugin!

37
сказал 04.07.2007 в 7.26

Great plugin. Works well. Is there a way to run it in multiple rotator?

38
сказал 13.07.2007 в 19.18

Goe D
on the WP screen where you manage your widgets you can specify how many adrotators you like to use. Set that number and apply and new ad rotator widgets will show..

Download the adjusted version on my site as mentioned above for this to work on the latest WP versions

39
сказал 15.07.2007 в 3.34

Hey Jr ! I’ve been trying to get your version off your site, but I keep getting this same error when trying to download the file:
Fatal error: Call to undefined function: add_action() in /home/jrbeltma/public_html/downloads/ad_rotator_plugin.php on line 23
Is it just me or is the server down ?

40
сказал 25.08.2007 в 14.28

Hi there Alex,
I didn’t check if the latest version has been posted here, so if you do try taking the plugin from my site remember 2 things:

1. Right click and save target (or link) as….
and dont left click as it will try and execute the script :)
2. - http://www.jrbeltman.com/downloads/ad_rotator_plugin.php
is a plugin that can be placed anywhere on your site, but isn’t the widget as Dmytro programmed. It is very similar in what it does though. But again isn’t a widget for your sidebar
- http://www.jrbeltman.com/downloads/adrotator.php is the working version of Dmytro’s sidebar widget!

41
сказал 29.08.2007 в 6.37

[...] More Info5 easy steps: [...]

42
сказал 09.09.2007 в 10.26

Does it support rotation of Javascript?

43
сказал 14.09.2007 в 4.06

Hi..

Juist like to say I LOVE this versatile widget. THANK YOU!

I use it on my site to rotate album covers, giving a fresh look to the graphics on every visit. Superb!

Just one question…

Why the maximum of 9 rotators? Any way I can change something to make it higher (30?)? Or is there a Wordpress limitation?

44
сказал 08.10.2007 в 5.53

I have a modified version of adrotator allowing you to use ads with multi-line codes without having to convert them to single-line codes. Read about it here

45
сказал 14.11.2007 в 8.27

[...] Ad-Rotator – If you have any ad banners (can be used for other things) – this should do just fine for you. If you have a Google Adsense account, you can just post codes into Widgets text box.  [...]

46
сказал 18.04.2008 в 15.37

[...] the conditional tag. Be creative with it and use your imagination. Use a widget in your header to rotate ads, or have a login box widget in the footer, or wherever you want - it’s up to [...]

Оставить отзыв

Вы можете использовать простые теги форматирования HTML (вроде <a>, <ul> and others). Чтобы вставить пример код, используйте <code lang="php">$a = "hello";</code> (поддерживаемые языки: ruby, php, yaml, html, csharp, javascript). Также Вы можете использовать <code>$a = "hello";</code>, синтаксис не будет подсвечен. Если вы не хотите использовать тег <code>, замените символ < на &lt;.

Отправить

 
Copyright © 2005 - 2008, Dmytro Shteflyuk