Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-22-2007, 04:54 PM
Fabsboards Fabsboards is offline
 
Join Date: May 2007
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default PHP code to determine user status

I want to create a few web pages for our users with admin status.

Is it possible to use PHP to determine whether or not a user is logged in, and what type of user they are?

Links to sample code would be greatly appreciated.

We are currently running v. 3.0.7, but plan to upgrade in the near future.
Reply With Quote
  #2  
Old 05-31-2007, 01:06 AM
Fabsboards Fabsboards is offline
 
Join Date: May 2007
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anybody? I thought this would be simple.
Reply With Quote
  #3  
Old 06-02-2007, 09:17 PM
Fabsboards Fabsboards is offline
 
Join Date: May 2007
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anyone actually read these messages???
Reply With Quote
  #4  
Old 06-03-2007, 03:22 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We do read these messages....It's only because you're using 3.0.x that it's going to be hard to get a reply.
Reply With Quote
  #5  
Old 06-03-2007, 05:46 AM
Fabsboards Fabsboards is offline
 
Join Date: May 2007
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
We do read these messages....It's only because you're using 3.0.x that it's going to be hard to get a reply.
Thanks! I'll get updated this weekend. Then I'll be back!
Reply With Quote
  #6  
Old 07-21-2007, 04:39 PM
Fabsboards Fabsboards is offline
 
Join Date: May 2007
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, we upgraded our license and upgraded to 3.6.7.

I'm looking for PHP code to determine if someone is logged in, and what kind of user they are. Are there any example files I can use?
Reply With Quote
  #7  
Old 07-21-2007, 06:10 PM
nexialys
Guest
 
Posts: n/a
Default

the vBulletin code for logged in verification is simple:

PHP Code:
if($vbulletin->userinfo['userid']) {
this user is logged in

and for examples... all the vBulletin core files have authentication for permissions, sessions and actions... you are not very clear on what you need to know, so it is complicated to have examples...
Reply With Quote
  #8  
Old 07-21-2007, 11:05 PM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
if (is_member_of($vbulletin->userinfo6)){
   
This user is an Administrator.

Reply With Quote
  #9  
Old 07-21-2007, 11:09 PM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if will also work
PHP Code:
if($vbulletin->userinfo['permissions']['adminpermissions']){..} 
or
PHP Code:
if(!$show['admincplink'])print_no_permission(); 
i think there are many ways
but not all are correct, because, there are many different "admintypes" (i hope someone can explain more what i think*g*
i mean because of the adminpermissions..)
Reply With Quote
Reply


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 12:42 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.11555 seconds
  • Memory Usage 2,244KB
  • Queries Executed 13 (?)
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
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (8)postbit_onlinestatus
  • (9)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_postinfo_query
  • fetch_postinfo
  • 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