vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Login Session (https://vborg.vbsupport.ru/showthread.php?t=312344)

juronx 06-23-2014 12:22 AM

Login Session
 
How To Use Login Session On other PHP Pages?

This Code 's=$session[sessionhash]' Not Work...

Help Me Please : (

kh99 06-23-2014 07:47 AM

You could include vb's global.php in your script, like in this article: https://vborg.vbsupport.ru/showthread.php?t=228112 . Otherwise I'm not sure if there's any other way to do it.

juronx 06-23-2014 05:31 PM

Very Very Tnx...

but
I Have Been Made A PHP File In This Address:
localhost/nuke-test/vb-login.php
PHP Code:

<?php
    chdir
("./vb");
    @require_once(
"includes/config.php");
    @require_once(
"global.php");

    if (
$vbulletin->userinfo['userid'] != 0) { 
    
    
$bekir = ($vbulletin->userinfo['username']);
    
    print(
$bekir);
    
    }
     
     else { echo 
"No Set..."; }

?>

Then, Include File To This Address For Show Logged User:
localhost/nuke-test/blocks/user-block.php
PHP Code:

<?php
include('../vb-login.php');
?>

This error is:
Code:

Fatal error: Call to undefined method vB_Database::sql_query() in...
Vb Installation Path: localhost/nuke-test/vb

kh99 06-23-2014 06:58 PM

I'm not sure but I think it might be a "current directory" problem. I think you need to chdir to the vbulletin install directory from wherever the orignially requested script is, not from where vb-login.php is.

juronx 06-23-2014 08:29 PM

TnQ,
Directory Changed to the VBulletin Install, And This Error:
Code:

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in [path]\global.php(29) : eval()'d code on line 33

Fatal error: Call to undefined method stdClass::set() in D:\Install\xampp\htdocs\vb\global.php(29) : eval()'d code on line 46


kh99 06-23-2014 08:53 PM

Sorry, maybe I said that wrong. Just to make sure, you don't want to change to the install subdirectory, I meant to make sure that the chdir ends up at localhost/nuke-test/vb.

But if you did that, then it looks like the problem is with a plugin using hook global_start. I've seen that error when you try to use vb3 plugins with vb4, but if that were your problem you'd see it when you went directly to the forum, and not just when you use your script.

juronx 06-23-2014 09:21 PM

Many Thanks...
The Problem was Solved.


All times are GMT. The time now is 07:47 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.01468 seconds
  • Memory Usage 1,724KB
  • 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
  • (2)bbcode_code_printable
  • (2)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