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_avatars.php
01 <?php
02
03 //
04 // Security message:
05 //
06 // This script is potentially dangerous.
07 // Remove or comment the next line (die(".... ) to enable this script.
08 // Do NOT FORGET to either remove this script or disable it after you have used it.
09 //
10 die("Please read the first lines of this script for instructions on how to enable it");
11
12 //
13 // Do not change anything below this line.
14 //
15
16
17 $phpbb_root_path = "../";
18
19 include($phpbb_root_path . 'extension.inc');
20 include($phpbb_root_path . 'config.'.$phpEx);
21 include($phpbb_root_path . 'includes/constants.'.$phpEx);
22 include($phpbb_root_path . 'includes/db.'.$phpEx);
23
24
25 $sql = "ALTER TABLE " . USERS_TABLE . "
26 ADD user_avatar_type TINYINT(4) DEFAULT '0' NOT NULL";
27 if( !$result = $db->sql_query($sql) )
28 {
29 die("Couldn't alter users table");
30 }
31
32 $sql = "SELECT user_id, user_avatar
33 FROM " . USERS_TABLE;
34 if( $result = $db->sql_query($sql) )
35 {
36 $rowset = $db->sql_fetchrowset($result);
37
38 for($i = 0; $i < count($rowset); $i++)
39 {
40 if( ereg("^http", $rowset[$i]['user_avatar']))
41 {
42 $sql_type = USER_AVATAR_REMOTE;
43 }
44 else if( $rowset[$i]['user_avatar'] != "" )
45 {
46 $sql_type = USER_AVATAR_UPLOAD;
47 }
48 else
49 {
50 $sql_type = USER_AVATAR_NONE;
51 }
52
53 $sql = "UPDATE " . USERS_TABLE . "
54 SET user_avatar_type = $sql_type
55 WHERE user_id = " . $rowset[$i]['user_id'];
56 if( !$result = $db->sql_query($sql) )
57 {
58 die("Couldn't update users table- " . $i);
59 }
60 }
61 }
62
63 echo "<BR><BR>COMPLETE<BR>";
64
65 ?>
66