I have a list of member IDs and want to batch delete all photos of these users. Does anybody know which function i need to call passing the member ID and it deletes all photos?
I saw there are lots mediaID functions in the twigmodule but i am not sure which functions to call first or raise alerts....
Maybe i need loop through bx_photos_main, retrieve the photo ID (which belongs to the user) then call some function passing this ID?
Whats the correct way?
Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81 |
Hello
You may use the followin service methods from BxPhotosModule class.
serviceDeleteProfileData($iProfileId); serviceDeleteProfileAlbums($iProfileId);
The call should looks like the following
BxDolService::call('photos', 'delete_profile_data', array($iProfileId));
Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV |
Hi Anton,
thanks for the tip, i also saw this service but only in the twigmodule. I forgot to mention i use 7.0.9 and these services do not exist in BxPhotoModule of 7.0.9 or i am stupid to understand how this works. Anyway the service calls do nothing invoked like that. I think because there are no such functions present. But i can see them in ./inc/classes/BxDolTwigModule.php
Does it the same? How to call them? Maybe create an instance of Class TwigModule and then directly call this function?
Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81 |
Hello
You are welcome. :)
You cannot see these service methods directly in BxPhotosModule class because they are written in its parent class BxDolFilesModule in inc/classes/BxDolFilesModule.php file. I checked in Dolphin 7.0.9 and they are there.
BxDolTwigModule class has the same methods, but they are used in Events, Groups and Store modules which inherit BxDolTwigModule class. So, service methods from BxDolTwigModule class are needed to delete profile's events, groups, products.
Best Regards AntonLV - http://www.boonex.com/market/posts/AntonLV |
Ahhhh i am so silly, you are right, they are inherited..... Anyway it is not working, i dont understand why. So I wrote my own code to batch delete avatars and photos and remove files on the disk, that was the fastest way.
But thanks for the help.
Check my GeoDistance, Watermark, TorBlock and Android Push Notifications mods | http://goo.gl/H3Vp81 |