HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Gallery help

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#92707 (In Topic #18580)
Avatar

Community saint

Hi,

I have started to migrate my sites Gallery 2 pictures over to OCP and have hit a snag - just want to make sure that I am not missing something.

My Gallery 2 files tar up to 254 MBytes - I have broken this down into smaller chunks and adjust the PHP upload limits to get larger files in.

Now I stupidly (on reflection) imported a 60 Mbyte tar file into "Gallery Home" expecting that it would respect directories and create child galleries for them. Now seeing as it didn't I am left with 227 images in the "Gallery Home" root - is there any way of mass deleting these images or moving them into child galleries?

I have searched but I cannot find a way to achieve either - have I really got to remove them one by one and then use the batch upload to bring a directory of pictures in one at a time ?

We do not need anything advanced for Galleries, just a way of viewing brochures and show pictures, so the OCP solution is perfect.

Cheers,
Ade
Back to the top
 
Posted
Rating:
#92708
Avatar

Go into the database, look at the 'images' table, and copy a list of IDs for the images you want rid of.

Open up notepad and prepare an OcCLE command featuring the image IDs:

Code

:require_code('galleries2');
delete_image(5,true);
delete_image(6,true);
...

If you're efficient you can do that quite fast by copying and pasting around.

Then put that command into OcCLE. You can paste multiple lines in and it'll work.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#92727
Avatar

Community saint

Ohhh that is better, had not explored OcCLE - images now gone in a fraction of the time i thought it was going to take me !! - Thanks Chris
Back to the top
 
Posted
Item has a rating of 5 (Liked by Chris Graham)  
Rating:
#92728
Avatar

Community saint

Chris Graham said

Go into the database, look at the 'images' table, and copy a list of IDs for the images you want rid of.

Open up notepad and prepare an OcCLE command featuring the image IDs:

Code

:require_code('galleries2');
delete_image(5,true);
delete_image(6,true);
...

If you're efficient you can do that quite fast by copying and pasting around.

Then put that command into OcCLE. You can paste multiple lines in and it'll work.

ADDED TO COMMUNITY DOCS!
Back to the top
 
Posted
Rating:
#93027
Avatar

Fan in action

That is why I love visiting this forum, your problem is solved once is shared.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: