| // +----------------------------------------------------------------------+ // // $Id: array_key_exists.php,v 1.1 2005/07/11 16:34:35 ggiunta Exp $ /** * Replace array_key_exists() * * @category PHP * @package PHP_Compat * @link http://php.net/function.array_key_exists * @author Aidan Lister * @version $Revision: 1.1 $ * @since PHP 4.1.0 * @require PHP 4.0.0 (user_error) */ if (!function_exists('array_key_exists')) { function array_key_exists($key, $search) { if (!is_scalar($key)) { user_error('array_key_exists() The first argument should be either a string or an integer', E_USER_WARNING); return false; } if (is_object($search)) { $search = get_object_vars($search); } if (!is_array($search)) { user_error('array_key_exists() The second argument should be either an array or an object', E_USER_WARNING); return false; } return in_array($key, array_keys($search)); } } ?>'>log msg
path: root/update/plugin/phpBB3/trunk/root/instadisc.php
blob: 185fc7803ec50c6cda37f74b6d873b983f149f79 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/**
*
* @package phpBB3
* @version $Id: instadisc.php 2008-08-06 07:12:00Z hatkirby $
* @version (c) 2008 Starla Insigna
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

// Start session
$user->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);
}

?>