vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Integrate vbulletin login / session info sitewide (https://vborg.vbsupport.ru/showthread.php?t=79416)

zeropaid 04-05-2005 04:32 PM

Integrate vbulletin login / session info sitewide
 
Hi, I know there are robust hacks out there that will do this and more, but I am looking for something extremely simple. What I want is a snippet of code I can include on all the pages on my site that are outisde the forum that will :

a) recognize a user as logged in, start their session, add them to the who's onling list, and show some stats, like:
Welcome back:
zeropaid
You last visited:
29. Mar 2005 11:10

View New Posts
Your Buddies
Mark Forums Read
Log Out
There are 297 users online, 45 members and 252 guests

b) not recognize a user as logged in, start their session, and present them with a login box and some who's online stats

I also need to be able to grab this user's userid for use in other applications, so that either needs to be a session variable I have access to or a cookie or something once they are logged in.

Please let me know if there is an exisiting hack for this, if not I will pay for one.

Thanks,

Chris

why-not 04-05-2005 04:50 PM

Is the site across different domain names or just sub-domains! You could do it both ways just the first way would be more work to get by the browser not letting you read or manage a cookie that is not a member of the current domain.

I have a script that I use for chat logins that I think I could convert to do this, it creates a small login box that you can place on any PHP page! You call it like so!

Code:

$box = not_user_login();
What it does, is checks to see if the user is logged in, if not it returns an array with a login box template, if they are logged in it just updates the session.

If this is what your wanting tell me and I will post you some code to do it! It might not be until tomorrow as I am busy at the moment!


Sonia

zeropaid 04-05-2005 05:37 PM

yeah, thats kind of what we are looking for, if you can please post the code and I will try it out. All our pages are ont he same domain.

greenhybrid 04-06-2005 01:38 AM

I'm looking for a similar script that basically lets a visitor show up "online" even if they aren't in a forum page. There should also be a way to validate if they're logged in so that they can be denied access to certain pages accordingly.

TyleR 04-06-2005 01:52 AM

just rename your files into php files, like so:

PHP Code:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT''file_name_here');
define('NO_REGISTER_GLOBALS'1);

// ################### PRE-CACHE TEMPLATES AND DATA ###################### 
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore 
$specialtemplates = array();

// pre-cache templates used by all actions 
$globaltemplates = array();

// pre-cache templates used by specific actions 
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
// assuming your forums folder is in a seperate direcotry than the area you have made.
chdir('./forum/');
require_once(
'./global.php');
chdir('./');

echo<<<EOF
your HTML can now go here ~_^

EOF;

?>

i don't trust my "EOF" thing in the echo, but maybe someone can fix it if it's wrong :p

xBhp 01-07-2006 01:23 AM

hey, so did tyler's method worked? anyone? :)

Mistah Roth 05-13-2006 09:57 PM

I'm also looking for something like this, I have a number of inefficient methods of getting the username or guest welcome displayed, but I can't seem to get people browsing non-vb pages to end up in online.php.

In vb 3.0.0 including global made it work fine :(

Marco van Herwaarden 05-16-2006 09:04 AM

Quote:

Originally Posted by Mistah Roth
I'm also looking for something like this, I have a number of inefficient methods of getting the username or guest welcome displayed, but I can't seem to get people browsing non-vb pages to end up in online.php.

In vb 3.0.0 including global made it work fine :(

Are you asking this for vB3.0? If not please ask in the 3.5 forums.

There are a few integration hacks/frameworks available, but often it would require customisation for your specific situation.

Mistah Roth 05-16-2006 11:42 PM

No, I'm asking for vb 3.5.4

I'm saying that this was easy in vb 3.0.0 lol


All times are GMT. The time now is 06:22 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.01041 seconds
  • Memory Usage 1,737KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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