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.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

convert_user_regdates.php

Zuletzt modifiziert: 09.10.2024, 12:51 - Dateigröße: 1.79 KiB


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  chdir("../");
20   
21  include('extension.inc');
22  include('config.'.$phpEx);
23  include('includes/constants.'.$phpEx);
24  include('includes/db.'.$phpEx);
25   
26      $months = array(
27          "Jan" => 1,
28          "Feb" => 2,
29          "Mar" => 3,
30          "Apr" => 4,
31          "May" => 5,
32          "Jun" => 6,
33          "Jul" => 7,
34          "Aug" => 8,
35          "Sep" => 9,
36          "Oct" => 10,
37          "Nov" => 11,
38          "Dec" => 12 
39      );
40   
41      $sql = "SELECT user_id, user_regdate FROM ".USERS_TABLE;
42      $result = $db->sql_query($sql);
43      if(!$result)
44      {
45          die("OOpppps, that didn't work!");
46      }
47   
48      $all_old_dates = $db->sql_fetchrowset($result);
49   
50      $sql = "ALTER TABLE ".USERS_TABLE."
51          CHANGE user_regdate user_regdate INT (11) NOT NULL";
52      $result = $db->sql_query($sql);
53      if(!$result)
54      {
55          die("Opps, that didn't work either ... oh damn!");
56      }
57   
58   
59      for($i = 0; $i < count($all_old_dates); $i++)
60      {
61          if(is_string($all_old_dates[$i]['user_regdate']))
62          {
63              if(eregi("^([a-zA-Z]{3}) ([0-9]+), ([0-9]{4})", $all_old_dates[$i]['user_regdate'], $result))
64              {
65                  echo $all_old_dates[$i]['user_regdate']." : ";
66                  echo $new_time = gmmktime(0, 1, 0, $months[$result[1]], $result[2], $result[3]);
67                  echo " : ".gmdate("M d, Y", $new_time)."<br>";
68                  $sql = "UPDATE phpbb_users 
69                      SET user_regdate = '$new_time
70                      WHERE user_id = '".$all_old_dates[$i]['user_id']."'";
71                  $result = $db->sql_query($sql);
72                  if(!$result)
73                  {
74                      die("Oh damn it, now that's really broken it!");
75                  }
76              }
77          }
78      }
79          
80      echo "<br>That's All Folks!";
81   
82  ?>
83  </body>
84  </html>
85