vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Adsense after first post ONLY if there are more than X posts in the thread (https://vborg.vbsupport.ru/showthread.php?t=106596)

Moparx 01-28-2006 10:00 PM

Adsense after first post ONLY if there are more than X posts in the thread
 
Many forums use three ad units in their threads.. at the top, within the content, and then at the bottom. This mod was made with this kind of set up in mind.
The problem is the thread pages can tend to look horrible and overrun with ads if there is not enough content (say only a couple one line posts) between the ad units.

This isnt for everyone as some people prefer to keep all their ads showing no matter what.. but for those interested, this template modification only displays adsense after first post if there are over X amount of posts in the thread.

If you want everyone to see the ads you can remove the is_member_of AND line. Otherwise, you can add the user groups who you want to see the ads to it. (Don't forget to replace 'X' with a numerical value of your choice)


Place the following at the very end of the postbit template:
PHP Code:

<if condition="is_member_of($bbuserinfo, 1,2) AND !$GLOBALS['FIRSTPOSTID'] AND $GLOBALS[threadinfo][replycount] >= X">
$spacer_open

<div class="page" style="width:100%; text-align:left">
    <
div style="padding:0px 0px 6px 0px">    

        <
table class="tborder" cellpadding="6" cellspacing="1" border="0" width="100%" align="center">
        <
tr>
            <
td class="alt1">
            
                <
div align="center">
                 <!-- 
adsense goes here -->
                </
div>
            
            </
td>
        </
tr>
        </
table>

    </
div>    
</
div>

$spacer_close 
</if> 


Snake 01-29-2006 11:03 AM

Bingo! I've been waiting for this. Thank you very much, Moparx. :)

Snake 01-29-2006 11:53 AM

One thing, I would like to show my ads AFTER the post #5. How do I do that?

Moparx 01-29-2006 01:43 PM

change:
PHP Code:

!$GLOBALS['FIRSTPOSTID'

to:
PHP Code:

$post[postcount] % $vboptions[maxposts] == 


bigmonay2k 01-31-2006 03:04 AM

screenshot?

Moparx 01-31-2006 03:57 AM

Quote:

Originally Posted by bigmonay2k
screenshot?

are you serious?
it displays an ad after the first post

Cal813 02-01-2006 04:56 AM

how about for forum display? Is there a way I could place it after certain amount of threads?

Akagi 02-02-2006 07:33 AM

thank you! this work fine!

hiiped 02-03-2006 09:54 PM

very useful

thanks

Sean James 02-04-2006 09:46 AM

I get a white blank page after i post, how do i fix this?


All times are GMT. The time now is 08:39 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.01284 seconds
  • Memory Usage 1,741KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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