vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do I? ads to registered and guests only (https://vborg.vbsupport.ru/showthread.php?t=147753)

chris20492002 05-21-2007 06:05 AM

How do I? ads to registered and guests only
 
Hi, how do I make ads show for guests and registered users only but for mods/admins/subscription(aka premium) members the ads do not show.

I gather its a if command so far I have

<!-- Header Banner Ads Start -->
<if condition="$show['guest']">

Ads Here

</if>
<!-- Header Banner Ads End -->

Please LMK if I am on the right track also how would I go about making the reg members to see the ads also

Dismounted 05-21-2007 06:09 AM

$vbulletin->userinfo['userid'] != 0

chris20492002 05-21-2007 06:10 AM

Quote:

Originally Posted by Dismounted (Post 1251870)
$vbulletin->userinfo['userid'] != 0


sorry to sound dumb but how would I use that in the above setup.



registered users - userid: 2
unreg/not logged in - userid: 1

Dismounted 05-21-2007 06:31 AM

<if condition="$show['guest'] AND $vbulletin->userinfo['userid'] != 0">

chris20492002 05-22-2007 02:54 AM

<!-- Header Banner Ads Start -->
<if condition="$show['guest'] AND $vbulletin->userinfo['userid'] != 2">

Ads Here

</if>
<!-- Header Banner Ads End -->

So this would be correct? as registered users are id 2. Also I added this and 1 user said they could not login could this be the problem? or is it something else? (it was only wrapped around the ads)

Dismounted 05-22-2007 07:25 AM

userid is the `userid` field in the database. It is different for every user. 0 simply means that the user is not logged in.

chris20492002 05-22-2007 01:30 PM

Quote:

Originally Posted by Dismounted (Post 1252557)
userid is the `userid` field in the database. It is different for every user. 0 simply means that the user is not logged in.

so the 2 i placed there would make it show for regisered users correct? registered users have the id of 2:confused:

??

???

Dismounted 05-23-2007 07:31 AM

They don't, it is different for EVERY user. 2 is probably your userid.

JohorBahru 08-31-2011 06:10 AM

thank you! this is very helpful. and i found the other one from google but this one seems easier..
http://www.mydigitallife.info/how-to...-in-vbulletin/


All times are GMT. The time now is 05:14 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.01111 seconds
  • Memory Usage 1,732KB
  • 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_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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