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_conf.php

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


001  <?php
002   
003  //
004  // Security message:
005  //
006  // This script is potentially dangerous.
007  // Remove or comment the next line (die(".... ) to enable this script.
008  // Do NOT FORGET to either remove this script or disable it after you have used it.
009  //
010  die("Please read the first lines of this script for instructions on how to enable it");
011   
012  //
013  // Do not change anything below this line.
014  //
015   
016   
017  $phpbb_root_path = "../";
018   
019  include($phpbb_root_path . 'extension.inc');
020  include($phpbb_root_path . 'config.'.$phpEx);
021  include($phpbb_root_path . 'includes/constants.'.$phpEx);
022  include($phpbb_root_path . 'includes/db.'.$phpEx);
023   
024  $sql = "SELECT *
025      FROM " . CONFIG_TABLE;
026  if(!$result = $db->sql_query($sql))
027  {
028      message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql);
029  }
030  else
031  {
032      $board_config = $db->sql_fetchrow($result);
033  }
034   
035  $newconfigtable = $table_prefix . "newconfig";
036   
037  $sql = "SELECT config_name, config_value FROM ". CONFIG_TABLE;
038  if( $result = $db->sql_query($sql) )
039  {
040      die("Don't run this script twice!<br>\n");
041  }
042   
043  $sql = "    CREATE TABLE $newconfigtable (
044                  config_name varchar(255) NOT NULL,
045                  config_value varchar(255) NOT NULL,
046                 PRIMARY KEY (config_name)
047              )";
048  print "Creating temporary table: $newconfigtable<p>\n";
049  if( !$result = $db->sql_query($sql) )
050  {
051      print("Couldn't create new config table<br>\n");
052  }
053   
054  $error = 0;
055  while (list($name, $value) = each($board_config))
056  {
057      if(is_int($name))
058      {
059          // Skip numeric array elements (we only want the associative array)
060          continue;
061      }
062   
063      // Rename sys_template
064      if ($name == 'sys_template')
065      {
066          $name = 'board_template';
067      }
068      // Rename system_timezone
069      if ($name == 'system_timezone')
070      {
071          $name = 'board_timezone';
072      }
073      print "$name = $value<br>\n";
074      $value = addslashes($value);
075      $sql = "INSERT INTO $newconfigtable (config_name, config_value) VALUES ('$name', '$value')";
076      if( !$result = $db->sql_query($sql) )
077      {
078          print("Couldn't insert '$name' into new config table");
079          $error = 1;
080      }
081  }
082   
083  if ($error != 1)
084  {
085      print "Dropping old table<p>\n";
086      $sql = "DROP TABLE ". CONFIG_TABLE;
087      if( !$result = $db->sql_query($sql) )
088      {
089          die("Couldn't drop old table");
090      }
091      print "Renaming $newconfigtable to ".CONFIG_TABLE."<p>\n";
092      $sql = "ALTER TABLE $newconfigtable RENAME ".CONFIG_TABLE;
093      if( !$result = $db->sql_query($sql) )
094      {
095          die("Couldn't rename new config table");
096      }
097      print "Renaming ".SESSIONS_TABLE." to ".$table_prefix."sessions<br>\n";
098      $sql = "ALTER TABLE ".SESSIONS_TABLE." RENAME ".$table_prefix."sessions";
099      if( !$result = $db->sql_query($sql) )
100      {
101          die("Couldn't rename session table");
102      }
103      
104  }
105   
106  $db->sql_close();
107   
108      echo "<BR><BR>COMPLETE<BR>";
109   
110  ?>
111