vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Forum Display Enhancements - Google AdSense (or other) after post... (https://vborg.vbsupport.ru/showthread.php?t=169075)

goranbaxy 01-28-2008 10:00 PM

Google AdSense (or other) after post...
 
I found this cod on vublletin.org and did some customization, I found this very useful and good place for ads.

Show a banner/ad after first (or somewhere else) post, show it to guests | register users | users with less then X posts...

This is what I have:
- It will show ad/banner after first post on every page (instead of just the first page) but only to guests.


Admin CP -> Styles & Templates -> Style Manager -> ? ? -> Postbit Templates ->
Edit postbit or postbit_legacy (depending on which layout you are using)

Find:
Code:

<!-- / post $post[postid] popup menu -->
After ad:

Code:

<if condition="$post[postcount] % $vboptions[maxposts] == 1 AND !$bbuserinfo[userid]">
<div style="padding: $stylevar[cellpadding]px 0px 0px 0px">

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
        <td class="thead" align="left">Sponsored Links</td>
</tr>
<tr>
        <td class="alt1" align="center">
                BANNER CODE HERE
        </td>
</tr>
</table>
</div>

</if>

Here is how it will look like: demo ads

Here are several other conditions you can use in the above code to show the banner in different places. Simply replace the first "if" statement.

...after the first post on every page (instead of just the first page):
Code:

<if condition="$post[postcount] % $vboptions[maxposts] == 1">
...after the first post, but only for guests:
Code:

<if condition="$post[postcount] == 1 AND !$bbuserinfo[userid]">
...after the first post, but only if the thread has at least 2 replies (so you never see a banner and only 1 post):
Code:

<if condition="$post[postcount] == 1 AND $GLOBALS[threadinfo][replycount] >= 2">
...after the first post, but only in specific forums (where X,Y,Z is a comma list of forumids):
Code:

<if condition="$post[postcount] == 1 AND in_array($GLOBALS[forumid], array(X,Y,Z))">
...after every X posts (replace X with a number):
Code:

<if condition="$post[postcount] % X == 0">
...after the last post on every page:
Code:

<if condition="$post['islastshown']">
...between the last and second to last post on every page (need to move the above code to the very top of the template instead of the bottom, then use the same condition as above):
Quote:

<if condition="$post['islastshown']">
You can use pieces of these conditions to do different combinations. For example, this condition will show the banner after the first post on every page (instead of just the first page), but only for guests, and only in certain forums (where X,Y,Z is a comma list of forumids):
Code:

<if condition="$post[postcount] % $vboptions[maxposts] == 1 AND !$bbuserinfo[userid] AND in_array($GLOBALS[forumid], array(X,Y,Z))">
Please click to "Mark as Installed"

projectego 01-29-2008 06:35 PM

Nice one! Thank you. :D

goranbaxy 01-29-2008 06:38 PM

If anyone use some custom code and want to share it let me know and I'll include it in first post.

SEOvB 01-29-2008 07:45 PM

how is this different then the other 8 billion ones already out there?

goranbaxy 01-29-2008 07:50 PM

I don't know, this is something I was looking for and didn't found so I add it here, if there is thread same as this one, feel free to delete it (anyone who can)

iogames 01-29-2008 11:36 PM

Does vBAd management have something like this... doesn't it?

goranbaxy 01-30-2008 04:53 AM

VBAd doesn't work for me, so I'm editing my templates for inserting ads

Forumdayim.Net 01-30-2008 10:36 AM

Can you add a screenshot ?

goranbaxy 01-30-2008 10:50 AM

added! (it's only visible to guests).

usearchme 01-31-2008 12:07 PM

added very handy tips


All times are GMT. The time now is 03:45 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.03355 seconds
  • Memory Usage 1,736KB
  • 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
  • (9)bbcode_code_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