vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   accessible only to logged in users (https://vborg.vbsupport.ru/showthread.php?t=171047)

lukemax 02-20-2008 07:10 PM

accessible only to logged in users
 
I have a page and I'm trying to do 2 things to it.
I used the hook feature and created a page
http://lvasp.com/forum/requestform.php
which used the vbulletin template system. How do I make it so that only logged in users can access the page (so that if there not logged in they get a standard vbulletin error) Also, how do I (autofill) the form so that LVASP Username would be filled in with their username (which, if logged in would be in the Welcome, "x" near the top).
Thanks....

Dismounted 02-21-2008 05:34 AM

Please post the code up.

GameWizard 02-21-2008 10:58 AM

Code:

<if condition="$show['member']">
This is what members see.
<else />
This is what guests see.
</if>

As for your field to be auto entered, for that field, use this value:

Code:

$userinfo[username]

MoT3rror 02-21-2008 12:49 PM

Quote:

Originally Posted by GameWizard (Post 1448025)
Code:

<if condition="$show['member']">
This is what members see.
<else />
This is what guests see.
</if>

As for your field to be auto entered, for that field, use this value:

Code:

$userinfo[username]

You actually need to compare against the userid like this.
Code:

<if condition="$bbuserinfo[userid] == 0">
This is what guests see
<else />
This is what users signed in see
</if>

or PHP code like this. This would require the global file included.
PHP Code:

if($vbulletin->userinfo['userid'] == 0)
{
//currently is guest
}
else
{
//currently signed in



GameWizard 02-21-2008 01:03 PM

Quote:

Originally Posted by MoT3rror (Post 1448097)
You actually need to compare against the userid like this.
Code:

<if condition="$bbuserinfo[userid] == 0">
This is what guests see
<else />
This is what users signed in see
</if>

or PHP code like this. This would require the global file included.
PHP Code:

if($vbulletin->userinfo['userid'] == 0)
{
//currently is guest
}
else
{
//currently signed in



Isn't this the same as the following?:
Code:

<if condition="$show['guest']">
This is what guests see
<else />
This is what users signed in see
</if>


MoT3rror 02-21-2008 03:15 PM

Quote:

Originally Posted by GameWizard (Post 1448110)
Isn't this the same as the following?:
Code:

<if condition="$show['guest']">
This is what guests see
<else />
This is what users signed in see
</if>


Yeah never knew they had the variable $show['member'], o well I guess I learn something today.

lukemax 02-21-2008 05:30 PM

wow, loads of responses, thanks...


All times are GMT. The time now is 01:10 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.01132 seconds
  • Memory Usage 1,735KB
  • 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
  • (8)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)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