Hi, i need to integrate a game written in PHP with Smf. I looked into SSI.php but it seems there are functions to show statistics or read-only information.
I need to:
- Register automatically a user (already registered to the game) (now i do it by updating directly SMF tables)
- Assign/deassign automatically a (existing) profile to a user
- Deleting a smf user
Is there another set of API around beside SSI.php?
Thanks
Not really -- but some files DO have the ability to do what you said.
Take a look at the Function Database at Development.
I've looked at those function but they seem not integration APIs,
I have read some more posts and seems i maybe have to use integration hooks? Is there around some examples on
how i can use them from a simple php file?
Thanks
Quote from: Sunchaser on February 08, 2011, 02:55:47 PM
I've looked at those function but they seem not integration APIs,
I have read some more posts and seems i maybe have to use integration hooks? Is there around some examples on
how i can use them from a simple php file?
Thanks
Those are indeed integration APIs. -- in fact, they are way more powerful.
Just require the file in your game, and use the desired function.
I tried the following
<?php
define ("SMF", 1 );
require "./Subs-Members.php";
deleteMembers( 'test_creaschema' );
?>
Gives an error like:
PHP Fatal error: Call to undefined function isAllowedTo() in <cut>httpdocs/Sources/Subs-Members.php on line 138
(function isAllowed is in the security.php file.
I have some questions:
1) What's the difference between Subs-* files and other files, and which ones should i include?
2) Which one i should include to avoid missing functions errors?
3) security checks the script for authentication, how i am supposed to authenticate the script
Sorry for all these questions, if there is a link you can point me to i can try to address the problem myself
Thanks
The function db has links to descriptions.
You need to require security.php too then before including the other file.
Just include SSI.php before including the other file which loads all the important parts of SMF like the query functions, the allowedTo stuff and so on.
Also, consider using the integration_hook functions rather than native smf functions...