Hi
thanks for your great module. I use it on our site.
I like the link to user album on user profile.
Now I created new user profile using node profile.
And I would like to add this link too.
I looked into your gallery module code, but I didn't find simply solution for test if some user has his/her own user album,
and if he/she has, then write link to it.
I thought that writing this link will be simple, just e.g. your-albums/$user->name but our users can use nonenglish letters in their nicks
so gallery mod rewrite will do from name "chichúň obrovský" this
/your-albums/chich____+obrovsk__/ what is differen of drupal $user-name (by pathauto) "chichun-obrovsky"
So please, add some simply function into gallery module code, which if I could call with variable $user, and it will return link to this user album or false if user hasn't user album yet (what means that he/she wasn't in his own album yet so this album is not created yet)
Thanks a lot
Igor
somvprahe.sk
Comments
Comment #1
profix898 commentedI just committed a patch for this feature to cvs. The function is named 'gallery_user_useralbum()' and you can use it like this:
The function is defined in gallery_user.inc. Make sure to include this file on your profile pages.
Comment #2
igorik commentedHi, thanks
I tried it, but when I got this your code into my user profile tpl.php
I got this fatal error:
Fatal error: Class 'GalleryCoreApi' not found in /home/somvprahe.sk/somvprahe.sk/www/sites/all/modules/gallery/gallery_user.inc on line 271
I have latest dev version of gallery module -
Download: gallery-5.x-2.x-dev.tar.gz
Size: 63.23 KB
md5_file hash: 8223440d28d7dfbf51d4da80cb2c3a7d
Last updated: August 15, 2007 - 00:04
Thanks
Igor
Comment #3
igorik commentedHi, thanks
I tried it, but when I give this your code into my user profile tpl.php
I got this fatal error:
Fatal error: Class 'GalleryCoreApi' not found in /home/somvprahe.sk/somvprahe.sk/www/sites/all/modules/gallery/gallery_user.inc on line 271
I have latest dev version of gallery module -
Download: gallery-5.x-2.x-dev.tar.gz
Size: 63.23 KB
md5_file hash: 8223440d28d7dfbf51d4da80cb2c3a7d
Last updated: August 15, 2007 - 00:04
Thanks
Igor
Comment #4
igorik commentedHi, thanks
I tried it, but when I give this your code into my user profile tpl.php
I got this fatal error:
Fatal error: Class 'GalleryCoreApi' not found in /home/somvprahe.sk/somvprahe.sk/www/sites/all/modules/gallery/gallery_user.inc on line 271
I have latest dev version of gallery module -
Download: gallery-5.x-2.x-dev.tar.gz
Size: 63.23 KB
md5_file hash: 8223440d28d7dfbf51d4da80cb2c3a7d
Last updated: August 15, 2007 - 00:04
Thanks
Igor
Comment #5
igorik commentedComment #6
igorik commentedsorry for inserting it 3times.
Comment #7
profix898 commentedThats no really a bug. It only means that you forgot to initialize the gallery first! Try to add
_gallery_init(TRUE);before the call togallery_user_useralbum(). The full code may look likeComment #8
profix898 commentedComment #9
profix898 commentedI have slightly changed the parameters of the function. It now takes the uid instead of the $user object:
$link = gallery_user_useralbum($user->uid)Also: If you omit the parameter (or pass
NULL) it returns the useralbum of the current user.Comment #10
(not verified) commented