about summary refs log tree commit diff stats
path: root/update/plugin/phpBB3/trunk
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2008-09-21 23:44:04 +0000
committerKelly Rauchenberger <fefferburbia@gmail.com>2008-09-21 23:44:04 +0000
commit6a5a5d67d9904c41e5419c91f55cb6c69418930f (patch)
treeeabf4b5f3ac4938b709de8540bfedc885008ec3c /update/plugin/phpBB3/trunk
parent43f8a9d35e74f71a7cdb71a3663befe8e51b8608 (diff)
downloadinstadisc-6a5a5d67d9904c41e5419c91f55cb6c69418930f.tar.gz
instadisc-6a5a5d67d9904c41e5419c91f55cb6c69418930f.tar.bz2
instadisc-6a5a5d67d9904c41e5419c91f55cb6c69418930f.zip
Update: Added SF generator to phpBB3
Fixes #60
Diffstat (limited to 'update/plugin/phpBB3/trunk')
-rw-r--r--update/plugin/phpBB3/trunk/root/instadisc.php55
1 files changed, 55 insertions, 0 deletions
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 @@
1<?php
2/**
3*
4* @package phpBB3
5* @version $Id: instadisc.php 2008-08-06 07:12:00Z hatkirby $
6* @version (c) 2008 Starla Insigna
7* @license http://opensource.org/licenses/gpl-license.php GNU Public License
8*
9*/
10
11/**
12* @ignore
13*/
14define('IN_PHPBB', true);
15$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
16$phpEx = substr(strrchr(__FILE__, '.'), 1);
17include($phpbb_root_path . 'common.' . $phpEx);
18include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
19
20// Start session
21$user->session_begin();
22$auth->acl($user->data);
23
24$user->setup('mods/instadisc', $forum_data['forum_style']);
25
26$template->set_filenames(array(
27 'body' => 'instadisc.html')
28);
29
30$template->assign_vars(array(
31 'S_SUBSCRIPTION' => ('http://' . $_SERVER['SERVER_NAME'] . '/forum-post/' . generateSlug($config['id_subscription_title']) . '/'),
32 'S_TITLE' => $config['id_subscription_title'],
33 'S_KEY' => $config['id_activation_key'],
34));
35
36page_footer();
37
38function generateSlug($title)
39{
40 $title = preg_replace('/[^A-Za-z0-9]/','-',$title);
41 $title = preg_replace('/-{2,}/','-',$title);
42 if (substr($title,0,1) == '-')
43 {
44 $title = substr($title,1);
45 }
46 if (substr($title,strlen($title)-1,1) == '-')
47 {
48 $title = substr($title,0,strlen($title)-1);
49 }
50 $title = strtolower($title);
51
52 return($title);
53}
54
55?>