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: Deleting pictures by username  (Read 3931 times)

0 Members and 1 Guest are viewing this topic.

Patrick

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Deleting pictures by username
« on: March 16, 2005, 09:59:03 pm »

Is it possible to delete all pictures from a certain member without having to go through all albums and deleting them one by one?
Logged

foulu

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 236
  • uhm
Re: Deleting pictures by username
« Reply #1 on: March 17, 2005, 01:35:16 am »

possible, but i think you must make a new php file !!!

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Deleting pictures by username
« Reply #2 on: March 17, 2005, 03:28:36 am »

You can use phpmyadmin to do that.

DELETE cpg132_pictures, cpg132_comments, cpg132_votes
FROM cpg132_pictures
LEFT JOIN cpg132_comments on cpg132_pictures.pid=cpg132_comments.pid
LEFT JOIN cpg132_votes on cpg132_pictures.pid=cpg132_votes.pic_id
WHERE cgp132_pictures.owner_id=56

In that example, 56 is the user_id who's pictures you want to delete.  This sql statement deletes all the pictures from the pictures table and all the comments and votes that belong to those pictures, where the owner of the pictures is #56.
« Last Edit: March 17, 2005, 03:36:29 am by kegobeer »
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

foulu

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 236
  • uhm
Re: Deleting pictures by username
« Reply #3 on: March 17, 2005, 03:32:30 am »

but image still in server, only database delete

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Deleting pictures by username
« Reply #4 on: March 17, 2005, 03:39:03 am »

Yes, they would still be on the server.  But all of those files should be in the userpics/10056 directory, so they would be easy enough to remove.

The hard part is cleaning up the database; the easy part is deleting the original, thumb_, and normal_ pictures.

It would be possible to write a file that would read the filenames and locations into an array, unlink those files, thumbnails, and normal images, then execute the above sql statement.  I'm not volunteering, mind you.  Just saying it's possible.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

foulu

  • Contributor
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 236
  • uhm
Re: Deleting pictures by username
« Reply #5 on: March 17, 2005, 03:42:27 am »

i'm not agree with you, hard part is delete file, with large gallery and if this user upload many file, find and delete is hell.

sorry, i'm wrong, all pics of an user is store in one folder do delete is easy.


« Last Edit: March 17, 2005, 03:51:35 am by foulu »
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Deleting pictures by username
« Reply #6 on: March 17, 2005, 03:50:58 am »

I guess your users upload using the XP Publisher utility, which creates a new directory for each date.  Otherwise, all of their images go into one directory.  Unless you allow your users to FTP images to any directory they want and do batch adds, in which case they would be administrators.
Logged
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.