diff options
Diffstat (limited to 'plugins/smf2')
-rw-r--r-- | plugins/smf2/smf2.module | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/plugins/smf2/smf2.module b/plugins/smf2/smf2.module index 8274318..066780e 100644 --- a/plugins/smf2/smf2.module +++ b/plugins/smf2/smf2.module @@ -1,6 +1,6 @@ <?php -function smf2_init($config) { +function smf2_bootstrap($config) { $smf_root_path = $config['root_path']; if (file_exists($smf_root_path . 'SSI.php')) { include_once $smf_root_path . 'SSI.php'; @@ -9,10 +9,20 @@ function smf2_init($config) { file_put_contents('php://stderr', "SMF not found at <{$smf_root_path}>.\n"); exit; } +} + +function smf2_init($config) { + smf2_bootstap($config); require_once __DIR__ . '/BridgeSMF2.php'; return new BridgeSMF2(); } +function smf2_session($config) { + smf2_bootstap($config); + $user = smf_ssi('welcome', NULL); + return (empty($user['is_guest']) && !empty($user['name'])) ? $user['name'] : FALSE; +} + function smf_ssi($function) { $args = func_get_args(); array_shift($args); |