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_sigs.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 $phpbb_root_path = "../";
17
18 include($phpbb_root_path . 'extension.inc');
19 include($phpbb_root_path . 'config.'.$phpEx);
20 include($phpbb_root_path . 'includes/constants.'.$phpEx);
21 include($phpbb_root_path . 'includes/db.'.$phpEx);
22
23 $sql = "SELECT post_id, post_text
24 FROM " . POSTS_TEXT_TABLE;
25 if( $result = $db->sql_query($sql) )
26 {
27 $rowset = $db->sql_fetchrowset($result);
28
29 $attach_sql = "";
30 $non_attach_sql = "";
31
32 for($i = 0; $i < count($rowset); $i++)
33 {
34 if( ereg("\[addsig]$", $rowset[$i]['post_text']))
35 {
36 if( $attach_sql != "" )
37 {
38 $attach_sql .= ", ";
39 }
40 $attach_sql .= $rowset[$i]['post_id'];
41
42 $sql = "UPDATE " . POSTS_TEXT_TABLE . "
43 SET post_text = '" . addslashes(preg_replace("/\[addsig\]/is", "", $rowset[$i]['post_text'])) . "'
44 WHERE post_id = " . $rowset[$i]['post_id'];
45 if( !$result = $db->sql_query($sql) )
46 {
47 die("Couldn't update post_text - " . $i);
48 }
49
50 }
51 else
52 {
53 if( $non_attach_sql != "" )
54 {
55 $non_attach_sql .= ", ";
56 }
57 $non_attach_sql .= $rowset[$i]['post_id'];
58 }
59 }
60
61 echo "<BR>";
62
63 if( $attach_sql != "" )
64 {
65 echo $sql = "UPDATE " . POSTS_TABLE . "
66 SET enable_sig = 1
67 WHERE post_id IN ($attach_sql)";
68 if( !$result = $db->sql_query($sql) )
69 {
70 die("Couldn't update post table attach_sig - ");
71 }
72 }
73
74 echo "<BR>";
75
76 if( $non_attach_sql != "" )
77 {
78 echo $sql = "UPDATE " . POSTS_TABLE . "
79 SET enable_sig = 0
80 WHERE post_id IN ($non_attach_sql)";
81 if( !$result = $db->sql_query($sql) )
82 {
83 die("Couldn't update post table non_attach_sig - ");
84 }
85 }
86
87 }
88
89 $db->sql_close();
90
91 echo "<BR><BR>COMPLETE<BR>";
92
93 ?>
94