Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-16-2004, 10:55 PM
paulmjno paulmjno is offline
 
Join Date: Sep 2004
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Site-wide integration

Hello,

I am moving from phpBB to vB, which I just purchased. I had a script for my phpBB which allowed me to display user information on any page on my website, and allowed users to login on any page of my website. With this script I could write my own little scripts, like:

if (user is logged in) {
do this
} else {
do this
}

The script also allowed me to retreive the users name if they were logged on. Does anything like this exist for vB?

Thank you.
Reply With Quote
  #2  
Old 09-16-2004, 11:51 PM
Dark_Wizard Dark_Wizard is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 1,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes it does...you may also want to check out vBAdvanced CMS
Reply With Quote
  #3  
Old 09-17-2004, 12:08 AM
paulmjno paulmjno is offline
 
Join Date: Sep 2004
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dark_Wizard
Yes it does...you may also want to check out vBAdvanced CMS
It does, where? And vBAdvanced CMS isn't what I want, that is a portal-type system. This script I could simply include on any PHP page on my site.
Reply With Quote
  #4  
Old 09-17-2004, 12:57 AM
paulmjno paulmjno is offline
 
Join Date: Sep 2004
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://www.ajquick.com/programming/phpbb/tutorial/" target="_blank">Here</a> is the script I used.
Reply With Quote
  #5  
Old 09-17-2004, 02:13 AM
Tekton Tekton is offline
 
Join Date: Jun 2004
Location: Wisconsin
Posts: 362
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you include vB's global.php on your php page, it basically does what you're looking for I'm pretty sure.
PHP Code:
// Near or at the begining of the php file
require_once('./global_stock.php'); 
Then something like this....
PHP Code:
if ($bbuserinfo['userid']){
// If they are logged in, then do this
//stuff here
}
else{
// If they aren't logged in, do something else here.

.... furthermore... (correct me if I'm wrong), but you can do a check to see if someone ISN'T logged in by adding an exclamation mark...
PHP Code:
if (!$bbuserinfo['userid']){


Reply With Quote
  #6  
Old 09-17-2004, 02:28 AM
paulmjno paulmjno is offline
 
Join Date: Sep 2004
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Tekton, that works. Is there any way to retreive the users username if they are logged in?
Reply With Quote
  #7  
Old 09-17-2004, 02:48 AM
Tekton Tekton is offline
 
Join Date: Jun 2004
Location: Wisconsin
Posts: 362
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by paulmjno
Hey Tekton, that works. Is there any way to retreive the users username if they are logged in?
$bbuserinfo[username]

Not sure if you need the quotes like 'username'; I can't remember off-hand.

By the way, if you didn't know this is an interesting fact. You can user the $bbuserinfo[] on ANY field in your database's user table.

$bbuserinfo[posts]
$bbuserinfo[ipaddress]
$bbuserinfo[gold]
etc...

Just in case you wanted to know! ^__^;;
Reply With Quote
  #8  
Old 09-17-2004, 02:50 AM
paulmjno paulmjno is offline
 
Join Date: Sep 2004
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Tekton, thanks alot! Now I can display all sorts of user information on any page of my site when the user is logged in.
Reply With Quote
  #9  
Old 09-17-2004, 03:02 AM
Tekton Tekton is offline
 
Join Date: Jun 2004
Location: Wisconsin
Posts: 362
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No problem It's all done already in the global file, so no use running any unnecessary queries to get that data at least. Good luck!
Reply With Quote
  #10  
Old 09-17-2004, 12:39 PM
paulmjno paulmjno is offline
 
Join Date: Sep 2004
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I spotted a problem. It will display the users information even if they have not been activated by a moderator. Is there a way to write a test as to whether the user is actually active and logged in?

Edit: I guess I should say, can I write a test script if the user is apart of the "awaiting moderation" usergroup?
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 10:16 PM.


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.04984 seconds
  • Memory Usage 2,256KB
  • 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
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete