View Full Version : get usergroupid value
mohammad6006
02-03-2015, 03:35 PM
I use this code in external vbulletin page :
$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
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
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
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
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 ?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.