Pages (2): 1 2   
Member
Member
drsprite   2013-06-23, 20:53
#1

Hi all,

Can you help offer insight on what is causing this error when trying to access page 2+ on the album pages?

PHP Notice: printField() invalid function call. in /zp-core/template-functions.php on line 1440 PHP Fatal error: Call to a member function getImages() on a non-object in /zp-core/template-functions.php on line 1968

Member
Member
sbillard   2013-06-23, 21:56
#2

Only if you can provide details of your install such as Zenphoto version, PHP version, etc.

Member
Member
drsprite   2013-06-24, 00:53
#3

PHP: PHP 5.3.3
Zenphoto: Zenphoto version 1.4.4.8 [4fd3c047c8] (Official build)

Interestingly enough it works on the default theme, but not working in this theme.

The call in the theme it's trying to do is
Next Page

Wondering if something is missing in the album.php logic?

Member
Member
sbillard   2013-06-24, 01:30
#4

Again, how about a little help with helping you? "this theme" is what exactly?

Anyway if it is working in the distributed themes then it is an error in whatever theme you are using. Maybe if you identify it the author might step in.

Member
Member
drsprite   2013-06-24, 01:45
#5

Yeah, sorry. zpMasonry (but am working on modifying it). Winmerge shows mostly everything is the same, so I'm not sure where the page 2+ logic comes in to play.

Author is a bit MIA and since I'm customizing it anyways, I'm on my own. Can you point me to a solid rtfm on this?

Member
Member
sbillard   2013-06-24, 02:03
#6

Sure: http://www.zenphoto.org/news/category/user-guide

Basically, you have tried those functions out of context.

Member
Member
drsprite   2013-06-24, 02:08
#7

Ok, suppose I'll start over and start removing items one by one again.

Member
Member
drsprite   2013-06-24, 17:54
#8

Found my error. Instead of showing subfolders as thumbnails, I'm trying to display them as folders in a sidebar. When going to page 2+, it's erroring the above errors in my original post when trying to load this code below while on page 2+.

I assume it's because when you're on page 2, there's no subfolders to load, so it just exits with error.

Is there a way to load the subfolder albums while on page 2+?

`
while (next_album()) {
?>

    [list]
        ">
    [/list]
Member
Member
sbillard   2013-06-24, 18:00
#9

For sure there is a way, but you will have to become familiar with themeing for Zenphoto and specifically the zenphoto object model.

Of course, there may well be sub-folders on page 2 depending on how your pagination is setup and how many sub-folders there are.

There are functions such as isImagePage and isAlbumPage (the spelling of these may be wrong, this is from memory) that will tell you the context.

Administrator
Administrator
acrylian   2013-06-24, 18:07
#10

The easiest is to use either the printAlbumMenu actually.

Member
Member
drsprite   2013-06-24, 18:35
#11

@acrylian, printAlbumMenu looks like what I'm after, but a couple issues are present.

  1. It's only displaying photos from the first subfolder on the main album view. It's not showing the root level photos at all, even when the URL is the root.

  2. While in an album, the list is showing OTHER albums, is there a way to restrict it to show only the subfolders of the current album being viewed?

Many thanks

Administrator
Administrator
acrylian   2013-06-24, 18:47
#12

Please review the plugin documentation about the available options.

Member
Member
drsprite   2013-06-24, 20:11
#13

I did, and that's why I'm getting those issues above. Sorry, should have included my code.

printAlbumMenu('list',null,null,null,null,null,null,null,null,true,null);

I want list, no count, no css (yet), no css (yet), no css (yet), no css (yet), no index name (default is fine), no first image link, keep top level album entry active, and no limit on truncation.

No where do I see "list only menu options for the current album" nor "show only pictures in first sub".

Please advise.

Member
Member
drsprite   2013-06-24, 20:17
#14

My #1 issue has gone away (great!),

but my #2 issue still exists (seeing other albums when I don't want to). Only want to see the current subs.

Administrator
Administrator
acrylian   2013-06-24, 20:21
#15

Quote:$option:
"list" for html list,
"list-top" for only the top level albums,
"omit-top" same as list, but the first level of albums is omitted
"list-sub" lists the offspring level of subalbums for the current album
"jump" dropdown menu of all albums(not context sensitive)
http://www.zenphoto.org/documentation/plugins/_zp-extensions---print_album_menu.php.html#functionprintAlbumMenu

The menu has nothing to do with ""show only pictures in first sub". It just lists the albums. All else you have to modify the theme.

Member
Member
drsprite   2013-06-24, 22:27
#16

Okay thanks. Yes, I was looking for something that will only show the subs of the currently viewed album.

Since all other albums will be private and hidden from clients, I don't want that to be shown

Member
Member
sbillard   2013-06-24, 23:33
#17

If you have set up your user permissions to allow viewing of only their albums, then that is all that will show from these functions. You make the albums both private and unpublished.

Member
Member
drsprite   2013-06-25, 00:15
#18

The security is through obscurity. There is no index page. So "security" is performed by URL access. As a result, all users will be public guests.

I'd rather not have public guests seeing albums they're not "supposed" to see. (if they stumble upon another album by luck (or because we've worked with them before), then I'm ok with it). Nothing confidential is being stored.

It's just to cut down on confusion.

If a visitor is viewing mysite.com/vendors/clientA, I don't want them to know about clientZ from clientA's album.

They should only be able to see the subfolders within the URL they're viewing - in this example, it's clientA.

It's not bulletproof security; because I don't need it to be. I just want to be able to silo the albums in an HTML subfolder list.

Member
Member
drsprite   2013-06-25, 00:24
#19

Best I can tell at this point, this custom function is working for me to display the subfolders for the album currently being viewed. It also works with infinite scroll. Thanks for the conversation.

`
function sidebarFolderMenu() {
if (isAlbumPage()) {
if (next_album())
echo 'Collections';

    while (next_album()) {
        ?>

        [list]
            ">
        [/list]
Member
Member
drsprite   2013-06-25, 01:43
#20

Update rev2. The snippet above actually omits a folder. For example, if there are 5 subfolders, the code above will only show 4.

This snippet seems to perform much better (and it's borrowed from the printAlbumMenu plugin).

function sidebarFolderMenu() { global $_zp_current_album; $albums = $_zp_current_album->getAlbums(); if ($albums) { // If there are subfolders, lets do something with them echo 'Collections'; echo ''; echo '[list]'; foreach ($albums as $album) { $topalbum = new Album(NULL,$album,true); $title = $topalbum->getTitle(); $link = "".html_encode($title).""; echo $link; } echo '[/list]'; echo ''; } else { // No subfolders to display, add some text on screen. echo 'Collections'; echo "No collections in this view."; } }

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.