Verzeichnisstruktur phpBB-2.0.0
- Veröffentlicht
- 03.04.2002
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
convert_usernames.php
01 <html>
02 <body>
03 <?php
04
05 //
06 // Security message:
07 //
08 // This script is potentially dangerous.
09 // Remove or comment the next line (die(".... ) to enable this script.
10 // Do NOT FORGET to either remove this script or disable it after you have used it.
11 //
12 die("Please read the first lines of this script for instructions on how to enable it");
13
14 //
15 // Do not change anything below this line.
16 //
17
18
19 //
20 // Convert 2.0.x Usernames to the new 2.0.5 Username format.
21 //
22
23 chdir("../");
24
25 define('IN_PHPBB', true);
26 include('extension.inc');
27 include('config.'.$phpEx);
28 include('includes/constants.'.$phpEx);
29 include('includes/db.'.$phpEx);
30
31 $sql = "SELECT user_id, username
32 FROM " . USERS_TABLE;
33 $result = $db->sql_query($sql);
34
35 if(!$result)
36 {
37 die("Unable to get users");
38 }
39
40 while ($row = $db->sql_fetchrow($result))
41 {
42 if (!preg_match('#(>)|(<)|(")|(&)#', $row['username']))
43 {
44 if ($row['username'] != htmlspecialchars($row['username']))
45 {
46 flush();
47 $sql = "UPDATE " . USERS_TABLE . "
48 SET username = '" . str_replace("'", "''", htmlspecialchars($row['username'])) . "'
49 WHERE user_id = " . $row['user_id'];
50 if (!$db->sql_query($sql))
51 {
52 echo "ERROR: Unable to rename user " . htmlspecialchars($row['username']) . " with ID " . $row['user_id'] . "<br>";
53 echo "<pre>" . print_r($db->sql_error()) . "</pre><br />$sql";
54 }
55 else
56 {
57 echo "Renamed User " . htmlspecialchars($row['username']) . " with ID " . $row['user_id'] . "<br>";
58 }
59 }
60 }
61 }
62
63 echo "<br>That's All Folks!";
64
65 ?>
66 </body>
67 </html>
68