IPB SDK How-to for IPB 2.2
After a slew of upgrades and massive internal reworking over at Highend3d, Will and I decided to upgrade his Invision Power Board installation. Its been a few months since the latest Boards version 2.2 as well as IPBSDK, so you’d think we were in the ‘safe zone’. HECK NO! Ipbsdk threw a fit. After gathering a few horror stories, I think I have a good idea of how to fix it, involving 2, possibly 3, steps!
Our main file to edit..
ipbsdk/ipbsdk_class.inc.php
Step 1: New Bootstrap Method
Right before the inclusion of the main IPS file..
require_once ROOT_PATH . "sources/ipsclass.php"; |
require_once ROOT_PATH . "init.php"; |
Step 2: Instantiation
Previously, the basic instantiation of the ipbsdk libs could be done multiple times, e.g.
1 2 3 4 5 6 7 8 9 10 11 |
require_once "ipbsdk/ipbsdk_class.inc.php"; global $SDK; $SDK =& new IPBSDK(); $SDK->create_forum(....); .... some code.... require_once "ipbsdk/ipbsdk_class.inc.php"; global $SDK; $SDK =& new IPBSDK(); $SDK->write_pm(....); |
$SDK =& new IPBSDK;
commands all over the place.
If you see this error
Fatal error: Call to a member function on a non-object in /home/tm/domains/public_html/forum/sources/handlers/han_parse_bbcode.php on line 380 |
At this point, most people’s boards should work just fine!
Step 3 (Optional): Corrupt Group Data
We had some corrupt group/user data that would throw up IPS DB Driver errors as well. If you’re having issues, do a grep for ‘IN(’ in the class file. if you see a statement like..
g_id IN(".$info['mgroup_others'].")"; |
g_id IN(".(strlen($info['mgroup_others']) ? $info['mgroup_others'] : "''").")" |
I’m not a big fan of forum software in general. Its always big, bloated, ugly, and appeals to stats-whores of the worst kind (oh look, I have a shiny new counter for xxxx feature). Digging through forums for a fix like this drives me nuts! Hopefully, being in a blog makes this more easily accessible for those of us that enjoy blogs! Converge, oh IPB users, converge I say ;)
March 21st, 2007 at 08:07 AM Thanks.. this helps a lot