vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Adding custom html code (adsense, ads...) after first post (postbit) (https://vborg.vbsupport.ru/showthread.php?t=91182)

RCA 06-27-2005 03:40 PM

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:

Code:

<if condition="$post[postcount] == 1">whatever</if>
Should work. Might be a better code, though. Place it at the end of postbit/legacy.

RCA 06-28-2005 11:27 AM

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

Quote:

Originally Posted by hellsatan

Those solutions aren't for vB 3.5

RCA 07-07-2005 10:51 PM

still no way...

Andreas 07-07-2005 11:07 PM

Hmm, try

HTML Code:

<if condition="!$GLOBALS['FIRSTPOSTID']">
<!-- Adsense here -->
</if>

at the End of Template postbit

RCA 07-08-2005 03:23 PM

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

Code:

<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/foru...ad.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

Quote:

Originally Posted by BrentWilson
Code:

<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/foru...ad.php?t=16230


quick question where do i paste this?

Quote:

Originally Posted by BrentWilson
Code:

<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/foru...ad.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

Quote:

Originally Posted by Mysticales
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

Code:

<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

Quote:

Originally Posted by Buczilla
You can do so using this conditional

Code:

<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

Quote:

Originally Posted by Buczilla
You can do so using this conditional

Code:

<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

Quote:

Originally Posted by CarVenue.com
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

Quote:

Originally Posted by GlobalFusion
Well... I pasted it at the top of my postbit_legacy template in 3.6.1 - and got nada.

try the bottom


All times are GMT. The time now is 04:47 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.01238 seconds
  • Memory Usage 1,801KB
  • 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
  • (7)bbcode_code_printable
  • (1)bbcode_html_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (24)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete