Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-13-2007, 01:07 PM
ghiboz's Avatar
ghiboz ghiboz is offline
 
Join Date: Nov 2006
Location: centallo (I)
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?

thanks
Reply With Quote
  #2  
Old 03-13-2007, 02:55 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just include global.php in your script and a session will be done automatically.
Reply With Quote
  #3  
Old 03-13-2007, 03:12 PM
ghiboz's Avatar
ghiboz ghiboz is offline
 
Join Date: Nov 2006
Location: centallo (I)
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Marco van Herwaarden View Post
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:
Reply With Quote
  #4  
Old 03-21-2007, 12:49 AM
JMH11788 JMH11788 is offline
 
Join Date: Jan 2005
Location: Ohio
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ghiboz View Post
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.
Reply With Quote
  #5  
Old 03-21-2007, 08:47 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
require("./global.php"); 
Just that is sufficient. The config is loaded by global.php.
Reply With Quote
  #6  
Old 03-21-2007, 01:07 PM
JMH11788 JMH11788 is offline
 
Join Date: Jan 2005
Location: Ohio
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
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
Reply With Quote
  #7  
Old 03-28-2007, 11:56 PM
kkiely kkiely is offline
 
Join Date: Feb 2004
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I use

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

and it works fine
Reply With Quote
  #8  
Old 03-29-2007, 02:04 AM
JMH11788 JMH11788 is offline
 
Join Date: Jan 2005
Location: Ohio
Posts: 83
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kkiely View Post
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.
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 02:09 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.07279 seconds
  • Memory Usage 2,241KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_code
  • (5)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete