Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
AdSense for Mobile Content Details »»
AdSense for Mobile Content
Version: 1.00, by WNxWakko WNxWakko is offline
Developer Last Online: Sep 2013 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.7.4 Rating:
Released: 11-16-2008 Last Update: Never Installs: 12
Uses Plugins Template Edits
Additional Files  
No support by the author.

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 click install

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 11-17-2008, 07:23 PM
Hornstar Hornstar is offline
 
Join Date: Jun 2005
Location: Australia
Posts: 2,469
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If only google didnt ban me in the early days id give this a go now :/
Reply With Quote
  #3  
Old 11-18-2008, 01:55 PM
unp unp is offline
 
Join Date: Oct 2008
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Not working for me.
Reply With Quote
  #4  
Old 11-20-2008, 12:08 AM
WNxWakko's Avatar
WNxWakko WNxWakko is offline
 
Join Date: Apr 2003
Location: Paradise, Texas
Posts: 309
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are you testing using your PC browser? If you are it wont display. Google designed the code to only appear if you are using a mobile device. Confirm your testing with a mobile.
Reply With Quote
  #5  
Old 11-20-2008, 12:15 AM
gwerzal's Avatar
gwerzal gwerzal is offline
 
Join Date: Oct 2007
Posts: 317
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks il give it a go
Reply With Quote
  #6  
Old 01-20-2009, 12:43 PM
tpearl5's Avatar
tpearl5 tpearl5 is offline
 
Join Date: Nov 2001
Location: PA
Posts: 1,014
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks! This is exactly what I was looking for... however, I can't get any ads to display - I'm not getting any errors.
Reply With Quote
  #7  
Old 02-09-2009, 11:41 AM
iamthemoz iamthemoz is offline
 
Join Date: Jun 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks! Works great!
Reply With Quote
  #8  
Old 11-08-2009, 11:00 AM
iamthemoz iamthemoz is offline
 
Join Date: Jun 2008
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Recently this plugin has had a major impact on the speed of my site. I had to uninstall. Any ideas?
Reply With Quote
  #9  
Old 04-01-2013, 09:00 PM
Naijasite's Avatar
Naijasite Naijasite is offline
 
Join Date: Mar 2012
Posts: 281
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how do i make it work on mobile style 4.2 ?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:26 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08640 seconds
  • Memory Usage 2,273KB
  • Queries Executed 24 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (8)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete