smf_api_2.php extension for advanced integration

Started by vb, January 28, 2007, 02:40:08 PM

Previous topic - Next topic

vb

I have made SMF 1.1 + Drupal 5 bridge.
I cannot use excellent SSI.php because both system use the same name db_query().
So I had to modify smf_api and extend its functionality.
smf_api_2.php extends functionality of smf_api.php and provides additional capabilities for advanced integration at low level.
A lot of functions needed in Drupal+Smf and other projects were adapted from SSI.php and smf core to work without including full Smf installation like in SSI.php to prevent naming conflicts.

You can use smf_api_2.php with or without current smf_api.php.
If you need something from current or next release of smf_api.php you can include both.


require_once (dirname(__FILE__) . '/smf_api.php');
require_once (dirname(__FILE__) . '/smf_api_2.php');


In this case smf_api_2.php extends functionality of smf_api.php.
If you do not need functions from smf_api.php you may use only smf_api_2.php.


require_once (dirname(__FILE__) . '/smf_api_2.php');


See smf_api_2_examples.php for usage.
http://vgb.org.ru/forum/smf_api_2_examples.php

Installation

1. Unpack smf_api_2.zip
2. Move smf_api_2.php, smf_api_2_subs.php to your smf root.
(Move smf_api_2_examples.php if you want to see demo)
3. Include smf_api_2.php in your php code.

Advanced
2. Move smf_api_2.php, smf_api_2_subs.php to directory of your choice.
3. Define global $smf_boarddir; and set it to smf root.
4. Include smf_api_2.php in your php code.


global $smf_boarddir;
$smf_boarddir = 'path to your smf root';
require_once ('path to your directory' . '/smf_api_2.php');


You may see advanced usage of smf_api_2.php function calls in Drupal smfforum.module code.

To see how smf_api_2.php works in SMF 1.1 + Drupal 5 bridge you may visit
http://vgb.org.ru

The current state of smf_api_2 is beta1.

At the moment it is stable and has no critical bugs but testing, fixing and some of improvements of course could be made.

Regards,
vb

OSLinux

~
Linux, Drupal5 & SMF work great 4 FREE @ www.iFASTnet.com [nofollow]

MrPrise



MrPrise

Thank you very much! I start to play with that! :-)

MrPrise

#5
I installed it. When I try to log in with an SMF user from Drupal I can't visit the recent topics because SMF require to login again. I think this is my mistake. Could you please give me some idea to fix this? I have a working SMF forum and I would like to build a portal around that, so I choosed master smf from the admin area.
Another small thing: When I gave to Drupal the wrong password it told me there is no such user in SMF which is not real because only the password was bad.
And a question: I expect an SMF+Drupal integration that: when I have SMF and Drupal in a different subdomain, after I login using one of them I can go to the other system's domain and I can see I'm already logged in it and vica versa. Can I achieve this with your extension?

Advertisement: