vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Need help on session management in vB and pulling data from a forum. (https://vborg.vbsupport.ru/showthread.php?t=174659)

ADM 03-31-2008 04:56 AM

Need help on session management in vB and pulling data from a forum.
 
Hi,

What I would like to do is be able to display a user's details on a external page (not run by vBulletin) if the user is logged in, if they're not then display a login page.

Also possibly show notifications (private messages, new visitor messages etc) underneath that if they're logged in.

Another thing is I'd like to pull the first post of the last X topics from a forum I specify.

I was looking into a CMS that could integrate into the forum but since I only need the news displayed and I'd like to be able to show a user's details if they're logged in I don't think I need the extra bloat a CMS would offer.

The reason I'd like the user details is because eventually I want to lock certain pages off to non-members (for competitions) or other similar things.

Thanks.

Dismounted 03-31-2008 08:33 AM

The easiest way would be to include vBulletin's backend (global.php). This would give you data such as if the user was logged in or not. It would also accommodate your idea of locking off pages to certain usergroups.

ADM 03-31-2008 11:21 AM

Thanks. Do you know if there are any plugins/addons that do what I want or code samples?

Dismounted 03-31-2008 11:38 AM

Plugins alter the functionality of vBulletin - not what you're doing :). One of the best code samples for this task:
PHP Code:

$curdir getcwd();
chdir('./path/to/forums/');
require_once(
'./global.php');
chdir($curdir); 


ADM 03-31-2008 12:02 PM

Heh I think i could have chosen a bit of better word than plugin ;) I meant a php file that has all these pre-programmed as functions I can call.

I know how to include the global and call on that but more specifically I need help with actually getting the user details and so on. Or can I just use the code from vB that does this since I'll be using global?

Dismounted 03-31-2008 12:06 PM

You can use code as you would in a plugin. This includes the whole $vbulletin class.

ADM 03-31-2008 12:09 PM

Excellent. Much appreciated! Thanks Dismounted.


All times are GMT. The time now is 09:14 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.01015 seconds
  • Memory Usage 1,717KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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