your album link?

Shredder

Joined: 2005-04-28
Posts: 28
Posted: Thu, 2009-10-22 06:51

Hey guys.. been working hard on my gallery drupal integrations and for the life of me I cant find how to make a link to the users album in the side bar. I have seen refrences to `"Your Album" link in the G2 useralbum module` but I cant seem to find that either. Right now with the Gallery link that the module sets up in the left sidebar.. if you click on it it goes to the main site album and you can see all the users albums, which I like, but also want a direct link to that users album.
Is it just a simple setting somewhere?

I tried adding the gallery block to a sidebar, then setting it to "block type" to "AlbumTree" and "AlbumSelect" but the block just disapears.. I can set the block type to "ImageBlock" and then set "Album or Item ID:" to user and that seems to only pull up picks from that users album.. but clicking on them takes you to the image and not the album.

Any ideas?
Thanks!

Gallery version (not just "2"): 2.3 eng full
PHP version (e.g. 5.1.6): 5.2.6
PHPInfo Link (see FAQ): http://apicaday.com/phpinfo.php
Webserver (e.g. Apache 1.3.33): Apache 2.2.8
Database (e.g. MySql 5.0.32): mysql 5.0.45
Activated toolkits (e.g. NetPbm, GD): none yet
Operating system (e.g. Linux):linux fedora 7
Browser (e.g. Firefox 2.0):

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7889
Posted: Fri, 2009-10-23 02:09

From my bridge:

/**
 * This functions will return either a userAlbum link or a link to
 *     create one based on whether or not the user has an album
 * @param    int     $uid     external emApp userId
 * @return   string  a link
 *
 */
function userAlbumUrl($uid) {
    global $gallery;
    // check to see if useralbum module is available
    list($ret, $modules) = GalleryCoreApi::fetchPluginStatus('module');
    if ($ret) {
        // module not available, return blank link
        return '';
    }
    if ($modules['useralbum']['active'] && $modules['useralbum']['available']) {
        list($ret, $user) = GalleryCoreApi::loadEntityByExternalId($uid, 'GalleryUser');
        if ($ret) {
            // cannot find user, return blank link
            return '';
        }
        list($ret, $albumId) = GalleryCoreApi::getPluginParameter('module', 'useralbum', 'albumId', $user->getId());
        if ($ret) {
            // no albumId lets create the userAlbum
            $urlGenerator = &$gallery->getUrlGenerator();
            return $urlGenerator->generateUrl(array('controller'=>'useralbum.UserAlbum'), array('forceFullUrl'=>true, 'forceSessionId'=>false, 'htmlEntities'=>false));
        }
        // got what we need, let's return our userAlbum link
        $urlGenerator = &$gallery->getUrlGenerator();
        return $urlGenerator->generateUrl(array('view'=>'core.ShowItem', 'itemId'=>$albumId), array('forceFullUrl'=>true, 'forceSessionId'=>true));
    }
}

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Shredder

Joined: 2005-04-28
Posts: 28
Posted: Fri, 2009-10-23 02:36

I see what thats doing.. but how do I implement it?
save it as a file somewhere? I am not very versed in php at this point

also.. all my users will have albums.. they get created when the user registers.. and there is no users yet.. getting the site ready before I release it ;)

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7889
Posted: Fri, 2009-10-23 02:44
Quote:
I see what thats doing.. but how do I implement it?

Sorry, not a Drupal user.
You could modify the function Drupal uses to create the "sidebar link"
And before you ask.... no I don't know which file/function

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
Shredder

Joined: 2005-04-28
Posts: 28
Posted: Fri, 2009-10-23 03:22

cool.. thanks for trying to help :)

 
Shredder

Joined: 2005-04-28
Posts: 28
Posted: Fri, 2009-10-23 17:37

so no one has setup a link either in the sidebar, or in the users profile, that takes them directly to their album instead of to the main gallery album?

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25953
Posted: Fri, 2009-10-23 21:30

http://gallery.menalto.com/node/70998#comment-256508

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Shredder

Joined: 2005-04-28
Posts: 28
Posted: Sat, 2009-10-24 23:35

so I have to put that in the template for drupal?

<a href="{g->url arg1="controller=useralbum.UserAlbum" useAuthToken=1}">Your Album</a>

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25953
Posted: Sun, 2009-10-25 02:42

No, a template file of gallery.
I don't think Drupal uses smarty.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Shredder

Joined: 2005-04-28
Posts: 28
Posted: Sun, 2009-10-25 02:49

I'm totally lost now.. I am not using any links in gallery.. all my navigation is done in drupal, even the gallery menu gets put into the sidebar when you access gallery embedded

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25953
Posted: Sun, 2009-10-25 02:54

Sorry don't know Drupal. Can edit a gallery template?
I don't know how to postion a link like that in a drupal navigation/menu

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
Shredder

Joined: 2005-04-28
Posts: 28
Posted: Sun, 2009-10-25 03:10

when you talk about a gallery template.. I think you are talking about the way it looks and all that.. I get rid of almost all of that in drupal.. basicly all the user stuff is handled by drupal.. even registration.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25953
Posted: Sun, 2009-10-25 04:39

I understand that. I don't use Drupal and can't offer an idea on how to add an album link in Drupal. I am only offering a way to add it to a gallery template since you have not gotten the way you want using Drupal.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team