'publie'"; break; case 'auteur': $critere = "AND statut NOT IN ('0minirezo', '1comite')"; break; case 'mot': default: $critere = 'AND 1=0'; // ne jamais desindexer un mot break; } spip_query("UPDATE $table_objet SET idx='' WHERE idx<>'non' $critere"); $suppr = ''; $s = spip_query("SELECT id_$type FROM $table_objet WHERE idx='' $critere"); while ($t = spip_fetch_array($s)) $suppr .= ','.$t[0]; $s = spip_query("SELECT id_$type FROM $table_objet WHERE idx='non'"); while ($t = spip_fetch_array($s)) $suppr .= ','.$t[0]; if ($suppr) spip_query("DELETE FROM $table_index WHERE id_$type IN (0$suppr)"); } // // MySQL // if ($GLOBALS['table_prefix']) $table_pref = $GLOBALS['table_prefix']."_"; else $table_pref = ""; $query = "SHOW TABLES LIKE '$table_pref%'"; $result = spip_query($query); while ($row = spip_fetch_array($result)) $tables[] = $row[0]; if ($tables) { $tables = join(",", $tables); $query = "OPTIMIZE TABLE ".$tables; spip_query($query); } spip_log("optimisation ok"); } ## debug if ($GLOBALS['auteur_session']['statut'] == '0minirezo' AND $_GET['optimiser'] == 'oui') optimiser_base(); ?>