Member
Member
flu   2008-06-23, 20:17
#1
Hi,
I've searched the board but I just don't get it :
In the admin section where you can edit the datas about an album, there's a field called "location".
Could someone tell me how to display it in the album.php ?
This is probably simple, but I'm looking for it for hours...

Thank you.
Member
Member
sbillard   2008-06-23, 20:26
#2
You would have to use `echo getAlbumData('location');`
Member
Member
flu   2008-06-23, 21:00
#3
Thanks but sorry, I've already made it but it just doesn't work, the data location isn't displayed and I just don't know why...
I use the last stable version (not a nightly).
Member
Member
flu   2008-06-23, 21:25
#4
Oops... I'm about to realize my mistake... I think I used it in a wrong place.
Member
Member
flu   2008-06-23, 21:45
#5
No way, I can display this data viewing the thumbnail in a subalbum containing images but not in its parent album :
for example :
www.url.tld/album-containing-only-subalbums/subalbum-with-images : fine I get it
www.url.tld/album-containing-only-subalbums : nothing is displayed

Does this function must be in a special loop or something like that ?
Member
Member
sbillard   2008-06-24, 02:34
#6
This function only works with $_zp_current_album. If you want to get the data for an arbitrary album you need to use the class functions. You should visit our WEB site and review the functions guide http://www.zenphoto.org/documentation-official/index.html
Member
Member
flu   2008-06-24, 13:02
#7
Well I'm trying to get it (I've already read the documentation, especially this one : http://www.zenphoto.org/documentation/zenphoto/_template-functions.php.html) but I must admit that the way to use the class functions looks like chinese to me...
If I understand, to display every field "location" of the subalbums listed in album.php, I can't do it in the same way that in a specific album, a custom function is required, right ?
So I must try to get these datas using $subalbums but I can't see something about it in the doc.
Sorry to ask again but any help would be really appreciated.
Member
Member
sbillard   2008-06-24, 15:19
#8
Perhaps you should show us a little of the code where you are trying to do this. Is it within the next_album loop? Then the getAlbumData() function should work.
Member
Member
flu   2008-06-24, 16:13
#9
Sure, here it is in album.php :
`

<?php while (next_album()): ?>

<div class="album">

<div class="thumb">

<a>" title="<?php echo gettext('View album:'); ?> <?php echo getAlbumTitle();?>"><?php printAlbumThumbImage(getAlbumTitle()); ?></a>





<a>" title="<?php echo gettext('View album:'); ?> <?php echo getAlbumTitle();?>"><?php printAlbumTitle(); ?></a>

<?php echo printAlbumDesc(); ?>

<a>" title="<?php echo gettext('View album:'); ?> <?php echo getAlbumTitle();?>">`[b]`<?php echo getAlbumData('location');?>`[/b]`</a>

<?php echo getAlbumCustomData( );?>

<?php echo getNumImages( ); ?> photos



<p style="clear: both; ">

</div>

<?php endwhile; ?>

</div>

`
Member
Member
flu   2008-06-24, 18:37
#10
Well... don't ask me why and how but it works now, sorry for the waste of time.
Don't worry I have many dumb questions to ask.
Thanks for your time.
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.