Hello,
It would be great if users upon registration would be able to see permanent link to their automatically created personal albums in the Gallery2. Can anyone explain how can I add such a link to users accounts?
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | add_user_album_link_to_profile_patch.txt | 1.76 KB | bharat |
Comments
Comment #1
michelleThe URL is http://www.example.com/user/gallery?g2_controller=useralbum.UserAlbum
I have mine set to create on first visit, so I just made a node that explains the user album feature and has that link in it. You could just put it on the menu if you have it set to create it for everyone automatically.
Michelle
Comment #2
yngens commentedDear Michelle,
Sorry, but I didn't get where and how exactly I could use the given link. I need an authorised user from any place (prefereble from his/her account page) to have direct link to his/her album. I tried to put http://www.example.com/user/gallery?g2_controller=useralbum.UserAlbum in a node, it of course did not go anywhere but just a profile page. Then I tried to substitute 'user' putting Drupal username, but it again did not work out.
My Gallery2 creates menu for everyone automatically, but the problem is that menu is under picture, that is within G2 pages, and I need a link from Drupal node to user's gallery.
In the beginning I hoped that user could get direct link in the Gallery Navigation block, that comes with the module, but unfortunately that block failed to appear at all. I use 'fancy' theme, maybe something wrong with the theme and I should report to the theme developer.
Anyway, my main problem remains - to get a link for user to his/her gapllery. Could you please explain in detail what steps I should take to use proposed by you variant. Sorry about many questions, I am a Drewbie.
Comment #3
michelleSorry, I don't know how that /user got in the link. I thought I had just copied and pasted. The URL should be:
/gallery?g2_controller=useralbum.UserAlbum
If you don't have clean URLs on, it may be different. Just check what the URL is for the "your album" link in your copy of Gallery and use that if it's different.
I don't know why your gallery navigation block isn't working. You might want to switch to bluemarine or box_grey to test your Gallery install.
Michelle
Comment #4
yngens commentedDear Michelle,
I have loged in as a user and tried to use http://www.mysite.com/gallery?g2_controller=useralbum.UserAlbum link, but it asks for username and password again as if I have not loged in. Pressing any link in the menu proves that I am in. I thought maybe I need to activate something within G2 settings and tried different ways, alas it does not work. I could give you address of me site in private if you could take a look, please.
Comment #5
michelleFirst off, did you check to make sure that's the right link for your site? URL rewrite can make differences between sites. Does the link for the user album that Gallery generates work for you?
You can email me your info if you want, but I don't get a lot of computer time so I'm not sure when I'd be able to go in and look.
Michelle
Comment #6
tom611 commentedGot a link to the current LOGGED in user's album, but how can I link to another user album? I want to add a generic link on every user's profile page so other users can view their user album. Is there a easy way to link directly to any given user album by userID? Thanks!
Comment #7
yngens commentedHi Tom,
I also managed to get a link for every user to his/her album. But I also wanted to make a generic link to put in let's say author's block for everybody else to press a link to get to the album of the author.
Comment #8
tom611 commentedSo I take it you haven't figured anything out?
Comment #9
yngens commentedWell, I had an idea of solving this problem by getting $username and linking to direct URL of the album. But then gave up because my website requires registration with both of first and last names, and because of this, names in URL can be written in very different ways like Name_Lastname or Name+Lastname, and that is the least of the difficulties - when names are written in cyrillic letters URLs completely unreadable and unguessable.
Comment #10
tom611 commentedWell my usernames are pretty straightforward...no combo fields or unusual languages. Can you post some examples that might work for me? Thanks.
Comment #11
yngens commentedtom611, since i gave up my idea, i don't have any code to give as an example. but concept is very simple. if you activated clean url both in drupal in gallery then every user will have his/her personal album at addresses with similiar URLs, only name part will be different. For example on my site all the albums have this URL: http://www.kyrgyz.us/gallery/users/and_here_user_name I am intentionally leaving here adress of my site so that you could take a look. thus, you have to get variable $user or $username (i don't exactly remember) within drupal php code and just add to the constant part of URL.
But to say frankly this is not very good way. Actually, there is another way:
1) to get $username variable from drupal;
2) to find out how gallery codes address for a personal album of user using $username variable of drupal
3) and to obtain correct URL from gallery, not from drupal.
but it would be much easier for the developer of this module to do this, since she knows all these issies much better then we.
Comment #12
bharat commentedThanks for alerting me to this, Michelle. Seems like a useful feature to have!
I'm attaching a patch that adds a Gallery2 section to the user profile and provides a link to the user's album. If the user doesn't have an album yet (hasn't been created because they didn't click the "My Album" link yet) it'll inform you that there's no album yet. The code is in reasonably good shape-- I tried to follow the existing patterns. The one thing that I'm unsure about is the way that we're doing link generation; I think that it's ok by Drupal standards but you might want to look over that part carefully in case there's a standard way to do it in the module that I'm missing.
Enjoy!
Comment #13
yngens commentedbharat, thank you very much for the patch. it works perfectly.
Comment #14
422j3 commentedI'm sorry bharat, could you please be specific as to where I install the patch?
I am so surprised that my embeded gallery works, I don't want to ruin it.
Comment #15
michelleLooks like it patches gallery_user.inc. I'm pretty sure there's a section in the handbook on applying patches. I'm a novice at it myself, so I won't attempt to instruct you. :)
Michelle
Comment #16
yngens commentedhi folks,
it just came to my mind that it would be much more comfortable if it would be possible to place direct link to a user's album in author's block (don't remember exact name of the block, you know, the one where we can see some information about an authoer of submitted page). bharat, could you please show how to do it or offer a patch file?
Comment #17
michelleI suspect Bharat isn't following this thread. As the founder and leader of Gallery, he's got a lot on his plate. Please file this as a seperate feature request and maybe kiz or someone will be able to do it.
If you do, explain where you want it better. I don't know what block you're talking about. I don't have any blocks that give info about the node author on any site of mine so either that's something you have enabled that I don't or it's from a contrib module.
Michelle
Comment #18
kiz_0987 commentedCommitted to HEAD. Thanks Bharat.
The inclusion of this info into the author info block will remain a feature request.
Comment #19
jeremy@jeremye77.com commentedHow to call this new addition if using custom theme. I fell kinda mentally challenged. How do I call this from my custom profile?
I tried this: <? print gallery_view_user($user); ?>
It just prints the word Array. There is something about this I do not understand. My apologies and thanks in advance.
Comment #20
jeremy@jeremye77.com commentedThat should read "I tried this: print gallery_view_user(jeremye77);
Comment #21
(not verified) commentedComment #22
zan commentedHere's the link on how to apply a patch.
Comment #23
zan commentedHere's the link on how to apply a patch.
http://drupal.org/node/60108
Comment #24
zan commentedThis patch outputs an error when trying to send private messages in Drupal 5.x
Comment #25
kiz_0987 commentedThis functionality is already included in the 5.x version -- why did you need to patch it? What error did you see?
Comment #26
kiz_0987 commented