Publishing System Settings Logout Login Register
Invision Power Board SDK Tutorial
TutorialCommentsThe AuthorReport Tutorial
Tutorial Avatar
Rating
Add to Favorites
Posted on April 30th, 2007
17724 views
PHP Coding
Hey this is my first tutorial on Pixel2Life where I will be teaching you how to use IPB SDK. IPB SDK is a library for IPB which makes site integration very easy.

Please note that this tutorial is for IPB 2.17 in particular. If you want this tutorial to work for IPB 2.2 you will need the v2.2 SDK. For information on how to get this click here

Uploading

First of all you need to download the IPB SDK. You can download it here (Invisionize registration required).

Now create a new folder on your hosting account called sdk. If you use FTP extract the ZIP onto a location on your PC and copy all of the files into the folder. If you use cPanel's File Management tool go into the folder, upload the IPB SDK ZIP file, click on it and on the right pane click Extract All Files.

You now have IPB SDK ready to configure.

Configuring
Once you have uploaded all the files open up ipbsdk_conf.inc.php for editing. For root path you should put in something like this:
$root_path = $_SERVER['DOCUMENT_ROOT'] . "/forum/";

If you don't understand what this means basically $_SERVER['DOCUMENT_ROOT'] is the public_html directory on your host and forum is your forum directory, for example if my forum was located at http://www.ipbsdkwebsite.com/community/forums/ you would put:
$root_path = $_SERVER['DOCUMENT_ROOT'] . "/community/forums/";


For $board_url just put your forums address (what you would type in the URL bar in your browser) without a trailing slash, for example:
$board_url = 'http://www.ipbsdkwebsite.com/forums';
I recommend you keep all other variables as they are.

Integrating

Now to start integrating. Open up a file you wish to integrate with your forums and at the top before anything else put:
<?php
require 'includes/sdk/ipbsdk_class.inc.php';
$SDK =& new IPBSDK();
?>


If you use PHP Navigation on your site (index.php?act=blabla etc.) just place the code on your master page, for example index.php?act=blabla you would just put the code at the top of index.php

Now I will teach you some of the things you can do using the IPB SDK.

Checking if user is logged in
If you want to check if a user is logged in you use this code:
<?php
if($SDK->is_loggedin())
{
// Display member only contents here.
}
?>

Basically $SDK->is_loggedin() returns a True/False answer to the PHP script. If a user is logged in the answer would be True. You can always add an else to the code for guests.

BB Code
bbcode2html(VALUE TO CONVERT, Smilies On(1)/Off(0));
Why create a BB Code script when IPB has already made a complex one with lots of options that you can use easily. This is an example of using BB Code:
<?php
if($_POST['submit'])
{
$inputfield = bbcode2html($_POST['input'], 1);
}
?>

This would convert whatever BB Code is found in input to HTML and smilies will be parsed.

Those are just two examples of what you can do with IPB SDK but there are dozens of other functions that you can use. For more examples just look in the examples folder.

Conclusion
I hope you enjoyed reading this tutorial. If there was something you didn't understand or you need help just send me a PM and I will answer as soon as possible. I would like to thank Pita (Invisionize.com) for the great SDK but most of all Jamie Chung (Chaos King) for this excellent publishing system.

Happy SDKing ^_^.
Dig this tutorial?
Thank the author by sending him a few P2L credits!

Send
drcrazy4

I am 14 years old, 15 soon and I live in the UK. I like PHP, HTML and Game Design. I run my own tutorial indexing site called Dream Tutorials which I spend quite alot of time and work on. That's about it!
View Full Profile Add as Friend Send PM
Pixel2Life Home Advanced Search Search Tutorial Index Publish Tutorials Community Forums Web Hosting P2L On Facebook P2L On Twitter P2L Feeds Tutorial Index Publish Tutorials Community Forums Web Hosting P2L On Facebook P2L On Twitter P2L Feeds Pixel2life Homepage Submit a Tutorial Publish a Tutorial Join our Forums P2L Marketplace Advertise on P2L P2L Website Hosting Help and FAQ Topsites Link Exchange P2L RSS Feeds P2L Sitemap Contact Us Privacy Statement Legal P2L Facebook Fanpage Follow us on Twitter P2L Studios Portal P2L Website Hosting Back to Top