View Full Version : Adding custom html code (adsense, ads...) after first post (postbit)
Adding custom html code (adsense, ads...) after first post (postbit)
How to do this in vb 3.5.0?
I need to add custom code after first post on every thread page, but it only custom html only appears at first page.
WEForums
06-27-2005, 05:06 PM
Try:
<if condition="$post[postcount] == 1">whatever</if>
Should work. Might be a better code, though. Place it at the end of postbit/legacy.
Thanks, but with code like this, custom html is shown only after first post on first page. At Page 2, Page 3 ... isn't shown because postcount != 1.
Chris M
06-28-2005, 01:15 PM
This was a thread on vBulletin.com yesterday...
http://www.vbulletin.com/forum/showthread.php?p=812388
http://www.vbulletin.com/forum/showthread.php?t=144577
Satan
Gary King
07-07-2005, 07:31 PM
This was a thread on vBulletin.com yesterday...
http://www.vbulletin.com/forum/showthread.php?p=812388
http://www.vbulletin.com/forum/showthread.php?t=144577
Satan
Those solutions aren't for vB 3.5
Andreas
07-07-2005, 11:07 PM
Hmm, try
<if condition="!$GLOBALS['FIRSTPOSTID']">
<!-- Adsense here -->
</if>
at the End of Template postbit
great, with that conditional ! is working ok! :D
vauge
07-31-2005, 06:14 AM
No worky for me in RC1. :(
Am I doing something wrong?
BamaStangGuy
08-03-2005, 04:53 AM
Works for me
http://www.mustangevolution.com/forum/t16230/
Example
Neal-UK
08-16-2005, 12:43 AM
How can I add the table code to this please? Nice mod thankyou.
ZeroSixty
09-12-2005, 12:08 PM
How can I get the ads placed in a nice table as seen here? - http://forums.digitalpoint.com/showthread.php?t=28193
TIA
BamaStangGuy
10-09-2005, 05:50 AM
<if condition="in_array($bbuserinfo[usergroupid], array(1))">
<if condition="!$GLOBALS['FIRSTPOSTID']">
$spacer_open
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td class="alt2" width="175" valign="top">
<span class="bigusername">Hey Guest!</span>
<br />
<div class="smallfont">
Not Registered? <a href="http://www.mustangevolution.com/forum/register.php">Join today!</a>
<br />
<br />
Registration allows you too:
<br />
<br />
Post on our Forums.
<br />
<br />
Host files in our <a href="http://www.mustangevolution.com/gallery/">Gallery</a>.
<br />
<br />
Create a Member <a href="http://www.mustangevolution.com/garage.php">Page</a>.
<br />
<br />
Get rid of this ad....
</div>
</td>
<td class="alt1">
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-6510039177967027";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="6228185316";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "910000";
google_color_url = "910000";
google_color_text = "00235D";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</td>
</tr>
</table>
$spacer_close
<div style="padding:$stylevar[cellpadding]px 0px 0px 0px; background-color: #FFFFFF;">
</div>
</if>
</if>
Here is my postbit_legacy code... adjust it to your fitting :)
The above if conditionals show it after the first post of every thread page and show it only to guests.
What it looks like: http://www.mustangevolution.com/forum/showthread.php?t=16230
jluerken
10-09-2005, 07:49 AM
Ok we already scanned if its the first post and which usergroup the user has to display the ads.
I also want to have an IF clause which is checking the language the user is using.
If its a guest or if the user has english selected a text should be shown in english.
If he/she has german selected a text should be shown in german.
Does anyone know the correct if clause for this?
Marco van Herwaarden
10-09-2005, 09:13 AM
Just use phrases. If you have a german translation, it would automatic show for people who selected german.
ZeroSixty
10-09-2005, 10:09 AM
Thank you very much Brent :)
MissKalunji
10-12-2005, 12:44 PM
<if condition="in_array($bbuserinfo[usergroupid], array(1))">
<if condition="!$GLOBALS['FIRSTPOSTID']">
$spacer_open
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td class="alt2" width="175" valign="top">
<span class="bigusername">Hey Guest!</span>
<br />
<div class="smallfont">
Not Registered? <a href="http://www.mustangevolution.com/forum/register.php">Join today!</a>
<br />
<br />
Registration allows you too:
<br />
<br />
Post on our Forums.
<br />
<br />
Host files in our <a href="http://www.mustangevolution.com/gallery/">Gallery</a>.
<br />
<br />
Create a Member <a href="http://www.mustangevolution.com/garage.php">Page</a>.
<br />
<br />
Get rid of this ad....
</div>
</td>
<td class="alt1">
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-6510039177967027";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="6228185316";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "910000";
google_color_url = "910000";
google_color_text = "00235D";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</td>
</tr>
</table>
$spacer_close
<div style="padding:$stylevar[cellpadding]px 0px 0px 0px; background-color: #FFFFFF;">
</div>
</if>
</if>
Here is my postbit_legacy code... adjust it to your fitting :)
The above if conditionals show it after the first post of every thread page and show it only to guests.
What it looks like: http://www.mustangevolution.com/forum/showthread.php?t=16230
quick question where do i paste this?
<if condition="in_array($bbuserinfo[usergroupid], array(1))">
<if condition="!$GLOBALS['FIRSTPOSTID']">
$spacer_open
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="0" border="0" width="100%" align="center">
<tr>
<td class="alt2" width="175" valign="top">
<span class="bigusername">Hey Guest!</span>
<br />
<div class="smallfont">
Not Registered? <a href="http://www.mustangevolution.com/forum/register.php">Join today!</a>
<br />
<br />
Registration allows you too:
<br />
<br />
Post on our Forums.
<br />
<br />
Host files in our <a href="http://www.mustangevolution.com/gallery/">Gallery</a>.
<br />
<br />
Create a Member <a href="http://www.mustangevolution.com/garage.php">Page</a>.
<br />
<br />
Get rid of this ad....
</div>
</td>
<td class="alt1">
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-6510039177967027";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel ="6228185316";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "910000";
google_color_url = "910000";
google_color_text = "00235D";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</td>
</tr>
</table>
$spacer_close
<div style="padding:$stylevar[cellpadding]px 0px 0px 0px; background-color: #FFFFFF;">
</div>
</if>
</if>
Here is my postbit_legacy code... adjust it to your fitting :)
The above if conditionals show it after the first post of every thread page and show it only to guests.
What it looks like: http://www.mustangevolution.com/forum/showthread.php?t=16230
and i would also want to show it to people who have 0 post
how can i fix that up?
Mysticales
08-03-2006, 10:57 PM
Question, I want to show this to all members who are NOT part of "x" usergroup (Either listed as primary or secondary) So this way if a user is in a premium usergroup (Which is normally a secondary checkmark for them) that it doesnt show up. I know if they were in primary usergroup.. this is a easy thing..
But I have all users in the "Registered User" group, however those who have a paid subscription will convert to a "Secondary addition" premium usergroup.
So any way to set something up like this so it doesnt show if a user is a part of "x" usergroup?
Buczilla
08-07-2006, 08:47 PM
Question, I want to show this to all members who are NOT part of "x" usergroup (Either listed as primary or secondary) So this way if a user is in a premium usergroup (Which is normally a secondary checkmark for them) that it doesnt show up. I know if they were in primary usergroup.. this is a easy thing..
But I have all users in the "Registered User" group, however those who have a paid subscription will convert to a "Secondary addition" premium usergroup.
So any way to set something up like this so it doesnt show if a user is a part of "x" usergroup?
You can do so using this conditional
<if condition="is_member_of($bbuserinfo, X)">
<else />
Ad Code Here
</if>
where X is the usergroupid of the usergroup that you do not want to see ads.
Mysticales
08-14-2006, 11:53 PM
You can do so using this conditional
<if condition="is_member_of($bbuserinfo, X)">
<else />
Ad Code Here
</if>
where X is the usergroupid of the usergroup that you do not want to see ads.
Thank you sooooo much! That lil code helped me fix a few others things too!
On 3.0.7 I wanted to disable the Triple triad from "x" usergroup by having the kind of code above to ensure they were a part of that premium usergroup.. sadly I never got the code right..
CarVenue.com
08-28-2006, 08:09 AM
Exactly where do I need to paste this code?
Will it work in 3.6.0?
Thanks in advance.
oldfan
09-21-2006, 05:03 PM
You can do so using this conditional
<if condition="is_member_of($bbuserinfo, X)">
<else />
Ad Code Here
</if>
where X is the usergroupid of the usergroup that you do not want to see ads.
looks like this is working, thanks
GlobalFusion
09-25-2006, 03:28 PM
Exactly where do I need to paste this code?
Will it work in 3.6.0?
Thanks in advance.
Well... I pasted it at the top of my postbit_legacy template in 3.6.1 - and got nada.
omonsta
09-29-2006, 10:26 PM
Well... I pasted it at the top of my postbit_legacy template in 3.6.1 - and got nada.
try the bottom
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.