vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Mini Mods - Add Adsense Code On First Post (https://vborg.vbsupport.ru/showthread.php?t=239678)

M? Mostafa 04-01-2010 10:00 PM

Add Adsense Code On First Post
 
1 Attachment(s)
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

Dr.osamA 04-03-2010 02:16 AM

thanxxx man

installed

جزاك الله كل الخير

w-elbalad.com 04-03-2010 02:57 AM

thanks mostafa
installed
nice work
بارك الله فيك
للأمام يااخوى

M? Mostafa 04-03-2010 11:19 AM

Thanks 4 installing

Please remember to click Mark as Installed if you use this modification.

This thread On Arabic

http://www.leenkat.com/vb/f99/37717/

Forum Lover 04-03-2010 01:57 PM

Please, can we do the same with blog too?

Kaleem 04-03-2010 11:27 PM

Isnt that included in vBulletin 4 by default?

M? Mostafa 04-04-2010 01:44 AM

Quote:

Originally Posted by Forum Lover (Post 2015149)
Please, can we do the same with blog too?

No its on Forum Only

M? Mostafa 04-04-2010 01:53 AM

Quote:

Originally Posted by LightInClouds (Post 2015370)
Isnt that included in vBulletin 4 by default?

It is included in vBulletin 4 by default >>

PHP Code:

{vb:raw post.message}
      </
blockquote>
     </
div

add Code Under It

Da-Vinci 04-04-2010 10:48 PM

Admin CP-->Advertising-->Add New Ad

https://vborg.vbsupport.ru/

abdobasha2004 04-07-2010 08:55 AM

thaaanx
was searching for it for vb4

YankForum 04-08-2010 09:26 PM

this is more flexible , i like it more

M? Mostafa 04-09-2010 09:43 AM

Quote:

Originally Posted by Da-Vinci (Post 2015846)
Admin CP-->Advertising-->Add New Ad

http://www.hostmypics.org/pictures/6...d9fddde38a.png

Not The same :)

Sampel

http://www.gamez4all.com/vb/showthre...-c&p=12#post12

M? Mostafa 04-09-2010 09:45 AM

Quote:

Originally Posted by abdobasha2004 (Post 2017337)
thaaanx
was searching for it for vb4

Any service ;)

M? Mostafa 04-09-2010 09:47 AM

Quote:

Originally Posted by YankForum (Post 2018088)
this is more flexible , i like it more

I am always in the service

YankForum 04-17-2010 10:56 PM

bro is there any way to force it to show on first post of pages instead of first post of thread ?

EDIT : replace this :
Code:

<vb:if condition="$post[postcount] == 1">
with line below :
Code:

<vb:if condition="$post[postcount] % $vboptions[maxposts] == 1">
in author's codes
tnx again bro

M? Mostafa 06-17-2010 10:18 PM

Quote:

Originally Posted by YankForum (Post 2022916)
bro is there any way to force it to show on first post of pages instead of first post of thread ?

EDIT : replace this :
Code:

<vb:if condition="$post[postcount] == 1">
with line below :
Code:

<vb:if condition="$post[postcount] % $vboptions[maxposts] == 1">
in author's codes
tnx again bro

Thnx 4 Ur Join

a7lameza.com 06-19-2010 09:33 PM

شكرا استاذ مصطفي بارك الله بيك
منديات احلى ميزة

naturalparent 07-04-2010 10:45 AM

has anyone combined this with a way t make adsense only show, if user is not logged in?

bhanuprasad1981 07-12-2010 08:19 AM

wow yoursite full of spam by bots

bond010007 07-23-2010 12:44 PM

great work M? Mostafa installed and done here www.ghawyy.com/forum

Extra PC 09-13-2010 05:48 PM

thanx how to put this add after first line in first post or in first post in middle ?

CBNeter 09-14-2010 10:36 AM

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

MichelangeloITA 01-22-2011 10:29 AM

Hi dude, how can I make this work on vB4.1.1? :)

risestar 01-27-2011 04:14 AM

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::preRegister('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 (Post 2152798)
Hi dude, how can I make this work on vB4.1.1? :)


Da-Vinci 02-04-2011 02:28 AM

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.

baghdad4ever 06-07-2011 12:46 PM

Quote:

Originally Posted by Extra PC (Post 2097690)
thanx how to put this add after first line in first post or in first post in middle ?

how to do that plz?


All times are GMT. The time now is 06:23 AM.

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.01336 seconds
  • Memory Usage 1,773KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (3)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (26)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete