Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Add Adsense Code On First Post Details »»
Add Adsense Code On First Post
Version: 1.00, by M? Mostafa M? Mostafa is offline
Developer Last Online: May 2013 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.0.2 Rating:
Released: 04-01-2010 Last Update: Never Installs: 28
Template Edits
 
No support by the author.

this simple modification does is add a adsense code or any ads to first post

See here for example
http://www.gamez4all.com/vb/showthre...ltiscreen)&p=6

In the postbit_legacy template find:

PHP Code:
align="center">{vb:raw post.message}</div>
      </
blockquote>
     </
div
Add this under it:

PHP Code:
<vb:if condition="$post[postcount] % $vboptions[maxposts] == 1">
here code adsense
</vb:if> 
That's all

Supporters / CoAuthors

Show Your Support

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

Comments
  #22  
Old 09-13-2010, 05:48 PM
Extra PC Extra PC is offline
 
Join Date: Dec 2009
Posts: 67
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanx how to put this add after first line in first post or in first post in middle ?
Reply With Quote
  #23  
Old 09-14-2010, 10:36 AM
CBNeter CBNeter is offline
 
Join Date: Sep 2010
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It worked fine on my Forum.
I have some questions, how to put adsense in the middle? so cut the tread in the middle.
thanks
Reply With Quote
  #24  
Old 01-22-2011, 10:29 AM
MichelangeloITA's Avatar
MichelangeloITA MichelangeloITA is offline
 
Join Date: Dec 2009
Location: Italy, Rimini
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi dude, how can I make this work on vB4.1.1?
Reply With Quote
  #25  
Old 01-27-2011, 04:14 AM
risestar risestar is offline
 
Join Date: Oct 2001
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can call it externally

1) Put the code that you were going to post in the template into an external php file and upload it to the webserver, call it adsenseinfirstpost.php



2) Go to plugin manager and create a new plugin
- Hook location : global_bootstrap_init_start
- Plugin code (edit in your website url):

ob_start();
require_once('http://www.yourwebsite.com/forum/adsenseinfirstpost.php');
$adsenseinfirstpost = ob_get_contents();
ob_end_clean();
vB_Template:reRegister('postbit_legacy',array('a dsenseinfirstpost' => $adsenseinfirstpost));




3) In postbit_legacy template, where you were going to post the code, put this instead

{vb:raw adsenseinfirstpost}





If you are using postbit, rather than postbit_legacy, just alter the template name in the ob_start code




Quote:
Originally Posted by MichelangeloITA View Post
Hi dude, how can I make this work on vB4.1.1?
Reply With Quote
  #26  
Old 02-04-2011, 02:28 AM
Da-Vinci Da-Vinci is offline
 
Join Date: Mar 2010
Posts: 249
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just use the built in Advertising system, click new in ad, in the drop down near the top, select thread then place your ad in either the first second or last post, you can do all 3 if you like.
Reply With Quote
  #27  
Old 06-07-2011, 12:46 PM
baghdad4ever baghdad4ever is offline
 
Join Date: Apr 2007
Location: baghdad
Posts: 443
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Extra PC View Post
thanx how to put this add after first line in first post or in first post in middle ?
how to do that plz?
Reply With Quote
Reply


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 01:23 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04165 seconds
  • Memory Usage 2,281KB
  • Queries Executed 23 (?)
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
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete