Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-08-2004, 10:09 AM
Bergman Bergman is offline
 
Join Date: Aug 2002
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 09-08-2004, 11:11 AM
Dark_Wizard Dark_Wizard is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 1,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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]
Reply With Quote
  #3  
Old 09-08-2004, 11:48 AM
Bergman Bergman is offline
 
Join Date: Aug 2002
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 09-08-2004, 11:52 AM
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Posts: 1,551
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 09-08-2004, 12:18 PM
Bergman Bergman is offline
 
Join Date: Aug 2002
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 09-08-2004, 12:41 PM
Dark_Wizard Dark_Wizard is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 1,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use this:

require_once('../forum/global.php');
Reply With Quote
  #7  
Old 09-08-2004, 03:59 PM
Bergman Bergman is offline
 
Join Date: Aug 2002
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Didnt work either ... it seems that a lot of variables (set in OakGallery) is resetted by global.php or some include-script.
Reply With Quote
  #8  
Old 09-08-2004, 04:18 PM
Bergman Bergman is offline
 
Join Date: Aug 2002
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When i remarken the Init.php script inclusion all variables was back ... dont understand how that one works.
Reply With Quote
  #9  
Old 09-08-2004, 04:31 PM
Bergman Bergman is offline
 
Join Date: Aug 2002
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
);
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 09:42 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.03997 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
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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