forked from daris/fluxbb-converters
-
Notifications
You must be signed in to change notification settings - Fork 1
/
done.php
221 lines (186 loc) · 9.9 KB
/
done.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?php
$time = generatedtime($_SESSION['conv_start'], $_SESSION['conv_end']);
include './'.$_SESSION['forum'].'/_config.php';
// Should not be here... redirect to the init page
if($time == '0.00')
redirect('index.php?page=init', 'Please go to the init page to start the converter.');
// Status settings
$status = array();
$status['adm'] = 'group_id=1';
$status['!adm'] = 'group_id!=1';
$status['mod'] = 'group_id=2';
$status['!mod'] = 'group_id!=2';
$status['usr'] = 'group_id=4';
if(isset($_GET['remove']))
{
if($_GET['remove'] == 'a_all')
$db->query('UPDATE '.$db->prefix.'users SET '.$status['usr'].' WHERE '.$status['adm']) or myerror('Unable to remove all admins', __FILE__, __LINE__, $db->query());
else if($_GET['remove'] == 'm_all')
$db->query('UPDATE '.$db->prefix.'users SET '.$status['usr'].' WHERE '.$status['mod']) or myerror('Unable to remove all moderators', __FILE__, __LINE__, $db->query());
else
{
$uid = intval($_GET['remove']);
$db->query('UPDATE '.$db->prefix.'users SET '.$status['usr'].' WHERE id='.$uid) or myerror('Unable to remove user status', __FILE__, __LINE__, $db->query());
}
}
else if(isset($_POST['newadmin']))
{
$db->query('UPDATE '.$db->prefix.'users SET '.$status['adm'].' WHERE id='.intval($_POST['newadmin']).' AND id>1') or myerror('Unable to change user status to admin', __FILE__, __LINE__, $db->query());
}
else if(isset($_POST['newmoderator']))
{
$db->query('UPDATE '.$db->prefix.'users SET '.$status['mod'].' WHERE id='.intval($_POST['newmoderator']).' AND id>1') or myerror('Unable to change user status to moderator', __FILE__, __LINE__, $db->query());
}
?>
<tr class="punhead">
<th class="punhead" colspan="2"><b><?php echo $settings['Title']; ?></b> conversion done</th>
</tr>
<tr>
<td class="puncon1right">Info </td>
<td class="puncon2">
<p><b>Conversion done!</b></p>
<p>Database converted in: <b><?php echo $time; ?>s</b></p>
<p><strong>
<?php /* <font color='red'>Note:</font> Don't forget to rebuild the search index!<br><br>
The converter does not uppdate the search-index, so that
must be done manually (<a href="../admin_maintenance.php">Administration->Maintenance->Rebuild index</a>).*/ ?>
There's alot of settings that's not converted, so go
through the admin-pages for additional settings.
</strong></p>
<p>Please also make sure you have at least one board administrator by using the list below, or else you won't be able to administrate your board!</p>
<p style="color: red; font-weight: bold">If this tool does not convert passwords, you can install Password Converter Mod (file password_converter_mod.txt in converter directory).</p>
</td>
</tr>
<?php /*
<tr>
<td class="puncon1right">Donate </td>
<td class="puncon2">
<p>If you want to support the converter development, you can donate money using PayPal:</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJ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htesqigRaeZSvT6D2djRw0XpxTM0iTso7e72UpEm5EpDFqiL13nozXNFAe3NFxzHmHmWAvd/CbzqywB8mpoLDpglxhchVKpkfdANmsl8hm4fMmxLLk9bouVKRrXwzZscRY8g==-----END PKCS7-----">
<p><input type="submit" name="submit" value="Make a Donation"></p>
</form>
</td>
</tr>
*/ ?>
<tr>
<td class="puncon1right">FluxBB administrators </td>
<td class="puncon2">
<form method="post" action="index.php?page=done">
<?php
$result = $db->query('SELECT * FROM '.$db->prefix.'users WHERE '.$status['adm'].' ORDER BY username ASC');
$counter = 0;
if($db->num_rows($result) == 0)
echo 'None';
else
while($user = $db->fetch_assoc($result))
echo "\t\t\t\t\t".++$counter.'. '.$user['username'].' <span style="float: right;">[<a href="index.php?page=done&remove='.$user['id'].'"> remove </a>]</span><br>'."\n";
?>
<br><b>New administrator:</b><br>
<select name="newadmin">
<?php
$f1 = '';
$res = $db->query('SELECT * FROM '.$db->prefix.'users WHERE '.$status['!adm'].' AND id!=1 ORDER by username ASC');
while($user = $db->fetch_assoc($res)){
$f2 = substr($user['username'], 0, 1);
if(strtolower($f2) != $f1)
{
echo $f1 != '' ? "\t\t\t\t\t\t</optgroup>\n" : '';
echo "\t\t\t\t\t\t".'<optgroup label="'.strtoupper($f2).'">'."\n";
}
echo "\t\t\t\t\t\t\t".'<option value="'.$user['id'].'">'.$user['username'].'</option>'."\n";
$f1 = strtolower($f2);
}
?>
</optgroup>
</select>
<input type="submit" name="submit" value="Add">
<?php if($db->num_rows($result) > 0): ?>
<span style="float: right;">[<a href="index.php?page=done&remove=a_all"> remove all </a>]</span>
<?php endif; ?>
</form>
</td>
</tr>
<tr>
<td class="puncon1right">FluxBB moderators </td>
<td class="puncon2">
<form method="post" action="index.php?page=done">
<?php
$result = $db->query('SELECT * FROM '.$db->prefix.'users WHERE '.$status['mod'].' ORDER BY username ASC');
$counter = 0;
if($db->num_rows($result) == 0)
echo 'None';
else
while($user = $db->fetch_assoc($result))
echo "\t\t\t\t\t".++$counter.'. '.$user['username'].'<span style="float: right;">[<a href="index.php?page=done&remove='.$user['id'].'"> remove </a>]</span><br>'."\n";
?>
<br><b>New moderator:</b><br>
<select name="newmoderator">
<?php
while($user = $db->fetch_assoc($res)){
echo "\t\t\t\t\t\t".'<option value="'.$user['id'].'">'.$user['username'].'</option>'."\n";
}
$f1 = '';
$res = $db->query('SELECT * FROM '.$db->prefix.'users WHERE '.$status['!mod'].' AND id!=1 ORDER by username ASC');
while($user = $db->fetch_assoc($res)){
$f2 = substr($user['username'], 0, 1);
if(strtolower($f2) != $f1)
{
echo $f1 != '' ? "\t\t\t\t\t\t</optgroup>\n" : '';
echo "\t\t\t\t\t\t".'<optgroup label="'.strtoupper($f2).'">'."\n";
}
echo "\t\t\t\t\t\t\t".'<option value="'.$user['id'].'">'.$user['username'].'</option>'."\n";
$f1 = strtolower($f2);
}
?>
</optgroup>
</select>
<input type="submit" name="submit" value="Add">
<?php if($db->num_rows($result) > 0): ?>
<span style="float: right;">[<a href="index.php?page=done&remove=m_all"> remove all </a>]</span>
<?php endif; ?>
</form>
</td>
</tr>
<tr>
<td class="puncon1right">FluxBB status </td>
<td class="puncon2">
<?php
echo "\t\t\t\t<br><b><u>FluxBB contains</u></b> (".$settings['Forum']." contains):";
// Step through the tables
foreach($tables AS $name => $value)
{
// Show it or not?
if($value != ''){
// FluxBB
$rem = $name == 'Users' ? '-1' : ''; // Remove guest user
$res1 = $db->query('SELECT count(*)'.$rem.' AS count FROM '.$db->prefix.$name.'');
$res1_count = $db->result($res1, 0);
// Save FluxBB post count
if($name == 'Posts')
$_SESSION['posts'] = $res1_count;
// Converted forum
$rem = isset($tablerem[$name]) ? '-'.$tablerem[$name] : '';
$res2 = $fdb->query('SELECT count(*)'.$rem.' AS count FROM '.$fdb->prefix.$value.'');
// If no count, try the alternative converted forum table
if(!$res2) {
$res2 = $fdb->query('SELECT count(*)'.$rem.' AS count FROM '.$fdb->prefix.$tables_conv[$name].'');
}
// Line
echo "\n\t\t\t\t<br><b>".$name.":</b> ".$res1_count.' ('.@$fdb->result($res2, 0).')';
}
}
echo '<br><br>'."\n";
?>
</td>
</tr>
<tr>
<td class="puncon1right" style="width: 140px; white-space: nowrap">Action </td>
<td class="puncon2" style="white-space: nowrap">
<form method="post" action="index.php?page=settings">
<br> <input type="submit" name="submit" value="Restart"><br><br>
</form>
</td>
</tr>
</form>