Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 02-20-2008, 07:10 PM
lukemax lukemax is offline
 
Join Date: Oct 2006
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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....
Reply With Quote
  #2  
Old 02-21-2008, 05:34 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please post the code up.
Reply With Quote
  #3  
Old 02-21-2008, 10:58 AM
GameWizard's Avatar
GameWizard GameWizard is offline
 
Join Date: Apr 2004
Location: Vancouver, BC
Posts: 319
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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]
Reply With Quote
  #4  
Old 02-21-2008, 12:49 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by GameWizard View Post
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

Reply With Quote
  #5  
Old 02-21-2008, 01:03 PM
GameWizard's Avatar
GameWizard GameWizard is offline
 
Join Date: Apr 2004
Location: Vancouver, BC
Posts: 319
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MoT3rror View Post
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>
Reply With Quote
  #6  
Old 02-21-2008, 03:15 PM
MoT3rror MoT3rror is offline
 
Join Date: Mar 2007
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by GameWizard View Post
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.
Reply With Quote
  #7  
Old 02-21-2008, 05:30 PM
lukemax lukemax is offline
 
Join Date: Oct 2006
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow, loads of responses, thanks...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:40 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.02062 seconds
  • Memory Usage 2,217KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (8)bbcode_code
  • (2)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete