[MOD] Database Cleanup [MOD] Database Cleanup
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[MOD] Database Cleanup

Started by MaThIbUs, February 26, 2004, 10:28:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MaThIbUs

Database Cleanup mod

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

/m_aTh!bUs

MaThIbUs

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.)

Widi

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.

Joachim Müller

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

MaThIbUs

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.

MaThIbUs

Database Cleanup mod v1.1

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://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fserver6.uploadit.org%2Ffiles%2FMaThIbUs-autoindex.jpg&hash=038e36a55c1911f5ae900a6f4140aa61e6391d1b)

Widi

Jupz you fixed it. Excellent...

 :lol:

PS. GauGau, agreed. It's a cleaning behind the scenes cosmetic thingy.

Nibbler

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.

MaThIbUs

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.

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 :)).

MaThIbUs

Database Cleanup mod v1.3

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).

Widi

Excellent,

Works like a charm

 :lol:

very nicely done

MaThIbUs