• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.
  • Chevereto Support CLST

    Support response

    Support checklist

How to delete multiple images

R

rinku2012

Guest
Hello,

i am having so many images on my website. i want to delete oldest images per user. when i select the user ( typically user has more then 30K images), and select delete all its deleting only 25 per page. it will take ages to delete more images.
how can i delete 100 or 200 images or more at a time

I see that all users are using direct links in forums or other website. i want to remove the code for direct bb code links. how can i do that ?
 
First of all, you won't get rid of those leeching by removing those embed codes. You need to actually block those websites that are compromising your server stability.

Regarding multiple image delete, currently the only way to achieve massive image deletion is by:

1. Remove those entries from your images table.
2. Update all the user counters (likes, liked, image count, etc).
3. Delete the actual images from disk.

Am alternative is to set listing to a large number (ie 200 images per page) and click on "Select all" then click "Delete".

Cheers,
Rodolfo.
 
Thanks Rodolfo. I have changed the listing to 300 and refreshing the page. every time i refresh or delete all 300 images , i see that browser is going to hung state for few mins. is this common ?
if i delete a user, will all the images under that user will be deleted automatically ?
 
Ir you delete an user all the images that you belongs to that user will be also deleted.
 
Thanks Rodolfo.
I have couple of more questions

1. I have changed the listing to 300 and refreshing the page. every time i refresh or delete all 300 images , i see that browser is going to hung state for few mins. is this common ?
2. how can i delete guests images ? . is there a way to search all images from guest and delete them ?
 
1. I have changed the listing to 300 and refreshing the page. every time i refresh or delete all 300 images , i see that browser is going to hung state for few mins. is this common ?

No, most likely the server can't handle it and it never sends the response.

2. how can i delete guests images ? . is there a way to search all images from guest and delete them ?

You will need to add a custom where clause to the Explorer route.
 
When I said clause I meant a Where clause (mysql) not a url portion.

The clause needs ot be on setWhere.

Open the explore route and you will get it.
 
can i get the results in website url so that i can use the script ( or manually select images) and delete them
 
Actually I just noticed that there is a bug in class.listing.php that conflicts with custom WHERE in route explore. You will have to wait for the next revision to get it working.
 
Yes, now the CHV\Listing\setWhere method will work as expected. You have to understand that what you are doing here is to add a clause to the listing query that will allow you to customize what you get from that listing.

You only need to add this into any route you want to use (override explore route, edit it directly, whatever):
PHP:
$list->setWhere('image_user_id IS NULL');

It should look like this, applies for any listing you want to hack.

upload_2017-10-15_15-27-26.png

Hope it helps.
 
Rodolfo,

can you please be more specific on how to use this. i dint get you on where to point this. i want to delete few guests images ( like we do user images) both in Db and on web.
if we delete them on website, then automatically physical reference of the image will get deleted both on database and on hard drive
can you let me know on how to delete them
 
I already provide you instructions on how to inject a conditional clause to any listing. Using that, you can craft listing that will match exactly what you want to delete and then you simply browse, select, delete. I was under the impression that you knew a little bit about programming.

Anyway, keep in mind that you are asking for something that the system doesn't do by default, so you can't expect that I will code all the thing for you. This qualify as a customization, not support.

I'm sorry, but if you can't understand my instructions then I can't help you any further.
 
Hi Rodolfo,

now i get it. i need to edit the file route.explore.php ( which is located under /public_html/app/routes/) and add the below value

$list->setWhere('image_user_id IS NULL');

i was under the impression that i have to do this from mysql or from web broswer. i was confused initially.

thanks for your clear instructions. it helped.
 
Back
Top