vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   info about session table (https://vborg.vbsupport.ru/showthread.php?t=141943)

ghiboz 03-13-2007 01:07 PM

info about session table
 
hi all!
I'm trying to develop a little cms based on vbulletin... I wish know how can I do to insert a user in the session table...
example..
the user enter in the home of the forum and automatically appears a record in the table...
but if the user go on my main page doesn't appear in session...
how can I do this?:rolleyes:

thanks

Marco van Herwaarden 03-13-2007 02:55 PM

Just include global.php in your script and a session will be done automatically.

ghiboz 03-13-2007 03:12 PM

Quote:

Originally Posted by Marco van Herwaarden (Post 1202567)
Just include global.php in your script and a session will be done automatically.

thanks! but

PHP Code:

require("./includes/config.php");
require(
"./global.php"); 

I use these, and works, 'cause i tried to comment the second line and the message that appears is this:
Code:

Fatal error: Call to a member function on a non-object in /home/admin/domains/test/public_html/forum/includes/functions_user.php on line 263
I suppose that the path is correct and global.php is included, but the session doesn't appears valid

thanks again:up:

JMH11788 03-21-2007 12:49 AM

Quote:

Originally Posted by ghiboz (Post 1202580)
thanks! but

PHP Code:

require("./includes/config.php");
require(
"./global.php"); 

I use these, and works, 'cause i tried to comment the second line and the message that appears is this:
Code:

Fatal error: Call to a member function on a non-object in /home/admin/domains/test/public_html/forum/includes/functions_user.php on line 263
I suppose that the path is correct and global.php is included, but the session doesn't appears valid

thanks again:up:

I've been trying to get past this for months. Someone please help him (us) :(

Just to add to the information pool, I also get this error sometimes when trying to do the same thing:

warning: array_keys(): The first argument should be an array in /var/www/forums/includes/functions.php on line 3699.
warning: Invalid argument supplied for foreach() in /var/www/forums/includes/functions.php on line 3699.

Dismounted 03-21-2007 08:47 AM

PHP Code:

require("./global.php"); 

Just that is sufficient. The config is loaded by global.php.

JMH11788 03-21-2007 01:07 PM

Quote:

Originally Posted by Dismounted (Post 1208628)
PHP Code:

require("./global.php"); 

Just that is sufficient. The config is loaded by global.php.

right, but why does it not work then?

I've noticed it usually works okay if your file is in the same directory as vBulletin, but if you aren't in the same directory then problems arise quickly. A fix is to use chdir() to set the right working directory before including the file. It works all fine and dandy until I try to add all of it into a function (my CMS uses functions for nearly everything so it has to go in a function). I've been pulling my hair out trying to make it work.

I'm going to try including the login file with an include via http. I'll declare the username and password variables global so they are available outside of the scope. HOPEFULLY that will work, but at this point it seems to be wishful thinking :(

kkiely 03-28-2007 11:56 PM

I use

<?php
chdir("vbforum/");
require('./global.php');
chdir("../");
?>

and it works fine

JMH11788 03-29-2007 02:04 AM

Quote:

Originally Posted by kkiely (Post 1214902)
I use

<?php
chdir("vbforum/");
require('./global.php');
chdir("../");
?>

and it works fine

I use

PHP Code:

<?php

$cwd 
getcwd();
chdir('/var/www/forums');
require_once(
'./global.php');
chdir($cwd);

?>

and it works sometimes and not others. I've been dissecting the code more and have learned what causes the error. It all depends on what you are trying to do though, but I got it down pat pretty well.


All times are GMT. The time now is 02:36 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.01899 seconds
  • Memory Usage 1,735KB
  • 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
  • (5)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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