Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 02-03-2015, 03:35 PM
mohammad6006's Avatar
mohammad6006 mohammad6006 is offline
 
Join Date: May 2008
Location: IRAN (Tabriz)
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 02-04-2015, 04:15 PM
Medi0cr3 Medi0cr3 is offline
 
Join Date: Aug 2014
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #3  
Old 02-05-2015, 05:50 AM
mohammad6006's Avatar
mohammad6006 mohammad6006 is offline
 
Join Date: May 2008
Location: IRAN (Tabriz)
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Medi0cr3 View Post
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
Reply With Quote
  #4  
Old 02-05-2015, 09:01 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 '/'.
Reply With Quote
  #5  
Old 02-07-2015, 06:37 AM
mohammad6006's Avatar
mohammad6006 mohammad6006 is offline
 
Join Date: May 2008
Location: IRAN (Tabriz)
Posts: 116
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
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 ?
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 08:22 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04095 seconds
  • Memory Usage 2,196KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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_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