forked from daris/fluxbb-converters
-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.php
145 lines (127 loc) · 5.41 KB
/
settings.php
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<?php
$type = intval($_SESSION['type']);
$same = $type == 1 ? 'table-row' : 'none';
$diff = $type == 2 ? 'table-row' : 'none';
?>
<form method="post" action="index.php">
<input type="hidden" name="punbb" value="<?php echo $db_name; ?>">
<input type="hidden" name="punpre" value="<?php echo $db_prefix; ?>">
<tr class="punhead">
<th class="punhead" colspan="2"><b>FluxBB Migration Tool - Settings</b></th>
</tr>
<tr>
<td class="puncon1right">Host: </td>
<td class="puncon2"><?php echo $db_host; ?></td>
</tr>
<tr>
<td class="puncon1right">FluxBB database: </td>
<td class="puncon2"><?php echo $db_name; ?></td>
</tr>
<tr>
<td class="puncon1right">FluxBB prefix: </td>
<td class="puncon2"><?php echo $db_prefix; ?></td>
</tr>
<tr>
<td class="puncon1right">Hostname/user: </td>
<td class="puncon2">
<label><input type="radio" name="sameordiff" onClick="duffusers('same');" value="same" <?php if($type == 1) echo 'checked'; ?>>Same host/user</label>
<label><input type="radio" name="sameordiff" onClick="duffusers('diff');" value="diff" <?php if($type == 2) echo 'checked'; ?>>Different host/user</label>
</td>
</tr>
<tr>
<td class="puncon1right">Convert forum: </td>
<td class="puncon2">
<?php
if(isset($_GET['forum']))
echo "\t\t\t\t".'<span class="red">You must specify a forum!</span><br>'."\n";
?>
<select style="width: 150px;" name="forum">
<option value=""> - Select forum - </option>
<?php
if ($handle = opendir('./'))
{
while (false !== ($file = readdir($handle)))
{
if (substr($file, 0, 1) != '.' && @$dir = opendir('./'.$file))
{
$selected = (isset($_SESSION['forum']) && $_SESSION['forum'] == $file) ? ' selected' : '';
echo "\t\t\t\t\t".'<option value="'.$file.'"'.$selected.'>'.$file.'</option>'."\n";
closedir($dir);
}
}
closedir($handle);
}
?>
</select>
</td>
</tr>
<tr id="diff1" style="display: <?php echo $diff; ?>;">
<td class="puncon1right">Hostname: </td>
<td class="puncon2">
<?php
if(isset($_GET['hostname']))
echo "\t\t\t\t".'<span class="red">You must specify a hostname!</span><br>'."\n";
?>
<input type="text" name="diff_host" style="width: 150px;" class="form" value="<?php if(isset($_SESSION['hostname'])) echo $_SESSION['hostname']; ?>">
</td>
</tr>
<tr id="diff2" style="display: <?php echo $diff; ?>;">
<td class="puncon1right">Username: </td>
<td class="puncon2">
<?php
if(isset($_GET['username']))
echo "\t\t\t\t".'<span class="red">You must specify a username!</span><br>'."\n";
?>
<input type="text" name="diff_un" style="width: 150px;" class="form" value="<?php if(isset($_SESSION['username'])) echo $_SESSION['username']; ?>">
</td>
</tr>
<tr id="diff3" style="display: <?php echo $diff; ?>;">
<td class="puncon1right">Password: </td>
<td class="puncon2"><input type="text" name="diff_pass" style="width: 150px;" class="form" value="<?php if(isset($_SESSION['password'])) echo $_SESSION['password']; ?>"></td>
</tr>
<tr id="diff4" style="display: <?php echo $diff; ?>;">
<td class="puncon1right">Database: </td>
<td class="puncon2">
<?php
if(isset($_GET['database']))
echo "\t\t\t\t".'<span class="red">You must specify a database!</span><br>'."\n";
?>
<input type="text" name="diff_db" style="width: 150px;" class="form" value="<?php if(isset($_SESSION['php_db'])) echo $_SESSION['php_db']; ?>">
</td>
<tr id="same" style="display: <?php echo $same; ?>;">
<td class="puncon1right">Database: </td>
<td class="puncon2">
<?php
if(isset($_GET['database']))
echo "\t\t\t\t".'<span class="red">You must specify a database!</span><br>'."\n";
?>
<select style="width: 150px;" name="database">
<option value=""> - Select database - </option>
<?php
$res = $db->query('SHOW DATABASES');
while($ob = $db->fetch_row($res))
{
$selected = (isset($_SESSION['php_db']) && $ob[0] == $_SESSION['php_db']) ? ' selected' : '';
echo "\t\t\t\t\t".'<option value="'.$ob[0].'"'.$selected.'>'.$ob[0]."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td class="puncon1right">Prefix: </td>
<td class="puncon2"><input type="text" style="width: 150px;" class="form" value="<?php if(isset($_SESSION['php_prefix'])) echo $_SESSION['php_prefix']; else echo ''; ?>" name="phppre"></td>
</tr>
<tr>
<td class="puncon1right">Old charset: </td>
<td class="puncon2"><input type="text" style="width: 150px;" class="form" value="<?php if(isset($_SESSION['old_charset'])) echo ($_SESSION['old_charset'] != 'UTF-8') ? $_SESSION['old_charset'] : ''; else echo 'ISO-8859-2'; ?>" name="old_charset"> Leave blank for UTF-8.</td>
</tr>
<tr>
<td class="puncon1right" style="width: 140px; white-space: nowrap">Actions: </td>
<td class="puncon2" style="white-space: nowrap">
<b>Warning:</b> <span style="color: red">ALL FluxBB tables will be deleted!</span><br>
<br> <input type="submit" id="submit" name="start_converter" value="Start converter"><br /><br />
If you run into problems with the converter, please send an email to<br />this address: <a href="mailto:chacmool@gmail.com">chacmool@gmail.com</a>. Please inform me which forum<br /> you're trying to convert, under which part of conversion it failed,<br /> and the whole error-message. <strong>Please also send a sql-dump of <br />your database, so I can try the converter with your actual data.</strong>
</td>
</tr>
</form>