Thanks for the reply koffe.
I am using 1.0.3 and it works to a point. It seems that in 1.0.3 they changed the naming of the thumbs so they no longer are 'filesnames_thumb.jpg' but the filesname and then some dimensions.
e.g.
filename.jpg_100_cw85_ch85.jpg
filename.jpg_119_w119_cw119_ch96.jpg
filename.jpg_595.jpg
Any thoughts? Your help would be appreciated.
bbish007-
I have a function that seems to work well for me. You can see it in operation Here.
/ Show Latest Images /
`function show_latest_images($number) {
$iw = $cw = zp_conf('thumb_crop_width');
$ih = $ch = zp_conf('thumb_crop_height');
$sql = "SELECT * FROM ". prefix("images") ." ORDER BY id DESC LIMIT $number";
$result = mysql_query($sql);
while($r = mysql_fetch_array($result)) {
$id=$r['albumid'];
$sql="SELECT * FROM ". prefix("albums") ." WHERE id = $id";
$album = mysql_query($sql);
$a = mysql_fetch_array($album);
echo '
[*]';
echo '';
echo '[img]'.WEBPATH.'/zen/i.php?a='.$a['folder'].'&i='.$r['filename'].'&s=thumb[/img]';
// echo '[img]'.WEBPATH.'/zen/i.php?a='.$a['folder'].'&i='.$r['filename'].'&w='.$iw.'&h='.$ih.'&cw='.$cw.'&ch='.$ch.'[/img]';
echo '';
echo '
';
}
}```
`/ Show Latest Images /
function show_latest_images($number) {
$iw = $cw = zp_conf('thumb_crop_width');
$ih = $ch = zp_conf('thumb_crop_height');
$sql = "SELECT * FROM ". prefix("images") ." ORDER BY id DESC LIMIT $number";
$result = mysql_query($sql);
while($r = mysql_fetch_array($result)) {
$id=$r['albumid'];
$sql="SELECT * FROM ". prefix("albums") ." WHERE id = $id";
$album = mysql_query($sql);
$a = mysql_fetch_array($album);
echo '
[*]';
echo '';
echo '[img]'.WEBPATH.'/zen/i.php?a='.$a['folder'].'&i='.$r['filename'].'&s=thumb[/img]';
// echo '[img]'.WEBPATH.'/zen/i.php?a='.$a['folder'].'&i='.$r['filename'].'&w='.$iw.'&h='.$ih.'&cw='.$cw.'&ch='.$ch.'[/img]';
echo '';
echo '
';
}
}`````
Sorry if the code got mangled. If it doesn't seem to come through right for you, let me know at craig (at) thinkdreams.com and I can email it to you.
Hello Thinkdreams, kofee and bbish.
This is just a suggestion.
Since this function could make the home page more like a photoblog, which is a relatively widespread use of galleries, could it be inserted in the default theme available with a theme option? ("show last photos in the home page" and "how many photos to show in the home page?").
Should I post this in the Trac wiki to see if it is a popular desire?
Best regards...
That function is already a template function (this thread is a little old). You can do that simply by yourself. Just add `` on your index.php where you want them to be shown.
Please take a look at our functions guide in the user guide section of our site, too.
Hello Acrylian.
Thanks a lot for your precise help. I have managed to find where to put it, and it works great. :-)
However, I have no php or coding knowledge, and I don't know how to read/use the functions guide to create the paging (previous/next) links.
If I manage to do it, which is the right place to document this how-to? The trac wiki?
Thanks a lot and best regards...
--
EM
The trac wiki is more or less a place for users to add things, all important stuff is on the normal site. Regarding the pagelist the best would be you look at one of the standard themes how it's done there.
The functions guide not that hard to read actually, you just need to get into it once. Example:
printPageListWithNav( string $prevtext, string $nexttext, [bool $oneImagePage = false], [string $nextprev = true], [string $class = 'pagelist'], [string $id = NULL] )
All that options next to the function are describe above it. "string" means there is text to be added for example.
Thanks Acrylian.
After some trial and error, I could understand the syntax. However, it still doesn't print the page navigator (take a look @ http://eduardo.mercovich.net/fotos/ if you like).
This is the code I inserted in the index.php:
`
Útimas fotos...
`
The latest 50 images are shown, but I have 77, so at least there should be a link with "siguiente".
What am I doing wrong?
Thanks a lot... :-)
EM
Re: pageslist
`
That can't work. It should be;
Re: latest images
The latest images function shows only the number of latest images and is working as it's meant. There is no next button supposed to be. Its not meant to show all images you have like on a photoblog and the pagelist is for the list of albums. You see how zenphoto works if you try a standard theme. The structure is Album index -> Thumbs -> Bigger Pictures. You probably want to use zenphoto as a photoblog?
Hi Acrylian.
``
Ah, sorry, I had a syntax problem...
Regarding ZP use, I want to use it as it is and with a navigable list, as a photoblog.
However, I believe there is a workaround... :-)
I am using 1 album ("Todas") with all the photos. The rest are dynamic albums except one specific album that has a password, since it is for the family only.
I can make in the home page a list of the album "todas" that has pagination, and has all the photos except the ones in the family album (that don't have to be listed in the first page).
Now, with your keyword "photoblog" (seems stupid but I didn't thought about that one, my fault) I searched and found a few posts regarding it, and the sigle physical album with N dynamic albums solution seems to have even more sense.
I believe that would work perfectly for me (and for others, I hope). :-)
Best regards...
Hello,
I want to use the function in another page of my website (not on the index of my portfolio).
What must I do ? Code ?
I am a novice, sorry...
Now, an error sentence is appearing : "Fatal error: Call to undefined function: printlatestimages() in /home.10.16/boutsdep/www/portfolio/8photos.php on line 55"
Thanks a lot in advance for your help.
Vincent
I presume you mean a not-zenphoto-page: http://www.zenphoto.org/2008/01/hacks/#zenphoto-as-plugin