Member
Member
jasronq   2008-07-20, 21:04
#1

I found the getalbumstatistic and getimagestatistic functions. I'm new to all this and want to use these to make a nested loop where I get each recent album and for each recent album show the most recent images. How do I feed the name of each recent album from the getalbumstatistic function to the name field of the getimagestatistic function?

PS. I can tell already, I'm going need to start learning some PHP...

Administrator
Administrator
acrylian   2008-07-21, 08:47
#2

You are on the right track. Use this:
``

I think I will add this nested setup as a extra function to the plugin.

Member
Member
jasronq   2008-07-21, 11:05
#3

I plugged it into my theme and got an error (of course). "Invalid argument supplied for foreach()" and a patha nd line number pointing to the "foreach ($latestalbums as $latestalbum) {" line. Any help on whats wrong here? Looking at the page on php.net about foreach I dont see anything suggesting what caused the error.

Member
Member
jasronq   2008-07-21, 12:09
#4

reading over things, is it possible that $latestalbums was created as a string and not an array? That would cause the error on the foreach loop as the docs say it should with any non-array variable.

Administrator
Administrator
acrylian   2008-07-21, 12:27
#5

You are right, I am sorry...It does not work with 1.1.7, I forgot that the plugin has been modified to return an "usable" array in the svn (which of course I as a dev work mostly with). You need to download the nightly build to use the code above. (maybe you can just use the plugin from there with 1.1.7 if you fear updating, but I haven't tried that).

Member
Member
jasronq   2008-07-21, 21:06
#6

Well, this is going to be used on my site when the theme is complete, so I need to be using a build I can rely on. Also, the theme will be very useful to others, so I'd like it to be usable by those not using the nightly build.

Is there a way to create recent image listings from each album in a way that works on the standard build?

Also, another, somewhat unrelated question. On an image page, the images can be paged through with next and previous links. Is it possible to setup an images page that will include all albums, not just one? In chronological order?

Member
Member
sbillard   2008-07-21, 21:38
#7

Nightly builds are pretty stable, but you never know. You certainly should do some testing before you put one up live. There is a great deal of change between the current nightly builds and the 1.1.7 release.

The image_album_statistics plugin looks like it has not changed much, though. I believe it will work with the 1.1.7 release. Give it a try.

It is certainly possible to set up page navigation the way you describe. However, it is not simple. We have no functions that do that kind of paging so you would have to code it yourself.

Member
Member
jasronq   2008-07-21, 21:43
#8

Well, this all comes from my desire to have a good art blog. I want a good navigable gallery, and a way for people too see the most recent images easily.

In any case. I fixed your code to work on 1.1.7 the way I expected it to the first time. It was a fairly simple and silly thing.

``

You can see the results at my site, www.ronquillostudios.com

its the stopdesign theme, with the latest gallery output replaced by the above code. Pics are all test images to populate a couple albums.

EDIT: for some reason the loop is only outputing three images, not three from each of the three albums...

Administrator
Administrator
acrylian   2008-07-22, 09:14
#9

[i]EDIT: for some reason the loop is only outputing three images, not three from each of the three albums...[/i]
That is because your fix fixed the error but not the functionality. The array that is returned does not have the structure that you need. Please try the plugin from the nightly. As sbillard already said it probably will work with 1.1.7 without any problems.

Member
Member
edbury   2008-10-29, 09:13
#10

Is there any way to get this to grab a size other than thumbnail?

Administrator
Administrator
acrylian   2008-10-29, 12:13
#11

Not at this time unless you want to hack the plugin. But I have it on my list to add that to the next version.

Member
Member
edbury   2008-11-05, 21:37
#12

I'm willing to mess with the php, any hints on a starting point?

[I don't need to have it be an option for the purposes of my hackery: totally fine with simply replacing the thumb grab with a medium-sized image grab.]

Member
Member
sbillard   2008-11-05, 22:00
#13

You need to change the following two lines:
$albumthumb = $tempalbum->getAlbumThumbImage(); echo "[img].$url.[/img]\n";
where you have filled in $size, etc. with the values you want.

Member
Member
edbury   2008-11-06, 18:34
#14

Thank youuuuu. Since I was printing images (instead of grabbing albums) I did something like:

foreach ($images as $image) { echo "getImageLink() . "\" title=\"" . html_encode($image->getTitle()) . "\">\n"; $url = $image ->getCustomImage('default', null, null, null, null, null, null, true); echo "getTitle()) . "\" />\n";
Working like a charm.

Member
Member
edbury   2008-11-06, 20:15
#15

is there any reason using echo $image->getTags(); within printImageStatistic returns an empty array for each image?

Member
Member
flu   2008-11-06, 20:25
#16

Thank you for the code Stephen ! Marvelous !

(I just noticed, as far as I know, that echo "img src=".$url.">\n"; is supposed to be echo "[img].$url.[/img]\n";)

Member
Member
3lie   2008-11-12, 16:00
#17

Hey everybody... i was following this post, but i have a question:

Is there a way to publish recent photos outside of the zenphoto folder/template?
I have zenphoto on its own folder and have an index php file on my server like homepage, is there a way to display the thumbnails on it?

Peace

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.