Google Adsense Widget
Posted on Tuesday the 27th of June, 2006 at 1:56 am in Widget After 24 grueling hours slaving over a hot computer, I have completed the Max Adsense widget to make the process of adding ads easier than counting all the money you’re sure to reap. The widget is made is such a way that everything you can do in the Google Adsense control panel (except anything that requires being saved such as saving channels, pallets etc.) is built directly into the widget. It evens has a wonderful (if I do say so myself) color picker to make it even easier to design your ads and alows up to 4 widgets*. If the widget is popular I may even add a few more features such as a dynamic example ad etc. However, the widget does not make referral buttons, there are too many of each kind to add into one little widget.
Screen shot (click thumbnail to see larger image, although it is still scaled down):
![]()
All it requires is a Google Adsense account and the widgets plugin for wordpress.
To Install:
- Unzip max_ad.zip.
- Copy the two files in the max_ad folder into your plugins > widgets directory.
- Activate the widget in your control panel.
- The only thing else you need is your publisher id from google. It can be found in top line of any of your old Google ad codes and looks like pub-23456765434
Other than that most of it should be self explanatory. But feel free to ask any questions.
Download:Max Adsense
*Thanks to Otto for making his execphp widget which I heavily borrowed code from to allow multiple widgets.
Change log:
6/27/06: Fixed a bug where the javascript in multiple ad widgets would only effect the first widget.


hello,
I just had a look at your widget and it looks great. I am just curious if it would work in an wpmu environment. What is important to know is where and how it stores the settings, to know if it would store the settigns for each blog owner separately or not, it it would be possible to hardcode my own adsense ID into the script with a fixed rate, so that my adds would be displayed 20% the blog owners ads 805 of the time, as an example…
Reply to ovidiuI’ve never tested it in WPMU, but I’ve just read through MU’s code and I don’t see anything that would cause problems. I also know that this plugin has been suggested on the WPMU forums a few times.
Hard-coding your id is easy.
if(rand(4) == 4){$user_id = 'Your ID Here;}Just add that before echo $before_widget . $before_title . $title . $after_title;
Reply to AaronI tried this widget, but could not get it to work. It just leaves a blank space where the widget should be, but the title is not inserted and no ads appear. Any ideas?
Reply to Kenny PenningtonThere really hasn’t been any developement on this for almost a year now, so I’m not really sure of where it could be going wrong. I’ll try to get to it over this weekend.
Reply to Aarondownload link is broken
Reply to Chad RidenFixed.
Reply to AaronHi,
Reply to lampsieI to am seeing just blank entries after populating the configuration screen. I’m on wordpress 2.2 which ships with Widgets by default
Thx,
Lampsie
This may be a silly question, but I’m getting this error message when I try to launch the widget in WordPress:
Warning: include(../wp-content/plugins/widgets/max_adsense_options.php) [function.include]: failed to open stream: No such file or directory in /home/thesexys/public_html/wp-content/plugins/max_adsense.php on line 137
Warning: include() [function.include]: Failed opening ‘../wp-content/plugins/widgets/max_adsense_options.php’ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/thesexys/public_html/wp-content/plugins/max_adsense.php on line 137
Can anyone help?
Reply to SarahMake sure all riles in the zip were uploaded correctly; however , I’m not even sure if the plugin will still work as it hasn’t been updated or tested in over a year.
Reply to AaronHi Sarah,
I am having the same problem. Exactly same error.
If you find the solution please let me know by email.
Thanks
Reply to parimalhttp://healthlifestyleforever.com/blog
In the file “max_adsense.php” rename this:(“../wp-content/plugins/widgets/max_adsense_options.php”)
Reply to endymionto this:
(“../wp-content/plugins/max_ad/max_adsense_options.php”)
Hi!
Does your plugin support section targeting? I am currently using adsense deluxe, and even if I have the code for section targeting it doesn’t show relevant ads on my post. You can take a look at my site http://yuwoncedric.com
Reply to derekThanx Buddy This Remains Very helpful for me. http://www.funwithfriendz.com
Reply to AryanIt works like a charm. I was having problems with the size though
Reply to rahulhttp://www.fashionhub.co.nr
when i put my adsense widget up in blogger there is also a blank space that takes up the same amount of space the adsence panel would. but only on the side
Reply to MarcusCan’t seem to get the adsense blocking feature to work. My post are named by title, not ID post.
Tried to enter the test , but the adds still pop up on posts that I want to exclude. Can anyone help?
Reply to imanifest wealthJust a quick mention…your docs say to upload php files to your plugins/widgets directory. WP has a plugins but not a subdir of that to widgets. This is using WP 3.0.1RC but I didn’t see one in 2.9.2 either. Easy enough to edit the php file but you might just wanna change that out and save the user the trouble.
I’ll see if this works. Something tells me I gotta have more than a pub number but we’ll see.
Thanks by the way
Reply to RonRon
Hi Ron,
Glad you are trying to use my plugin, but it was written almost 3 years ago for WordPress 2.0, so it hasn’t worked in a long time.
I may look into reviving and revising it eventually, but I have other projects that are taking up my time.
Aa.
Reply to AaronActually, it was written 4 years ago in 2 weeks.
Reply to AaronLemme drop in another quick post…first read the earlier post about editting php before I posted min so, sorry but that’s the answer.
The blank page appearing after installing the the widget may be due to the Save Widget function in WP not saving all your info. If I edit, save, and enter the edit screen again, the only info I see is the selection I made for sidebar location. Nothing else seems to save. Additional info to conclude that it’s not saving is by my viewing the website from another browser and refreshing after saving widget. I note that even tough I chose a different size box, it seems to default back to another size. The widget would be ultra-cool if you can get that fixed. Many a WordPress user would be thankful for the time you save them having to attempt to insert html code on a php page. Here’s an idea, once it’s fixed, sell it to Google. They can’t seem to get past inserting code.!
Thanks again
Reply to RonRon
Get Google Adsense Account in Just 10$ (USA , Europe , Pakistan, India, Bangladesh , etc.
within 4 hours (Guaranted).
After approval i’ll send you Screen shot of your account and you can pay me to get your
account.
Reply to HafizPrice Negotiates For More than 1 Account.
Email: webdiziner01@gmail.com
Cell : +92 323-4208304
Thanks for the plugin.
Reply to Gurgaon