Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Dont let user delete album

8 years 10 months ago
Licenses:
JomSocial Expired

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

8 years 10 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

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!

8 years 10 months ago
Licenses:
JomSocial Expired

Hello Dimas,

The url used to these albums is like this one:

public_html/images/photos/userid/albumid/

These albums have the same name to all users and I need to prevent users deleting them.

Thanks in advance

P.S: They are not system albums.

8 years 10 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

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"



but indeed I cant delete the album system, the album system is "Avatar Photos"..

I need your screenshoot like this, so I can undersatnd your issue very well

Attachments:
8 years 9 months ago
Licenses:
JomSocial Expired

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

8 years 9 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

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!

8 years 9 months ago
Licenses:
JomSocial Expired

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

8 years 9 months ago
Licenses:
JomSocial Expired

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

8 years 9 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi Daniel,

You need hack this file components/com_community/helpers/albums.php, find this code :

if(in_array(strtolower($album->type),$type) || $isDefaultAlbum){
replace and add condition like this :
if(in_array(strtolower($album->type),$type) || $isDefaultAlbum || $album->name=='selfies' || $album->name=='ensaios' ){

this code is not tested yet, but i hope it will work

thank you!

8 years 9 months ago
Licenses:
JomSocial Expired

Hello Dimas,

It worked like a charm!!

Thank you so much!

8 years 9 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

you're welcome :)

8 years 9 months ago
Licenses:
JomSocial Expired

Hey Dimas,

I found out a colateral effect in this aproach.

When I set the specific albums as system albums the user can´t insert photos to these albums anymore.. The slbum do not appears as a option when uploading photos, as you can see in the image below:


Attachments:
8 years 9 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

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);
replace to :
$dataAlbums = $objPhoto->getAlbums($my->id, false, false, 'date', '');

#2 open this file components/com_community/templates/jomsocial/layouts/photos/uploader.php and remove this code :
if (CAlbumsHelper::isFixedAlbum($album))
                                    continue;

cheers!

8 years 9 months ago
Licenses:
JomSocial Expired

Hey Dimas,

I used the same logic of the begining:

 if (CAlbumsHelper::isFixedAlbum($album) and ($album->name!=='Ensaios' and $album->name!=='Selfies') )
   continue;

It worked like a charm!
Thank You!

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW