vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Adding vbulletin login check to an external page (https://vborg.vbsupport.ru/showthread.php?t=219728)

expatdirectory 07-29-2009 02:18 PM

Adding vbulletin login check to an external page
 
HI,
I know this is possible but I cannot remember how I did it last time and lost the reference. :(

I have a form that I only want to allow my forum users access to. Basically I want to put the login check in the header so:

if logged in: I can get the user name to add with the form
if not logged in: will display the normal you need to register message.

Anyone point me in the right direction?

I tried several searches but to no avail, I know the snippets on VB.org as I referenced it a year back, forgot to subscribe to it!

Lynne 07-29-2009 02:49 PM

First, your custom page should be coded following the directions in an article like this one - [How-To] vBulletin API Basics: Creating Custom Pages & Misc. Then just add something like this:
PHP Code:

if (!isset($vbulletin->userinfo['userid']) OR $vbulletin->userinfo['userid'] == 0)
{
        
print_no_permission(); 



expatdirectory 07-29-2009 02:57 PM

Thank you Lynne. I really appriciate the fast response. :D

--------------- Added [DATE]1248893169[/DATE] at [TIME]1248893169[/TIME] ---------------

Its working a treat Lynne. Now I just have to figure out how to get the username into a hidden form input and hey presto. Takes a bit of lateral thinking but hoefully will be able to pull it off. If I figure it out I'll post it here for reference


All times are GMT. The time now is 12:32 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.00994 seconds
  • Memory Usage 1,714KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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