Version: 1.00, by TECK
Developer Last Online: Nov 2023
Version: 2.2.x
Rating:
Released: 05-01-2002
Last Update: Never
Installs: 62
No support by the author.
As we all know, there is a great tool included in the /extras folder, called [high]repair.php[/high].
I think not alot of people use it, because probably they don't know the gold mine hidden on it, related to tables optimisation.
freddie's script will repair your database, but ALSO will optimize the tables. So what is that means? It will remove all the empty spaces that clutter the database. The result? A smaller database size.
I ran the script on my localhost. At the beggining my database was 1.63MB. After I completed the repair&optimize process, my database was shrinked to 0.82MB!! That's almost half of the original size!!
So I decided to integrate this tool directly into my admin CP.
NOTE: The script is made by freddie, I only adapt it to the VB security and made it look like part of your CP. Also, my goal was to be able to optimize easy my database (with one click), not to repair it.
You can use this script in combination with another hack, also made freddie: Admin Quick Stats
[high]INSTALL PROCEDURE[/high]
In /admin/index.php, find:
Now, upload repair.php into your /admin folder. You are done.
[high]UPDATE[/high]
Quoted from freddie's post:
Quote:
Originally posted by freddie
I wrote repair.php as something that I could run nightly on my forum as it was getting periodic corruption. It has run nightly for probably a year now and I have not had a corrupt table since.
I thought that perhaps it might help out others and be an easier than telling everyone to go run myisamchk on their databases to fix problems. That being said, I only tested it on my forum so that is why it says "Not Supported". It won't work on non MyISAM tables and it won't work if the user table is corrupted.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
The script seems to be working for me but I'm getting this error:
PHP Code:
Warning: Supplied argument is not a valid MySQL result resource in /home/wdj/www/forums/admin/db_mysql.php on line 154
FYI, here's the block which includes line 154 in my db_mysql.php
PHP Code:
function fetch_array($query_id=-1,$query_string="") {
// retrieve row
if ($query_id!=-1) {
$this->query_id=$query_id;
}
if ( isset($this->query_id) ) {
$this->record = mysql_fetch_array($this->query_id);
} else {
if ( !empty($query_string) ) {
$this->halt("Invalid query id (".$this->query_id.") on this query: $query_string");
} else {
$this->halt("Invalid query id ".$this->query_id." specified");
}
}
Any help would be appreciated.
Also: I didn't realize until I ran it the first time you modified repair.php. Might make a note of that, (unless you already did and I missed it somewhere) or, better yet, rename repair.php to something else and change it in the hack.
Anyway, this is really handy to have available from the Admin console. Thank you!
If you find out how this is done, I would be very interested to know.
Quote:
Originally posted by NTLDR
I have freddies hack installed, but I wanted to know how the avatar and attachment count was added as that isn't part of the freddies hack (or at least not the version I installed).