Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 221 lines (186 sloc) 10.136 kb
ece5714 @daris Importing SVN r981
daris authored
1 <?php
2
3 $time = generatedtime($_SESSION['conv_start'], $_SESSION['conv_end']);
4 include './'.$_SESSION['forum'].'/_config.php';
5
6 // Should not be here... redirect to the init page
7 if($time == '0.00')
8 redirect('index.php?page=init', 'Please go to the init page to start the converter.');
9
10 // Status settings
11 $status = array();
12 $status['adm'] = 'group_id=1';
13 $status['!adm'] = 'group_id!=1';
14 $status['mod'] = 'group_id=2';
15 $status['!mod'] = 'group_id!=2';
16 $status['usr'] = 'group_id=4';
17
18 if(isset($_GET['remove']))
19 {
20 if($_GET['remove'] == 'a_all')
21 $db->query('UPDATE '.$db->prefix.'users SET '.$status['usr'].' WHERE '.$status['adm']) or myerror('Unable to remove all admins', __FILE__, __LINE__, $db->query());
22
23 else if($_GET['remove'] == 'm_all')
24 $db->query('UPDATE '.$db->prefix.'users SET '.$status['usr'].' WHERE '.$status['mod']) or myerror('Unable to remove all moderators', __FILE__, __LINE__, $db->query());
25
26 else
27 {
28 $uid = intval($_GET['remove']);
29 $db->query('UPDATE '.$db->prefix.'users SET '.$status['usr'].' WHERE id='.$uid) or myerror('Unable to remove user status', __FILE__, __LINE__, $db->query());
30 }
31 }
32
33 else if(isset($_POST['newadmin']))
34 {
35 $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());
36
37 }
38
39 else if(isset($_POST['newmoderator']))
40 {
41 $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());
42
43 }
44
45 ?>
46
47 <tr class="punhead">
48 <th class="punhead" colspan="2"><b><?php echo $settings['Title']; ?></b> conversion done</th>
49 </tr>
50
51 <tr>
52 <td class="puncon1right">Info&nbsp;&nbsp;</td>
53 <td class="puncon2">
54 <p><b>Conversion done!</b></p>
55
56 <p>Database converted in: <b><?php echo $time; ?>s</b></p>
57
58 <p><strong>
59 <?php /* <font color='red'>Note:</font> Don't forget to rebuild the search index!<br><br>
60 The converter does not uppdate the search-index, so that
61 must be done manually (<a href="../admin_maintenance.php">Administration->Maintenance->Rebuild index</a>).*/ ?>
62 There's alot of settings that's not converted, so go
63 through the admin-pages for additional settings.
64 </strong></p>
65
66 <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>
67
68 <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>
69 </td>
70 </tr>
71 <?php /*
72 <tr>
73 <td class="puncon1right">Donate&nbsp;&nbsp;</td>
74 <td class="puncon2">
75 <p>If you want to support the converter development, you can donate money using PayPal:</p>
76 <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
77 <input type="hidden" name="cmd" value="_s-xclick">
78 <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYBLh1oa6Yv20IbPd5JrUNtAJkfcWQxzt2A+iEHGeQUnYaGjdaiUHcNVNltIaf8nZUUoAPAsTL1fBWSyKUqEhJ/Lhiua9ke6W7vPq/GmOwrYKpkQiYkEPzTHQvFufbrBIqc7IMubYVbrtSOaZmwjXE1FYMQtXg+Wl5eMJE6tdQmP3jELMAkGBSsOAwIaBQAwgcQ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UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb22CAQAwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCBXzpWmoBa5e9fo6ujionW1hUhPkOBakTr3YCDjbYfvJEiv/2P+IobhOGJr85+XHhN0v4gUkEDI8r2/rNk1m0GA8HKddvTjyGw/XqXa+LSTlDYkqI8OwR8GEYj4efEtcRpRYBxV8KxAW93YDWzFGvruKnnLbDAF6VR5w/cCMn5hzGCAZowggGWAgEBMIGUMIGOMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC1BheVBhbCBJbmMuMRMwEQYDVQQLFApsaXZlX2NlcnRzMREwDwYDVQQDFAhsaXZlX2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMDUwOTMwMTIyMTI1WjAjBgkqhkiG9w0BCQQxFgQUe+njWFbOt0qcr+DtL0aNTK3tPtswDQYJKoZIhvcNAQEBBQAEgYBtRLhi5xklKd8XpSQ2uhL7CIbX+7vuFYBXQK3FKPhtesqigRaeZSvT6D2djRw0XpxTM0iTso7e72UpEm5EpDFqiL13nozXNFAe3NFxzHmHmWAvd/CbzqywB8mpoLDpglxhchVKpkfdANmsl8hm4fMmxLLk9bouVKRrXwzZscRY8g==-----END PKCS7-----">
79 <p><input type="submit" name="submit" value="Make a Donation"></p>
80 </form>
81 </td>
82 </tr>
83 */ ?>
84 <tr>
85 <td class="puncon1right">FluxBB administrators&nbsp;&nbsp;</td>
86 <td class="puncon2">
87 <form method="post" action="index.php?page=done">
88 <?php
89 $result = $db->query('SELECT * FROM '.$db->prefix.'users WHERE '.$status['adm'].' ORDER BY username ASC');
90 $counter = 0;
91
92 if($db->num_rows($result) == 0)
93 echo 'None';
94 else
95 while($user = $db->fetch_assoc($result))
96 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";
97 ?>
98 <br><b>New administrator:</b><br>
99 <select name="newadmin">
100 <?php
101
102 $f1 = '';
103 $res = $db->query('SELECT * FROM '.$db->prefix.'users WHERE '.$status['!adm'].' AND id!=1 ORDER by username ASC');
104 while($user = $db->fetch_assoc($res)){
105 $f2 = substr($user['username'], 0, 1);
106
107 if(strtolower($f2) != $f1)
108 {
109 echo $f1 != '' ? "\t\t\t\t\t\t</optgroup>\n" : '';
110 echo "\t\t\t\t\t\t".'<optgroup label="'.strtoupper($f2).'">'."\n";
111 }
112
113 echo "\t\t\t\t\t\t\t".'<option value="'.$user['id'].'">'.$user['username'].'</option>'."\n";
114 $f1 = strtolower($f2);
115 }
116 ?>
117 </optgroup>
118 </select>
119 <input type="submit" name="submit" value="Add">
120 <?php if($db->num_rows($result) > 0): ?>
121 <span style="float: right;">[<a href="index.php?page=done&remove=a_all"> remove all </a>]</span>
122 <?php endif; ?>
123 </form>
124 </td>
125 </tr>
126
127 <tr>
128 <td class="puncon1right">FluxBB moderators&nbsp;&nbsp;</td>
129 <td class="puncon2">
130 <form method="post" action="index.php?page=done">
131 <?php
132 $result = $db->query('SELECT * FROM '.$db->prefix.'users WHERE '.$status['mod'].' ORDER BY username ASC');
133 $counter = 0;
134
135 if($db->num_rows($result) == 0)
136 echo 'None';
137 else
138 while($user = $db->fetch_assoc($result))
139 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";
140 ?>
141 <br><b>New moderator:</b><br>
142 <select name="newmoderator">
143 <?php
144 while($user = $db->fetch_assoc($res)){
145 echo "\t\t\t\t\t\t".'<option value="'.$user['id'].'">'.$user['username'].'</option>'."\n";
146 }
147
148 $f1 = '';
149 $res = $db->query('SELECT * FROM '.$db->prefix.'users WHERE '.$status['!mod'].' AND id!=1 ORDER by username ASC');
150 while($user = $db->fetch_assoc($res)){
151 $f2 = substr($user['username'], 0, 1);
152
153 if(strtolower($f2) != $f1)
154 {
155 echo $f1 != '' ? "\t\t\t\t\t\t</optgroup>\n" : '';
156 echo "\t\t\t\t\t\t".'<optgroup label="'.strtoupper($f2).'">'."\n";
157 }
158
159 echo "\t\t\t\t\t\t\t".'<option value="'.$user['id'].'">'.$user['username'].'</option>'."\n";
160 $f1 = strtolower($f2);
161 }
162 ?>
163 </optgroup>
164 </select>
165 <input type="submit" name="submit" value="Add">
166 <?php if($db->num_rows($result) > 0): ?>
167 <span style="float: right;">[<a href="index.php?page=done&remove=m_all"> remove all </a>]</span>
168 <?php endif; ?>
169 </form>
170 </td>
171 </tr>
172
173 <tr>
174 <td class="puncon1right">FluxBB status&nbsp;&nbsp;</td>
175 <td class="puncon2">
176 <?php
177 echo "\t\t\t\t<br><b><u>FluxBB contains</u></b> (".$settings['Forum']." contains):";
178
179 // Step through the tables
180 foreach($tables AS $name => $value)
181 {
182 // Show it or not?
183 if($value != ''){
184
185 // FluxBB
186 $rem = $name == 'Users' ? '-1' : ''; // Remove guest user
187 $res1 = $db->query('SELECT count(*)'.$rem.' AS count FROM '.$db->prefix.$name.'');
92ae7de @olimortimer - Added bans import function
olimortimer authored
188 $res1_count = $db->result($res1, 0);
ece5714 @daris Importing SVN r981
daris authored
189
190 // Save FluxBB post count
191 if($name == 'Posts')
92ae7de @olimortimer - Added bans import function
olimortimer authored
192 $_SESSION['posts'] = $res1_count;
ece5714 @daris Importing SVN r981
daris authored
193
194 // Converted forum
195 $rem = isset($tablerem[$name]) ? '-'.$tablerem[$name] : '';
196 $res2 = $fdb->query('SELECT count(*)'.$rem.' AS count FROM '.$fdb->prefix.$value.'');
197
92ae7de @olimortimer - Added bans import function
olimortimer authored
198 // If no count, try the alternative converted forum table
199 if(!$res2) {
200 $res2 = $fdb->query('SELECT count(*)'.$rem.' AS count FROM '.$fdb->prefix.$tables_conv[$name].'');
201 }
ece5714 @daris Importing SVN r981
daris authored
202 // Line
92ae7de @olimortimer - Added bans import function
olimortimer authored
203 echo "\n\t\t\t\t<br><b>".$name.":</b> ".$res1_count.' ('.@$fdb->result($res2, 0).')';
ece5714 @daris Importing SVN r981
daris authored
204 }
205 }
206
207 echo '<br><br>'."\n";
208 ?>
209 </td>
210 </tr>
211
212 <tr>
213 <td class="puncon1right" style="width: 140px; white-space: nowrap">Action&nbsp;&nbsp;</td>
214 <td class="puncon2" style="white-space: nowrap">
215 <form method="post" action="index.php?page=settings">
216 <br>&nbsp;&nbsp;<input type="submit" name="submit" value="Restart"><br><br>
217 </form>
218 </td>
219 </tr>
220
221 </form>
Something went wrong with that request. Please try again.