b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (0.9.x) [ class tree: install ] [ index: install ] [ all elements ]

Source for file index.php

Documentation is available at index.php

  1. <?php
  2. /**
  3.  * This is the main install menu
  4.  *
  5.  * IF YOU ARE READING THIS IN YOUR WEB BROWSER, IT MEANS THAT PHP IS NOT PROPERLY INSTALLED
  6.  * ON YOUR WEB SERVER. IF YOU DON'T KNOW WHAT THIS MEANS, CONTACT YOUR SERVER ADMINISTRATOR
  7.  * OR YOUR HOSTING COMPANY.
  8.  *
  9.  * b2evolution - {@link http://b2evolution.net/}
  10.  * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
  11.  * @copyright (c)2003-2005 by Francois PLANQUE - {@link http://fplanque.net/}
  12.  *
  13.  * @package install
  14.  */
  15.  
  16. /**
  17.  * include config and default functions:
  18.  */
  19. require_oncedirname(__FILE__).'/../conf/_config.php' );
  20. require_oncedirname(__FILE__)."/$install_dirout/$core_subdir/_functions.php)// db funcs
  21. require_once dirname(__FILE__)."/$install_dirout/$core_subdir/_timer.class.php";
  22. $Timer new Timer('main');
  23. require_oncedirname(__FILE__)."/$install_dirout/$core_subdir/_vars.php);
  24. require_oncedirname(__FILE__)."/$install_dirout/$core_subdir/_class_db.php);
  25. require_oncedirname(__FILE__)."/$install_dirout/$core_subdir/_functions_cats.php);
  26. require_oncedirname(__FILE__)."/$install_dirout/$core_subdir/_functions_bposts.php);
  27. require_oncedirname(__FILE__)."/$install_dirout/$core_subdir/_functions_forms.php);
  28. require_oncedirname(__FILE__).'/_functions_install.php' );
  29. require_oncedirname(__FILE__).'/_functions_create.php' );
  30.  
  31. param'action''string''default' );
  32. param'locale''string' );
  33.  
  34. ifpreg_match('/[a-z]{2}-[A-Z]{2}(-.{1,14})?/'$locale) )
  35. {
  36.     $default_locale $locale;
  37. }
  38. else
  39. // detect language
  40.     $default_locale locale_from_httpaccept();
  41.     // echo 'detected locale: ' . $default_locale. '<br />';
  42. }
  43. // Activate default locale:
  44. locale_activate$default_locale );
  45.  
  46. $timestamp time(120// We start dates 2 minutes ago because their dates increase 1 second at a time and we want everything to be visible when the user watches the blogs right after install :P
  47.  
  48. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  49. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php locale_lang(?>" lang="<?php locale_lang(?>">
  50. <head>
  51.     <meta http-equiv="Content-Type" content="text/html; charset=<?php locale_charset(?>" />
  52.     <title><?php echo T_('b2evo installer'?></title>
  53.     <link href="../rsc/b2evo.css" rel="stylesheet" type="text/css" />
  54. </head>
  55. <body>
  56. <div id="rowheader" >
  57.     <h1><a href="http://b2evolution.net/" title="b2evolution: Home"><img src="../img/b2evolution_logo.png" alt="b2evolution" width="472" height="102" /></a></h1>
  58.     <div id="tagline"><?php echo T_('Multilingual multiuser multi-blog engine.'?></div>
  59.     <h1 id="version"><?php echo T_('Installer for version ')' '$b2_version ?></h1>
  60.     <div id="quicklinks">
  61.         <?php echo T_('Current installation'?>:
  62.         <a href="index.php?locale=<?php echo $default_locale ?>"><?php echo T_('Install menu'?></a> &middot;
  63.         <a href="phpinfo.php"><?php echo T_('PHP info'?></a> &middot;
  64.         <a href="../index.php"><?php echo T_('Go to Blogs'?></a> &middot;
  65.         <a href="../admin/"><?php echo T_('Go to Admin'?></a> &middot;
  66.         <?php echo T_('Online'?>:
  67.         <a href="http://b2evolution.net/man/"><?php echo T_('Manual'?></a> &middot;
  68.         <a href="http://b2evolution.net/man/supportfaq.html"><?php echo T_('Support'?></a>
  69.     </div>
  70. </div>
  71.  
  72. <?php
  73. if( ($action == 'start'|| ($action == 'default'|| ($action == 'conf'|| ($action == 'menu') )
  74. {
  75.     ?>
  76.     <div class="installSideBar">
  77.     <h2><?php echo T_('Language / Locale')?></h2>
  78.     <p><?php echo T_('Choose a default language/locale for your b2evo installation.')?></p>
  79.  
  80.     <ul>
  81.  
  82.     <?php
  83.     // present available locales on first screen
  84.     foreach$locales as $lkey => $lvalue )
  85.     {
  86.         echo '<li>';
  87.         if$default_locale == $lkey echo '<strong>';
  88.         echo ' <a href="index.php?action='.$action.'&amp;locale='.$lkey.'">';
  89.         locale_flag$lkey'w16px''flag'''true"$install_dirout/$img_subdir/flags);
  90.         echo T_$lvalue['name');
  91.         echo '</a></li>';
  92.  
  93.         if$default_locale == $lkey echo '</strong>';
  94.     }
  95.     ?>
  96.     </ul>
  97.     </div>
  98.     <?php
  99. }
  100.  
  101. if$config_is_done || (($action != 'start'&& ($action != 'default'&& ($action != 'conf')) )
  102. {    // Connect to DB:
  103.     $DB new DBDB_USERDB_PASSWORDDB_NAMEDB_HOST$db_aliasesfalse );
  104.     if$DB->error )
  105.     // restart conf
  106.         echo '<p class="error">'.T_('Check your database config settings below and update them if necessary...').'</p>';
  107.         $action 'start';
  108.     }
  109.     else
  110.     {
  111.         $DB->halt_on_error true;    // From now on, halt on errors.
  112.  
  113.         // Check MySQL version
  114.         $mysql_version $DB->get_var'SELECT VERSION()' );
  115.         list$mysl_version_main$mysl_version_minor explode'.'$mysql_version );
  116.         if( ($mysl_version_main 100 $mysl_version_minor323 )
  117.         {
  118.             die'<div class="error"><p class="error"><strong>'.sprintf(T_('The minimum requirement for this version of b2evolution is %s version %s but you are trying to use version %s!')'MySQL''3.23'$mysql_version ).'</strong></p></div>');
  119.         }
  120.     }
  121. }
  122.  
  123. // Check PHP version
  124. list$version_main$version_minor explode'.'phpversion() );
  125. if( ($version_main 100 $version_minor401 )
  126. {
  127.     die'<div class="error"><p class="error"><strong>'.sprintf(T_('The minimum requirement for this version of b2evolution is %s version %s but you are trying to use version %s!')'PHP''4.1.0'phpversion() ).'</strong></p></div>');
  128. }
  129.  
  130. switch$action )
  131. {
  132.     case 'conf':
  133.         /*
  134.          * -----------------------------------------------------------------------------------
  135.          * Write conf file:
  136.          * -----------------------------------------------------------------------------------
  137.          */
  138.         param'conf_db_user''string'true );
  139.         param'conf_db_password''string'true );
  140.         param'conf_db_name''string'true );
  141.         param'conf_db_host''string'true );
  142.         param'conf_baseurl''string'true );
  143.         $conf_baseurl preg_replace'#(/)?$#'''$conf_baseurl )// remove trailing slash
  144.         param'conf_admin_email''string'true );
  145.  
  146.         // Connect to DB:
  147.         $DB new DB$conf_db_user$conf_db_password$conf_db_name$conf_db_host$db_aliasesfalse );
  148.         if$DB->error )
  149.         // restart conf
  150.             echo '<p class="error">'.T_('It seems that the database config settings you entered don\'t work. Please check them carefully and try again...').'</p>';
  151.             $action 'start';
  152.         }
  153.         else
  154.         {
  155.             $conf_filepath $conf_path.'/_config.php';
  156.             // Read original:
  157.             $conf file$conf_filepath );
  158.             ifempty$conf ) )
  159.             {    // This should actually never happen, just in case...
  160.                 printf'<p class="error">Could not load original conf file [%s]. Is it missing?</p>'$conf_filepath );
  161.                 break;
  162.             }
  163.  
  164.             // File loaded...
  165.             // Update conf:
  166.             $conf preg_replace(
  167.                                                         array(
  168.                                                                         "#define\(\s*'DB_USER',\s*'.*?'\s*\);#",
  169.                                                                         "#define\(\s*'DB_PASSWORD',\s*'.*?'\s*\);#",
  170.                                                                         "#define\(\s*'DB_NAME',\s*'.*?'\s*\);#",
  171.                                                                         "#define\(\s*'DB_HOST',\s*'.*?'\s*\);#",
  172.                                                                         "#baseurl\s*=\s*'.*?';#",
  173.                                                                         "#admin_email\s*=\s*'.*?';#",
  174.                                                                         "#config_is_done\s*=.*?;#",
  175.                                                                     ),
  176.                                                         array(
  177.                                                                         "define( 'DB_USER', '$conf_db_user' );",
  178.                                                                         "define( 'DB_PASSWORD', '$conf_db_password' );",
  179.                                                                         "define( 'DB_NAME', '$conf_db_name' );",
  180.                                                                         "define( 'DB_HOST', '$conf_db_host' );",
  181.                                                                         "baseurl = '$conf_baseurl';",
  182.                                                                         "admin_email = '$conf_admin_email';",
  183.                                                                         'config_is_done = 1;',
  184.                                                                     )$conf );
  185.  
  186.             $f @fopen$conf_filepath 'w' );
  187.             if$f == false )
  188.             {
  189.                 ?>
  190.                 <h1><?php echo T_('Config file update'?></h1>
  191.                 <p><strong><?php printfT_('We cannot automatically update your config file [%s]!')$conf_filepath )?></strong></p>
  192.                 <p><?php echo T_('There are two ways to deal with this:'?></p>
  193.                 <ul>
  194.                     <li><strong><?php echo T_('You can allow the installer to update the config file by changing its permissions:'?></strong>
  195.                         <ol>
  196.                             <li><?php printfT_('<code>chmod 666 %s</code>. If needed, see the <a %s>online manual about permissions</a>.')$conf_filepath'href="http://b2evolution.net/man/install/file_permissions.html" target="_blank"' )?></li>
  197.                             <li><?php echo T_('Come back to this page and refresh/reload.'?></li>
  198.                         </ol>
  199.                         <br />
  200.                     </li>
  201.                     <li><strong><?php echo T_('Alternatively, you can update the config file manually:'?></strong>
  202.                         <ol>
  203.                             <li><?php echo T_('Open the _config.php file locally with a text editor.'?></li>
  204.                             <li><?php echo T_('Delete all contents!'?></li>
  205.                             <li><?php echo T_('Copy the contents from the box below.'?></li>
  206.                             <li><?php echo T_('Paste them into your local text editor. <strong>ATTENTION: make sure there is ABSOLUTELY NO WHITESPACE after the final <code>?&gt;</code> in the file.</strong> Any space, tab, newline or blank line at the end of the conf file may prevent cookies from being set when you try to log in later.'?></li>
  207.                             <li><?php echo T_('Save the new _config.php file locally.'?></li>
  208.                             <li><?php echo T_('Upload the file to your server, into the /_conf folder.'?></li>
  209.                             <li><?php printfT_('<a %s>Call the installer from scratch</a>.')'href="index.php?locale='.$default_locale.'"'?></li>
  210.                         </ol>
  211.                     </li>
  212.                 </ul>
  213.                 <p><?php echo T_('This is how your _config.php should look like:'?></p>
  214.                 <blockquote>
  215.                 <pre><?php
  216.                     foreach$conf as $conf_line )
  217.                     {
  218.                         echo htmlspecialchars$conf_line );
  219.                     }
  220.                 ?></pre>
  221.                 </blockquote>
  222.                 <?php
  223.                 break;
  224.             }
  225.             else
  226.             // Write new contents:
  227.                 foreach$conf as $conf_line )
  228.                 {
  229.                     fwrite$f$conf_line );
  230.                 }
  231.                 fclose($f);
  232.  
  233.                 sprintf'<p>'.T_('Your configuration file [%s] has been successfully updated.').'</p>'$conf_filepath );
  234.  
  235.                 $baseurl $conf_baseurl;
  236.                 $admin_email $conf_admin_email;
  237.                 $config_is_done 1;
  238.                 $action 'menu';
  239.             }
  240.         }
  241.         // ATTENTION: we continue here...
  242.  
  243.     case 'start':
  244.     case 'default':
  245.         /*
  246.          * -----------------------------------------------------------------------------------
  247.          * Start of install procedure:
  248.          * -----------------------------------------------------------------------------------
  249.          */
  250.         if( (($action == 'start'&& ($allow_evodb_reset == 1)) || (!$config_is_done) )
  251.         {
  252.             // Set default params if not provided otherwise:
  253.             param'conf_db_user''string'DB_USER );
  254.             param'conf_db_password''string'DB_PASSWORD );
  255.             param'conf_db_name''string'DB_NAME );
  256.             param'conf_db_host''string'DB_HOST );
  257.             // Guess baseurl:
  258.             $baseurl 'http://'.isset$_SERVER['SERVER_NAME'$_SERVER['SERVER_NAME''yourserver.com' );
  259.             ifisset$_SERVER['SERVER_PORT'&& $_SERVER['SERVER_PORT'!= '80' ) )
  260.                 $baseurl .= ':'.$_SERVER['SERVER_PORT'];
  261.             $baseurl .= preg_replace'#/install(/(index.php)?)?$#'''$ReqPath );
  262.             param'conf_baseurl''string'$baseurl );
  263.             param'conf_admin_email''string'$admin_email );
  264.  
  265.             ?>
  266.             <h1><?php echo T_('Base configuration'?></h1>
  267.  
  268.             <p><?php echo T_('Your base config file has not been edited yet. You can do this by filling in the form below.'?></p>
  269.  
  270.             <p><?php echo T_('This is the minimum info we need to set up b2evolution on this server:'?></p>
  271.  
  272.             <form class="fform" name="form" action="index.php" method="post">
  273.                 <input type="hidden" name="action" value="conf" />
  274.                 <input type="hidden" name="locale" value="<?php echo $default_locale?>" />
  275.  
  276.                 <fieldset>
  277.                     <legend><?php echo T_('Database you want to install into'?></legend>
  278.                     <?php
  279.                         form_text'conf_db_user'$conf_db_user16T_('mySQL Username')sprintfT_('Your username to access the database' ) )100 );
  280.                         form_text'conf_db_password'$conf_db_password16T_('mySQL Password')sprintfT_('Your password to access the database' ) )100'''password' );
  281.                         form_text'conf_db_name'$conf_db_name16T_('mySQL Database')sprintfT_('Name of the database you want to use' ) )100);
  282.                         form_text'conf_db_host'$conf_db_host16T_('mySQL Host')sprintfT_('You probably won\'t have to change this' ) )120 );
  283.                     ?>
  284.                 </fieldset>
  285.  
  286.                 <fieldset>
  287.                     <legend><?php echo T_('Additional settings'?></legend>
  288.                     <?php
  289.                         form_text'conf_baseurl'$conf_baseurl50T_('Base URL')sprintfT_('This is where b2evo and your blogs reside by default. CHECK THIS CAREFULLY or not much will work. If you want to test b2evolution on your local machine, in order for login cookies to work, you MUST use http://<strong>localhost</strong>/path... Do NOT use your machine\'s name!' ) )120 );
  290.  
  291.                         form_text'conf_admin_email'$conf_admin_email50T_('Your email')sprintfT_('Will be used in severe error messages so that users can contact you. You will also receive notifications for new user registrations.' ) )80 );
  292.                     ?>
  293.                 </fieldset>
  294.  
  295.                 <fieldset>
  296.                     <fieldset>
  297.                         <div class="input">
  298.                             <input type="submit" name="submit" value="<?php echo T_('Update config file'?>" class="search" />
  299.                             <input type="reset" value="<?php echo T_('Reset'?>" class="search" />
  300.                         </div>
  301.                     </fieldset>
  302.                 </fieldset>
  303.  
  304.             </form>
  305.  
  306.             <?php
  307.             break;
  308.         }
  309.         // if config was already done, move on to main menu:
  310.  
  311.     case 'menu':
  312.         /*
  313.          * -----------------------------------------------------------------------------------
  314.          * Menu
  315.          * -----------------------------------------------------------------------------------
  316.          */
  317.         ?>
  318.         <h1><?php echo T_('How do you want to install b2evolution?'?></h1>
  319.         <form action="index.php" method="get">
  320.             <input type="hidden" name="locale" value="<?php echo $default_locale ?>" />
  321.  
  322.             <p><?php echo T_('The installation can be done in different ways. Choose one:')?></p>
  323.  
  324.             <p><input type="radio" name="action" id="newdb" value="newdb" checked="checked" />
  325.                 <label for="newdb"><?php echo T_('<strong>New Install</strong>: Install b2evolution database tables with sample data.')?></label></p>
  326.  
  327.             <p><input type="radio" name="action" id="evoupgrade" value="evoupgrade" />
  328.                 <label for="evoupgrade"><?php echo T_('<strong>Upgrade from a previous version of b2evolution</strong>: Upgrade your b2evolution database tables in order to make them compatible with the current version!')?></label></p>
  329.  
  330.             <p><input type="radio" name="action" id="cafelogupgrade" value="cafelogupgrade" />
  331.                 <label for="cafelogupgrade"><?php echo T_('<strong>Upgrade from Cafelog/b2 v 0.6.x</strong>: Install b2evolution database tables and copy your existing Cafelog/b2 data into them.')?></label></p>
  332.  
  333.             <p><input type="radio" name="action" id="upfrom_miniblog" value="upfrom_miniblog" />
  334.                 <label for="upfrom_miniblog"><?php echo T_('<strong>Upgrade from Manywhere Miniblog</strong>: Install b2evolution database tables and copy your existing Miniblog data into them.')?></label></p>
  335.  
  336.             <!-- <p><input type="radio" name="action" id="upfrom_wordpress" value="upfrom_wordpress" />
  337.                 <label for="upfrom_wordpress">EXPERIMENTAL: <?php echo T_('<strong>Upgrade from WordPress v 1.2</strong>: Install b2evolution database tables and copy your existing WordPress data into them.')?></label></p> -->
  338.  
  339.             <?php
  340.                 if$allow_evodb_reset == )
  341.                 {
  342.                     ?>
  343.                     <p><input type="radio" name="action" id="deletedb" value="deletedb" />
  344.                     <label for="deletedb"><strong><?php echo T_('Delete b2evolution tables')?></strong>:
  345.                     <?php echo T_('If you have installed b2evolution tables before and wish to start anew, you must delete the b2evolution tables before you can start a new installation. <strong>WARNING: All your b2evolution tables and data will be lost!!!</strong> Your Cafelog/b2 or any other tables though, if you have some, will not be touched in any way.')?></label></p>
  346.  
  347.                     <p><input type="radio" name="action" id="start" value="start" />
  348.                     <label for="start"><?php echo T_('<strong>Change your base configuration</strong> (see recap below): You only want to do this in rare occasions where you may have moved your b2evolution files or database to a different location...')?></label></p>
  349.                     <?php
  350.                 }
  351.             ?>
  352.  
  353.             <p><input type="submit" value="&nbsp; <?php echo T_('GO!')?> &nbsp;" /></p>
  354.             </form>
  355.         <?php
  356.         if$allow_evodb_reset != )
  357.         {
  358.             ?>
  359.             <br />
  360.             <h2><?php echo T_('Need to start anew?'?></h2>
  361.             <p><?php echo T_('If you have installed b2evolution tables before and wish to start anew, you must delete the b2evolution tables before you can start a new installation. b2evolution can delete its own tables for you, but for obvious security reasons, this feature is disabled by default.');
  362.             echo '</p>';
  363.             echo'<p>To enable it, please go to the /conf/_config.php file and change:</p>
  364. <pre>$allow_evodb_reset = 0;</pre>
  365. to
  366. <pre>$allow_evodb_reset = 1;</pre>
  367. <p>Then reload this page and a reset option will appear.</p>
  368. <p>This will also allow you to change your base configuration.</p>');
  369.         }
  370.         ?>
  371.  
  372.         <hr />
  373.         <h2><?php echo T_('Base config recap...')?></h2>
  374.  
  375.         <p><?php printfT_('If you don\'t see correct settings here, STOP before going any further, and <a %s>update your base configuration</a>.')'href="index.php?action=start&amp;locale='.$default_locale.'"' ?></p>
  376.  
  377.         <?php
  378.         if!isset($conf_db_user) ) $conf_db_user DB_USER;
  379.         if!isset($conf_db_password) ) $conf_db_password DB_PASSWORD;
  380.         if!isset($conf_db_name) ) $conf_db_name DB_NAME;
  381.         if!isset($conf_db_host) ) $conf_db_host DB_HOST;
  382.  
  383.         echo '<pre>',
  384.         T_('mySQL Username').': '.$conf_db_user."\n".
  385.         T_('mySQL Password').': '.(($conf_db_password != 'demopass' T_('(Set, but not shown for security reasons)''demopass') )."\n".
  386.         T_('mySQL Database').': '.$conf_db_name."\n".
  387.         T_('mySQL Host').': '.$conf_db_host."\n\n".
  388.         T_('Base URL').': '.$baseurl."\n\n".
  389.         T_('Admin email').': '.$admin_email.
  390.         '</pre>';
  391.         break;
  392.  
  393.  
  394.     case 'newdb':
  395.         /*
  396.          * -----------------------------------------------------------------------------------
  397.          * NEW DB: Create a plain new db structure + sample contents
  398.          * -----------------------------------------------------------------------------------
  399.          */
  400.         ?>
  401.         <h2><?php echo T_('Installing b2evolution tables with sample data')?></h2>
  402.         <?php
  403.         create_b2evo_tables();
  404.         populate_main_tables();
  405.         ?>
  406.         <p><?php echo T_('Installation successful!')?></p>
  407.         <?php
  408.         printfT_('<p>Now you can <a %s>log in</a> with the login "admin" and password "%s".</p>
  409.     <p>Note that password carefully! It is a <em>random</em> password that is given to you when you install b2evolution. If you lose it, you will have to delete the database tables and re-install anew.</p>')'href="'.$admin_url.'/"'$random_password );
  410.         break;
  411.  
  412.  
  413.     case 'evoupgrade':
  414.         /*
  415.          * -----------------------------------------------------------------------------------
  416.          * EVO UPGRADE: Upgrade data from existing b2evolution database
  417.          * -----------------------------------------------------------------------------------
  418.          */
  419.         require_oncedirname(__FILE__)'/_functions_evoupgrade.php' );
  420.         ?>
  421.         <h2><?php echo T_('Upgrading data in existing b2evolution database')?></h2>
  422.         <?php
  423.         ifupgrade_b2evo_tables() )
  424.         {
  425.         ?>
  426.         <p><?php echo T_('Upgrade completed successfully!')?></p>
  427.         <p><?php printfT_('Now you can <a %s>log in</a> with your usual %s username and password.')'href="'.$admin_url.'/"''b2evolution')?></p>
  428.         <?php
  429.         }
  430.         break;
  431.  
  432.  
  433.     case 'cafelogupgrade':
  434.         /*
  435.          * -----------------------------------------------------------------------------------
  436.          * UPGRADE FROM B2 : Create a new db structure + copy content from previous b2
  437.          * -----------------------------------------------------------------------------------
  438.          */
  439.         require_oncedirname(__FILE__)'/_functions_cafelogupgrade.php' );
  440.         ?>
  441.         <h2><?php printfT_('Installing b2evolution tables and copying existing %s data')'b2' ?></h2>
  442.         <?php
  443.             create_b2evo_tables();
  444.             upgrade_cafelog_tables();
  445.         ?>
  446.         <p><?php echo T_('Upgrade completed successfully!')?></p>
  447.         <p><?php printfT_('Now you can <a %s>log in</a> with your usual %s username and password.')'href="'.$admin_url.'/"''b2')?></p>
  448.         <?php
  449.         break;
  450.  
  451.  
  452.     case 'upfrom_miniblog':
  453.         /*
  454.          * -----------------------------------------------------------------------------------
  455.          * UPGRADE FROM MINIBLOG : Create a new db structure + copy content from miniblog
  456.          * -----------------------------------------------------------------------------------
  457.          */
  458.         require_oncedirname(__FILE__)'/_functions_miniblog.php' );
  459.         ?>
  460.         <h2><?php printfT_('Installing b2evolution tables and copying existing %s data')'Miniblog' ?></h2>
  461.         <?php
  462.             create_b2evo_tables();
  463.             upgrade_miniblog_tables();
  464.         ?>
  465.         <p><?php echo T_('Upgrade completed successfully!')?></p>
  466.         <?php printfT_('<p>Now you can <a %s>log in</a> with your usual Miniblog email login cropped at 20 chars. All passwords have been reset to "%s".</p>
  467. <p>Note that password carefully! It is a <em>random</em> password that is given to you when you install b2evolution. If you lose it, you will have to delete the database tables and re-install anew.</p>')'href="'.$admin_url.'/"'$random_password )?>
  468.         <?php
  469.         break;
  470.  
  471.  
  472.     case 'upfrom_wordpress':
  473.         /*
  474.          * -----------------------------------------------------------------------------------
  475.          * UPGRADE FROM WORDPRESS : Create a new db structure + copy content from wordpress
  476.          * -----------------------------------------------------------------------------------
  477.          */
  478.         require_oncedirname(__FILE__)'/_functions_wordpress.php' );
  479.         ?>
  480.         <h2><?php printfT_('Installing b2evolution tables and copying existing %s data')'WordPress' ?></h2>
  481.         <?php
  482.             create_b2evo_tables();
  483.             upgrade_cafelog_tables();
  484.         ?>
  485.         <p><?php echo T_('Upgrade completed successfully!')?></p>
  486.         <p><?php printfT_('Now you can <a %s>log in</a> with your usual %s username and password.')'href="'.$admin_url.'/"''WordPress')?></p>
  487.         <?php
  488.         break;
  489.  
  490.  
  491.     case 'deletedb':
  492.         /*
  493.          * -----------------------------------------------------------------------------------
  494.          * DELETE DB: Delete the db structure!!! (Everything will be lost)
  495.          * -----------------------------------------------------------------------------------
  496.          */
  497.         require_oncedirname(__FILE__)'/_functions_delete.php' );
  498.         ?>
  499.         <h2><?php echo T_('Deleting b2evolution tables from the datatase'?></h2>
  500.         <?php
  501.         if$allow_evodb_reset != )
  502.         {
  503.             echo '<p>'.T_('For security reasons, the reset feature is disabled by default.' ).'</p>';
  504.             echo'<p>To enable it, please go to the /conf/_config.php file and change:</p>
  505. <pre>$allow_evodb_reset = 0;</pre>
  506. to
  507. <pre>$allow_evodb_reset = 1;</pre>
  508. <p>Then reload this page and a reset option will appear.</p>');
  509.             break;
  510.         }
  511.         db_delete();
  512.         ?>
  513.         <p><?php echo T_('Reset done!')?></p>
  514.         <p><a href="index.php?locale=<?php echo $default_locale ?>"><?php echo T_('Back to menu')?></a>.</p>
  515.         <?php
  516.         break;
  517. }
  518.  
  519. ?>
  520.  
  521. <div id="rowfooter">
  522.     <a href="http://b2evolution.net/"><?php echo T_('official website'?></a> &middot;
  523.     <a href="http://b2evolution.net/about/license.html"><?php echo T_('GNU GPL license'?></a> &middot;
  524.     <a href="http://fplanque.net/About/index.html"><?php echo T_('contact'?>: Fran&ccedil;ois PLANQUE</a>
  525. </div>
  526.  
  527. <?php
  528.     debug_info()// output debug info if requested
  529.  
  530.  
  531.     // the following comment gets checked in the automatic install script of demo.b2evolution.net:
  532. ?>
  533. <!-- b2evo-install-end -->
  534. </body>
  535. </html>

Documentation generated on Tue, 20 May 2008 01:51:46 +0200 by phpDocumentor 1.4.2