Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #11  
Old 07-03-2005, 03:39 PM
Xia Xia is offline
 
Join Date: Mar 2005
Location: Belgium
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, so I have changed the code to :

PHP Code:
<?php
function test() {
    global 
$phrasegroups;
    global 
$specialtemplates;
    global 
$globaltemplates;
    global 
$actiontemplates;

    
chdir('/home/wa/public_html/forum/');
    
$phrasegroups = array();
    
$specialtemplates = array();
    
$globaltemplates = array();
    
$actiontemplates = array();
    require_once(
'./global.php');
}

test();
?>
But it still doesn't work
Reply With Quote
  #12  
Old 07-04-2005, 06:01 PM
Xia Xia is offline
 
Join Date: Mar 2005
Location: Belgium
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone ? :s
Reply With Quote
  #13  
Old 07-06-2005, 11:03 AM
Xia Xia is offline
 
Join Date: Mar 2005
Location: Belgium
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No replies, does this mean it's impossible to do??
Reply With Quote
  #14  
Old 07-06-2005, 12:05 PM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it just means noone has a solution to fix your problem.


Now that I've read your requirements, no. you will not be able to do this to use it inside a class.

It is still possible, and since you're already mucking around with classes i dont see why you'd need help to copy the data_managers init function to make it work.

you will need to reproduce init.php's behaviour to initialise any variables the datamanager requires.
Reply With Quote
  #15  
Old 07-07-2005, 06:21 AM
Xia Xia is offline
 
Join Date: Mar 2005
Location: Belgium
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll look into that, thanks!

Btw, is there also a login function in that class or anywhere else which I can easily use from outside Vb? That would be very nice.
Reply With Quote
  #16  
Old 07-07-2005, 06:23 AM
merk merk is offline
 
Join Date: Nov 2001
Location: Canberra, Australia
Posts: 601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

im not sure. if there is one itll be in /includes/.
Reply With Quote
  #17  
Old 03-15-2006, 12:19 AM
johnobandalong johnobandalong is offline
 
Join Date: Feb 2006
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm having this problem too. Did anybody find a solution? How do other people integrate vbulletin with their application?
Reply With Quote
  #18  
Old 04-14-2006, 10:44 PM
kolita's Avatar
kolita kolita is offline
 
Join Date: Apr 2006
Location: Montevideo, Uruguay
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Xia,

(Hope is not too late.. well, it will serve someone else if it's too late for you )

Here's the code to get an instance of vbulletins' registry object (a.k.a $vbulletin).

I've placed toghether a couple pieces from various threads here in vb.org (including some of them from this same one, and from https://vborg.vbsupport.ru/showthread.php?t=112388)

You can place the function as a method in your class and call it statically like:
PHP Code:
$vbInstance = &yourClass::_getVbulletinRegistryInstance() 
(remember to use '=&', not just '=' here )

I've successfully tested this and used a datamanager, and it worked perfectly (created thread and post correctly :-D)

This follows a singleton pattern, so you'll never overwrite the instance, even if the instance was created by vB itself.

PHP Code:
function &_getVbulletinRegistryInstance() {
    
define('SKIP_SESSIONCREATE'1);
    
define('DIE_QUIETLY'1);
    
define('THIS_SCRIPT''vbSupport');
    
$GLOBALS['phrasegroups'] = array();
    
$GLOBALS['specialtemplates'] = array();
    
$GLOBALS['globaltemplates'] = array();
    
$GLOBALS['actiontemplates'] = array();

    
$cwd getcwd();
    
chdir($_SERVER['DOCUMENT_ROOT'].'/forum'); 

    if (!isset(
$GLOBALS['vbulletin'])) {
        include_once(
'./includes/init.php');
        
$GLOBALS['vbulletin'] = &$vbulletin;
    }
    
chdir($cwd);

    return 
$GLOBALS['vbulletin'];

regards!

Markus
Reply With Quote
  #19  
Old 05-10-2006, 12:27 PM
Hammon Hammon is offline
 
Join Date: Mar 2006
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Why isn't it possible to create a session? I would like to display the username on an external website if a user is logged in in the forum.
No one has the answer? I'm interested me too.
Reply With Quote
  #20  
Old 05-18-2006, 03:51 PM
bradsears's Avatar
bradsears bradsears is offline
 
Join Date: Aug 2003
Location: Toronto
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm struggling with this as well. Please help.
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:03 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04940 seconds
  • Memory Usage 2,256KB
  • 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
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete