vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   get usergroupid value (https://vborg.vbsupport.ru/showthread.php?t=317133)

mohammad6006 02-03-2015 03:35 PM

get usergroupid value
 
I use this code in external vbulletin page :
PHP Code:

$curdir getcwd ();
chdir('/home/tractorfc/domains/tractorfc.com/public_html/forum');
require_once(
'global.php');
chdir ($curdir);
echo 
$vbulletin->userinfo['usergroupid']; 

work good for me and display usergroup 6

but for another users that usergroup is 20 : display 1 ( unregistered)

user is logged in forum

are there another way for get usergroupid?

Medi0cr3 02-04-2015 04:15 PM

Code:

require_once('./global.php');
$username = mysql_real_escape_string($vbulletin->userinfo['username']);
$usergroupfield = $vbulletin->userinfo[usergroupid];

Only gets the viewing user's "usergroupid" usergroup. What exactly are you requiring?

mohammad6006 02-05-2015 05:50 AM

Quote:

Originally Posted by Medi0cr3 (Post 2536143)
Code:

require_once('./global.php');
$username = mysql_real_escape_string($vbulletin->userinfo['username']);
$usergroupfield = $vbulletin->userinfo[usergroupid];

Only gets the viewing user's "usergroupid" usergroup. What exactly are you requiring?

I know

I create a file test.php
and insert that codes

so , my usergroup is 6 and when i run this page show 6
but for other users for example moderators and registered group display 1

1 is for unregistered group

this file can not detect other peoples
just work for me

kh99 02-05-2015 09:01 AM

If it's displaying 1 then it's probably seeing them as not logged in. I see that you're using chdir(), so I guess this is a script that's outside the forum directory? You might need to change your setting for "Path to Save Cookies" to '/'.

mohammad6006 02-07-2015 06:37 AM

Quote:

Originally Posted by kh99 (Post 2536285)
If it's displaying 1 then it's probably seeing them as not logged in. I see that you're using chdir(), so I guess this is a script that's outside the forum directory? You might need to change your setting for "Path to Save Cookies" to '/'.

my forum is in : forum.site.com

other folder that i want to use forum cookie is : site.com/admin

cookie path setting is on : /
domain cookie setting is on : (space)

What value i need to set to work cookies on site.com/admin ?


All times are GMT. The time now is 08:32 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.01286 seconds
  • Memory Usage 1,725KB
  • 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_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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