Member
Member
alexsmith2709   2015-03-04, 20:30
#1
Hi,
I have read the dynamic albums guide but when i use
`<?php

zp_load_album('all.alb');

prepareAlbumPage();

?>`
i get this error:
`Warning: Cannot modify header information - headers already sent by (output started at /home/adetaran/public_html/dev/themes/zpbase/index.php:18) in /home/adetaran/public_html/dev/zp-core/functions-common.php on line 501`
I dont really want to go messing with anything in the core files so could anyone help shed some light on how i would get this dynamic album to show on the home page. Im using the dynamic album as a way to show all images on the homepage.

I am using the zbBase theme and putting the code in the codeblock of the gallery.

Thanks,
Alex
Administrator
Administrator
acrylian   2015-03-04, 21:01
#2
The code example above is meant to be used programmatically on theme files, That worked last time I tried.

Since codeblocks go through a function call they are a bit different and the global context needed may generally not be setup correctly that easily.

Editing the theme might be a way. Or maybe it has an option for a custom page. Then you could create a new theme page for the multiple_layouts plugin and use that for the homepage.
Member
Member
gjr   2015-03-04, 21:16
#3
Please review object model framework:
http://www.zenphoto.org/news/zenphotos-object-model-framework

This will get you started... place in codeblock as you say (make sure codeblock is called in theme):

`

<?php

$album = newAlbum('all.alb');

$images = $album->getImages();

foreach ($images as $image) {

$image = newImage($album,$image);

echo '';

echo '[img]'.html_encode(pathurlencode($image->getThumb())).'[/img]getTitle()).'" />';

echo ''.$image->getTitle().'';

echo '';

}

?>

`

note there will be no pagination!
Administrator
Administrator
acrylian   2015-03-04, 22:09
#4
That's a way to do it via a codeblock. The other code has a different additional purpose additionally though. Just to mention it.
Member
Member
gjr   2015-03-04, 22:23
#5
Yep, alexsmith2709 is asking how to do it in a codeblock Smile
Member
Member
alexsmith2709   2015-03-05, 23:00
#6
Thanks for your help. That code has helped. Now i need to work on the layout. Is it possible to use this code to create a masonry layout with images? I see in the multiple layout options of zpbase its only possible with albums.
Member
Member
gjr   2015-03-06, 01:30
#7
Yes, of course, you would need to do some custom coding or take a look at what is already in zpBase and tailor it to your needs.
Member
Member
alexsmith2709   2015-03-06, 15:10
#8
Thanks gjr, i appreciate your help. I had been trying some code from whats already in zpbase but havent got there yet, i'll keep working on it!
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.