![]() |
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 --> Code:
<if condition="$post[postcount] % $vboptions[maxposts] == 1 AND !$bbuserinfo[userid]"> 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"> Code:
<if condition="$post[postcount] == 1 AND !$bbuserinfo[userid]"> Code:
<if condition="$post[postcount] == 1 AND $GLOBALS[threadinfo][replycount] >= 2"> Code:
<if condition="$post[postcount] == 1 AND in_array($GLOBALS[forumid], array(X,Y,Z))"> Code:
<if condition="$post[postcount] % X == 0"> Code:
<if condition="$post['islastshown']"> Quote:
Code:
<if condition="$post[postcount] % $vboptions[maxposts] == 1 AND !$bbuserinfo[userid] AND in_array($GLOBALS[forumid], array(X,Y,Z))"> |
Nice one! Thank you. :D
|
If anyone use some custom code and want to share it let me know and I'll include it in first post.
|
how is this different then the other 8 billion ones already out there?
|
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)
|
Does vBAd management have something like this... doesn't it?
|
VBAd doesn't work for me, so I'm editing my templates for inserting ads
|
Can you add a screenshot ?
|
added! (it's only visible to guests).
|
added very handy tips
|
If you are displaying ads only to guests you can replace this code:
Code:
<td class="thead" align="left">Sponsored Links</td> Code:
<td class="thead" align="left"><a href="http://www.mysite.com/linkToPost.php">Remove ads from forum!</a></td> |
thanks..
installed. |
very nice, thanks.
|
How would you make it visible only to certain usergroups?
I'd like to make it not visible to admins, mods, and donors. |
You can try this:
Code:
<if condition="!is_member_of($bbuserinfo, X, Y, Z)"> Try it and let me know did it work. |
Hi,
I tried using this conditional code of yours... Quote:
In a thread with a total of 37 posts, it displays the ad after the 5th post, 15th post, 25th post and 35th post. But it is just making space for the ad after the 10th post, 20th post, 30th post. But not showing the ad. Why? Please can you help fix this for me. This also spoiled the display of ads after the last post in every page that was working fine earlier. I'm also using conditionals for "after 1st post on every page", that is working fine. Thanks in advance. |
@induslady: can you add a screen shoot, I'm not sure I understand what you're talking about.
|
Hello,
Thank you for your response. I am attaching screen shots and have explained below what's happening on using this condition... Quote:
Meaning, I want to show Google ads below every 5th post in the thread. My forum threads have max 10 posts per page. Using the above condition, I am able to get ads displayed below 5th post. (refer image 1 - showing ad) But ads are not getting displayed below 10th post. (refer image 2 - no ad - white space) While ads are getting displayed below 15th post too. (refer image 3 - showing ad) But again ads are not getting displayed below 20th post. (refer image 4 - no ad - white space) I used to have conditions included for displaying ads "below the 1st post in all pages of the thread and below the last post in all pages of the thread". After I included the above condition to display ad below the 'X' post, the condition for displaying ads below last post in all pages of a thread is also not working. While I have ads below 1st post in all pages of a thread working fine. Hope my issue is clear now with the screen shots and the explanation. Please advise. Thanks. |
Did you use this code to display ads on last post on every page?
Code:
<if condition="$post['islastshown']"> |
Yes, to display ads below the last post in all pages of the thread, I use...
Quote:
Quote:
Quote:
|
how can i move the "Similar threads" after 1st post ?
i had remove "$similarthreads" in SHOW_THREAD templates and add it after the 1st post, like this tutorial, but it doesn't show... Thanks for your helping |
worked great for me thanks
|
Neat and handy, works with adbrite on my 3.6.8pl2 install.
Visible to guests only of course ;) I used the "show to certain groups" and "show in certain forums". "Installtime" less than 30 secs. *clicks installed* |
@induslady I'm sorry, I really don't know where is the problem, you should look at the code to si if the ads are generated or not, if they are then the problem is in your custom template.
@Phr34q you can use any advertisement code, it's ;) |
@goranbaxy, I know, just thought I'd put in in my reply so others can read that it's possible before they start a "help help can I use ...." post ;)
|
Oh, ok thanks!
|
The problem for you, induslady, is that you can only have 3 Google Adsense spots on each page. If you have more than that, the Adsense code just blanks out.
|
how about if i use this only for guest and registered member, but not showing for staff or paid member ?
|
Worked for me, thanks. :D
|
how can i make the ads visible to all groups , ( registered , mods, admins ,and guests ) ?
|
Just don't put any condition
|
thanks man .. *installed*
|
sorry .. but after i removed the codition the ads appeared after every post
i want it to be visible to all groups and after the 1st post only |
Does it work for 3.7 ?
|
Working for me on 3.7.1 P1 :D
|
Quote:
PHP Code:
|
I originally had it on the 1st page of every thread (between first and second post), but I changed it to every page because it just wasn't enough exposure for the 'long' threads. Most people jumped to the last page and missed the ad. Just a tip ;)
|
thanks installed but has problem with quich reply issue for me
it redirects poster to advertises included after last posts |
AFTER A LITTLE SEARCH I FOUND THIS :
Code:
<if condition="($post['islastshown'] and !$GLOBALS['vbulletin']->GPC['ajax'])"> |
where di you put that code?
|
All times are GMT. The time now is 07:07 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|