vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Want to display ads, but not for mods or subscribers? (https://vborg.vbsupport.ru/showthread.php?t=73174)

msu2k 12-21-2004 06:40 PM

Want to display ads, but not for mods or subscribers?
 
I wanted to add a Google AdSense ad after the first post in every thread...but didn't want Mods, Admins or Subscribers to have to see it. Can this be done? This is the code in the postbit for displaying it to all users after the first post in each thread...

Code:

<if condition="$post['postid'] == $thread['firstpostid']">

  Your Adsense Code Goes Here

</if>


boo.3 12-21-2004 06:50 PM

i would also like to see somthing like this :)

Paul M 12-21-2004 07:14 PM

Just add conditions for the usergroups you want to exclude (or include).

msu2k 12-21-2004 07:15 PM

Quote:

Originally Posted by Paul M
Just add conditions for the usergroups you want to exclude (or include).

Can you help me with the code please? I figure it's easy but I'm lost when it comes to this stuff.

PolishPanda 12-22-2004 08:28 AM

Yeah I'm also wondering about this. What if I have a usergroup called "Premium Users" and I don't want them to view ads? This can be done using some simple "if" functions, but I don't know how to identify what usergroup a user is in.

msu2k 12-22-2004 12:24 PM

Quote:

Originally Posted by PolishPanda
Yeah I'm also wondering about this. What if I have a usergroup called "Premium Users" and I don't want them to view ads? This can be done using some simple "if" functions, but I don't know how to identify what usergroup a user is in.

You can find out the # assigned to each usergroup in Usergroups > Usergroup Manager. You'll see the "id=#" for each group in the dropdowns. What I'm not sure about is what the syntax is to say...

If this is the first post in a thread and if user is not part of user groups 1, 2, 3 or 4....display this.

msu2k 12-22-2004 05:38 PM

I managed to figure it out...this displays to all the groups except for those listed:

Code:

<if condition="$post['postid'] == $thread['firstpostid']">
<if condition="($bbuserinfo[usergroupid]!=5 AND $bbuserinfo[usergroupid]!=6 AND $bbuserinfo[usergroupid]!=7 AND $bbuserinfo[usergroupid]!=10)">
Ad code goes here
</if>
</if>



All times are GMT. The time now is 12:59 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.01569 seconds
  • Memory Usage 1,723KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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