Passed
Pull Request — master (#117)
by Spuds
07:11
created

PHPBoost3::getDbName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 10
1
<?php
2
/**
3
 * @name      OpenImporter
4
 * @copyright OpenImporter contributors
5
 * @license   BSD https://opensource.org/licenses/BSD-3-Clause
6
 *
7
 * @version 1.0
8
 */
9
10
class PHPBoost3 extends Importers\AbstractSourceImporter
11
{
12
	public function getName()
13
	{
14
		return 'PHPBoost3';
15
	}
16
17
	public function getVersion()
18
	{
19
		return 'ElkArte 1.0';
20
	}
21
22
	public function getPrefix()
23
	{
24
		global $boost_prefix;
25
26
		return '`' . $this->getDbName() . '`.' . $boost_prefix;
27
	}
28
29
	public function getDbName()
30
	{
31
		global $boost_database;
32
33
		return $boost_database;
34
	}
35
36
	public function getTableTest()
37
	{
38
		return 'member';
39
	}
40
}
41
42
/**
43
 * Utility functions
44
 */
45
function boost_replace_bbc($content)
46
{
47
	$content = preg_replace(
48
		array(
49
			'~<strong>~is',
50
			'~</strong>~is',
51
			'~<em>~is',
52
			'~</em>~is',
53
			'~<strike>~is',
54
			'~</strike>~is',
55
			'~\<h3(.+?)\>~is',
56
			'~</h3>~is',
57
			'~\<span stype="text-decoration: underline;">(.+?)</span>~is',
58
			'~\<div class="bb_block">(.+?)<\/div>~is',
59
			'~\[style=(.+?)\](.+?)\[\/style\]~is',
60
		),
61
		array(
62
			'[b]',
63
			'[/b]',
64
			'[i]',
65
			'[/i]',
66
			'[s]',
67
			'[/s]',
68
			'',
69
			'',
70
			'[u]%1[/u]',
71
			'%1',
72
			'%1',
73
		),
74
		trim($content)
75
	);
76
77
	return $content;
78
}
79