|
Calling MyBB engine from external script?
|
|
10-23-2008, 01:52 PM
(This post was last modified: 10-23-2008 01:54 PM by siberianlaika.)
Post: #1
|
|||
|
|||
|
Hi!
I'm working now on Drupal bridge to MyBB. One of desirable features for this app is single sign-on (SSO). I made login from MyBB plugin to Drupal site and its works with such code: PHP Code: include('./includes/bootstrap.inc');because Drupal allows to use it from other scripts. Just needed include bootstrap.inc and execute drupal_bootstrap(), then you may use Drupal functions - login, logout, save nodes, users etc. But on other side I get in troubles ![]() I tried to initialize MyBB from Drupal module: PHP Code: global $db, $lang, $mybb, $mybbgroups, $time, $cache, $plugins, $session, $groupscache, $displaygroupfields, $templates;No errors, init seems successfull, but I not found way how to login user to MyBB site from Drupal module. Dances around member.php not get me success. MyBB hooks also seems unuseful for this case. Fallback way is to imitate MyBB cookies and set them from Drupal directly, but I hope maybe another way exists? Well... my questions are: What is right way to include MyBB to external scripts and execute MyBB functions? Is there method for external login/logut user to MyBB site? Is ther methods for other operations like create/modify/delete threads/replies and so on? Thank for any useful suggestions. |
|||
|
10-23-2008, 04:27 PM
Post: #2
|
|||
|
|||
|
RE: Calling MyBB engine from external script?
You shouldn't need to global all that stuff and just include global.php.
Try that. Unless you are executing functions from specific mybb includes there is no need to seperately include them. Login does not require more but the posting pages might. Hope that helps. MYPS is now available for FREE! Download over 40 exclusive plugins at Mybb Central [Some plugins at Mybb Central are for paid subscribers only] |
|||
|
10-23-2008, 09:37 PM
(This post was last modified: 10-24-2008 09:51 PM by siberianlaika.)
Post: #3
|
|||
|
|||
|
RE: Calling MyBB engine from external script?
Thank for directing me to right way. I digging code again and understand logic of MyBB (I hope). Sign-on works in both directions now
![]() For these who follows this topic later. Right piece of code for this task is: PHP Code: require_once("global.php"); |
|||
|
10-24-2008, 08:24 AM
Post: #4
|
|||
|
|||
|
RE: Calling MyBB engine from external script?
^ You might want to be careful with that. You're including global.php, then member.php will include it again. Easiest fix is to change "include" to "require_once".
|
|||
|
10-24-2008, 09:30 AM
Post: #5
|
|||
|
|||
| RE: Calling MyBB engine from external script? | |||
|
10-24-2008, 07:12 PM
Post: #6
|
|||
|
|||
|
RE: Calling MyBB engine from external script?
How to get mybb settings in joomla?
I tried to include global.php but that didn't work |
|||
|
10-25-2008, 01:58 AM
Post: #7
|
|||
|
|||
| RE: Calling MyBB engine from external script? | |||
|
10-25-2008, 02:08 AM
Post: #8
|
|||
|
|||
|
RE: Calling MyBB engine from external script?
I wonder how hard it would be to create a bridge class. Does that even make sense?
MYPS is now available for FREE! Download over 40 exclusive plugins at Mybb Central [Some plugins at Mybb Central are for paid subscribers only] |
|||
|
« Next Oldest | Next Newest »
|
Search
Member List
Calendar
Help







![[Image: banner.png]](http://www.sencweb.nl/images/banner.png)