Member
Member
rmcfarland   2010-06-18, 20:25
#1
i have some simple PHP on my album.php in order to create a simple menu on each album page that displays a link to every album and makes the current album a non-link. here is the php:
`
<?php
$toplevelalbums = $_zp_gallery->getAlbums();
foreach($toplevelalbums as $album) {
$obj = new Album($_zp_gallery,$album);

if($_zp_current_album->name == $obj->name) { ?>

<?php echo $obj->getTitle(); ?>
<?php }
else {
?>
<?php echo $obj->getTitle();?>

<?php } } ?>
`
this works fine, and it creates the menu exactly how i want it, however below this i get a printed warning:

`Warning: basename() expects parameter 1 to be string, object given in /home/content/s/u/m/summer83/html/zphoto/zp-core/template-functions.php on line 4539`

i'm not sure how to fix this, i suspect it may have something to do with my server or something?
any help would be greatly appreciated.

thanks!
Member
Member
sbillard   2010-06-19, 01:56
#2
Do'nt use `$obj` for a variable name. It is in conflict with a variable used in the base index.php script.
Administrator
Administrator
acrylian   2010-06-19, 09:18
#3
Maybe you should first look what already is there... The print_album_menu plugin already does this..
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.