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 Didikajah on 26 October 2009 - 9 h 59 min
Quote
i want to show the 3 banners with that code, is there any mistake?
#2 by admin on 26 October 2009 - 9 h 52 min
Quote
Can you please put here your code for the three banners ?
#3 by Didikajah on 26 October 2009 - 9 h 49 min
Quote
i use the latest version, from the link to wordpress above… but my wp is 2.8.2
#4 by admin on 26 October 2009 - 9 h 40 min
Quote
Hello,
What version of wp-addpub you have ?
The bug was reloved in 1.2.3
Thx
#5 by Didikajah on 26 October 2009 - 9 h 35 min
Quote
how to show a php code in comment?
i’ll write without php tag
wp_addpub(“filter=banner”)
#6 by Didikajah on 26 October 2009 - 9 h 33 min
Quote
here is the code
#7 by Didikajah on 26 October 2009 - 9 h 32 min
Quote
hi, i’ve put the code to display 3 banners in my header. but unfortunately it only show 1 banner. what’s the mistake???
thx
#8 by igor on 6 October 2009 - 21 h 30 min
Quote
ou, I know what problem is it. Plugin don’t supports non latin in tatles
#9 by igor on 6 October 2009 - 20 h 35 min
Quote
when I download banner – Banner was added successfully. But in fields – no banners found. On local with same theme plugin works good. I look on server and saw that images load successfully. Why banners don’t show in admin panel?
#10 by Magnus Olander on 14 September 2009 - 8 h 25 min
Quote
This is a great plugin and it works very good. But unfortunatly there is no ALT-attribute in the [img] tag when you upload a banner and alt-attribute is required in HTML/XHTML. Could you please just add a alt=”" to the IMG-tag created by the plugin. That way it won’t break my pages.
Functionality request- would it be possible to get banner images from the media archive/store the uploaded banners in the media archive?
Thanks a lot for a great plugin!
#11 by admin on 3 September 2009 - 18 h 22 min
Quote
Thank you very much. The tracking will be included soon in the next version.
#12 by bj on 3 September 2009 - 14 h 11 min
Quote
This works a treat, is easy to set up and use, and is pretty flexible. Thank you so much!
The only improvements I can envision would be some sort of tracking, and maybe widgets for the different zones, if that’s possible. Tracking would be especially helpful.
#13 by Nancy on 22 August 2009 - 14 h 31 min
Quote
Sorry not sure how to post code.
#14 by Nancy on 22 August 2009 - 14 h 25 min
Quote
Hello,
I am using your plugin and it’s great except for one thing. I have two banners set up in the sidebar and they are appearing randomly. The part that I can’t get to work is the field. When I switch between English and French I want only banners specific to the language to appear, but that part is not working.
Below is the code that I have set up:
When I use the wordpress admin for the plugin and specify the field to be english or french it doesn’t work.
I’ve tried different variations with no luck (e.g. en, English, en_EN, en_US).
Is there a solution?
Thanks!
#15 by Stanley on 20 August 2009 - 14 h 14 min
Quote
Hi,
can you give me a sample how I can filter for some Tags?!
*Sorry for my english!
Stanley
#16 by Alex on 15 August 2009 - 17 h 10 min
Quote
Hi wareteam, nice job but without tracking there is no point in managing banners.
I´ve been searching for 3 days for a plugin which cover this requirements: easy flash banners integration, tracking, rotation and banner locations. But no luck. This one looks great when tracking is solved.
Muchas Gracias!
#17 by admin on 15 August 2009 - 12 h 24 min
Quote
Hi dede,
Thank you very much, I really appreciate any kind of suggestion. Your ideas are welcome.
The stats system is a very interesting feature that i hope will be part of the next version (major version 2.0)
I’ll keep posted.
#18 by dede on 13 August 2009 - 19 h 16 min
Quote
hello,
i really love this plugins, but can i suggest for next release? can you make the tracker too, so how many times that banner shows and how many clicks that banner clicked by user.
thx
#19 by admin on 1 August 2009 - 10 h 37 min
Quote
Hello iva,
Try to update the plugin to 1.2.5 and put the code to the file footer.php regarding to the zone you’ve mentionned.
< ?php wp_addpub('bannerID=1');?>
or the following code is recommended because the ID is unique and can’t be changed if you remove it so you have to change the code in the theme again.
< ?php wp_addpub('zone=footer');?>
#20 by admin on 1 August 2009 - 10 h 30 min
Quote
Hello Jorge,
Thank you very much. I’ve just commited a new version.
changelog 1.2.5: http://wordpress.org/extend/plugins/wp-addpub/changelog/
Waiting for your feedback.
#21 by iva on 1 August 2009 - 6 h 33 min
Quote
Hellou,
Can you help me? In witch php file for theme do I need to put
I put in index.php , zone :footer, ID is 1 but it didn´t show.
Banner is swf file, and it is activated.
#22 by admin on 31 July 2009 - 16 h 59 min
Quote
Hi Jorge,
Sorry, it’s not included yet. I’ll commit that in a new version this weekend.
I’ll keep you posted.
#23 by Jorge on 31 July 2009 - 16 h 36 min
Quote
Hi,
Before updating I’d like to know…
Is this new version including the CDATA tag to make it valid? I made that adjustment on my local copy of the plugin as I mentioned a couple of weeks ago. Also I mentioned here that there is a problem with the SWF banner deployment depending on your permalink structure so I also added a get_bloginfo(’url’) to solve that. Is this also included in the new version?
Thanks.
#24 by admin on 31 July 2009 - 10 h 14 min
Quote
Another bug reported by “inklude” http://wordpress.org/support/topic/283778?replies=4
Changelog 1.2.4:
[+] code optimization
[-] bug : user level access set to 8 (Thanks to Lars)
[-] bug : error when adding a html banner (Thanks to inklude)
#25 by admin on 31 July 2009 - 9 h 18 min
Quote
Hello Lars,
Thank you very much for reporting this bug. I’ve just commited the plugin.
Changelog 1.2.4:
+ Code optimization (select only the active banners)
- bug: user level access set to 8 ( http://codex.wordpress.org/User_Levels#User_Level_8)
Thanks
#26 by Lars Schenk on 30 July 2009 - 16 h 28 min
Quote
Some may also change the user_access_level from 1 to a higher level. This will prevent “normal” users to see and access the backend page.
Change in wp-addpub.php
add_submenu_page(‘options-general.php’, ‘WP Addpub’, ‘WP AddPub’, 8, __FILE__, ‘wp_addpub_page’);
#27 by Juan Pablo on 23 July 2009 - 15 h 35 min
Quote
Hi,
i need to make that when i upload a banner of certain dimensions, the plugin resize that banner automatically. exmpl: if i have a banner of 123×12 the plugin resize it to 230×84px… i have tried with CSS but it doesn’t work…
please,
and thanks again for this great plugin!
greetings.
#28 by Lars Schenk on 23 July 2009 - 11 h 16 min
Quote
Please change the following line in function
function wp_addpub($args = “”)
from
$sql = ‘SELECT * FROM ‘.$table_banners.’ WHERE ‘.$WHERE.’ ‘.$ORDERBY.’ LIMIT 1;’;
to
$sql = ‘SELECT * FROM ‘.$table_banners.’ WHERE ‘.$WHERE.’ AND ACTIVE=\’1\’ ‘.$ORDERBY.’ LIMIT 1;’;
This will allow to select only active adds. Otherwide deactivated adds will prevent other active adds to be shown. Thanks.
#29 by admin on 21 July 2009 - 11 h 07 min
Quote
You should have many banners. Probably with only 2 or 3 it appears with the same ID. (try to refresh the page many times)
#30 by Gilberto on 21 July 2009 - 10 h 37 min
Quote
Hi, I have tried the random function and it changed once, then the same banner always appeared… I don’t understand.
Thanks for your help.
I just discovered that script seems to block the Flash banner own LINK, even if I don’t use any link in the database.
#31 by admin on 21 July 2009 - 10 h 03 min
Quote
Hello,
Actually, you can do that. you can rotate all banners using random=true and if you use it with the field zone or/and filter you can display a random banner by categories or/and zone
e.g.:
< ?php wp_addpub("random=true&zone=sidebar"); ?> or < ?php $catid = get_the_category(); // get the ID of the category // show a random banner that has filter equal to the cat id and the zone is equal to sidebar wp_addpub('random=true&zone=sidebar&filter='.$catid[0]->term_id); ?>Thanks
#32 by Gilberto on 21 July 2009 - 9 h 44 min
Quote
Sorry, The line was not show in my last message… so here it is…
[php $a=array( '8', '9'); wp_addpub ( "bannerID=" . $a[array_rand($a)] ); /php]
#33 by Gilberto on 21 July 2009 - 9 h 43 min
Quote
I have a simple solution for rotating the banners…
And I just replaced the line with this code:
It will random show any of these bannerId’s, just remember to create the array with the bannerid that correspond to the zone you are using the banner.
Hope it could help, while we wait for version 1.3
#34 by Jorge on 19 July 2009 - 18 h 16 min
Quote
Ok, I can’t make it work with the PRE tags but on line 224 the ALT tag needs to be added aswell. I have it now like:
alt=’ad space’
But a variable can be added there too.
#35 by Jorge on 19 July 2009 - 16 h 36 min
Quote
I thought by using PRE tags… let me try again:
echo ”
//ID.”\”);
// ]]>
“;
#36 by Jorge on 19 July 2009 - 16 h 32 min
Quote
After the last modification were I included the blog URL to call absolutely the swf I was able to see the banners on deeper folders with my permalink structure. However, the code that calls the swf won’t pass the w3c validation. So I added CDATA tag online 97 and 101 like this:
echo ”
//file_url).”&href=”.urlencode($Recordset[0]->file_link).”&target=”.$Recordset[0]->target.”\”, \”".addslashes($Recordset[0]->title).”\”, \”".$Recordset[0]->width.”\”, \”".$Recordset[0]->height.”\”, \”".$Recordset[0]->version.”\”);
so.write(\”wp-banner_div_”.$Recordset[0]->ID.”\”);
// ]]>”;
#37 by Carol on 18 July 2009 - 4 h 21 min
Quote
I need more specific instructions for how to show a different banner in the sidebar of each category.
When I’m adding a new banner, for “zone” would I put “sidebar” (without quotes, of course) and do I specify right or left? Does it really matter since I am inserting the code there myself? And how do I word “filter”? … “cat=red widgets” or “category=red widgets” or “$catid = getthecategory();”???
Then if I have 10 categories, do I put 10 lines of code into the sidebar template? What wording to I use to specify the categories there?
Thanks for any help you can provide. I really want to get this working.
#38 by Clayton on 17 July 2009 - 18 h 27 min
Quote
Polls
<?php mw_recent_comments(7, false, 38, 20, 40, ‘all’, ‘%author_name% – %title%‘,’d.m.y, H:i’); ?>
#39 by Clayton on 17 July 2009 - 17 h 49 min
Quote
I hope you can delete these comments that are not working for me. The bottom line is that my sidebar code now has li and ul tags for the other items. when I put in the one line of code as per the installation instruction above into the sidebar.php file, nothing happens so I am wondering if I should add div tags etc?
#40 by Clayton on 17 July 2009 - 17 h 46 min
Quote
I have read and tried the related info in the above comments but because I have a customised template I think something may be different as the following code in my sidebar does not work. A number of other configurations with ul and li tags does not work for me either. When I install wp-addpub-banners, is there related code in functions or something? If there is, I will go there and check to see if it exists.
Polls
<?php mw_recent_comments(7, false, 38, 20, 40, ‘all’, ‘%author_name% – %title%‘,’d.m.y, H:i’); ?>
#41 by admin on 17 July 2009 - 17 h 14 min
Quote
it works
#42 by admin on 17 July 2009 - 17 h 14 min
Quote
Test :
#43 by admin on 17 July 2009 - 17 h 13 min
Quote
Hi,
You can add your code with a pre or code tags
< pre> your code < / pre>
pre without spaces
#44 by Clayton on 17 July 2009 - 16 h 43 min
Quote
sorry – how do i add code to a comment?
#45 by Clayton on 17 July 2009 - 16 h 41 min
Quote
I have read and tried the related info in the above comments but because I have a customised template I think something may be different as the following code in my sidebar does not work. A number of other configurations with ul and li tags does not work for me either. I may be missing something in functions????
<?php mw_recent_comments(7, false, 38, 20, 40, ‘all’, ‘%author_name% – %title%‘,’d.m.y, H:i’); ?>
#46 by Jorge on 17 July 2009 - 0 h 00 min
Quote
Feel free to check your plugin making it happen on http://wearetrends.com
I’m almost finished with it!
#47 by Jorge on 16 July 2009 - 23 h 58 min
Quote
Hi,
Thanks for the update. I think I found another glitch. Depending on your permalinks structure your flash ads wont show on the deeper folders. I changed a line (line 98 on wp-addpub.php) to include the absolute path to the url from this:
var so = new SWFObject(\”wp-content/…..
to this:
var so = new SWFObject(\”".get_bloginfo(‘url’).”/wp-content/…..
it worked for me
#48 by admin on 15 July 2009 - 12 h 02 min
Quote
Dear Jorge and Juan,
I fixed the issue and updated the plugin
You can download the new version from :
http://wordpress.org/extend/plugins/wp-addpub/
see the changelog :
http://wordpress.org/extend/plugins/wp-addpub/changelog/
Thank you very much for you help.
#49 by admin on 14 July 2009 - 22 h 07 min
Quote
Don’t let it bother you
the problem was already solved in my local copy. i’ll commit that tomorrow.
I’ll keep you informed when it’s done. Thank you.
#50 by Jorge on 14 July 2009 - 21 h 28 min
Quote
Ok… I could fix that but I’m not able to write a simple post with code in it… same on me! How do we include HTML and PHP code here?