forum.coppermine-gallery.net

Support => Older/other versions => cpg1.2 Standalone Support => Topic started by: MaThIbUs on February 26, 2004, 10:28:57 pm

Title: [MOD] Database Cleanup
Post by: MaThIbUs on February 26, 2004, 10:28:57 pm
Database Cleanup mod (http://www.mathibus.com/specials/hacks/cpgdbcleanup/)

I welcome your comments and/or suggestions in this thread.

/m_aTh!bUs
Title: [MOD] Database Cleanup
Post by: MaThIbUs on February 27, 2004, 03:10:13 pm
Can anyone tell me how to alter the AutoIndex value which is in the cpg_pictures MySQL table? Which MySQL query should I run? (It would be handy to include something like that in the mod.)
Title: [MOD] Database Cleanup
Post by: Widi on February 28, 2004, 03:36:37 am
Nice Mod.

Nothing fancy, just handy. I tested it and everything keeps working fine. But will keep my backup for while tough  :wink:

A stumbled on this:

As the script rearranges the 'pid' and 'aid'. Pictures will get a different pid. I had set a certain thumb set as an album_thumb So it's stored in mysql. Arranging all the 'pid's' made it show the wrong album_thumb. 'cause the pic.nr. as stated in sql doesn't correspond with the same 'pid' anymore. (It's rearranged remember) It even showed thumbs that weren't in the album at all.
To correct this i had to go by all the albums properties and correct the thumbs.

I don't know if it'll also happens when the album_thumb is set on 'last uploaded', as i didn't have any when a ran dbcleanup.php.

If your album count is low this isn't such a big problem, but as the photoalbum growes, the problem grows too.
Title: [MOD] Database Cleanup
Post by: Joachim Müller on February 28, 2004, 08:41:05 am
I see little point in this mod, as I don't care what numbers the PIDs have. If the mod crashes in mid-air, you'll have a problem.
Unless you're some kind of "keeping things nice'n neat fanatic", I recommend not using the mod...
After all, PID's are just numbers in an url...

GauGau
Title: [MOD] Database Cleanup
Post by: MaThIbUs on February 28, 2004, 10:31:51 am
Thanks for posting that bug report, Widi. I'll try to fix it asap.

Gaugau: there shouldn't be *any* problem if you create a backup (as stated in the mod readme). I get your point though.
Title: [MOD] Database Cleanup
Post by: MaThIbUs on February 28, 2004, 10:54:02 am
Database Cleanup mod v1.1 (http://www.mathibus.com/specials/hacks/cpgdbcleanup/)

Now the only thing I'm looking for is how to alter the AutoIndex value which is in the cpg_pictures MySQL table... Which MySQL query should I run? (It would be handy to include something like that in the mod.)

(https://forum.coppermine-gallery.net/proxy.php?request=http%3A%2F%2Fserver6.uploadit.org%2Ffiles%2FMaThIbUs-autoindex.jpg&hash=038e36a55c1911f5ae900a6f4140aa61e6391d1b)
Title: [MOD] Database Cleanup
Post by: Widi on February 28, 2004, 03:51:55 pm
Jupz you fixed it. Excellent...

 :lol:

PS. GauGau, agreed. It's a cleaning behind the scenes cosmetic thingy.
Title: [MOD] Database Cleanup
Post by: Nibbler on February 29, 2004, 04:45:23 pm
alter table $CONFIG['TABLE_PICTURES'] auto_increment = 0

- should fix that for you.

Incidently there is no need to make your own database connections, init.inc.php already does that (and includes config.inc.php too). Just use db_query() to run your queries directly.
Title: [MOD] Database Cleanup
Post by: MaThIbUs on March 01, 2004, 08:11:29 pm
Thanks for the info, Nibbler. I use mysql_query(), seems to work fine too. Anyway, with your help I updated the mod to v1.2 (http://www.mathibus.com/specials/hacks/cpgdbcleanup/).

Expect v1.3 real soon, which will use the table names which are stored in the config settings, and not the default names (thanks for that too, Nibbler :)).
Title: [MOD] Database Cleanup
Post by: MaThIbUs on March 03, 2004, 03:53:28 pm
Database Cleanup mod v1.3 (http://www.mathibus.com/specials/hacks/cpgdbcleanup/)

Much faster than v1.2, fixed some bugs and it now uses the table names which are stored in the configuration settings (instead of the default ones).
Title: [MOD] Database Cleanup
Post by: Widi on March 03, 2004, 04:45:56 pm
Excellent,

Works like a charm

 :lol:

very nicely done
Title: [MOD] Database Cleanup
Post by: MaThIbUs on March 04, 2004, 08:53:28 pm
Thanks, Widi :)