Hello,
WP-addpub is a very simple plugin that let’s you upload your banners or your html and javascript code to your blog. Can be used, also, for any kind of script (google adsense, paypal donate, youtube video…)
The advantages of this plugin:
* Enabling and disabling the banner
* Display banners in different areas.
* Ability to display a banner depending on any special field (category, tag,…).
* Ability to display a banner depending on the language using the field filter.
* Ability to add/edit a script banner ( since 1.2).
* Ability to display a random banner ( since 1.2.1).
Requires WordPress Version: 2.3 or higher
Installation:
1. Unzip the file and place the folder wp-addpub in the directory plugins wordpress \ wp-content \ plugins
2. Activate the plug wp-addpub
3. Go on the management of banners in the Options> WP-Addpub
Screenshot :
How-to use:
Add the following line in your theme:
-
<?php wp_addpub ( "bannerID=1" ) ; ?>
The parameter of the function is a string that contains variables:
* bannerID : Id of the banner
* zone: a text field that can be used to identify an area of your page (eg sidebar,… footer)
* filter: a text field that can be used as a criterion for display (ie value: French, English or Category1, Category2…)
* random : display a random banner (random=true) (since version 1.2.1)
These variables can be used separately or together (example: “zone=sidebar&filter=EN”)
Changelog 1.2.5:
[+] add CDATA to javascript code to ignore by the validator (Thanks to by Jorge)
[+] add the full url to swfobject (Thanks to Jorge)
[+] add width to the banner type input
[-] bug fixed : when updating a banner without uploading a new file, it changes to html code.
Changelog 1.2.4:
[+] code optimization
[-] bug : user level access set to 8 (Thanks to Lars Schenk)
[-] bug : error when adding a html banner (Thanks to inklude)
Changelog 1.2.3:
[-] bug div id when displaying many swf in the same page.
[+] show error if cannot upload the file
Changelog 1.2.2:
[-] bug ie7 resolved. Thanks to Tony V
Changelog 1.2.1:
[+] Display a random banner using random argument. e.g. : wp_addpub (“zone=sidebar&random=true”);
Changelog 1.2:
[+] Accept a script as a banner
[+] Check if there is a new version of the plugin
[-] Correct bug : Edit banner
Changelog 1.1:
[+] add new file “swfload.swf” => enable to click an swf banner
[-] BUG Display flash
[-] Change varchar(255) to TEXT
Download the current version from wordpress.org plugin directory:














#1 by Jorge on 14 July 2009 - 21 h 27 min
Quote
Hi,
We have found a possible solution. Thanks to Linda Sung that helped me with the code. Changed 2 lines in wp-addpub.php to add the banner ID to the div ID this way:
line 191 changed to
[code]echo 'ID.'">';[/code]
And on the SWFObject call in line 197 added the same info so it now looks like this:
[code]so.write(\"wp-banner_div-".$Recordset[0]->ID."\");[/code]
I have tested and seems to be working fine. Please let me know if this works for you too.
Jorge.
#2 by admin on 14 July 2009 - 20 h 45 min
Quote
Hello,
This is the same problem that was reported by Jorge (see http://www.wareteam.com/wp-addpub-banners-management-wordpress-plugin/en/#comment-275 ). I’ll figure this out this week.
I’ll keep you posted
#3 by Juan Pablo on 14 July 2009 - 20 h 12 min
Quote
hi again! yes, it’s me again!
well, can’t say nothing about the last answer you gave me, it was very useful! but i have another problem now!
i beg for a solution cause i’m trying to understand the plugin but i don’t get it… the problem is that when i upload a banner in flash (swf file) it works perfect, but when i upload 2 banners in flash, only shows one!
look,
http://www.plan-b.cl/wordpress/
in the bottom, there is only one banner, and should be two banners… why does that happens!
plz heeeeelp! SOS!
#4 by admin on 10 July 2009 - 17 h 24 min
Quote
You’re welcome
#5 by Juan Pablo on 10 July 2009 - 15 h 08 min
Quote
oh! thanks! so simple as call the swfobject.js … can’t say nothing but thanks!
thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks thanks
#6 by admin on 10 July 2009 - 9 h 50 min
Quote
Hi Jorge,
Thank you for reporting this problem. I’ll figure it out.
I’ll keep you posted.
#7 by admin on 10 July 2009 - 9 h 38 min
Quote
Hi Juan,
you don’t have any js loaded in the head. try to put wp_head(); before the end of the head < / head>
Thanks
#8 by Juan Pablo on 10 July 2009 - 0 h 14 min
Quote
hi, first of all, thanks a lot for this great plugin, great idea cause it follows the K.I.S.S. rule (keep it simple stupid XD)
but! there is a always a but!
every time i try to upload an image file, there is not problem, but when i get to upload a swf file, it doesn’t show on the page, i’m using the plugin to show banners in a template page.
(and so, using this method: “” to place a banner)
there is no problem with the gif, png, jpg banners, but when i get to swf, it’s not showing… what could it be?
(this is the page: http://www.plan-b.cl/wordpress/ notice the empty area in the bottom, there should be a .swf banner there)
well, nothing else, and thanks again for this great plugin!
#9 by Jorge on 9 July 2009 - 23 h 04 min
Quote
some of the comment didn’t go through but to keep it simple, the plugin is adding a div tag with the same wp-banner_div ID. IDs as you know are meant to be unique and since there are more that one div with the same ID the SWFObject is not placing the .swf files correctly.
#10 by Jorge on 9 July 2009 - 3 h 51 min
Quote
Hi,
This is by far the most simple yet versatile Advertising plugin for WP I have found. I’m kind of lazy though so please let me know if there is something better
Yet, I think I have found a little bug on the plugin. When the plugin adds a banner, regardless of how many ads are on the page, it will always put markup to place its content. As you can see it is using the same ID for all of them. Not a big deal until you need to refer to one of them with javascript or any other DOM related stuff… such as SWFObject! Yes, I need to put 2 flash banners on the same page and the SWFObject replaces the first wp-banner_div regardless of the zone, ID, filters or whatever setting you are using.
I’ll try to find a solution for this but I’m pretty new to plugin coding so I will probably end up ruining the plugin. LEt me know if there is a fix coming up.
#11 by admin on 24 June 2009 - 11 h 37 min
Quote
Hi videodro,
Sorry, this plugin can’t do that.
Thanx
#12 by admin on 23 June 2009 - 8 h 30 min
Quote
Hello Sammy,
You can put the banners into a DIV then add a style margin:0 auto; and a fixed width.
#13 by videodro on 23 June 2009 - 3 h 40 min
Quote
i’m not really sure what this plug-in does ? but i’m looking to add my logo in all video that i post on my website i’ve included a link for an example ; http://www.worldstarhiphop.com/videos/video.php?v=wshhsdo4cz87O2nxHf6l
this video is not the websites own but they have thier logo on the player. is this what this plug-in does ?
#14 by sammy edwards on 22 June 2009 - 20 h 44 min
Quote
thank you for such a great plugin. I would like to centre the banners on my page any ideas of how to edit my index.php to achieve this?
#15 by admin on 21 June 2009 - 16 h 31 min
Quote
You’re welcome
#16 by baron on 21 June 2009 - 16 h 08 min
Quote
Works great, thank you
#17 by Tony V on 11 April 2009 - 22 h 36 min
Quote
Works fantastically Admin!
Thank you very much for the update.
And thank you very much for the great plugin.
Tony V
#18 by admin on 11 April 2009 - 18 h 52 min
Quote
Hi Tony,
Can you try the new version 1.2.2 please, and tell me if it works in IE7 ?
Thank you
#19 by Tony V on 3 April 2009 - 15 h 42 min
Quote
Thanks admin,
any chance you were able to reproduce this issue yet?
and maybe a fix? Getting ready to open up a service which will be in high need of this plugin.
thanks again for your time.
Tony V
#20 by admin on 2 April 2009 - 7 h 59 min
Quote
Hi,
I’m trynna reproduce theses bugs.
I will keep you posted.
Thanks
#21 by Tony V on 1 April 2009 - 21 h 39 min
Quote
forgot to mention that I installed this in wp 2.7
#22 by Tony V on 1 April 2009 - 21 h 38 min
Quote
Hi,
installed the plugin wp-contents/plugins as recommended.
works great in Firefox.
but has issues in IE7
in IE7 when I choose html option it closes up the browse option but does not provide a text area to imput the html. I have to click on add first, leave the page and come back then click on edit the new banner in order to see a text erea to add the html code in.
Any chance you are aware of this? Any chance you have an easy fix for this?
thanks for your time.
thanks for an otherwise great plugin
#23 by RaiulBaztepo on 29 March 2009 - 0 h 29 min
Quote
Hello!
Very Interesting post! Thank you for such interesting resource!
PS: Sorry for my bad english, I’v just started to learn this language
See you!
Your, Raiul Baztepo
#24 by KING_Hack on 25 March 2009 - 9 h 52 min
Quote
The plugin is incompatible with explorer
I have tested banner in flash on exlorer 6 and 7.
I have recived error message:
“Internet Explorer cannot open the internet site http://...
Operation Aborted”
…and the site is blocked.
I have edited wp-addpub.php on line:
from (line 99)
echo ”
var so = new SWFObject(…
so.write(\”wp-banner_div\”);
“;
to:
echo ”
window.addEvent(‘domready’, function(){
var so = new SWFObject(…
so.write(\”wp-banner_div\”);
});
“;
I not see flash banner but the site is not blocked.
I suppose this is bug.
How resolved this situation? Have you any suggestion?
Bye
#25 by admin on 14 March 2009 - 9 h 33 min
Quote
Yes, you should reload the banner because you’ve changed the content of the html code.
#26 by KING_Hack on 14 March 2009 - 9 h 18 min
Quote
Thanks you admin
..but if I re-edit flash banner because i would change his link/title when i saved my mod the type of banner changed from swf to code and I don’t visualize it on my blog.
If i see propriety of this banner the code field’s is empty.
I have this problem only flash banner.
It’s only my problem?
I have to reload the banner?
Do you think this is the only solution?
I’m sorry for too many questions
#27 by admin on 14 March 2009 - 8 h 36 min
Quote
Hi,
if you want to add a swf banner, you should upload it as a file and the plugin will display automatically via swfobject. Html code can be used to display a html or a javascript code like adding google adsense code…
I hope it can help you.
#28 by KING_Hack on 13 March 2009 - 17 h 30 min
Quote
I have a truble.
I add new banner then upload flash file and active this. Ok
When I edit this banner and I save it then type change from swf to code but the code is html for image tag and not for flash object.
There is any solution for this?
PS: sorry for my english
#29 by Juan K on 21 February 2009 - 4 h 13 min
Quote
Thanks So much, it works perfectly!
#30 by admin on 20 February 2009 - 22 h 53 min
Quote
Hi,
You’re right. The explanation wasn’t clear enough
You can add the line in the file where you want to place the banner.
e.g. : if you want to place the banner in your sidebar below the categories menu, you have to find the categories block (div) in the sidebar.php and add the line just after.
You can use the theme editor of wordpress to edit the file sidebar.php.
i hope it helps you. Don’t hesitate to ask me if you couldn’t find it out.
#31 by Juan K on 20 February 2009 - 20 h 40 min
Quote
Hi
I know Im going to sound like a complete idiot but on the How to Use Instructions: When you say: “Add the following line in your theme:
1.
”
Do you mean 1)add that line to any file on my theme? 2)add that line to the files on my theme were i will use the plug in? or 3) Is there an specific file called “theme” That I need to add this line to?
Sorry for the stupid question but I don’t have to much experience as Im sure you can tell
Thank you
#32 by admin on 25 November 2008 - 16 h 44 min
Quote
You are welcome.
#33 by bimz on 25 November 2008 - 15 h 59 min
Quote
Hello,
Thanks for your reply. Well, I managed to solve the problem, which is.. uh.. a really stupid mistake on my part. I actually edited the wrong file. And that explains why the main banner isn’t shown while sidebar are shown perfectly. This plugin itself works really well!
Thanks for your support and sorry for bothering you.. -__-;
#34 by admin on 25 November 2008 - 11 h 35 min
Quote
Hello,
First, make sure that your banners are activated.
If you want to display 2 different banners in the same page. you should use different zones or filter.
The banner must have a unique (zone + filter) data
eg:
wp_addpub(“zone=content”)
wp_addpub(“zone=sidebar”)
OR
wp_addpub(“zone=the-zone&filter=content”)
wp_addpub(“zone=the-zone&filter=sidebar”)
Let me know, if it works
#35 by bimz on 25 November 2008 - 11 h 15 min
Quote
Hello,
first of all, thank you for the plugin!
However, I have a problem in putting more than 1 banner ‘group’ in a page. For example I want to display 2 banners, one in my sidebar, and one in my main content. I put the required code “wp_addpub(‘zone=the-zone’)” in both the sidebar and main content area, but only the sidebar banners being shown. Is there a limitation for one function usage in a page, or is there something’s wrong in my part?
Thank you.
#36 by admin on 22 November 2008 - 13 h 42 min
Quote
The version 1.2 is available for download now.
Now, You can add a javascript or html code as a banner.
Do not hesitate to contact me if you have any further questions.
Pingback: WordPress Plugins Database » Plugin Details » wp-addpub
#37 by admin on 21 November 2008 - 9 h 55 min
Quote
Hi,
The actual version cannot manage a rotation of banners. However, it’s a good feature that can be implemented in the v1.3.
The 1.2 will accept html and javascript codes as a banner, so you will be able to add a script that rotate your banners.
The 1.2 is coming soon.
#38 by admin on 21 November 2008 - 9 h 47 min
Quote
Hi,
Sorry, the actual version of wp-addpub can’t manage a rotation of banners. However, its’a an amazing features that ca
#39 by Chris on 20 November 2008 - 20 h 57 min
Quote
How do i display different banners in the same area?
example: i want have 10 728×90 banners to rotate through the header… how do i code that? thanks!
#40 by admin on 11 November 2008 - 10 h 50 min
Quote
Hi,
To update my last comment. Now you are able to link a flash banner to a corresponding website that you specified in the “link” field.
Thanks
#41 by admin on 20 June 2008 - 12 h 38 min
Quote
Hello,
You can use the field “filter” to customize the banner that you want to display.
eg: if you want to display one different banner per category, you can put the id of the category in this field and then you put the following lines in your sidebar for example:
$catid = get_the_category(); // get the ID of the category
wp_addpub(”filter=”.$catid[0]->term_id); // show banner that has filter equal to the cat id
For your other question about url link. if you are using a swf file as a banner, it’s not possible in this version. You should modify your flash if you can.
I’m looking for the solution & it should be available in the next version.
Best regards
#42 by Michelle Rodriguez on 20 June 2008 - 10 h 51 min
Quote
I was able to get a banner in my sidebar without a problem, but it does not link to the corresponding website that I entered in the “link” field in the edit banner menu. Also, what do I put in the “filter” field in the edit banner menu.
Many thanks for the great plug in!!!
#43 by juan on 13 April 2008 - 18 h 30 min
Quote
Hello, something like for all banners, not whith ID
#44 by admin on 9 April 2008 - 14 h 22 min
Quote
Hello,
You can put a single code for all banners. You need to specify a filter when adding a banner.
best regards
#45 by juan on 8 April 2008 - 15 h 55 min
Quote
Great! this plugin its perfect for me!
Can i put a single code line for all banners?
and show something like ul – li banner#1 /li – li banner#2 /li /ul ?
Pingback: Wp Wordpress » Blog Archive » wp-addpub
Pingback: FEED.NIO.NAME » wp-addpub
#46 by admin on 5 February 2008 - 11 h 21 min
Quote
Hello,
The function wp_register_script is not integrated in wordpress v2.0.
Try to modify the function load_swfobject() line 41 in the file /wp-content/plugins/wp-addpub/wp-addpub.php by the following code :
function load_swfobject() {
echo "\n".'<!-- Start Of Script Generated By wp-addpub 1.0 -->'."\n";
echo "<script type='text/javascript' src='".get_bloginfo('siteurl')."/wp-content/plugins/wp-addpub/swfobject.js?ver=6124'></script>";
echo '<!-- End Of Script Generated By wp-addpub 1.0 -->'."\n";
}
Hope that you upgrade your blog
#47 by David MEKERSA on 5 February 2008 - 10 h 28 min
Quote
Hi, I managed to install the plugin under my Wordpress 2.0, the admin page is working well but my blog crach… error call function register blabla