[ Index ] |
|
Code source de SPIP 1.9.2c |
1 <?php 2 3 /***************************************************************************\ 4 * SPIP, Systeme de publication pour l'internet * 5 * * 6 * Copyright (c) 2001-2007 * 7 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James * 8 * * 9 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. * 10 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. * 11 \***************************************************************************/ 12 13 // http://doc.spip.org/@inc_install_3 14 function install_etape_3_dist() 15 { 16 global $adresse_db, $login_db, $pass_db, $spip_lang_right, $chmod; 17 18 echo install_debut_html(); 19 20 echo info_etape(_T('info_choix_base')." "._T('menu_aide_installation_choix_base').aide ("install2")); 21 22 echo generer_url_post_ecrire('install'); 23 echo "<input type='hidden' name='etape' value='4' />"; 24 echo "<input type='hidden' name='chmod' value='$chmod' />"; 25 echo "<input type='hidden' name='adresse_db' value=\"$adresse_db\" />"; 26 echo "<input type='hidden' name='login_db' value=\"$login_db\" />"; 27 echo "<input type='hidden' name='pass_db' value=\"$pass_db\" />\n"; 28 29 $link = mysql_connect("$adresse_db","$login_db","$pass_db"); 30 $result = @mysql_list_dbs(); 31 32 echo "<fieldset><legend>"._T('texte_choix_base_1')."</legend>\n"; 33 34 $checked = ''; 35 if ($result AND (($n = @mysql_num_rows($result)) > 0)) { 36 echo "<label for='choix_db'><b>"._T('texte_choix_base_2')."</b><br />"._T('texte_choix_base_3')."</label>"; 37 echo "<ul>"; 38 $bases = ""; 39 for ($i = 0; $i < $n; $i++) { 40 $table_nom = mysql_dbname($result, $i); 41 $base = "<li><input name=\"choix_db\" value=\"".$table_nom."\" type='radio' id='tab$i'"; 42 $base_fin = " /><label for='tab$i'>".$table_nom."</label></li>\n\n"; 43 if ($table_nom == $login_db) { 44 $bases = "$base checked='checked'$base_fin".$bases; 45 $checked = true; 46 } 47 else { 48 $bases .= "$base$base_fin\n"; 49 } 50 } 51 echo $bases."</ul>"; 52 echo "<p>"._T('info_ou')." "; 53 } 54 else { 55 echo "<b>"._T('avis_lecture_noms_bases_1')."</b> 56 "._T('avis_lecture_noms_bases_2')."<p>"; 57 if ($login_db) { 58 // Si un login comporte un point, le nom de la base est plus 59 // probablement le login sans le point -- testons pour savoir 60 $test_base = $login_db; 61 $ok = @mysql_select_db($test_base); 62 $test_base2 = str_replace('.', '_', $test_base); 63 if (@mysql_select_db($test_base2)) { 64 $test_base = $test_base2; 65 $ok = true; 66 } 67 68 if ($ok) { 69 echo _T('avis_lecture_noms_bases_3'); 70 echo "<ul>"; 71 echo "<li><input name=\"choix_db\" value=\"".$test_base."\" type='radio' id='stand' checked='checked' />"; 72 echo "<label for='stand'>".$test_base."</label></li>\n"; 73 echo "</ul>"; 74 echo "<p>"._T('info_ou')." "; 75 $checked = true; 76 } 77 } 78 } 79 echo "<input name=\"choix_db\" value=\"new_spip\" type='radio' id='nou'"; 80 if (!$checked) echo " checked='checked'"; 81 echo " /> <label for='nou'>"._T('info_creer_base')."</label></p><p>"; 82 echo "<input type='text' name='table_new' class='fondl' value=\"spip\" size='20' /></p></fieldset>"; 83 84 echo bouton_suivant(); 85 echo "</form>"; 86 87 echo install_fin_html(); 88 } 89 90 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Wed Nov 21 10:20:27 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |