Back to vBulletin 3.7 Add-ons

AdSense for Mobile Content
Mod Version: 1.00, by WNxWakko

This modification is in the archives.
vB Version: 3.7.4 Rating: (2 votes - 3.00 average) Installs: 12
Released: 17 Nov 2008 Last Update: Never Downloads: 2
Not Supported Uses Plugins Template Edits Additional Files External Content  

AdSense for Mobile Content in VB Templates

If you have ever attempted to create the Adsense for Mobile Content then you probably hit a stumbling block when it didn't give you the code it normally provides for regular ads.

The problem is you cant just copy paste the code google gives you and expect it to work. Google gives you the following four options and none of these can be pasted into VB Templates.

AdSense for Mobile Content generated code options.
PHP
CGI/Perl
JSP
ASP

Here is the PHP Solution

How to add Adsense for Mobile Content into your VB mobile template using the PHP include code bits.

Requirements:
1 New Plugin
1 New File
1 Template Edit

Instructions:

Since the information you need to put in all three of these will vary on your server paths, I dont know any way to give you a plugin to import that wouldn't require you to change it anyway. You will need to create these manually. Some of this I found in the VB handbook.

1. Create a Plug-in for global_start with these contents:

Code:
  ob_start();
  include('path/to/this/file/mobilead.php');
  $mobileadsense = ob_get_contents();
  ob_end_clean();
Replace the path and filename with the correct path and filename of the PHP file you want to include. The code in mobilead.php will execute and any output generated by this script will be stored in $mobileadsense

---------------

2. Create the PHP file

Login to your Google Adsense account and create a AdSense for Mobile Content.
Choose Server-side scripting language: PHP

Since the contents of this PHP file will be different for everyones individual account you will need to create it. When you see Your AdSense code showing in PHP, copy that into a newly created PHP file and call it "mobilead.php"

Upload the file to your root directory or where ever you wish to have it reside.
---------------

3. Template Change

Place $mobileadsense in one of your templates, such as header, navbar, FORUMHOME, depending upon where you want the mobile ads to display.

Your done!

If you wish to create more than one ad, just repeat the process and use a different name on the files and variables.

Enjoy!

If you use this, please

Download

No files for download.

Screenshots

Click image for larger version
Name:	mobilecontent.gif
Views:	229
Size:	7.3 KB
ID:	89487  


vblts.ru supports vBulletin®, 2022-2024