vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   userinfo vars (https://vborg.vbsupport.ru/showthread.php?t=107688)

thepomonacow 02-11-2006 05:13 AM

userinfo vars
 
I am having a hell of a time trying to get the userinfo['userid'] and userinfo['username'] variables from vbulletin. I have attached my code to sho how I am trying to do it. I am trying to use the variables on a page outside of the forum directory.

the result printed out is "0,Unregistered". I know for a fact that I am logged in. Does anyone see anything I am doing wrong???




Code:

chdir('/home/mysite/public_html/connect');
require_once('./global.php');
 

$id = $vbulletin->userinfo['userid'];
$name = $vbulletin->userinfo['username'];
echo $id, $name;


Daniel 02-11-2006 05:38 AM

May have better luck in this forum:
https://vborg.vbsupport.ru/forumdisplay.php?f=111

Logikos 02-11-2006 05:42 AM

I've had this problem when I was creating my custom portal. Things you should remember: Cookies need to be set, try logging in from the forums and then going back to that page with a CRT+F5. (Hard Refresh)

Make sure all paths in your HTML is correct. vBulletin default template point to URL like so:
Code:

<script type="text/javascript" src="clientscript/vbulletin_global.js"></script>
<script type="text/javascript" src="clientscript/vbulletin_menu.js"></script>

Use full URLS like:
HTML Code:

<script type="text/javascript"  src="$vboptions[bburl]/clientscript/vbulletin_global.js"></script>
Since your no longer in the forums directory. Should work, as I don't see a problem with your code. :)

Edit: This might help, adding a slash...

PHP Code:

chdir('/home/mysite/public_html/connect'); 

To:
PHP Code:

chdir('/home/mysite/public_html/connect/'); 


Trigunflame 02-11-2006 05:43 AM

This forum category is not for posting questions.

thepomonacow 02-11-2006 07:47 PM

So sorry trigunflame!!!!!!

Logikos 02-11-2006 08:26 PM

thepomonacow, Just ignore those who have enough time to correct your posting abilities, but not enough time to answer the threads question. I reported the thread to the staff asking them to move it when you first posted this. Not everyone understands that people make mistakes. Anyway, did my post above happen to help at all?

Adrian Schneider 02-11-2006 10:01 PM

Check your vB cookie settings, you may have specified the cookies for a certain folder.


All times are GMT. The time now is 05: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.02160 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)bbcode_html_printable
  • (2)bbcode_php_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