Displaying Owner name

OpenLens

Joined: 2002-09-08
Posts: 10
Posted: Sun, 2002-09-08 05:37

I went through this with Bharat a few months back, but I...err...missplaced the email with the solution :???:

I need to display the Album owner below each album thumb. Echoing the owner (username) variable will only give "Admin" under each album (the top-most album owner) and not the username of the person who created/owns the sub album.

Thanks in advance.

 
vallimar

Joined: 2002-08-15
Posts: 487
Posted: Sun, 2002-09-08 05:57

Do you mean the 'Show Owners' option in the album preferences?

 
OpenLens

Joined: 2002-09-08
Posts: 10
Posted: Sun, 2002-09-08 11:48
Quote:
Do you mean the 'Show Owners' option in the album preferences?

Nope. That only shows the owner (admin) for the top-level albums, not any of the subalbums, which in my case have different owners. If I edit the album thumb wrapper to display the owner var, it displays admin (the top-level album owner) and not the name of the subalbum owner.

 
OpenLens

Joined: 2002-09-08
Posts: 10
Posted: Tue, 2002-09-10 15:49

Anyone? :???:

 
bharat
bharat's picture

Joined: 2002-05-21
Posts: 7994
Posted: Wed, 2002-09-11 09:16

Luckily, I never delete any email. Here's the solution, put this in html_wrap/inline_albumthumb.footer

<?
$i = $GLOBALS['i'];
if ($gallery->album->isAlbumName($i)) {
$myAlbumName = $gallery->album->isAlbumName($i);
$myAlbum = new Album();
$myAlbum->load($myAlbumName);
$owner = $myAlbum->getOwner();
$username = $owner->getFullName();
echo "<center>";
echo "<span class='caption'>";
echo "Owned By: <a
href=user.php?op=userinfo&amp;uname=".$username.">".$username."</a>";
echo "</span>";
echo "</center>";
}
?>