Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Automated removal of dead links?  (Read 3429 times)

0 Members and 1 Guest are viewing this topic.

DanJ

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Automated removal of dead links?
« on: April 18, 2005, 03:29:35 pm »

The server my site was stored on recently had a catestrophic RAID array failure which resulted in the loss of all data. The site has now been restored from a backup however the recently uploaded images are missing however the the SQL database still refers to them (independent server so no data lost). Is there a way to mass remove all dead links to the images that no longer exist?

If not is there a 3rd party tool to do so? (I guess I should post that on the other forum but I thought it polite to safe x-posting in the hope that there is already a facility I've overlooked).

Thanks to anyone who's able to provide any help, it's all appreciated.
Logged

krkeegan

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 53
  • ahh the life...
    • Kevin's Photos
Re: Automated removal of dead links?
« Reply #1 on: April 18, 2005, 05:45:18 pm »

Wow that sucks. I can't think of anything off hand that has been created but I think you may be able to figure something out with phpMyAdmin. If you can figure out what is the most recent photo that is still up I think you could delete all  other posts after.

The pid value in the pictures database is auto_incremented so if you can find the last good picture and remove all references to the other pictures that occur there after I think it should work.

I don't have the table structure in front of me right now, but I also think you will have to make a few mods to the other tables.

Anyone else care to check my reasoning? Is there anything I am missing?

Kevin

Of course if you had a corresponding backup of the database that would work to.
Logged
There are no stupid questions, only stupid people. -Mr. Mackey, South Park

DanJ

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: Automated removal of dead links?
« Reply #2 on: April 19, 2005, 01:19:15 am »

What you've said makes sense to me. My knowledge of SQL is poor at best but I'm sure I can write a simple enough query to report back the appropriate records.

Thanks for your help.
Logged

Nibbler

  • Guest
Re: Automated removal of dead links?
« Reply #3 on: April 19, 2005, 02:51:23 pm »

Try the attached - unzip, upload to cpg dir, and run from browser.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 20 queries.