Album owner-fullname/username

suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2005-10-16 18:26

I've been searching for an answer to simple(I hope)question:
How do I show username instead of fullname for album owner/photo owner?
I thought it might be a config setting in admin but cannot seem to find it.

All modifications found in forums refer to old code that does not appear to exsist.

G2 theme matrix

Thanks in advance

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Sun, 2005-10-16 18:54

Edit Album | Edit Permissions | New Owner

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2005-10-16 19:01

Not really acceptible, albums are generated on the fly when new user joins the site. Nobody wants their real name. This is a gamer site, so everybody knows each other by screennames.

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2005-10-16 19:05

There is this How To for comments: http://codex.gallery2.org/index.php/Gallery2:How_to_Change_Fullname_to_Username_in_Comments

It also mentions how to do this for item (albums/photos/etc) by editing ItemInfo.tpl
http://codex.gallery2.org/index.php/Gallery2:How_to_Change_Fullname_to_Username_in_Comments

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2005-10-16 20:22

Thanks nivekiam,
That got me most of the way, now where would that be for the sidebar? Album tree still shows fullnames.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2005-10-16 20:25

oops.. found it in modules/imagblock/templates/imageblock.tpl

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2005-10-16 20:27

Well, depending on what it is in the sidebar it could be a lot of different places. But my album tree doesn't show username or full name. Are you thinking Image Block? Can you post a screenshot of what you're looking at?

edit: ah, nevermind then :)
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2005-10-16 20:29

actually that changed the imageblock, but not the album tree. Cannot find that one:(

The dhtml album tree nav.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2005-10-16 23:24

Ok, it seems the problem lies in the album creation process. User albums are created with the first visit to the gallery, and it is naming the albums based on fullname instead of username.

Anyone have any idea where that code is?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Mon, 2005-10-17 00:01

Please post a screenshot of what you want to change. I can find no reference to fullName or userName in the albumselect module, thus the username or fullname should not even be displayed. I've never seen it displayed and see no options to turn that on or off so I don't know why that information is even displayed in your album tree.

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2005-10-17 00:15

Actually as it turns out, it is displaying the album name, which is based on the users fullname. I have gallery embedded, all user information is correctly mapped, and I have gallery set to create a user album for each user on his/her first visit to gallery. Gallery is creating this user album based on the users fullname, so that is why I'm seeing the fullnames in the album tree.
I would like to set gallery to create these user albums based on username instead of fullname.

Is that more helpful?

 
robert070612

Joined: 2003-08-05
Posts: 565
Posted: Mon, 2005-10-17 00:30

Is this area going to do what you want?

[/modules/useralbum/classesUserAlbumHelper.class]
	/* Create album.. */
	$albumTitle = trim($user->getFullName());
	if (empty($albumTitle)) {
	    $albumTitle = $user->getUserName();
	}
	$albumName = $user->getUserName();
	while (true) {
	    list ($ret, $album) = GalleryCoreApi::createAlbum(
		$module['targetLocation'], $albumName, $albumTitle, '', '', '');
	    if ($ret->isSuccess()) {
		break;
	    }
	    if ($ret->getErrorCode() & ERROR_COLLISION) {
		$albumName .= '_';
	    } else {
		return $ret->wrap(__FILE__, __LINE__);
	    }
	}
 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Mon, 2005-10-17 01:40

Yes that would be it, thank you very much!
I replaced: $albumTitle = trim($user->getFullName());
with: $albumTitle = $user->getUserName();
Since username cannot be empty, I don't see a problem.
I've been searching for that piece of code for hours, don't know how I missed it.

Thanks again:)