Photo Module default album name

I try to change the default photo album name from {nickname} to {firstname} but it just makes an album called {firstname}'s album, not Joe's album, and messes things up. I'm trying to get away from {nickname} for everything.

I don't mind doing code edits or sql injections.

Aceiscracked

Quote · 20 Jun 2013

try {FirstName}

Quote · 20 Jun 2013

Where do we change this?

 

What hapens if more than one person has the same first name?

TravelNotes.org - The Online Guide to Travel
Quote · 20 Jun 2013

{FirstName} just makes an album with {FirstName}'s Album too...The only one that actually seems to work is {nickname}...But I hate nickname, and want never to use it.

Quote · 20 Jun 2013

I would assume the name of the album does not have to be unique since internally it is tracked by the user ID..

It would be nice if a developer would jump in here but they don't always have an interest.

Geeks, making the world a better place
Quote · 20 Jun 2013

The only automatic substitution here is NickName, if you want to get rid of it, make it without any replacements, for example 'Profile Photos'.

Rules → http://www.boonex.com/terms
Quote · 21 Jun 2013

 

The only automatic substitution here is NickName, if you want to get rid of it, make it without any replacements, for example 'Profile Photos'.

Just so I understand what you are saying; the {nickname} used in the photo module setting is a hard coded part of the photo module and we can not use other identifying information; such as {FirstName} or {firstname}. 

Sounds like code hacking time again.

@Aceiscracked: I have not looked at the code but I am guessing according to Alex's comment that the code that creates the profile photo album looks to see if {nickname} exists in the settings for the photo module and replaces it with the user's nickname; anything else is placed as is.  You would need to hack the code so that it pulls out the first name instead of the nickname.  Note: if you care to look, you will see that a member can change the name of the profile photo album so that name does not have to be unique since two different members could possibly change the name of their photo album to the same name.  Therefore, there should be no problem with two Jenny's Photos albums.

Geeks, making the world a better place
Quote · 21 Jun 2013

Actually, I think the album name has to be unique. Because: I changed it to {firstname} and it auto created an album called {firstname}'s albums. Because my users have all migrated over to new versions at different times, unknown to me there was already a user with an album called {firstname}'s album. I was denied access to my album, so I only have to guess that the value needs to be unique.

I also did some code hacking, because I now know how to make modules, and I changed the SQL database insert to {firstname} and I modified the photo module to look for {firstname} and it still didn't work. So, I may be missing another area but I could swear that I mod'ed the code correctly.

My fix...Hard code the user's {nickname} to be a unique combination of their first and last name and some random numbers...EG: Joe Schmoe would be joe_s2593 and his default album would then be joe_s2593's album. I can already do this and it would be an easy fix.

My next step would be, I would like to be able to do a PHP sub string edit and remove the last 6 digits of the string {username} so it just displays joe's album. Formatting of output text is usually done in the module file, so I will start looking there. If anyone knows where I could insert a substr() to format the output of the default album name, I would appreciate the knowledge...

Ace

Quote · 21 Jun 2013

So, it looks like the first album created is when the user joins.

I found this line in the join processor:

'album' => str_replace('{nickname}', getUsername($iId1), getParam('bx_photos_profile_album_name')),

I am thinking that I can modify it to look like:

'album' => str_replace('{nickname}', substr(getUsername($iId1),0,-6), getParam('bx_photos_profile_album_name')),

Adding the substr(string,0,-6) will pull off the last 6 digits, leaving just the firstname...It may cause issues, but I am not sure? Can someone like AlexT jump in and point me in the right direction if I am gonna cause major issues?

Ace

Quote · 21 Jun 2013

 

so I only have to guess that the value needs to be unique.

I can test this on a test site.  If it does have to be unique, then the bozo checker should yell at me; it should inform the member that the name already exists and to choose another one.  I will report back.

Geeks, making the world a better place
Quote · 21 Jun 2013

No, the profile photos album name is not unique; two members can have the exact same profile photo album name.  The name is not how the album is assigned to a member.  So if you have two members with the first name of Jenny, then both can have a profile photo album named Jenny's Photos.  I tested this on my test site, logging in and changing my profile photo album on the two test accounts I have.  I set both accounts Profile Photos album name to Jenny's Photos without any problems.

Geeks, making the world a better place
Quote · 21 Jun 2013

So that means that my edit should work? I'll try it, and report back.

-Ace

Quote · 21 Jun 2013

 Update:

So, it looks like the first album created is when the user joins.

Not quite. It makes the first album in the Avatar module. I found this line in the AvaModule:

'album' => str_replace('{nickname}', getUsername($iProfileId), getParam('bx_photos_profile_album_name')),

I modified it to say:

'album' => str_replace('{nickname}', substr(getUsername($iProfileId),0,-6), getParam('bx_photos_profile_album_name')),

Then I made a new user and uploaded a avatar...It kind of worked...The avatar was created and put in an album called joe's photos...However, there is still an album called joe_b3426's photos.

So now I am sure I can make the avatar album called "profile photos", because that's appropriate...However I am still not able to change the name of the default {username}'s album...

Inside BxDolAlbums I found

    function getAlbumDefaultName ()
    {
        return getParam('sys_album_default_name');
    }

 

But I can't find the value 'sys_album_default_name' anywhere else...

Quote · 21 Jun 2013

Update:

When I name the first album created (avatar module) "profile photo" it adds an 's in the wrong place and doesn't look right...

So, now I have the avatar module creating an album with nickname. I have formatted the nickname from the users real name "Joe Schmoe" to be "joe-s1234".

 

When I log in as Joe Schmoe, I can go to my albums, select my default album, click on Edit Album and rename the field "Title" from "joe-s1234's photos" to "joe's photos".

 

The easy thing would be to have a system message pop up and say "edit your album name and remove -(letter)(4 numbers)" BUT...I would like to edit the software to automatically rename it for my users when populating the "Title" field for the first time.

Anyone know where I can add a PHP edit for something like Title = subStr({nickname}, 0, -6)?

Quote · 23 Jun 2013
 
 
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.