Jump to content
Matt
 Share


IP.Board 3: Networking And Integration

Brandon blogged a while back about IP.Board's integration points.

I wanted to spend a moment discussing the features within IP.Board 3 that all you integrate the board with your website and to create your own network.

Member Management
Since IP.Board 2, we've had, what we call, "Log In Modules". This is basically a mini-framework to allow custom code to be used easily when authenticating and registering members. For example, if you had a database full of members and you wanted for them to be able to use their existing usernames and passwords, you could add a log in module to query your database or other system (via SOAP, XML-RPC, etc) for authentication.

This system has been enhanced based on user feedback and IP.Board now ships with modules for LDAP and OpenID which will make it much easier to use existing authentication.

Networking
The log in modules also tie into our 'IP.Converge' product which allows you to share authentication details across multiple IP.Board installations. The IP.Boards don't even need to be on the same server! In fact, we use Converge and the log in modules ourselves so that our customers can use the same log in details on the forum as they do in our ticket center.
You could use this functionality to share members across many forums, creating a true network of members.

Using the IP.Board Engine

We've made no secret that IP.Board 3 is a complete rewrite. The new framework makes full use of PHP 5 and incorporates many timesaving features that you can instantly make use of.

It's common for our customers to ask how they can use certain parts of IP.Board within their own website. For example, they'd like to show a list of recent topics or posts. That's no problem as we've had an API class interface since IP.Board 2.

However, if you wanted to send data to IP.Board, such as a new post or new personal message; things got tricky. Even using a template bit required a lot of code copying.

For example, if you wanted to make use of our database engine or templating engine, you would need to copy a lot of 'index.php' so that it set up ipsclass correctly. With IP.Board 3, that is no longer required. You can use our engine in your own scripts as simply as this:

  require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );    $registry = ipsRegistry::instance();  $registry->init();

require_once( './initdata.php' );





Those few lines of code give you access to: Caches, settings, member management, database management and more.

Writing your own code
Quite often, you want to add some IP.Board functionality to your own website. With IP.Board 3.0.0 it's very simple.

You want to add a new post? No problem, simply use that code above and add:

    $postClass = new classPostForms( $registry );  $postClass->setForumID( $forumID );  $postClass->setForumData( $this->registry->class_forums->forum_by_id[ $forumID ] );  $postClass->setTopicTitle( "My Topic" )  $postClass->setPostContent( "Hello, I am post content!" );  $postClass->setAuthor( $memberID );    try  {      $postClass->addTopic();  }  catch( Exception $error )  {      print $error->getMessage();  }

require_once( IPSLib::getAppDir( 'forums' ) . '/sources/classes/post/classPost.php' );

















It's really as simple as that! Note the try -> catch block? That's consistent with all the new API-like functions. We take advantage of the PHP 5 exception handler to return information on what went wrong. We also list all the possible exceptions that are returnable in the phpDoc for that function.

Of course, seasoned modification authors will already be familiar with functions similar to those present in IP.Board 2's API system. The good news here is that this functionality doesn't require an API bridge anymore, it's the exact same code that is used in the normal posting routines.

Do you want to send a new personal conversation to someone in your own code? Simple!

  $messengerFunctions = new messengerFunctions( $registry );  $messengerFunctions->sendNewPersonalTopic( $toMemberID, $fromMemberID, $invitedUserIDArray, $msgTitle, $msgContent );

require_once( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php' );



Want to get a list of PMs in your own code?

  $messengerFunctions = new messengerFunctions( $registry );  $messengerFunctions->getPersonalTopicsList( $memberID, 'in' );

require_once( IPSLib::getAppDir( 'members' ) . '/sources/classes/messaging/messengerFunctions.php' );



Another common request is to use IP.Board's templates in your own projects, again this is as simple as:

  require_once( IPS_ROOT_PATH . 'sources/base/ipsRegistry.php' );    $registry = ipsRegistry::instance();  $registry->init();    print $registry->output->getTemplate( $templateGroup )->templateName( $templateArguments);

require_once( './initdata.php' );







There really is so much that you can do. Listing them all would make for a very large blog entry indeed! We will of course be providing a lot of documentation on these new features.

Combine this functionality with the new hooks and plug-ins system and you've got a very quick way to build new code using our core. We're very excited to see what you do with it!

 Share

Comments

Recommended Comments

Great Great Great, Just too bad that i have already built my website using the current settings, I hope updating will not be that hard (considering that the new version was rewritten i think it will)


It's fixed in the blog entry but not in the topic post in the IPS Blog forum , Just wanted to mention that.

Fixed

Link to comment
Share on other sites

its sounds more and more nicer, each post give me the to say "WTF!~ how can 1 person do all that work , and why he gives us to 'surffe' whlie not see the IP BOARD 3" lol~ kidding,
qustion: when you wil release the beta in the IP BOARD forum?

Link to comment
Share on other sites

Oh God, this is like 99% my problems solved, now can you provide an efficient template integration? I think that integrating forum elements on our sites is great, but most importantly on the user's end is the integration of our blogs with the forums.

Integration the look and feel of our sites/blogs with IPB has been a pain for the longest time, I would highly suggest a much more efficient way to insert our website's header and footer into the IPB's.

Link to comment
Share on other sites

Erick, I think that was what this part was trying to explain :)



That would give the exact same template that is used on your forums, on your website :)

YumeChan, Brandon and Josh and maybe others, also work on IPB3 code :)

print $registry->output->getTemplate( $templateGroup )->templateName( $templateArguments);

Link to comment
Share on other sites

Yea, i think that the fist thing ill do in PHP when IPB 3 will release is to say "i wont do ANYTING else them read the whole IPB 3 until i'll get all the system and get to the level to know how to build systems in that lv" becuse its sounds so cool!@ :D but for now i have problems in 2.3.5 >.> so... ill try my best XD

Link to comment
Share on other sites

[quote name='NS2_Erick' date='Sep 30 2008, 11:34 PM']Oh God, this is like 99% my problems solved, now can you provide an efficient template integration? I think that integrating forum elements on our sites is great, but most importantly on the user's end is the integration of our blogs with the forums.

Integration the look and feel of our sites/blogs with IPB has been a pain for the longest time, I would highly suggest a much more efficient way to insert our website's header and footer into the IPB's.

Our template system supports many features to make this simpler (both in IPB 2.x and 3.x)

  1. Template includes can allow you to include other files into templates (e.g. a header or footer)
  2. PHP code can be executed right in the templates as well (in 2.x a constant needed to be enabled first, but it is always on with 3.x)
  3. In 3.x you can make template plugins, which will execute plugin files - allowing you to do nearly anything
Just for starters
Link to comment
Share on other sites



i dont see any reson to use Jommala if you can combine those code with some little nice PHP & HTML code and youll get a beutyfull website ;)

So does this mean integration with Joomla may be a possibility?

Link to comment
Share on other sites



Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...