vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Get userid & username from Non-vB page ? (https://vborg.vbsupport.ru/showthread.php?t=69220)

Bergman 09-08-2004 10:09 AM

Get userid & username from Non-vB page ?
 
In order to get OakGallery to work with vB 3.0.3 it would be really great if someone could help me with a PHP script.

The only thing i need to know how i can find out the userid & username for the user that runs the PHP script. Anyone who can help me out ? Please. :)

Dark_Wizard 09-08-2004 11:11 AM

Quote:

Originally Posted by Bergman
In order to get OakGallery to work with vB 3.0.3 it would be really great if someone could help me with a PHP script.

The only thing i need to know how i can find out the userid & username for the user that runs the PHP script. Anyone who can help me out ? Please. :)

At the top of the Oak script add this:
PHP Code:

require_once('./global.php'); 

then to get the userid -> $bbuserinfo[userid] and for the username -> $bbuserinfo[username]

Bergman 09-08-2004 11:48 AM

We have tested the following with no luck
require('./global.php');

and i dont think that
require_once('./global.php');

will do any diffrence. The first one worked fine with ver 2.3.0 version of the forum but after upgrade to 3.0.3 it does not work anymore. Maybe its something in 3.0.3´s global.php that makes the error.

But i will test the require_once thing when i comes home in 3 hours.

Colin F 09-08-2004 11:52 AM

that shoudn't make a difference. You might have to adjust the path if the script is in a different directory than the vBulletin root folder.

Bergman 09-08-2004 12:18 PM

Strange, my scripts finds the global.php and also loads it but it doesnt seem to find the id and name. It also makes the OakGallery unfunctional ... probably there is something in global.php that messes tha gallery up. Dont know what though.

http://217.215.89.49/fiskesnack/fotogalleri/index.php

Dark_Wizard 09-08-2004 12:41 PM

Use this:

require_once('../forum/global.php');

Bergman 09-08-2004 03:59 PM

Didnt work either ... it seems that a lot of variables (set in OakGallery) is resetted by global.php or some include-script.

Bergman 09-08-2004 04:18 PM

When i remarken the Init.php script inclusion all variables was back ... dont understand how that one works. :(

Bergman 09-08-2004 04:31 PM

Now i know what the problem are ... its the following section in Init.php that disables all neccessary variables for the OakGallery. Is it "safe" do disable it ?

-------------------------------------------------------------------------------
// ################################################## ###########################
// set which variables can pass through globals filter
$_allowedvars = array(
'GLOBALS', // of course :)
'_GET', // }
'_POST', // } system variables
'_COOKIE', // }
'_REQUEST', // }
'_SERVER', // }
'_ENV', // |
'_FILES', // }
'specialtemplates', // special templates from datastore table
'globaltemplates', // used for template cacheing
'actiontemplates', // templates for specific script actions
'phrasegroups', // phrase groups (in addition to 'global')
//'actionphrases', // phrase groups for specific actions
'noheader', // used to suppress the default vB headers
'nodb', // suppress database connection
'nozip', // suppress gzipping
'steptitles', // step titles for upgrade scripts
'pagestarttime', // microtime() from top of page
'_allowedvars', // this array :-)
'___db_user', // lycos has special variables
'___db_host', // lycos has special variables
);


All times are GMT. The time now is 07:30 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.01125 seconds
  • Memory Usage 1,732KB
  • 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)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