Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: [MOD] Database Cleanup  (Read 5936 times)

0 Members and 1 Guest are viewing this topic.

MaThIbUs

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • I rock.
    • http://mathibus.com/
[MOD] Database Cleanup
« on: February 26, 2004, 10:28:57 pm »

Database Cleanup mod

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

/m_aTh!bUs
Logged

MaThIbUs

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • I rock.
    • http://mathibus.com/
[MOD] Database Cleanup
« Reply #1 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.)
Logged

Widi

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 32
    • http://www.widi.tk
[MOD] Database Cleanup
« Reply #2 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
[MOD] Database Cleanup
« Reply #3 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
Logged

MaThIbUs

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • I rock.
    • http://mathibus.com/
[MOD] Database Cleanup
« Reply #4 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.
Logged

MaThIbUs

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • I rock.
    • http://mathibus.com/
[MOD] Database Cleanup
« Reply #5 on: February 28, 2004, 10:54:02 am »

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

(http://server6.uploadit.org/files/MaThIbUs-autoindex.jpg)
Logged

Widi

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 32
    • http://www.widi.tk
[MOD] Database Cleanup
« Reply #6 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.
Logged

Nibbler

  • Guest
[MOD] Database Cleanup
« Reply #7 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.
Logged

MaThIbUs

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • I rock.
    • http://mathibus.com/
[MOD] Database Cleanup
« Reply #8 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.

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

MaThIbUs

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • I rock.
    • http://mathibus.com/
[MOD] Database Cleanup
« Reply #9 on: March 03, 2004, 03:53:28 pm »

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

Widi

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 32
    • http://www.widi.tk
[MOD] Database Cleanup
« Reply #10 on: March 03, 2004, 04:45:56 pm »

Excellent,

Works like a charm

 :lol:

very nicely done
Logged

MaThIbUs

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 130
  • I rock.
    • http://mathibus.com/
[MOD] Database Cleanup
« Reply #11 on: March 04, 2004, 08:53:28 pm »

Thanks, Widi :)
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.