vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Show Thread Enhancements - Google Adsense Postbit Integration (https://vborg.vbsupport.ru/showthread.php?t=194817)

oldfan 08-01-2010 12:49 AM

I played around with the script a bit and I got the ads to work after the last post

SHOWTHREAD template, I added the red text.
Now I have the first and last post

Quote:

<div id="posts">$postbits<div id="lastpost"></div></div>
<!-- start content table -->
$spacer_open
<!-- / start content table -->
$gaip_code1
<p>

<!-- controls below postbits -->
Now if I could figure out to have different ad colors for my other skins

TitanJeff 09-10-2010 01:17 PM

Love this hack. I started using it with 3.7 and the same version works fine with 3.8.6.

If I could add a feature, it would be to have the option to add code in multiple areas of a thread, use different code and be able to set each for different usergroups.

For example:

After the third post, a leaderboard is placed which is set to be viewed by all.

After the sixth post, a 300x250 is added to be seen by only guests.

I think I can add conditions for it to be seen by only certain groups but can't figure out how to add multiple code options.

fxwoody 09-11-2010 10:16 AM

Nice hack tks! Lots of good ideas here for this, should be interesting to see what will be the results of all these?

Anyway, installed ;)

BadgerDog 09-27-2010 10:10 AM

I tried to get an answer in the programming area, but nobody there seems to know how to do this, or doesn't want to help out ....

I have this mod installed and it works great, so I thought either the programmer here or someone else could help me with a simple question ...

I'm not a programmer, but know enough to be dangerous and can insert code within templates etc.

I'd like to have my adsense ads only appear for specific usergroups (1,2,3,4,6,13,16)...

So, in simple terms, what is the code to wrap around my adsense script to have the ads displayed for just those usergroups and centered.

ie:

===================
if ....

<script>

xxx
xxxx
xx

<script>

endif
==================

Thanks for any help ... :)

Regards,
Badger

TitanJeff 10-01-2010 12:56 PM

Try this:

PHP Code:

<if condition="is_member_of($vbulletin->userinfo,1,2,3,5)">
Your ad code here.
</if> 


BadgerDog 10-01-2010 08:24 PM

Quote:

Originally Posted by TitanJeff (Post 2105488)
Try this:

PHP Code:

<if condition="is_member_of($vbulletin->userinfo,1,2,3,5)">
Your ad code here.
</if> 


Thanks ... :)

Regards,
Badger

shoppingtelly 10-06-2010 09:11 AM

Is there a way to use this twice? So I can see the mod twice in control panel and add ads under two different number posts?

Many thanks

BadgerDog 10-06-2010 10:15 AM

Quote:

Originally Posted by shoppingtelly (Post 2107320)
Is there a way to use this twice? So I can see the mod twice in control panel and add ads under two different number posts?

Many thanks

I'd like to add this as well, just after first post and before last post ....

Regards,
Badger

BadgerDog 10-06-2010 10:26 AM

Quote:

Originally Posted by oldfan (Post 2077428)
I played around with the script a bit and I got the ads to work after the last post

SHOWTHREAD template, I added the red text.
Now I have the first and last post

Hi ... :)

I can't seem to find the code you posted anywhere in showthread template, so I can add the part you indicated in red and get adsense in the two places?

Thanks for any help ....

Regards,
Badger

asabet 05-22-2011 12:42 AM

Quote:

Originally Posted by xlguy (Post 2005612)
If you want the ad to appear twice in a thread then you just need to edit the plugin code, Google Adsense Postbit Integration > postbit_display_complete find this bit of code

PHP Code:

if ($post[postcount] % $vbulletin->options[maxposts] == $google_sira and !$GLOBALS['vbulletin']->GPC['ajax'])
{
eval(
'$template_hook[postbit_end] .= "' fetch_template('gaip_code1') . '";');


and add below this code (editing 19 to your choice)...

PHP Code:

if ($post[postcount] % $vbulletin->options[maxposts] == 19 and !$GLOBALS['vbulletin']->GPC['ajax'])
{
eval(
'$template_hook[postbit_end] .= "' fetch_template('gaip_code1') . '";');



Thanks for the tip! I changed

PHP Code:

if ($post[postcount] % $vbulletin->options[maxposts] == $google_sira and !$GLOBALS['vbulletin']->GPC['ajax']) 

to

PHP Code:

if ($post[postcount] % == and !$GLOBALS['vbulletin']->GPC['ajax']) 

and now have the ad after every 3rd post the way I wanted it.


All times are GMT. The time now is 03:55 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.01094 seconds
  • Memory Usage 1,757KB
  • 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
  • (6)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete