Hello there,
I do use JSPT to make some acl rules like don't let an user create album.
However I didn't find neither in JSPT nor in jomsocial a way to dont´t let user delete an album.
I have two albums created during custom user login that I need to keep them fixed in user´s profiles.
How could I achieve that?
Thanks in advance
Hi daniel,
May I know the album URL? because by default you cant delete the system album, like stream album, avatar album and cover album.
thank you!
Hello Dimas,
The url used to these albums is like this one:
public_html/images/photos/userid/albumid/
I look to admin account photos here is the URL
equismap.com/index.php/minhas-fotos/3079-acomp61
, and I able to delete album "Ensaios" and "Selfies"
Hi Dimas,
That is my problem . I dont want my users to be able to delete these albums ( selfies and ensaios). These albums have to be permanent like a system álbum.
Thanks in advance
Hi Daniel,
So do you mean once user create new album thay wont be allowed to delete that new album? that is very odd.. are you sure about this ?
:)
thank you!
Hey Dimas,
These specific albums (Ensaios and Selfies) are created during user registratios (I have the code in my custom registration form). They are important because I have pages in my site like a portfolio, that use the photos inside these user albums.
If these albums with these names doesn't exist the user job won´t appear in portfolios pages.
So aswering your question, users can create and delete all albums they want, but I need to protect only these specific album : Ensaios and Selfies.
Thanks
Hey Dimas,
These specific albums (Ensaios and Selfies) are created during user registratios (I have the code in my custom registration form). They are important because I have pages in my site like a portfolio, that use the photos inside these user albums.
If these albums with these names doesn't exist the user job won´t appear in portfolios pages.
So aswering your question, users can create and delete all albums they want, but I need to protect only these specific album : Ensaios and Selfies.
Thanks
Hi Daniel,
You need hack this file components/com_community/helpers/albums.php, find this code :
if(in_array(strtolower($album->type),$type) || $isDefaultAlbum){
if(in_array(strtolower($album->type),$type) || $isDefaultAlbum || $album->name=='selfies' || $album->name=='ensaios' ){
Hello Dimas,
It worked like a charm!!
Thank you so much!
you're welcome :)
you need to change 2 files for this
#1 open this file components/com_community/controllers/photos.php, this code :
$dataAlbums = $objPhoto->getAlbums($my->id, false, false, 'date', $excludedAlbumType);
$dataAlbums = $objPhoto->getAlbums($my->id, false, false, 'date', '');
if (CAlbumsHelper::isFixedAlbum($album))
continue;
Hey Dimas,
I used the same logic of the begining:
if (CAlbumsHelper::isFixedAlbum($album) and ($album->name!=='Ensaios' and $album->name!=='Selfies') )
continue;