Les archives de FluxBB.fr
Vous n'êtes pas identifié(e).
Pages : 1
Salut, je viens d'installé mon forum avec quelque module, et je le trouve super, par contre, j'ai rien trouvé qui me perme d'optimiser ma base de donné directement depuis le panneau admin, je suis obliger d'exécuter depuis PhpMyAdmin cette requête :
OPTIMIZE TABLE `balises`, `balises_modo`, `bans` , `categories` , `censoring` , `chatbox_msg` , `config` , `contacts` , `forums` , `forum_perms` , `groups` , `logs` , `messages` , `polls` , `posts` , `ranks` , `replyfast` , `reponses_auto` , `reports` , `search_cache` , `search_matches` , `search_words` , `smilies` , `subscriptions` , `topics` , `users`
C'est que quelqu'un connait un module, un plugin ou une astuce pour rajouter un bouton pour le faire depuis le panneau admin.
Hors ligne
Plugin inexistant à ma connaissance...
Mais pas très dur à faire/proposer.
Hors ligne
j'ai trouvé ceci, je pense que le code php est simple à modifier pour faire un plugin.
edit : voici un petit test que j'ai fait, quelqu'un peu me dire s'il marche, comme j'ai optimiser ma BDD ce matin, elle change pas de taille chez moi.
Sinon, je connais pas le php, donc j'aimerai avoir des conseil pour améliorer ce code 
<?php
/***********************************************************************
Copyright (C) 2007 Quentin Chergui (kankan@live.fr)
This file is part of PunBB.
PunBB is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any later version.
PunBB is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA
************************************************************************/
// Make sure no one attempts to run this script "directly"
if (!defined('PUN'))
exit;
// Tell admin_loader.php that this is indeed a plugin and that it is loaded
define('PUN_PLUGIN_LOADED', 1);
generate_admin_menu($plugin);
mysql_connect('sql.serveur', 'pseudo', 'mdp');
$base = 'base';
$table = mysql_list_tables($base);
//on prépare la requête
$sql = "OPTIMIZE TABLE ";
//on recherche toutes les données des tables
$req = mysql_query('SHOW TABLE STATUS');
while($data = mysql_fetch_assoc($req))
{
//on regarde seulement les tables qui affichent des pertes
if($data['Data_free'] > 0)
{
//et on l'inclut si elle comporte des pertes
$sql .= '`'.$data['Name'].'`, ';
}
}
//on enlève le ', ' de trop
$sql = substr($sql, 0, (strlen($sql)-2));
//et on optimise
mysql_query($sql);
mysql_close();
?>
<div class="blockform">
<h2><span>Action optimisation</span></h2>
<div class="box">
<div class="inbox">
<p>Vous avez optimiser la BDD.</p>
</div>
</div>
</div>Edit : marche pas
Dernière modification par kardoc (01-09-2008 10:30:08)
Hors ligne
Pages : 1