diff options
Diffstat (limited to 'update/plugin/phpBB3/trunk/root')
-rw-r--r-- | update/plugin/phpBB3/trunk/root/instadisc.php | 55 |
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 | */ | ||
14 | define('IN_PHPBB', true); | ||
15 | $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; | ||
16 | $phpEx = substr(strrchr(__FILE__, '.'), 1); | ||
17 | include($phpbb_root_path . 'common.' . $phpEx); | ||
18 | include($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 | |||
36 | page_footer(); | ||
37 | |||
38 | function 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 | ?> | ||