From 6a5a5d67d9904c41e5419c91f55cb6c69418930f Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 21 Sep 2008 23:44:04 +0000 Subject: Update: Added SF generator to phpBB3 Fixes #60 --- update/plugin/phpBB3/trunk/root/instadisc.php | 55 +++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 update/plugin/phpBB3/trunk/root/instadisc.php (limited to 'update/plugin/phpBB3/trunk/root/instadisc.php') diff --git a/update/plugin/phpBB3/trunk/root/instadisc.php b/update/plugin/phpBB3/trunk/root/instadisc.php new file mode 100644 index 0000000..185fc78 --- /dev/null +++ b/update/plugin/phpBB3/trunk/root/instadisc.php @@ -0,0 +1,55 @@ +session_begin(); +$auth->acl($user->data); + +$user->setup('mods/instadisc', $forum_data['forum_style']); + +$template->set_filenames(array( + 'body' => 'instadisc.html') +); + +$template->assign_vars(array( + 'S_SUBSCRIPTION' => ('http://' . $_SERVER['SERVER_NAME'] . '/forum-post/' . generateSlug($config['id_subscription_title']) . '/'), + 'S_TITLE' => $config['id_subscription_title'], + 'S_KEY' => $config['id_activation_key'], +)); + +page_footer(); + +function generateSlug($title) +{ + $title = preg_replace('/[^A-Za-z0-9]/','-',$title); + $title = preg_replace('/-{2,}/','-',$title); + if (substr($title,0,1) == '-') + { + $title = substr($title,1); + } + if (substr($title,strlen($title)-1,1) == '-') + { + $title = substr($title,0,strlen($title)-1); + } + $title = strtolower($title); + + return($title); +} + +?> -- cgit 1.4.1