Modifying default photo album

I've seen a few questions but no definitive answers. What I'd like to be able to do is set it up where new users already have a few albums auto created. The current process is a bit confusing for new users and they end up creating multiple albums and then complaining about it.

 

What I like is that the iOS app only allows user to add photos to existing albums, not create new albums.

 

Anyway, I'd like to modify things so that when a new user is sign up they already have three albums

 

{nickname}'s private videos *ideally a way have privacy already set to private

{nickname}'s friend videos *ideally a way have privacy already set to friends

{nickname}'s public videos *ideally a way have privacy already set to public

 

I'm pretty handy in editing code if someone can point me in the right direction. Otherwise if anyones done a mod regarding let me know

Quote · 18 Feb 2017

To automatically create default albums, you can modify the following code in modules/boonex/photos/classes/BxPhotosConfig.php file:

        $this->aDefaultAlbums[] = 'profile_cover_album_name';
        $this->aDefaultAlbums[] = 'profile_album_name2';
        $this->aDefaultAlbums[] = 'profile_album_name3';

Where profile_album_name2 and profile_album_name3 are settings where album name is stored, actual settings names are bx_photos_profile_album_name2 and bx_photos_profile_album_name3.

To disable adding new albums you need to make additional modification.

Rules → http://www.boonex.com/terms
Quote · 19 Feb 2017

I also wish to do this. I've been creating albums when people join and telling them not to create new ones. A waste of time really. AlexT if you can guide us through stage 2 when you find time, I'm sure it's a mod many users could find worthwhile. Thanks

Quote · 19 Feb 2017

I also need this feature and I'll bet a few others do as well. Just recently a member uploaded 12 photos and put them in 12 new albums. 

Boonex have inadvertently created this monster by the way the "Update Photos" Box is presented. (See attachment 1) A lot of users don't read and simply press the submit button to move on. My member posted 12 new photos over a period of time and ended up creating 12 new albums as a result. He was one of many.

I also want my members to have 4 albums only: (1) Profile Photos (2) Cover Photos (3) General Photos and (4) Friends Only. All albums will be for general exhibition (Members), except for Friends Only which will be viewable by friends only.

I've used AlexT's code in another post above to create the additional albums and it works fine. I've also stopped my members from messing with the privacy levels (attachment 2), but in doing so I now have to set them in the database. 

The system is almost ready to use except for the following:

1. How can I add to AlexT's code to also set the privacy levels to save me doing it in the database?
2. How can I remove the Add button from the Dropdown under "Main" in Albums. (Attachment 3) I've tried making changes in the database but they're not working. I'm obviously looking in the wrong place.

Once I sort that lot out, I'm happy to share the changes with anyone who wants to use them. 

001.jpg · 12.4K · 257 views
002.jpg · 7K · 279 views
003.jpg · 30.3K · 233 views
Quote · 6 Mar 2017

 

To automatically create default albums, you can modify the following code in modules/boonex/photos/classes/BxPhotosConfig.php file:

 Awesome. I think that will work and it's a definite step in the right direction. Even with keeping the ability to create new albums intact (although I totally agree the way it is presented is awkward and leads to mistakenly creacting new albums every upload).

 

Alex please let us know what we would have to add to set the privacy settings when these are created. Otherwise this would actually be a bad thing to auto-create as they would imply they are set appropriately

 

As always much thanks for your tireless efforts in further refining and improving a pretty amazing product.

Quote · 8 Mar 2017

You can set default privacy for different content in `sys_privacy_actions` table > `default_group` field, there is numeric value there:

1 - special default group

2 - nobody

3 - all

4 - members

5 - friends

6 - favourites

7 - contacts

8 - hidden

 

Alex please let us know what we would have to add to set the privacy settings when these are created. Otherwise this would actually be a bad thing to auto-create as they would imply they are set appropriately

 

Rules → http://www.boonex.com/terms
Quote · 12 Mar 2017

Thanks AlexT. I knew that, but when I use your original suggestion:

 $this->aDefaultAlbums[] = 'profile_album_name2';

etc., and get this result (see example) in Photos Settings, there's no way of setting the privacy levels for each album in your code. To do this, I have to set them in the database.

Because I'm trying to create a situation where members can't interfere, I need to set the privacy settings for each album as I (admin) create them. i.e. 4 members, 5 friends only or whatever the case may be.

As you can see from the second photo, I've removed the option for members to set their own privacy levels.

It seems my members can't be told and they're changing privacy levels to suit themselves. This isn't fair on other members.

 

admin.jpg · 21.2K · 238 views
002.jpg · 7K · 209 views
Quote · 12 Mar 2017

All albums have the same default privacy level, if you need different privacy levels for different albums you need custom modification, I would suggest to do this in the following code in inc/classes/BxDolPrivacy.php file:

    function checkDefaultAlbums($iProfileId)
    {
    	$sUri = $this->_oConfig->getUri();

    	$aAlbums = $this->_oConfig->getDefaultAlbums(true, array('{nickname}' => getUsername($iProfileId)));
		foreach($aAlbums as $sAlbum) {
	        $aAlbumInfo = $this->oAlbums->getAlbumInfo(array('fileUri' => uriFilter($sAlbum), 'owner' => $iProfileId));
	        if(!empty($aAlbumInfo) && is_array($aAlbumInfo))
	        	continue;

            $this->oAlbums->addAlbum(array(
                'caption' => $sAlbum,
                'owner' => $iProfileId,
                'AllowAlbumView' => ($sAlbum == getParam('sys_album_default_name')) ? BX_DOL_PG_HIDDEN : $this->oAlbumPrivacy->_oDb->getDefaultValueModule($sUri, 'album_view'),
            ), false);
		}
    }

It maybe you will need to hire someone to implement this for you.

Rules → http://www.boonex.com/terms
Quote · 12 Mar 2017

 

$this->aDefaultAlbums[] = 'profile_cover_album_name';
$this->aDefaultAlbums[] = 'profile_album_name2';
$this->aDefaultAlbums[] = 'profile_album_name3';

 

Alex thanks so much for giving us the tools to implement this. I'm pretty good in modifying the php code so one last bit and I think I'm good to go. Using your example of the default album creation above, can you show in the code modification how you'd make each of these a different privacy level?

 

For example, automatically set the following 

 

'profile_cover_album_name' - set default public
'profile_album_name2' - set default friends
'profile_album_name3' - set default private


Thanks ever so much in advance for your wisdom and coding prowess. You rock!

Quote · 12 Mar 2017

When privacy is assigned:

'AllowAlbumView' => ($sAlbum == getParam('sys_album_default_name')) ? BX_DOL_PG_HIDDEN : $this->oAlbumPrivacy->_oDb->getDefaultValueModule($sUri, 'album_view'),

add checking for album name and depending on the album name assign different privacy level as numeric value

Rules → http://www.boonex.com/terms
Quote · 13 Mar 2017

 

Where profile_album_name2 and profile_album_name3 are settings where album name is stored, actual settings names are bx_photos_profile_album_name2 and bx_photos_profile_album_name3.

 

Okay I am working on this now. Only thing I think I'm missing is where the actual names I choose for each album is entered. You mention the above reference bx_photo_profile_album_name2 etc. where is this added?

Quote · 13 Mar 2017

In the photos module settings. See my attached photo "admin.jpg" above.

Quote · 13 Mar 2017

 

In the photos module settings. See my attached photo "admin.jpg" above.

 @johnk42 - That's what I thought but I've checked there after adding the additional default albums and its' not showing additional boxes on the Photo admin settings side. What am I missing?

 

Quote · 13 Mar 2017

Try naming them profile_cover_album_name2 etc and not profile_album_name2 etc.

Quote · 13 Mar 2017

 

Try naming them profile_cover_album_name2 etc and not profile_album_name2 etc.

 

Just tried. Was gonna be my next attempt but figured I'd keep it as AlexT showed it. However its still not showing on the backend admin that way either. 

 

I've cleared dolphin cache and the browser caches. Very strange...

Quote · 13 Mar 2017

I have to rush off. I'll play with it tonight. Can't recall why I changed the names.

Not knowing where Alex's code appeared, I do remember physically updating the database at the time. Maybe that's how I got the stuff to appear in settings. I physically added the items in the red box and set my privacy permissions in the database at the same time. See attachment.

I'd be checking my database to see if it's been updated with AlexT's code. Possibly not.

database.jpg · 39.4K · 253 views
Quote · 13 Mar 2017

@AlexT

 

Can you please give some clarification on this process. Seems a little confusion and you're the guy who can clear it up. Thanks in advance.

Quote · 14 Mar 2017

I haven't forgotten you. Unfortunately I'm very busy on another unrelated project and it will be a couple of days before I can respond. If you're in the position to uninstall and then reinstall the Photo Module, I can send you a file, but it will be incomplete. Although it will work, there are several back doors for creating albums and I'm trying to close them all, one by one. If I send the file, some of those back doors will still be ajar and your members will surely find them.

Give me a bit of time and I'll get it working - I think. Bear in mind that I have very limited PHP experience.

Quote · 15 Mar 2017

@johnk42

 

thanks for even taking the time and trying to help. It's contributors like you that help us all improve and tweak an already pretty amazing Boonex product. Feel free to send/attach the file and any relevant information I'd need. I can reinstall the photo module or at least dig down and see what you did. 

Quote · 15 Mar 2017

You need to manually execute SQL statement which adds settings to module admin.

Rules → http://www.boonex.com/terms
Quote · 20 Mar 2017

Thanks AlexT.  I'm actually well advanced with this mod which is in fact quite a big change. In doing what we're trying to achieve, consideration must also be given to a member's ability to edit and delete albums. 

With admin taking control, any kind of editing by a member is inadvisable, and deleting an album isn't a good idea either.

As I won't be creating endless new albums, setting privacy permissions in the database isn't a problem for me.

I have the ADD operation disabled when uploading a photo, but I'm still trying to sort out the Add, Edit and Delete options in the dropdowns (see attachments). I have them so that clicking the option doesn't do anything, but I'd rather have the wording removed completely. That's where I'm up to as I write. Once done, the mod should work as expected. I should be able to remove the Delete action okay.

So if any kind person can point me to the code or DB query that will remove the wording and not leave a space I'll be forever grateful.

As an aside, a member just uploaded 20 photos over a period of an hour and created 20 albums. This mod will hopefully stop them in their tracks.

album Add.jpg · 6.8K · 224 views
album edit.jpg · 18.6K · 227 views
Quote · 20 Mar 2017
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.